Look at this snippet:  void Sample_Compositor::createEffects(void) {     Ogre::CompositorPtr comp3 = Ogre::CompositorManager::getSingleton().create("Motion Blur", Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME);     {         {             Ogre::CompositionTargetPass *tp = t-&gt;getOutputTargetPass();             tp-&gt;setInputMode(Ogre::CompositionTargetPass::IM_NONE);             {                 Ogre::CompositionPass *pass = tp-&gt;createPass();                 pass-&gt;setType(Ogre::CompositionPass::PT_RENDERQUAD);                 pass-&gt;setMaterialName("Ogre/Compositor/MotionBlur");                 pass-&gt;setInput(0, "sum");             }         }     } }   If this code is legit, how do these blocks work?
101730
What is the purpose of anonymous { } blocks in C style languages (C, C++, C#)  Example -    void function() {    {     int i = 0;     i = i + 1;   }    {     int k = 0;     k = k + 1;   }  }    Edit - Thanks for all of the excellent answers!
70506
I have a scene with monitors that display video from cameras in the same scene (or other scenes, but all of them are linked i.e., same objects in the scene). The cameras shown on the monitors do not view the monitors, so no looping should occur.  I found  that shows how to get the effect in the Game Engine.  I would like to do this in cycles.  Essentially I would like a material input node that corresponds to the output of the composition of a particular scene. The incoming image should honor the render settings of the particular scene and any compositing applied to it.  The Render Layer node does not appear to honor the resolution or compositing settings of the scene it comes from, and is not available to apply as a texture in the material node editor (that I can find).  I understand that this could be done by rendering the animation from the various cameras, then applying that video as textures to the monitors, then rendering the camera of the monitors. That's super tedious if your making changes to the whole scene, and I don't want to do that.
87028
Looking at the API docs I found , but It cannot be called in Edit Mode. When I try to call it, I always get:     RuntimeError: VertexGroup.add(): cannot be called while object is in edit mode.   The buttons in the vertex group list use bpy.ops.objects.vertex_group_assign(), but to work with it you have to manipulate selections, this is not nice to do from a script.    Why I try to use VertexGroup.add() in Edit Mode? My script works this way:  Human weight paint a bone, "Arm_1.L", "Arm_1.L" shares vertices with "Arm_2.L" in this case they share half the vertices (4 bone arm rig, trick to have nice deform in certain movements). When script run, all selected vertices that exist in both groups (Arm_1.L and Arm_2.L) will copy the weights of Arm_1.L into Arm_2.L but inverted. This way, I only need to weight paint "Arm_1.L" and "Arm_3.L", the script will fill the weights for "Arm_2.L".  import bpy  # ensure we are in edit mode bpy.ops.object.mode_set(mode="EDIT")  # configurable parameters src_group = "Arm_03.L" dst_group = "Arm_02.L"  obj = bpy.context.edit_object src_group_index = obj.vertex_groups[src_group].index dst_group_index = obj.vertex_groups[dst_group].index  mesh = obj.data sel_verts = [v for v in mesh.vertices if v.select] #sel_verts = mesh.vertices  # SEGFAULT in this line bpy.ops.object.mode_set(mode="OBJECT")  print("Working")  for v in sel_verts:     v1in = False     v2in = False     for g in v.groups:         if g.group == src_group_index:             v1in = True         if g.group == dst_group_index:             v2in = True     if v1in and v2in:         print("True")         obj.vertex_groups[dst_group].add([v.index], 1.0 - obj.vertex_groups[src_group].weight(v.index), 'REPLACE')  print("Finished")
37291
Does C++ support '' blocks?  What is the ?  What is the difference between C++'s RAII idiom and ?
40213
I have a piece of footage that I motion-tracked fairly successfully, solved the camera motion, and made it into a 3D scene with that little button on the left of the motion-tracking layout. I then modelled a basic spaceship-thingy and animated it landing, with flames (specifically the ) emitting light onto the ground plane (which is on the mask layer).   I would like to add the light from the flames into the footage, but it does not show up. I do see that there is no DiffuseIndirect pass in the compositing setup but I do not know how to mix that pass in and, if I can, whether the light from the HDRI will mess it up.   Is there a way to add in emission so that the render will look more realistic?
78109
If I have a sequence of .obj (or any other readable format) files created from my own simulation code (say cloth simulation), can I use the rendering capabilities of blender to generate a video?   Is there a way to set the material properties for frame 1 and use the same or rest of the frames while the corresponding meshes are imported afresh from that ones I provide?
73696
How can I get a Node input/output (e.g. a single Color/Value) that I can control from the one spot, but have mapped across multiple materials? For example, to control a value (say, Glass Shader IOF, or a Mix Shader Fac) across 30 different materials (that may or may not have different node setups, but all use the input I want as a driving factor somewhere inside). I've got a few ideas so far, but am not sure which will work and/or which will be the best way to go about it:  Use a Node Group I tried setting up an input inside a node group, then using the node group in various locations - however I could only seem to automate/keyframe the 'default' values of things inside the group (these changes didn't flow through into the instances of the group).  Script node I could set up a Script Node that returns the value I want - however I imagine this would be tricky to automate, and it would also lock me into OSL, which feels a bit roundabout and also rules out GPU rendering (not essential but it would be nice)  Driver I could set up a dummy object or material, set up drivers through to the things I want to control, then keyframe the dummy object and that might achieve what I want. However this again feels a bit roundabout/messy.    Background: I'm working on a model that has a non-trivial number of materials (just over 100, auto-generated from a 3D scanner), and am trying to set up effective backface culling in rendering by using the method described . This involves scripting the addition and connecting of all the extra nodes (Mix shader controlled by Geometry Backfacing, and a Transparent BSDF node to make the faces be rendered transparent from the back), because doing it manually for all 100+ materials would be a pain. It's not essential, but I was thinking it would be nice to be able to control the overall effect by automating all the Transparent BSDF Alpha amounts - I'm just not sure how I'd go about controlling that from a single point though.
25027
I can't seem to figure this out. I am trying to testfor if a player is near certain coordiantes, namely {-9, 100, 16}, and then to teleport them somewhere else.  In earlier versions it would be /testfor @a[x=-9,y=100,z=16,r=2] in a repeating command block going into a chain conditional command block that says /tp @p ~8 ~ ~, although it seems in 1.13 they have removed /testfor. I've seen that apparently I'm supposed to use /execute now in some way but I'm not sure how.
41515
I'd like to do motion graphics type work in blender and it would be really helpful if I could see the results of keyframing material opacity to cut items in and out of view.  Blender internal is sufficient, using shadeless materials.  I could have swore there used to be something in view options.  Any ideas?
105476
As you can see appears "undefined" the PBT Principled shader node from blender 2.79, and I need to use it.  Is there a way or other alternative for rendering PBR Textures with all the same input settings that this shader has?
19112
Whenever I download Nintendo models I come across this texture with the black. I can't transparent it, but how do I use this for stuff in Blender Render mode? If it's possible can you tell me what I do with these kind of textures?
32363
So I am new to the DX12 world. I am currently trying to tweek the nbody_gravity DX12 sample, but appending or calling another Compute Shader which is to add 2 buffers to produce an output in a different buffer.   I have written this code in "ComputeShader.hlsl" however when i tried to invoke it using the following, i get an error sayin "file not found" When i printed the debug error it says the following: D3D12GetDebugInterface: This method requires the D3D12 SDK Layers for Windows 10, but they are not present on the system.   I am invoking my shader after the default invocation to the nBodyGravity.hlsl is done:  ComPtr&lt;ID3DBlob&gt; computeShader; ComPtr&lt;ID3DBlob&gt; computeShader_m;  #if defined(_DEBUG)         // Enable better shader debugging with the graphics debugging tools.         UINT compileFlags = D3DCOMPILE_DEBUG | D3DCOMPILE_SKIP_OPTIMIZATION; #else         UINT compileFlags = 0; #endif           ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"NBodyGravityCS.hlsl").c_str(), nullptr, nullptr, "CSMain", "cs_5_0", compileFlags, 0, &amp;computeShader, nullptr));  //extra call for my shader ComPtr&lt;ID3DBlob&gt; error_ptr;         ThrowIfFailed(D3DCompileFromFile(GetAssetFullPath(L"ComputeShader.hlsl").c_str(), nullptr, nullptr, "main", "cs_5_0", compileFlags, 0, &amp;computeShader_m, &amp;error_ptr));  if (error_ptr) {     OutputDebugStringA((char *)error_ptr-&gt;GetBufferPointer()); }   Is there somthing amiss?
92426
When I put   /summon Item ~ ~2 ~ {Item:{id:"minecraft:diamond",Count:1b,Motion:[0.0,0.8,0.0]}}    in a command block, it summons the diamond with Count:1b but it doesn't follow the Motion Tag. Does anyone know how to get the Motion Tag working?
32807
Sometimes I create Material Groups to be used as appendable reusable assets. Unfortunately sometimes parameters I want to control using a Group Node's slider are not available for routing to a Group Node's input socket. Some examples of these are the Color Ramp and the Mapping Node.  So here's what I want to do:    Can this be done? If so, how?  Thanks!
83632
I am doing an animation. The images I have attached show 2 different render layer view node results.    Image one shows a cube on layer 1, and 2 icosphere on layer 2. I have layer 2 set to fast blur. I have to use transparent film and therefore I use the Alpha over nodes in composition.  Image two shows a cube and 1 icosphere. Image 1 should not be showing 2 icospheres, as the left most one is behind the cube.    Image 2 is from the same render result, and is correcting showing only 1 icosphere. However, that icosphere should be blurred as it is on layer 2. It seems for whatever reason I can not have both the correct composition effect and also have every object's visibility render correctly. I can only either have everything work fine, with no composition, or composition with every emission object showing through every other object in the scene.   I am aware that masks would solve this problem, but because of the complicated setup of object materials and particles, masking produces these very strange and suddenly appearing artifacts. Material Indexing also produces odd artifacts and does not consistently effect the appropriate materials.   This is also a new problem, I did not have this issue in the last blender version. So, material indexing is out, masking is out, object indexing is out.       I want to use the compositor to blur certain layers, but every emission object in the scene shows through. It shows through as though it was on x-ray, regardless if it is behind another or inside another object. The first image is an example of this, the left icosphere is behind the cube, and should not be visible. That is the problem. Why is it visible when it shouldn't be?
21535
I am compositing a scene using a standard process in Cycles, and it worked correctly as long as I had my lighting setup in the scene, however when I switched to HDR, my Shadow pass seems to become a solid black. Why is this, and how can it be avoided?  My node setup:
54784
I'm trying to take my Cycles render passes into photoshop and combine them there. The purpose of this is to be able to manipulate the passes individually with various photoshop tools. However, photoshop does not support the way that Cycles passes are usually combined.  Normally, you have ((Diffuse Direct + Diffuse Indirect) * Diffuse Color) + ((Gloss Direct + Indirect) * Gloss Color). However, Photoshop does not have the Add blend mode.  So to do this, I need a different way to combine passes that does not rely on the Add blend mode. Is there another way that will be reasonably accurate?