Atmospheric lighting in cycles How would I go a about making volume light beams?

I have have tried  various tutorials, but they must be for a older version. as applying them does seemingly nothing.

A link to a functioning tutorial would be greatly appreciated as well.

I don't have a picture or .blend to show, as my problem with atmospheric lighting does not pertain to any specific scene.

Volumetric lighting can be done with volume scattering.
On cycles you have two basic choices:
1. Add volume scattering to the world volume. That will create a foggy/dusty atmosphere for the whole scene. It might take long to render, but the whole scene will be covered in a kind of misty/foggy atmosphere.
Note that anything connected to the background surface shader will be ignored and will render black, so Enviromental textures will not work well with volume scattering (for more info read this post).

2. Create some geometry around the area where you need volumetrics, and use volume scatter as volume for the object (there should be no node connected to the surface, only to the volume). This approach has the advantage of being a bit less intense to compute and you can still use the background color or environment images (like HDR).


Import GLTF Tilt Brush via Google Poly is throwing an error Blender Version 2.90.1 (2.90.1 2020-09-23)
I have made a very simple Tilt Brush drawing on Oculus Quest 2. I have exported it to Poly from Tilt Brush. In Poly I have published the sketch in private mode. I am then fetching a link to it via the Poly API, and download a GLTF fil (https://poly.googleapis.com/downloads/fp/1602791954433581/7xSV2Yv6hW6/6eSd6Co6PZC/sketch.gltf). When I try to import that file (standard import settings), I get the following error from Blender:
    File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 46, in from_union
    return f(x)
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 1162, in <lambda>
    accessors = from_union([lambda x: from_list(Accessor.from_dict, x), from_none], obj.get("accessors"))
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 70, in from_list
    assert isinstance(x, list)
08:11:20 | ERROR: An error occurred on line 46 in statement return f(x)
08:11:20 | ERROR: An error occurred on line 1162 in statement accessors = from_union([lambda x: from_list(Accessor.from_dict, x), from_none], obj.get("accessors"))
08:11:20 | ERROR: An error occurred on line 70 in statement assert isinstance(x, list)
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 46, in from_union
    return f(x)
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 38, in from_none
    assert x is None
08:11:20 | ERROR: An error occurred on line 46 in statement return f(x)
08:11:20 | ERROR: An error occurred on line 38 in statement assert x is None
Traceback (most recent call last):
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/__init__.py", line 928, in execute
    return self.import_gltf2(context)
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/__init__.py", line 942, in import_gltf2
    if self.unit_import(path, import_settings) == {'FINISHED'}:
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/__init__.py", line 955, in unit_import
    success, txt = self.gltf_importer.read()
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/imp/gltf2_io_gltf.py", line 164, in read
    self.data = gltf_from_dict(json.loads(content, parse_constant=glTFImporter.bad_json_value))
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 1218, in gltf_from_dict
    return Gltf.from_dict(s)
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 1162, in from_dict
    accessors = from_union([lambda x: from_list(Accessor.from_dict, x), from_none], obj.get("accessors"))
  File "/Applications/Blender.app/Contents/Resources/2.90/scripts/addons/io_scene_gltf2/io/com/gltf2_io.py", line 56, in from_union
    assert False
AssertionError

It looks like the problem is, that Poly exports GLTF v1.0, which is unsupported by Blender and others (ThreeJS, Chronos Blender GLTF Importer)


Rounding ends in rectangle I have a problem with rounding rectangle. I know how to round a cube, but not how to evenly round a rectangular prism. When I use bevel, it does not seem to bevel evenly. But I want to do it correctly. Please see the following pictures for an example:

This is my model comparison. Here you can see my model is not rounded evenly.

And this is standard cube, that you can see when program starts. It's rounded evenly, but when you will scale it, you can see, that it will round not evenly, like my model (But my model was created not on this method)

Maybe try adding a support edge by ctrl+R in edit mode, edge like that should limit the area bevel is counted on and make to your liking :)


Unable to join two nodes in Compositor I used everything to solve the issue, deleting the nodes, installing 8.2 version, Shift+CRL+left click but no avail!
I attached a picture of the problem below
(https://i.stack.imgur.com/ct0Hp.jpg)

You are not supposed to plug a composite node into the denoise node- or any other node for that matter.
The composite node represents the output the compositor will return. What you plug into it will be returned as the output.
To use the denoise node, you will instead need to hook it up to the render layers node. This is the output from the render result you have just generated. Plug "Noisy Image" into "Image", "Normal" into "Denoising Normal", and "Denoising Albedo" into "Albedo". Now drag the output "Image" of the denoise node into the input "image" of the composite node.
The compositor is designed to change the render result, sort of like an image editor except it is node based and more powerful.


Texture with a grid of points? With Python? Is there a way to generate a grid of points as a texture? Something like this (without the box):

And/or is there a way to create my own texture node with Python? If there's API for that I guess I can also write my own procedure texture.

A wave texture will give you a gradient from black to white. Two of them rotated ninety degrees from each other gives you a grid. A colour ramp can then adjust the size of each square, which with the gradient becomes circular at smaller sizes.

Set the colour ramp to use constant interpolation to get a sharper edge. Adjust the position of the ramp stops to adjust the size of the spots. The mapping nodes and scale of the wave texture will adjust the overall placement.


Constrain armature movement based on child bone position Fair warning: I'm new to rigging.

I am working on a snake-like creature's rig and have organized the bone hierarchy like so:

Basically the head bone is the parent of the neck, the neck is the parent to the next bone in the chain, etc.

I have successfully made this clip (albeit painstakingly):

Now I am trying to make an attack clip but the interpolation causes the tail to dip below the XY plane:

Is there a bone constraint that will prevent the armature from dipping below the XY plane? Could I have rigged it with some kind of IKs or a different bone hierarchy?

Any guidance or suggestions are greatly appreciated!

To get a curved armature result, the splineIK constraint is very helpful. It allows you to use a curve object that the armature follows. You may also want to try using curved bones, which you need to enable B-Bone display for the armature.

As the curve defines the "shape" of the bones you animate the curve to move the armature. To achieve this go into edit mode for the curve and for each control point add a hook by pressing ⎈ CtrlH->Hook to new object which will create an empty for the point. Now when you animate the position of the empty, the corresponding point in the curve will follow and the armature will bend to match.

For the animation you are trying to do I would reverse the direction of the armature. I'm not sure if this will make the rest of your animation easier or not.

Here is an example with curved bones enabled


Duplicating / copy collections (unlinked) in 2.81 from one scene to another scene I'm trying to copy everything in a collection (I don't want them linked) called Camera.001 from one scene to another scene (the second scene is in the same blender file). But I notice that when I duplicate a collection called Camera.001 that when I paste it into another scene nothing shows up.

You can move Collections between Scenes using outliner.

Set the Display Mode to Scenes
Grab the Collection and drag it to another Scene

Example:
Moving Collection 01 from Scene 01 to Scene 02.


Selection of 'Backface Culling' in Edit mode I have imported a Shapefile through the BlenderGIS Add-On into Blender (v 2.79). It consists of a lot of Multipolygons with x, y and z-values as a subsurface layer.

The problem is, that a big amount of Polygons seem to be displayed the wrong way round. If i switch on "Display face normals as lines" I can see that these lines go into both directions, up and down. The lines of the polygons that are wrong way round show downwards.

In the "Shading" settings, there is an option called "Backface Culling" and all the polygons wrong way round are selected (in "Object Mode"). As soon as i switch into "Edit Mode" the selection is gone, all polygons are selected. A "Flip Direction" of Normals is not possible, because the polygons just toggle. Ctrl + N shows no effect and the Strg+G selection of similiar normals is not the best, as you need a threshold to adjust the tool. I have so many small polygons in there,  that the option "Backface Culling" can be used in "Edit mode" will be the best and safed option to select the wrong oriented polygons.

Is this possible or is there another way to turn my flip polygons that are the wrong way round?

I think it is not possible..
I found a workaraound: duplicated the original mesh and flipped its normals. Thats how I get a continous surface on both sides.


Another question about normal maps Is it possible to bake normal map from high poly object without the existence of a low poly object?

Yes.  You just need to ensure that you have an image texture assigned to the object and that the object has a UV map.

In it's simplest form, using Cycles:

Split your screen so you can see the 3D view and a UV/Image
Editor
Create a new image in the image editor.  Let's call it
"BakedNormalMap"
Switch back to your 3D view and select your hi-poly object
Make sure you've unwrapped it and it has a UV map.
Add a new material
Click the dot at the end of the Color option and choose Image
Texture (this can be achieved with the node editor if you prefer)
Select your BakedNormalMap as the image
Switch from the Materials tab to the Render tab and scroll to the
bottom to find the Bake options
Choose the Normal option and below this in the "Normal Settings" choose Space: Object
Bake

Don't forget to save your file.


Reflected light did not appear Testing some settings in cylces, tried to set up the same scene in blender, and a different modelling program with different rendering engine.
Cylces did the job well, but cannot achive the yellowish reflection on the bottom plane - which makes the scene more realistic. Any hints?

Thanks!

not cycles

Cycles (no reflection)

Make sure that you have the max bounces set adequately high to show full global illumination effects. There is a preset that you can activate as well. You may also have to increase the intensity of the light source and adjust the exposure. The distance, size or intensity of the light seems to be different in your first render, because the shadows are much crisper than in the second.

Plane with Principled BSDF (Specular 0.5, Roughness 0.5)

Plane with Principled BSDF (Specular 0.0, Roughness 0.5)


Portrait Video Camera Tracking shift is it possible to track the vertical (portrait) video ?
(I tried every step I did to Normal Landscape Video format)
The solve error is 0.2 (looks good) , but after creating the scene , all track points are shifting..Floating.
I tried manually trackers and Auto Feature Trackers

I tried several video ratio with the same clip (smooth handhold shot), get the result below.
Situation_01:
Portrait video ratio, result shifting.

Situation_02:
Rotated 90 degree as landscape ratio, rock solid tracking result.

Situation_03:
Keep 16:9 ratio but with Black Matte, solid camera resolved.

Answer
Yes it is possible to track vertical video, so that is not the issue at all.
Not an answer, but getting to the core of the issue.
The most common problem with tracking is using the wrong model for solving. If the camera is stationary or just rotating (paning and tilting) then you need to solve as "tripod".
Read:
How can I get better results when doing camera motion tracking?.
To help you further you would need to edit your original post and show a link to the video, and share some images of the interface showing what you have so far.


How to unfold an entire mesh into a flat object? (Not UV Unwrap) Is it possible to unfold the geometry into a plane without distorting the faces, Just like a paper cutoff inside blender?

Finally Found the answer

Export the uv layout as a .svg file. Then import that .svg file back into blender. It will be a curve object so you will need to then convert it to a mesh (Alt+C)


Mid point between levels on subsurf modifier I'm trying to make a holographic representation of one of the models I made. However, I had the problem of the final render and the preview being drastically different.

 Bottom right is preview and top right is render
I later found that the problem was to do with the subsurf modifier I had on the block and the blades. At this point I had it set to adaptive on the render. So I figured I had to change that to the level I had it on the preview.

Again there was a problem. They were not the same so I thought I had to lower it to fix. However, I could only get bad results on the blades.

So my question is how can I make the final render wireframe look like it does in the preview?

As Timaroberts said, the preview and render settings need to match for it to be the same. This means that it will not work if you are using the adaptive subsurf setting on the newer versions of blender.

Occasionally you will need to reload blender before the viewport preview matches the final render when the preview and final are the same.


How to Bend/curve edges I'm trying to make a detail for a glass that i made and i wanna make the Edges bend like the picture bellow

as you can see there are bendy details on a glass, and i'm confused how to make that.

Sounds like you're looking for the Bevel Tool. Select the edges you want to bevel in Edit Mode, press Ctrl+B, drag the mouse to start beveling the edges, use the scroll wheel to set the number of segments.
For a more detailed description of the Bevel Tool read this article in the Blender Manual:
Bevel Edges
There's also a non-destructive way to bevel the edges:
Bevel Modifier


How to turn on the horizontal scroll bar in text editor Is seems strange that the text editor has a vertical scroll bar but not a horizontal one.

Bender uses Shift-MMB to 'pan' most views, but I couldn't get it working on the text editor.  I don't like 'word wrap' for long lines. Is it possible to enable the horizontal bar?

You can use the MMB (without the Shift key) to grab and slide the view in the text editor.


Odd Bump/Normal Map behavior with Texture Nodes - Blender Internal So I've run into an issue that is really confusing me.  I'm trying to set up a material that gets bump mapped by a texture that uses nodes and getting odd results.  Here's what I mean:

Bump mapped with normal clouds texture:

Bump mapped with same settings, but texture that uses nodes:

That same node texture, but applied to color instead of Normal:

Hopefully that makes the odd behavior clear.  As you can see, it influences color fine, but if I set it to Normal the entire object looks smoothed out.  The texture in question is just a simple mix of clouds and noise - I've tried both individually and they work fine, but not when the texture is set to use nodes.

So, in summary, what about having the texture use nodes makes it so that it doesn't influence the Normal of the material properly?

Here's a link to the .blend

To output normal data, you need to use the Normal socket on Output node. (Be sure to also enable Normal setting in Influence)


Transfering UV Maps/Custom Normals to identical object Not my model, it's just a custom job and this got me nuts.
I've been almost 5 hours trying to deal with this, I swear this was my last option to solve this problem.

I've got one object with perfect UV map but without Custom Normals.

And another identical object (same verts and faces) with perfect Custom Normals but without UV map

The task looks simple: just copy/paste/transfer the UV Map or the Custom Normals to the other object to make the perfect model.

But it looks impossible, at least by my knowledgement

What I've tried:

Ctrl + L > transfer UV maps
Tools > Data transfer UV/Normals
Magic UV > Copy/Paste UV
Magic UV > Transfer UV
Data Transfer modifier

None of them worked, the most close result was using Magic UV but didn't worked.

I'm using Cycles engine and Blender v2.79

Please help me! I really appreciate your time and efforts!

UPDATE

LukeD's answer is ok, but still having issues at the transferred UV map to the other model, look at this attachments:

Transfer UV Maps is working just fine.

Select object with bad UV map.
With Shift select one with good UV Map.
Press CTRL+L > Transfer UV Map.


Armature not working after linking new mesh data So I created a character and an armature that worked very well. I decided to change the legs and feet of my character using a mesh from another character I created (almost identical mesh, with minor tweaks).

I swapped the linked mesh data from the original character with the mesh data from the new character (just the legs and feet). I renamed the new mesh data to match that of the original mesh data and did the work to apply the same bone weights to the new mesh that the original had (the original vertex groups still appeared in the DATA tab of the PROPERTIES panel, so this was easy).

However, the armature will not move the new mesh (but it still does move the rest of the body). Any thoughts on how to resolve this?

Logistically speaking, If it is now a single mesh with verts associated with vertex groups with the appropriate bone names from the armature that it is already parented to, it should work.

I just ran some tests on a rig that I have. I added a cube in Object mode, joined it to the rigged mesh, in Edit mode I copied the vertex groups associated with a vert in the original mesh, went into pose mode and it worked without a hitch.

If you upload the .blend I'll take a peek.


How to add a freestyle stroke to a specific edge in blender? I am trying to add a black line (freestyle) to a single edge in blender cycles render. I need help !

Go to Edit mode and select the edge, Ctrl + E, choose Mark Freestyle Edge.
Then go to the Render Layers properties tab. Under Freestyle Line Set, set up the Edge Types as in this screenshot:

Don't forget to enable Freestyle under the Render properties tab.


Get list of selected objects on specific layer How to find which objects are selected on a given layer?

bpy.context.scene.selected_objects shows objects only on visible layer(s). After switching to another layer, the list of selected objects is gone.

>>> bpy.context.scene.layers[0] = False
>>> bpy.context.scene.layers[10] = True
>>> bpy.context.scene.object
bpy.data.objects['Cube']

>>> bpy.context.scene.selected_objects
[]

>>> bpy.context.scene.layers[0] = True
>>> bpy.context.scene.selected_objects
[bpy.data.objects['Cube']]

Returning only the selected objects on a layer simply requires checking the object's select property at the same time as checking which layer it is on.

To extend the example on Get the list of objects on a layer in python:

import bpy

layerIndex = 0  #Chosen layer
objects = bpy.context.scene.objects

selectedObjects = [ob for ob in objects if ob.layers[layerIndex] and ob.select]


Sculpting - Unwanted lines on brush strokes While sculpting, I get these lines on my brush strokes. This particluar example was made with Clay Strips. With other brushes it's not as noticeable, but it's there too.
I don't know if this happens because of some limitation of Blender itself, since the model has a lot of polygons (720k tris), and it may be "lagging".
Is there a way around this?

Thanks!

As you said, it may be because of the low resolution.  Usually with Sculpting Mode, you'll want to use the Multiresolution modifier so that in sculpting mode you can have a high resolution while in object mode the resolution won't slow you down too much.  You can also check you brush settings, particularly Texture and Symmetry/Lock.  In Stroke settings, you can make sure that the spacing is set to 1% and the jitter to 0.


Cannot translate vertice/edge will duplicate Most of the time when I try to move a vertex or an edge, instead of translating that, it extrudes it, it creates another face or, vertiex or whatever.
I do not really get why it behaves like that. I hope I explained it in depth. I am sorry if this is a duplicate post but I could not find anything!

Paul Gonet solved your problem in the comments, but here is how you can spot the problem yourself, and a bit more detail for future reference.

You are not making a new vertex but rather moving only one vertex when there are two in the same place.

You can easily spot that problem, double vertices,  by looking at the selection color of the edges. In your image below I highlighted in red the edge you should watch out for. It is not selected, that means that it is not connected to the vertex you do have selected (and thus there is a double vertex hiding there).

Whenever you select a vertex all the edges connected to it should be the selected color (the default is orange) around the vertex (the whole edge will not change color, the selected color fades out along the edge).

You can select the second vertex that is hiding there, change the shading mode to Wireframe in the 3D view header or by pressing Z. Now select one of the vertices that are there, then hold Shift and select the second.
You can also use border select B, circle select C, or lasso select (hold Ctrl and drag with the LMB
 held) to easily select double vertices.

To get rid of the problem you can use the Remove Doubles operator or Merge them. Both are accessible in the Tools tab of the tool shelf and many other ways.

Remove Doubles (W then R) will go through every vertex that is selected and see if there are any within its merge distance if there are, then it will merge them.

Merge (AltM) can be thought of as a manual version of the remove doubles command, but with much more control. For a scenario like you have where the two vertices are in the exact same place, any of the first three options will work fine (and do the same thing).


How to UV unwarp and keep the original face proportion? I have a simple cube and in edit mode , i stretched it in Z direction  so now the cube become very tall and the faces on top and botom are still perfect square. I setup the edge seams already so it will unwarp the box perfectly. The proportion of uv will be correct if i use square image (texture). If my texture doesnt' have 1:1 aspect ratio, the uv will try to adjust itself to the image aspect ratio. How to ignore image/texture aspect ratio ?

If your texture is 800x600 do some simple math: 600/800=0.75, so scale the whole UV by 0.75 on X axis (A to select all UV, S X 0.75 Enter).


Reloading texture with python not working I am trying to build a tool to bake textures from one UV layout to another via scripting but before baking all the textures must be loaded in blender.

I set the filepath to my image:

bpy.data.images["Image"].filepath = "/Users/John/image.jpg"

In texture panel I can see the source is set, but Can't Load Image is displayed

bpy.data.images["Image"].reload()

seems to have no effect. Only after manually clicking the reload button, the texture is refreshed. Any ideas how to reload the texture through Python, also I'm trying to run this headlessly if it matters.

Thanks!

Hi in addition to what J. Bakker said, here is some code that I used in TexTools addon to reload all images and remove unused ones.

import bpy

# Clean up unused images
for img in bpy.data.images:
    if not img.users:
        bpy.data.images.remove(img)

#Reload all File images
for img in bpy.data.images :
    if img.source == 'FILE' :
        img.reload()

Hope this helps,

renderhjs


Invisible mirror modifier? For some weird reason, only this object acts like it has a mirror modifier when it clearly does not.

Painting acts with symmetry, as well as the UV map. When painting, I turned off x-symmetry and it still clones to the other side. Is there a fix for this?

In the 3d-viewport select only those 3d-faces you want to seperate in the uv-editor. Then only these faces appear in the uv-editor.

Next you select all appearing faces (a) in the uv-editor, scale them using sx-1, so the faces get mirrored and grab them (g) to place them where you want them to be.


Mixing materials using textures in nodes I am doing a test for mixing three materials using black-and-white image in nodes.

What I want basically is something like this -

It is a cube object. And on the white portion the material colour is yellow and in black portion the material color is red and in blue portion the material color is Green.

So what I did is I opened up GIMP and made two separate black-and-white image. Like these -

Map1

Map2

And then set-up the nodes this way -

But I am not getting the desired result. What is wrong with this? And how to fix it?

Do we mix various materials this way for complex meshes and material mixing patterns? What is the best way to achieve this?

I am adding the blend file for further clarification:

You only need one difuse shader and the rest is combining colors using the existing masks.

The result of one RGB mix is concatenated to another RGB mix and those become the color for the shader.

(Click on the images to expand to full screen)

If you must use shaders then the masks are used in a similar way to concatenate the mixes one over the other.


Can I replace an object with another object and keep animation? Is it possible to use an element, in this case a ship, in a blender scene and progress through animation and then easily replace that ship with a different one? A replace command?

The best way to replace a "replace" button. :)

Create a proxy object that will be animated. Create as many ships as needed. naming them as object and mesh can be useful.

change the mesh of the proxy object with another ship.

The same animated object can be any ship you like with the same animation.

The resulting object is a linked duplicated, same as AltD. They share the same mesh. If you need an independant duplicate (same as ShiftD), press the button beside F (normally 2, counting objects sharing the same mesh) to make it a new object independent of the original. Use F button to give the mesh a fake user before changing it if you want it to be saved in the .blend even if no object use it (else it will disapear when you reload your .blend file).


How to avoid faces overlapping when bridging edge loops I want to create a bottom wall and to do it i add a circle and then use "bridge edge loop"

But the result is strange:

I don't want a face also inside circle (beacause it will be a hole).

I hope can you help me and sorry for my english

Duplicate that loop and Scale it down.

Make it a circle.

Select both loops and apply the bridge.

See the images below.


How to get the coordinates of the knife tool on an edge (in real time)? After developing my first addon (Arrange objects along a curve), I was interested in continuing learning and developing scripts for Blender. The question now might be difficult, but I know it's possible:

How to get the coordinates of the knife tool on an edge in real time, in python?

With the Chebhou's tips I get:

import bpy
from bpy_extras import view3d_utils
from bpy.props import FloatVectorProperty

def main(context, event, ray_max=1000.0):
    # get the context arguments
    scene = context.scene
    region = context.region
    rv3d = context.region_data
    coord = event.mouse_region_x, event.mouse_region_y

    # get the ray from the viewport and mouse
    view_vector = view3d_utils.region_2d_to_vector_3d(region, rv3d, coord)
    ray_origin = view3d_utils.region_2d_to_origin_3d(region, rv3d, coord)

    if rv3d.view_perspective == 'ORTHO':
        # move ortho origin back
        ray_origin = ray_origin - (view_vector * (ray_max / 2.0))

    ray_target = ray_origin + (view_vector * ray_max)

    def obj_ray_cast(obj, matrix):
        """Wrapper for ray casting that moves the ray into object space"""

        # get the ray relative to the object
        matrix_inv = matrix.inverted()
        ray_origin_obj = matrix_inv * ray_origin
        ray_target_obj = matrix_inv * ray_target

        # cast the ray
        hit, normal, face_index = obj.ray_cast(ray_origin_obj, ray_target_obj)

        if face_index != -1:
            return hit, normal, face_index
        else:
            return None, None, None

    # no need to loop through other objects since we are interested in the active object only
    obj = context.scene.objects.active
    matrix = obj.matrix_world.copy()
    if obj.type == 'MESH':
        hit, normal, face_index = obj_ray_cast(obj, matrix)
        if hit is not None:
            hit_world = matrix * hit
            return hit_world
        else:
            hit_world = matrix
            return 0.0,0.0,0.0
    #return None

class ViewManoOperator(bpy.types.Operator):
    """using mouse events"""
    bl_idname = "view3d.mano_operator"
    bl_label = "View Mano Operator"

    hit = FloatVectorProperty(name="hit", size=3)

    def modal(self, context, event):
        if event.type == 'MOUSEMOVE':
            self.hit = main(context, event)
            context.area.header_text_set("hit: %.4f %.4f %.4f" % tuple(self.hit))
            return {'RUNNING_MODAL'}

        elif event.type in {'LEFTMOUSE', 'RIGHTMOUSE', 'ESC'}:
            context.area.header_text_set()
            return {'CANCELLED'}

        return {'RUNNING_MODAL'}

    def invoke(self, context, event):
        context.window_manager.modal_handler_add(self)
        return {'RUNNING_MODAL'}

def register():
    bpy.utils.register_class(ViewManoOperator)

def unregister():
    bpy.utils.unregister_class(ViewManoOperator)

if __name__ == "__main__":
    register()

instead of getting the coordinates of the knife tool you can get the mouse coordinates in the 3d space " since they are the same position " as CoDEmanX stated : they are not the same position. Knife tool snaps to edges and vertices and is thus not always at mouse location

all the steps needed for this are in the template script  "operator_modal_view3d_raycast.py" in blender , what it does is : cast a ray from the view and find the nearest intersection point with the visible objects , the position of the mouse in the 3d view is the Hit output from the obj_ray_cast()

here is the bare code after some elimination of unnecessary lines :

import bpy
from bpy_extras import view3d_utils

def main(context, event, ray_max=1000.0):

    # get the context arguments
    scene = context.scene
    region = context.region
    rv3d = context.region_data
    coord = event.mouse_region_x, event.mouse_region_y

    # get the ray from the viewport and mouse
    view_vector = view3d_utils.region_2d_to_vector_3d(region, rv3d, coord)
    ray_origin = view3d_utils.region_2d_to_origin_3d(region, rv3d, coord)

    if rv3d.view_perspective == 'ORTHO':
        # move ortho origin back
        ray_origin = ray_origin - (view_vector * (ray_max / 2.0))

    ray_target = ray_origin + (view_vector * ray_max)

    def obj_ray_cast(obj, matrix):
        """Wrapper for ray casting that moves the ray into object space"""

        # get the ray relative to the object
        matrix_inv = matrix.inverted()
        ray_origin_obj = matrix_inv * ray_origin
        ray_target_obj = matrix_inv * ray_target

        # cast the ray
        hit, normal, face_index = obj.ray_cast(ray_origin_obj, ray_target_obj)

        if face_index != -1:
            return hit, normal, face_index
        else:
            return None, None, None

    # no need to loop through other objects since we are interested in the active object only
    obj = context.scene.objects.active
    matrix = obj.matrix_world.copy()
    if obj.type == 'MESH':
        hit, normal, face_index = obj_ray_cast(obj, matrix)
        if hit is not None:
            hit_world = matrix * hit
            return hit_world

    return None


Curved mesh topology I'm still learning to model on Blender, but one thing I can't grasp is how to make such perfectly aligned and evenly-spaced mesh topologies. I'm trying to model an acoustic guitar and my mesh looks at best messy:

How can I create a smooth topology like this one? Notice how the features in the instrument's face align perfectly with its outline.

You can do that easily with edge loops.

Option 1

Start with a circle.

Extrude it (Press E and Scale it S).

Take the outermost vertices and grab them (G) create the shape of the guitar.

Until you have the full outline of your guitar.

Create edge loops by pressing CtrlR. And dragging the mouse to the middle of the geometry.
You can choose how many edge loops you want to create.

Keep adding edge loops to refine your shape.

Option 2

Another way to do this is modeling with curves:

Add a Curve_Circle object.

In edit mode subdivide it and add an outer circle. Subdivide it and shape it to the form you need. (It's very important that your circles have the same number of control points, 8 in this example).

Make sure the fill option in your curve is set to none:

Exit edit mode and convert your curve to mesh by pressing AltC and select Mesh form Curve/Meta.

Then in edit mode select all your vertices and do bridge edge loops (press the Space Bar and type Bridge...)

Then you can do edge loop cuts with CTRLR

Note the adjustments you can do changing the factor


How do i create low lying smoke (similar to Zootopia), in blender Hello Blender community,

I am a huge fan of the Disney movie Zootopia, the amount of physics and detail really drew me into 3D animation and design. Although I always had an interest in 3D technologies, designs, animation, etc. This movie really pushed me into getting into making 3D stuff, and learning Blender.

Anyway, as a learning experience, I decided to take multiple different 'animating techniques' of the movie and try to replicate in Blender.

The scene I'm trying to replicate? The Limo scene, specifically the low, lying smoke.

I have analyzed this scene many times and I have concluded on some of its properties

It lively collides, with the characters, meaning that it is not a textured material, it is most likely mesh based.
It has a lower temperature value than other objects, which is why when the characters breathe, an amount of fog appears (This is because the movie was designed in the Hyperion Renderer, I don't really need this, but if you know how to make this please let me know)
It is somewhat fluffy, although not cloud-like. When a mass of this smoke comes together, it makes a fluffy looking mass.
It is affected by gushes of air, when Judy (the bunny) lands on the ground, a gush of air extrudes the smoke around her. Sudden movements have this effect as well.

Now I'm pretty sure that making this is in Blender is difficult or even impossible, considering that Disney has their own proprietary rendering engine named Hyperion and they can drop smoke in within a couple of clicks. And they have HUGE render-farms that can render these details.

But I just wanted to know if it is possible. As I may be getting an internship for Disney Animation, I need to know this stuff

UPDATE:
So, I see that using a still frame from the movie to demand something that needs multiple frames, is pretty stupid

So feel free to study this clip:
https://www.yahoo.com/movies/zootopia-clip-fur-skunk-170000173.html
(and if you haven't seen the movie, do yourself a favor and please have a watch)

Also, I would like to know, how to smoke kind of 'flows', the way that it lies low to the ground moving. Not just stuck in place similar to how Cycles does it.

I've tried really simple smoke in Blender and here is what I've got:

Gif with sample

You just need to play with smoke temperature and domain height.
Sphere is nothing more but smoke collision.

UPDATE:

Here it is how to make it:

Gif steps

If you need more info just specify what you want.

Sorry that I didn't cover timeline for sphere animation.

UPDATE 2

Smoke.

Create a simple plane. Shift+A > Mesh > Plane
With still selected plane go to Physics tab then select Smoke and set smoke type to Flow. Next change the Temp. Diff. to -0.01. It will keep smoke near the ground and even after collision smoke will very slowly descend.

Create cube Shift + A Mesh > Cube and position it as you can see in picture below. It must be a little wider then our plane. So scale it a little S. This cube will be our smoke domain.

Having selected cube go to Physics tab, select Smoke then smoke type Domain.

First thing you want to change is Resolution, I've set it to 64. Higher values gives more detailes to our smoke.
Secondly you need to check Smoke Adaptive Domain, this will only calculate domain where smoke actually is.
Next check Smoke High Resolution. This will add more details to smoke. Set Resolution to 2 and Noise Method Strenght to 1. Lowering Strenght gives us smooth smoke.

Now save your file and go to Smoke Cache in Domain options. Choose File Format > OpenVDB (this is optional).
Now you can Bake or just hit Alt+A to start animation. Second option will be slow trough te first loop.

As you can see nothing happend which in this case is good :) Now let's make some...

Noise.

We will create collision object and little bit of turbulance to give this smoke a life.

Create Turbulance - Shift+A > Force field > Turbulance and set Strenght to about 0.5. This option is totally up to you. you can even skip it. What it does is it create some air movements in our domain and based on location (room, outdoor etc.) you will want to adjust position of it and strenght.
Create UV Sphere - Shift+A > Mesh > UV Sphere. In Tools tab select Shading as Smooth. Position sphere in a corner of our domain and right above plane. Check on your timeline if you are on frame 0.

In Top ortho view (sphere selected) hit I and choose Location. Now you can go to frame 50, move your sphere and again hit I and choose Location, and repeat this step. You can also select Automatic keyframe insertion (red dot under the timeline) and do this little faster. See gif below.

With selected sphere go to Physics tab then select Smoke and set smoke type to Collision and Collision type > Animated.

That's it! You can now bake it and play it. Should look like this:

There is still many to do. Smoke texture, lighting, correct density and so on.
If you want I could try to make it but I'm not really good at it.

Here is the blend file:

UPDATE 3

Here I've changed Turbulance to Wind. You can adjust wind speed and noise.
If you want to make it fluffy try higher resolutions. I don't have render farm and 64 is max usable/testing for me.


Mesh not moving with Armature in pose mode I am totally stomped on this one. I have looked into other questions of people having  a similar problem.

I have "manipulate center points" turned off
It is deformed with Automatic weights. (See last image)
I made sure all of the vertex groups were deleted before putting on
 the armature
Made sure all of the modifiers on the model were applied
Made sure that the Armature was on the top of the Modifier stack
Made sure that my mesh has nothing locked in the Rotation/Location/Scale
Applied the Rotation/Location/Scale of the model
I have also tried to use Envelope weights instead of automatic and it gives me a weird result. See the first image. It deforms to the mesh but part of the mesh does not move

If any further information is needed to answer this question please let me know and I will update.

Please help
Thanks

Regarding the first image, those vertices aren't weighted to any bone, you'll have to select the corresponding bones and weight paint them, and in the last image:
1 Put the main mesh in object mode
2 Select all the bones in pose mode, hold shift and click the main mesh, then click back on the bones while still holding shift
3 parent with automatic weights
4 reapply weights on the parts that don't deform as intended


Why is the image not transparent in when I import as a plane? I'm very new to blender and I'm trying to make a simple character with a 2d face. I was following along with this tutorial (https://youtu.be/YGjwOEMgDGw?t=60) but I can't get my image to look transparent.

This is what it looks like in the blender image editor. The transparency shows up in that view.

The starting Shader setup is also different from the tutorial (I don't know enough to know what all this means)

But when I make it like the tutorial it looks like this, still not transparent (it also looks like in the image editor if I set the alpha to none).

I have no idea what settings I might have wrong or what I'm doing wrong. I've been stuck for about 2 hours on this so any help would be appreciated. I used photoshop to make the image (just incase there is some setting I need to set there), and also here are the import settings for the image.

Again any help is appreciated. Thanks :)

If you imported your image by first creating an image plane (Add > Image > Background), then you will want to click on the resulting plane object in Object Mode, and then look in the Object Data tab of the Properties Panel to find its Opacity slider.

If you created it as a Background Image, you will want to select your camera instead (this is easiest to do in the Outliner window), and then look in the same Object Data tab from the Properties Panel, which will now show the object data for the camera. This will expose you to a different opacity slider.

Hope this helps.


Can I use Space + LMB to pan? Is it possible to set the space bar so when it's held down, you can pan by using LMB plus dragging? This is how panning works in a bunch of other programs.

Yes, this is possible.
Open up the File > User Preferences (see 2nd image) by pressing ⎈ Ctrl⎇ AltU and go the the Input section (the third rider on the top menu of the User Preferences window).
First, we have to remove/change the existing bindings for a  LMB as well as Space.

The functionality bound to  LMB click is called Set 3D Cursor. Search for 3D Cursor in the search window. Remove the item by pressing the X - button.

Find the Spacebar command by searching for Space via key-binding. Remove this item as well.

Now search for Rotate View. Click on the items shortcut, then perform a left click again to enter a Left Mouse value. To set the modifier key to space, click on the (currently empty) input box in the right of the third row and press the Space key. It is going to be used as a modifier key for the action.

You can now rotate the view using Space LMB
You have to unbind Set 3D Cursor otherwise the event will not be passed on.

You press Space.
You make a  LMB down click.
Set 3D Cursor is called and all other events are aborted.

You can however set Set 3D Cursor to a  LMB using either Click or Release as the mouse mode. The action will however only be called once you release the mouse.


While compositing, RenderLayer doesn't move with time I tracked a sequence of images and want to add a box to the tracked scene.
All works well, and in the 3D view, if I change the current frame, the box looks aligned to
the movie, which I use as a background.

When compositing, I have a RenderLayer node and the movie node combined using "over alpha". This works, but in the viewer, the rendered cube is at a fixed location (doesn't move with the scene), as it it's pinned to a single frame. The 3D view still works, and as I slide the current time, the cube moves with the movie.

Any suggestions?

Attaching a screenshot where the cube is aligned (next to the mouse) in the 3D view (bottom right), but not in the composite viewer (bottom left).

To make things more clear, here's a comparison of the 3D view (on the right) and the composite result view (on the left). First, on frame 20:

Now on frame 50:

And finally on frame 220:

In the composite output view, the cube is stationary while in the 3D view it's "moving" with the tracked camera.

Here's the blend file: comp_room2.blend

You have to rerender each frame in order to update the comp. You can do this by pressing F12 to render the whole scene or clicking the render icon on the layer node to render just that layer.

It would be simple to add the possibility of rerendering when the frame is changed, but in reality most renders take several minutes (sometimes hours, or days) to render and thus accidentally changing the frame would clear the render and you would have to wait for it to finish again.

Of course this option could be disabled by default, but I don't see any serious use coming from this and thus it's not worth the effort to code.


trouble with eye holes so I'm looking to make a doll, and I wanted to start the head by modeling a perfectly symmetrical face that I could then 3D print and work on to of digitally. this is basically my first time sculpting in blender ever so I've run into a few issues, and one that I've just kinda ignored up until this point is this weird thing going on with the eye holes. I've been having trouble with them since I first created them by deleting some vertices. As you can see from my images when I went to work on them in sculpt they went wavy and they pinch in spots no matter what I do. Subdividing as created these kind of vertex milky ways that cause dimples I definitely don't want. And when I solidified the whole thing you can see that it came out wavy and created overlapping spikes in some places. My questions would be, "what do you think caused these problems?", "is there a simple/easy fix?",  and "do I need to start over to fix this?".

Your mesh is extremely dense. Understand that, while the denser your mesh is, the smoother it is, it's also true that, the denser it is, the harder it is to control. At early stages of modeling, you don't need the smoothness. But you do need the control. Achieving smoothness can be saved for later. Of course, you can certainly put a Subdivision Surface modifier on your mesh at a very early stage if you want, so long as you do not apply it (meaning you don't "finalize" it) until later. This way, you can go back and forth between smooth and not smooth, to check your results over time.

On the left shows about the maximum ammout of mesh density you want while modeling. On the right shows the same mesh with a Subdivision Surface modifier added.

Another issue is topology. You mentioned a doll, so perhaps this isn't relelvant in your case, but if you want it to be animated afterwards, and exhibit facial deformations that look appropriate, you will need to take into consideration the topology, which is to say, the flow of your mesh's contours. In the pic above, note the flow of the mesh contours, and see how they build rings around the eyes. The same approach will be necessary for the mouth, and any other surface that needs to expand and contract convincingly.

Finally, Christopher Bennett correctly notes that triangles can also create a problem, especially if you want to add a Subdivision Surface modifier at any point, but also, even if you don't, because triangles (and five-or-more sided polygons, or n-gons) can create unsightly rendering artifacts, or pinching during deformation. Again, the included pic shows that all polygons are quads, and this is what you want to strive for as a general rule (there are exceptions, but they don't concern us here). These conventions are especially important in modeling a face that will make expressions.

I don't see any easy way to fix this. Likely you will need to start over. However, if you like the overall shape of your mesh, you can remesh it, and start over with the remeshed version of your model. You can put a Decimate modifier on it, and choose the Unsubdivide option. This is good if your mesh is already quads. But if it isn't, you may be better off using Quadriflow Remesh. Press F3 to bring up the search function, and type in "Quadri..." and it should pop up in the list. Select it, and set the options. Choose how many polygons you want the end result to be. For the most part, you can check all the boxes. Experiment. All you care about at this point is ending up with all quads and also keeping the general shape of your mesh in tact. Don't select a high poly count; you'll make it too dense, and that's already your main problem.

When you get done with this, you can get back to modeling the eye holes. If you have a separate eyeball object, this is ideal, because you can use it as a "cut out" guide. Create a sphere primitive. None of its generation settings matter, but make it about the right size for the face. Move it into position. Now you can model around it. Also, to ensure that you get the eyelid part of your face mesh to perfectly meet the eye object, you can put a Shrinkwrap modifier on the face object. However, by default it will shrinkwrap the entire face to the eyeball, which you don't want. So when setting up the Shrinkwrap in the modifier settings, you will want to be able to tell Blender that you only want the eyelid to be affected. To do that,  create a vertex group for the Face object, with only the vertices for the inner rim of the eyelid selected, and assign those vertices only to the vertex group. Then, when you create the Shrinkwrap modifier, in the modifier settings for it, point it to the eye object as a target, as well as to the eyelid rim vertex group you just created. This way, no part of your face will shrinkwrap to the eyeball object except for the inner eyelid rim, which means your eyelid will meet the eyeball object perfectly.

Sorry this stuff isn't easier. Hope this helps.


Objects Evade or Repell eachother in Animation Nodes I'm trying to achieve this. Sphere's displacing the position of other objects as they move through them. Sorta like someone pushing through a crowd.

I've managed to get this far in AN but adding more than one effector is where I'm getting stuck.

It was easy enough to displace the arrows based on an effector but I couldn't get them to choose the most efficient direction to travel. That is why I made them point towards the effector so they could be pushed back on their local X-axis. This adds complexity to the setup that I can't solve now that I need the arrows to "point" to more than one Effector.

Thanks in advance

I divide this Repeller Effect into parts:

Offsetting the locations with multiple-object effectors.
Changing the direction of arrows with respect to the effectors'
location.

Part-1: Idea is, we offset the locations (grid-points) using the first effector then use those offsetted grid-points for next the effector with the help of reinitializing option of the loop node.

We want to offset location using more than one effectors (I'm using empties objects), so we need the Loop-Node and looping over effectors to get the location of each effector.

Then I have added the Vector-list (name it as grid-points) as "new parameter" in the Loop-Node and calculated the offset by taking the difference between the effector's location and grid-points using Vector-Node which I use as offset-list for the Offset-Node to repel the grid-points based on the Object-Falloff,

Now, select the Loop-Node then open the N-panel and reinitialize the grid-points and also enable the output option so that we can use these grid-points for instanced objects which are arrows in this case but you can use any object. Here is the complete setup for this part:

Part-2: To calculate the direction for the arrows, I take the difference of effector's location and offsetted grid-points. Now, to get the effect that arrows point toward the effector based on the distance from the effector (e.g. like in case of electric field), so we have to normalize directions w.r.t inverse of distances using Math-Node. You can also change the direction of arrows (i.e. point away or toward the effector) by changing the 1 to -1 in the Math-Node.

Next, we add these normalized directions for all effectors which we can do that by creating an empty Vector-list from "new parameter" then reinitializing it and enable the output option for further use in the N-panel,

From the outputs of Loop-Node, first, normalize the directions to one then connect them to Direction-To-Rotation node, and then to the Object-Transforms-Output Node,

The complete Node-Tree (I have added the Switch-Node to change arrow direction):

Note:- This Node-Tree also works for 3DGrid-Points.


Getting the full address of an interface item In blender menus, I can CTRL+C on a menu item and get it's full address (correct me if this is the wrong terminology) that is ready to paste in python code. In a properties window, there are some buttons that I can right click on and choose "Copy Python Command." However, if I right click on the X field in the Transform Location in the same Properties window, I only have the option "Copy Data Path" which puts the text "location" in the clipboard. If I hover over the same X field, I see at the bottom of the tool tip:

bpy.data.objects["Plane"].location[0]

Is there any way to copy this to the clipboard?

Here's why I'm doing this: I have an idea on how to simplify the workflow for Drivers to somewhat mimic similar functionality in the best compositor in the history of VFX; Shake (R.I.P.) and want to make a proof of concept for how this will work. Basically copying an address to a value number field and pasting that in another number field with the option of using it as part of an expression. The expression would be parsed and then executed via

exec()

and

eval()

commands.

So basically enabling expressions in a number field and allowing that expression to include updated values from object parameters.

I think that this would be a great addition to blender, but noone seems to be interested in the idea. But if I could show everyone what a great idea it is...

There are a number of keyboard shortcuts you can use to copy different forms of fields and components out of the interface.

The simplest is Ctrl+C - this copies the value of the field (eg, 0.0).

The next is Ctrl+Shift+C - this copies the local path to that value (eg, location).

Finally, you can use Ctrl+Shift+Alt+C - this copies the absolute path to that value (eg, bpy.data.objects["Cube"].location[0]).


Bone Rotation in Pose Position I am trying to create Motion-Capture rig using blender, copying the rig from this video: https://www.youtube.com/watch?v=1UPZtS5LVvw

Everything is set up and supposed to be working fine, the only problem is that almost all of the bones rotate as soon as I switch the rig from rest mode to pose mode, causing the models torso to twist, the feet to be upside down and overall preventing me from using it for animation. Does anyone know why the bones rotate like this and how I can prevent it from happening?

Heres the link to the file:

Thanks in advance and goodbye

I'm not currently using a computer that can run Blender (school), and I've only spent only a few weeks in Blender so far, but here's my two cents:

One thing that might be wrong is that the keyframes don't have rotation.  Make sure that you're doing LocRotScale instead of LocScale.  If you go to the bottom-right area of the timeline editor, you should be able to set the box to default to LocRotScale when you press I if you want.


It is possible to check if a particle is within a face? I have a particle system and I wanted to see which face each particle was in. Is there a way to check it? I have tried to check x, y, and z coordinates separately but that would not work. Also is there a way to see which vertices a face has?

These are the faces and the particles:

I would like to check which face each particle is in so that I can find probabilities.

Using the particles location vector, and the closest_point_on_mesh method.  The particle location is  in global coords.  We can see this by moving the emitter in the UI, the particles remain in their world position and need to be re(bake)calculated.

As pointed out in https://blender.stackexchange.com/a/40979/15543 you need to put the location passed to closest_point_on_mesh into the objects local space, otherwise it will give unexpected results once the object's matrix_world is no longer the identity matrix.

The particle location is multiplied by the inverse matrix world of the emmitter object, to put it into that objects local coordinates.

I'm using a build of 2.76.4 and it appears closest_point_on_mesh has a new return value,

>>> C.object.closest_point_on_mesh((0,0,0))
(True, Vector((0.9999996423721313, -2.980232238769531e-07, 0.0)), Vector((1.0, 0.0, 3.2782557468635787e-07)), 2)

The first being success of operation, the others: location vector of closest point; normal vector; and face index.

The script below prints how many particles are closest to each face.

import bpy
context = bpy.context
obj = context.object

mwi = obj.matrix_world.inverted()

ps = obj.particle_systems.active
facelist = []
new_version = bpy.app.version == (2, 76, 4)

print("-" * 72)
print("Obj: %s Particle System: %s" % (obj.name, ps.name))
print("-" * 72)

for i, p in enumerate(ps.particles):
    v1 = p.location # global particle location
    localPos = mwi * v1  # particle in obj local space
    if new_version:
        (found, loc, norm, face_index) = obj.closest_point_on_mesh(localPos)
        if not found:
            continue
    else:
        (loc, norm, face_index) = obj.closest_point_on_mesh(localPos)

    facelist.append(face_index)

mesh = obj.data
for fi in set(facelist):
    vertstr = str([v for v in mesh.polygons[fi].vertices])
    print("face %d,  verts: %s particle count:%d" % (fi, vertstr, facelist.count(fi)))

Sample result default cube, default particle system

------------------------------------------------------------------------
Obj: Cube Particle System: ParticleSystem
------------------------------------------------------------------------
face 0,  verts: [0, 1, 2, 3] particle count:180
face 1,  verts: [4, 7, 6, 5] particle count:168
face 2,  verts: [0, 4, 5, 1] particle count:161
face 3,  verts: [1, 5, 6, 2] particle count:169
face 4,  verts: [2, 6, 7, 3] particle count:150
face 5,  verts: [4, 0, 3, 7] particle count:172


Select objects in scene by their object color I would like to select all the objects in the scene that have the same object color Object.color as the active object.

import bpy
active = bpy.context.view_layer.objects.active
color=active.material_slots.data.color
for obj in bpy.data.objects.keys():
    colorSelect = obj.material_slots.data.color
    if colorSelect == color:
        #How do I select this object?

Based on your comment, I guess you want to compare against the viewport display color property:

I think one easy way to compare color values is appending the components to a new list and compare the resulting lists using the == operator.

>>> [c for c in C.object.color]
>>> [1.0, 1.0, 1.0, 1.0]
>>>
>>> [c for c in C.object.color] == [1.0, 1.0, 1.0, 1.0]
>>> True

If you don't like lists for any reason, you can also convert the color to a tuple using the slice operator [:], which is even shorter -> thanks to @batFINGER:

>>> C.object.color[:] == (1.0, 1.0, 1.0, 1.0)
True

Full script iterating through Scene.objects, comparing the color values (r,g,b,a) of each object against the values of Context.object and selecting the matches:

import bpy

ctx = bpy.context
obj = ctx.object

# Object color as list
obj_clr = [c for c in obj.color]

for o in ctx.scene.objects:
    if o != obj and o.type not in ('LIGHT', 'CAMERA', 'EMPTY'):
        # Compare both lists
        if [c for c in o.color] == obj_clr:
            o.select_set(True)

obj.select_set(False)

Be aware that there are might be issues with floating point precision when comparing the values. One way around that is using isclose(a, b, *, rel_tol=1e-09, abs_tol=0.0) provided by the math module, which can be wrapped into a little helper function to test all 4 floats at once:

def compare_color(a, b, t=0.001):
    from math import isclose
    comp = {isclose(i, j, abs_tol=t) for i, j in zip(list(a),list(b))}
    return True if (len(comp) == 1 and next(iter(comp)) == True) else False

Another example comparing against Material.diffuse_color using the helper function:

import bpy

def compare_color(a, b, t=0.001):
    from math import isclose
    comp = {isclose(i, j, abs_tol=t) for i, j in zip(list(a),list(b))}
    return True if (len(comp) == 1 and next(iter(comp)) == True) else False

ctx = bpy.context
obj = ctx.object

# Object color as list
obj_clr = obj.active_material.diffuse_color

for o in ctx.scene.objects:
    if o != obj and o.type not in ('LIGHT', 'CAMERA', 'EMPTY'):
        # Compare both lists
        if compare_color(obj_clr, o.active_material.diffuse_color):
            o.select_set(True)

Further Reading: Select an object by name in 2.8 and Set active object in 2.8


Questions about the Light Path node I would like to increase my shading skills by understanding the light path node a little bit better. I am a little bit confused as to how this node works, mainly in terms of how some node setups have different output sockets being added together, as well as what is being measured for ray length, and depth.
The first thing that is quite hard for my brain to understand is, how it is possible to mix the camera rays and the glossy rays (like in the picture), as well as turn it into color information. How does the light path node convert the camera ray/glossy ray information into color information? This part stumps me, I can't quite visualize what happens here.
The other thing that stumps me is what is being measured for ray length and depth. In the blender manual, the ray length has this definition:

Distance traveled by the light ray from the last bounce or camera.

and the ray depth has this definition:

Number of times the ray has been reflected or transmitted on interaction with a surface.

From these definitions it is measuring 'a ray', my question is which single ray are both of these options measuring (or am I thinking about this in the wrong way)? From my understanding, aren't there thousands and thousands of rays that are bouncing around?

Question 1:
Light Path node outputs a single value between 0 and 1.
When plugged directly into RGB input, they correspond to black and white.
Example using the mentioned Ray Length output. The longer the distance, the higher the value.

Question 2:
The values are calculated for each ray hitting a surface.

Direct view - 0 bounces
Mirror reflection - 1 bounce
Glass panes - 1 to 3 bounces


Vertex Vertices Weight Paint I am having a weight paint issue, I can't figure out way this wraps up the way it does, it twists at the ankle and dissforms. Can you help?

blend file:

Was helpful to see the file. Bone roll 180 degrees and all is fine.


I need to animate a production line simulation (several rotating cylinders pushing a rubbery gasket material forward) I basically need to animate about 5 or 6 cylinders that push a rubbery sealing material down the production line in a somewhat complex pattern so doing it by hand with keyframes is not an option. The cylinders are not in a straight line
 or only below the substance which complicates things.

My idea is to use physics and cloth with the correct constraints, settings and options to achieve this effect.

I require the cylinders to rotate constantly at the same speed troughout the animation giving off kinetic energy to the cloth, not affected by the cloth weight, pushing it forward. The cloth needs to be stiff and not buckle inward under the strain because that just wouldn't happen. It's a gasket sealing material and that wouldn't happen IRL. It's several mm thick and very

I need some help and helpful tips from people who're experienced in animation.

List of requirements:

Extremely rigid "cloth" that acts like rubber. I am fine working with extensions.

rotating cylinders that are not afected by physics in their rotation but do transmit energy via friction

Can you give me some helpful pointers? The tests i've been making  have been somewhat abysmal and it's a pretty specific thing so there aren't many tutorials around.

I'm sorry, the question was way too broad.

I've gotten a partial solution from Duarte Farrajota Ramos by experimenting with presets and ramping up bending to 1000 and structural to 500 for the rubbery material.

I'll create a new question for how to propel the piece of ruber track in the animation forward.


how to show reflection of a different object in cycles I have a mirror and an object in front of it. I want to hide the reflection of that object and show instead a reflection in the mirror of another object hidden in that scene,is that possible?

I slapped together a quick example. In short -
The visibility options for the first object (Suzanne) have glossy, shadow and diffuse turned off.

The second object (cone) has only visibility for glossy enabled.

This results in Suzanne not being visible in the reflection and the cone just being visible in the mirror.

Depending on what you're needing, there might be more involved ways of doing it via compositing, but I hope this answers your original question.


Teleport to Object not working When I pressed . it didn't teleport me to the object, can someone help fix this problem? I selected it and then pressed ..

The active object needs to be on a visible layer in order for View Selected (.) to work.

Look in the 3D view header at the layers.

As shown in that picture, I suspect you will have the active object on a non visible layer. The darker squares are the visible layers. The orange dot is the active object.

Press ` to show all layers, or Shift LMB  on the layer button in the 3D view header for the layer the active object in on.


UV upwrap is bigger than image So I modeled a log cabin in blender (it's all one object). I added a woodplank material and after upwrapping I had to scale up the UV vertexes in the UV editor so that it looked right. Now I'm trying to figure out the best way to bake this into an image so I can import it into Unity. It's possible I don't have this workflow correct. When baking do the UV vertexes have to be within the bounds of the image it's baking too? How can I make this work? I'm a bit lost.

Yes the vertices have to be inside. This tutorial might help: https://www.youtube.com/watch?v=0r-cGjVKvGw


Can I modify a rigify rig to add a head after generating it? So a while back I rigged a model using rigify in blender 2.8, and deleted the face bones, as it was way too complex for what I wanted to do with the character. Flashback to now, and I've spent hours making animations for the model, but would now like to add facial animations to go along with the body one's I made. Is there anything I can do to add a face rig, because it doesen't seem like I can modify the rig in edit mode, the new bones I make do nothing? I'm ok with rigging a new character but I would like to be able to save the animations I made with this rig? Thanks so much I would apricate any advice.

https://docs.blender.org/manual/en/2.81/addons/rigging/rigify.html
From the manual:
Nondisruptive re-rig
If the generated rig doesn’t fit all the features you need or, for example, you decide to add something more to your character (like a sixth arm or a tail), you can re-generate your rig without losing your previously generated features and your animation data.


Trying to get FBX import add on I think the link is missing to this addon

https://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Import-Export/Autodesk_FBX

Anyone know how I can get this? Thanks!

This is built into Blender.  Go to File -> User Preferences... -> Add-ons and type "FBX" into the search box at the top.  Put a checkmark on the FBX plugin to activate it.


Generating rigging problem Im trying to generate rig my character yet for some reason the rest of my generate rig for the body isnt appearing. Does this only work when it comes to the human meta rig?

As long as you follow the Rigify bone naming conventions, the rig widgets should generate. As it looks like you're creating your own custom rig, I recommend you read through the Rigify documentation so you understand how the addon works.


Is there a way to display the view of an active program/screen as a texture on a 3D object? I'm looking at making a Rainmeter skin to look like a Game UI, however the program only works in 2D, and so I'm unable to add any sense of perspective or depth to it. (I should note that the design is meant to be contextual, as if the HUD is a part of the game world)

So I was wondering if it was possible to have a live view of the desktop or rainmeter window (since they are linked) put onto a surface in blender to give a 'wraparound' appearance.

Rotating live data out of view is what it sounds like you are after.

You can create a screenshot of the static elements you want to animate and turn them into a gif from frame by frame files. But live data would not be possible, not without extending blender with a new plugin.  Even then, the best place for this kind of transformation to take place would be within rainmeter.

You may want to approach the rainmeter community with questions about how to take a screen cap, and use lua to apply rotation transforms on a flat screen capped image.

Hope that helps.


Can't move in the 3D view with mouse I thought that I was able to use my mouse to navigate in the viewport before. I can only seem to rotate the project view via the numpad keys. I have tried to Google for my problem but can not seem to find any answers.

You can try one of the following

View > View selected or . on Numpad
If that doesn't work try Shift + C

It seem that with some blend files "zooming to much" locks the 3D view and you can only rotate the view, not pan or zoom in or out, with other .blend files it is OK... don't know the real source or how to fix the file, anyway if you still want "free zoom, pan and rotate", you can copy the objects that you need to a new .blend.


How do I rotate a group of objects around their respective centers? This question asks about rotating a group of objects around a common center. I want to rotate a group of objects around their respective centers, is that possible?

Normal behavior is like this

Set the menu as below:

You will get look like this:

Best of luck :)


screen space position in material graph I have a GLSL vertex shader which computes cameraspace normal and screen space position and then it uses them to compute other values.

vec3 n = (modelView * vec4(vertexNormal, 0.0)).xyz;
vec3 p = (mvp * vec4(vertexPosition, 0.0f)).xyz;
vec3 w = n+p; (for example)

I am trying to replicate this shader in an eevee material graph but I'm not sure  how can I get screen space and camera space data. Is this posible?

You can get camera space coordinates from the Input > Texture Coordinates node using the Camera or Window socket, depending on what you are looking for.

The same node provides local position for vertex using the Object socket, you can convert to world coordinates using a Vector Transform node.

Using the Vector Math node you can do the required matrix calculations.

If I interpreted your code right you should need something along the lines of the node tree below.


Blender Fracture Modifier locking to another mesh I am using the Fracture Modifier build of blender and have recreated a door in blender. I have the door's handle as a separate object, and I need the door handle to attach to the door as it is breaking. Adding an object constraint unfortunately doesn't work because the Fracture Modifier build adds a modifier, thus the positions of the shards in the door stay at the same location even after the door is shattered. I need a way to lock the door's handle to the door so that after the door is smashed, the handle will continue to fall with the wood shards it's attached to. Thanks!

You can add a fracture modifier to the handle too, setting shard count to 1 if you dont want it shattered. But it is important it is an FM object in order to use "Automation" -> "Combine" -> "Connect" in the fracture helper addon which is shipped with the fracture modifier build. (Needs FM 2.79a or newer.)

This will connect FM objects with external constraints where the objects "touch" basically. You can control the properties of the external constraints on the newly generated helper object (which has also an FM, but only maintains the constraints).

Alternatively you can setup the connection manually. In order to do so you can put the desired FM objects into a group, then create another helper object manually. Put an FM onto it, disable all sources. Specify the Group in "Sub object group" and check "Constraints only"... also enable "Use constraints in the helper object. But note, its easier to let the addon do the boring automation work.

Here I quickly built an example file with a simple door :)


How to parent a grease pencil with armature? How to parent a grease pencil stroke with armature for a 2d animation. Please try to post a detailed answer.

There is a drop down menu below the layer.choose armature and then choose bone..there should be a list of bones. (it does not matter if the gp layer is attached to an object or the scene.)


Character start distorting when I moved the body rig blender community.
Sorry, if this question was asked so many times but I am working on character rigging from months but when I rotate or move any bone of the Rig then the body starts distorting.
I have tried so many solutions but nothing works. Please help.
Rigged character

I would personally merge all the character's part to make one object, it would make things easier in my opinion. But first select the armature, display the layer with the deforming bones:

Then shift select the mesh and check the bones, you can see that some have influence when they should not:

Select these parts in Edit mode, in the Properties panel > Object Data > Remove From All Groups, then reassign to the right group (the one that has the name of the bone that is supposed to control) with the Assign button. Or do the corrections with a brush (in Mix or Subtract mode) in Weight Paint mode.

For the smoothness yo could add a Subdivision Surface under your Armature modifier, but you should add edge loops where the bending is happening (by the way, no need for so many horizontal edges in my opinion, especially if you add a Subdivision Surface):


When I touch an object that I'm meant to pass through I spin randomly out of control So I have a very thin cube and I've put it in my environment, I've told this cube to let people pass through it using logic bricks. I'm using it to count your score, but when I pass through it I spin randomly out of control. If it helps you have to be in the air to pass through it.

First, make sure that "Ghost" is checked and "obstacle" and "collision bounds" are unchecked in physics. Check that the base and top face are far enough up apart on the Z axis so they do not collide with the avatar. You may want to change the cube into a plane to prevent this from becoming a problem.
It would help to know what version of blender, it may be a bug, and what your logic bricks look like.


Painting a dog with texture paint, TOTAL NOOB I started blender and made a model of a dog. I tried painting the dog but it would not paint in the areas I wanted it to. It paints in random spots all around. I'm stuck. Here is the picture.

As you can see, I only put the brush on the eyes, but it painted the legs and nose too. The brush did not touch any other area but the eyes

Firstly you need to unwrap mesh into UV editor in Edit mode.

STEP 1: Goto "Edit mode" in 3D viewport by pressing TAB key or using the menu below

Once you are in Edit mode like this

Drag the window below just like this

Now, follow the image below to go into UV Editor.

Then hit U in 3D viewport and press "Unwrap" in the menu from the image below

After the unwrap you'll get unwrapped mesh in UV Editor something like the below image.

But you can see that all the unwrapped mesh is overlapped in UV Editor in image no.5.
You have the same problem with the mesh.

Now the solution starts.

You need to select the vertices of the mesh so that when unwrapped it needs to be unwrapped good. Check out the reference cube image that has its vertices selected.

After the selection of vertices in the mesh hit Ctrl+E in 3D Viewport and select "Mark Seam".

Then hit select all the vertices A+8 x2times, after all the vertices are selected, Hit U and select "Unwrap".

Now, after the mesh is unwrapped correctly, create new texture

And continue your Texture Painting.


connecting grease pencil drawing to object with armature for animation For a project, I am creating an animation. For this animation, I need to be able to connect my grease pencil drawing to my object to then be able to animate both.. with grease pencil I clicked on the "surface" option to draw on my surface, but it did not truly connect to the surface..

If it is not possible to connect the two, is there any other way to give that scribbling pencil effect to my object?

thank you.

You can parent the grease pencil marks to the object first select the mark in object mode
then the object i believe its shift p to parent it to the object if not try alt p


Extruding edges on the plane When I extrude my edges, they extrude at an angle. I'm trying to make the clothing pattern for a dress, so all the vertices should be on one plane. I'm working on the neckline now (see image). I want to extrude the edges towards the centre and on one plane. But each time I toggle from front view to left view, I see that I extruded the edges at an angle (see image). This was obviously not my intention. Any advice on how how to achieve the desired result?

If you want to work entirely on the X-Z plane, like here (note the little axes on the bottom left):

then, every time you extrude, make sure to do E, then ShiftY: this will exclude the Y axis from the extrusion. This works even if you are not in front view.

To fix a mesh that was mistakenly extruded along the Y axis, do A(A)SY0

A: select all (twice if something was already selected)
S: scale ...
  Y: ... along the Y axis ...
    0 ("zero"): ... until its width is 0% of the original


Using the fracture modifier with the principled shader? My understanding is these 2 features are impossible to install as add-ons.  I have the current build of Blender 2.78c with the fracture add-on built in, and the beta 2.785 version of Blender that has the new principled shader.  Is there any way to use these 2 features together?  I've heard about making your own Blender builds, but I'm not sure how to do it.

Thanks!

No, both of the features you mention are part of blender's core source code and can't be combined without some work.

The principled shader is part of the current blender development that will be included in the next release which is planned to be released soon.

The built in fracture modifier is a separate development project that is being done parallel to blender's main development with plans to have it merged into a blender release at a later time. The developer working on this merges the main blender development into the work being done on occasions. Unless you know some C/C++ coding and want to help, I would suggest waiting until the next merge from master is done. You can find instructions for building your own versions of blender on the blender wiki.

The developer has a website dedicated to the fracture modifier project where you can find links to a blenderartist thread and a facebook page, so you can try contacting the developer and asking if they have any plans to merge soon, a donation to the project may help persuade them.

As you seem to have a copy of blender with the fracture modifier, you can setup a pbr shader that will give similar results to the new principled shader that you can use until the update happens. Blender guru has a tutorial on pbr shaders and you can find some pre-built shaders to download at BlenderBrit.


How to save alpha channel render The render result is below

But I would like to save the image generated by switching to alpha channel below (the black and white image)

Regular "save as" would override the alpha draw, how would I save the image from alpha channel (the black and white image)?

In the compositor add a File output node and plug the Alpha output to it and Render.

That way you can save the Alpha channel as a separate file.


BGE play animation in other object using button I need help with my game engine project.
I try to create a text object that move to center of viewport when i click a button. I've try using action actuator, but it affected the button, not the text.

Here's the animation that i wanted to do

The text first at the right side of camera, and when i clicked that button, the text move to the center of viewport like this

If anyone can help, please let me know how to do that, or maybe someone can give me a link to tutorial that related to my problem.
Another thing, is there a way that i can make my text dynamic, based on what button i click? like when i click the white button, the text value is 1, and when i click another button, the text value change to 2?

You need to play the action at the text rather than the button.

For inter-object communication I suggest to activate a message actuator e.g. with subject "button clicked".

On receipt of the message "button clicked" the text object can start playing the action.


Combine mixamo animations with own rig / animation possible? So I downloaded a bunch of mixamo animations and edited them in NLA Editor. I want to make small tweaks here and there and add them to the whole animation but it doesnt work. When I rig up my character and animate it, it "erases" the whole underlying animation from mixamo. The animations are all fbx files.

Do you know how to combine mixamo animations with own animations?

You have to keyframe the influence of IK (or other controls from your rig- for example, I have my hand and foot bones copy transforms from my respective hand and foot controllers) down to 0 for the Mixamo actions. Just go to every single Mixamo animation at the frame 0 and keyframe every custom influence/bone constraint to 0. You also have to do the reverse for your custom animations.
This approach works perfectly for exporting animations to Unity. I don't know how you're going to be using NLA editor so I can't say if it's going to work for you.


How to merge two edge loops This is a Q&A so I answer it myself. I searched for an answer to this question for ages and didn't find anything so I'll add this here if anybody else struggles with the same issue.

So, how can I merge two edge loops to one? I do not want to connect them (I have seen many answers that suggest to just bridge the edge loops), nor do I want to merge each vertex by hand. I just want each vertex to be merged with the closest opposing vertex.

Also, I find it highly unpractical and in most situations useless to remove doubles after moving the vertices to overlap each other by scaling and moving the edge loops. This is another common suggested answer.

Select both Edge Loops Shift+Alt+RMB
Hit Space Bar and type "Bridge" and press Enter
Press F6 and check "Merge"

Bridge works also for loops with different amount of vertices.
Merge function only with the same amount of vertices.

For more advanced work with Loops try "Loop Tools" add-on of Bart Crouch.


Rigid Simulation freezes at frame 250 Any idea of why my viewport preview of the simulation stops at 250 frames? (as you can see on the orange line on the timeline)

Am I maybe missing any kind of configuration?..

It's a rigid body simulation.. e.thing works fine but the preview freezes at 250 frames.... No keyframes on the simulation, only on the colliding object that has an infinite loop rotation.....

Is it maybe because of motion paths setting?
 It is set on 300......

Update:

Problem solved! I missed this tab of configurations!!

Did you bake the physics when your animation length was at 250?

If so, free all bakes, change a value, then bake again (and make sure you have the dynamic length of the bake set long enough). [You must change a value to reset Blender's built-in caching, and make sure it starts from scratch. You may then change it back.]

Here is an example of setting the length for a cloth simulation.


Transparency painting gone wrong I want to make part of the mesh transparent. For this I used 2 principled bsdf nodes. They are linked to a mix shader. The transparent bsdf to the 2nd slot, the leather to the 1st slot. I've made a mask/ texture image with black background and I painted white where I wanted the mesh to be transparent, whose color slot is linked to the mix shader fac slot. The normal slot from the normal map of the leather material is connected to both principled bsdf normal slots. Any guess what I did wrong for this ?
The top principled bsdf is for the transparent part, the bottom is the leather.

It doesn't work because your "transparent" Principal BSDF is not transparent because the Alpha slot value is 1.0. It should be 0.0. But you don't need to mix 2 Principled BSDF shaders for transparency.
You just need one Principled BSDF. Then plug the mask (Image Texture node) into the Alpha slot of the Principled BSDF node. That's all :-)
Of course, you can do it as you did. But you better would take a Transparent BSDF (instead of another Principled BSDF) and mix it with a Principled BSDF. The mask goes into the Fac slot of the Mix Shader as you did. Such setups are often used for glass and plastic shaders.
Transparent shader nodes don't need a normal map. (At least I've never this.)


How to make torch cutting logo out of a plane (steel) and falling pieces.? I want to make a plane, which i can cut in shape of a logo and then the cutout piece will fall revealing the logo. I can make the torch but struggling with cutting a plane. Please help.

I wanna make animation similar to this https://www.youtube.com/watch?v=MTBQI2SiYGw

Starting with a plane, you can use the knife tool K to cut a logo into it.

Then in face select mode select the faces you want to come out. Use P->Selection to break the selected faces into a new object that are located at the same position, so both objects will blend in as one. Note that a subsurf modifier will pull the edges apart and make the seam visible.

Now you animate the location of the piece you want to fall. Go to the frame you want it in place, say 20, and press I->LocRot to add a keyframe for the location and rotation. Move ahead a few frames and move the logo and add another keyframe. Repeat a few times to have it move and rotate as you want.

For the effects you can combine that animation with dynamic paint and particles.


How to make a physics simulation permanent I have a bed of pebbles that have been physics simulated and are now in a resting position:

I want to append this to an architectural render I'm working on. When appending, the pebbles go back to their start position (suspended in space).

I don't want to bake the simulation, because it's only the ending position I care about. Is there a way to apply all the pebble's positions?

First off, go to the target frame and make sure only your pebbles are selected.

In the 3D Viewport, under Object > Rigid Body select Apply Transformation. This will make the current position the pebbles' starting one.

Then, in the same submenu, click Remove to remove the pebbles from the Rigid Body simulations; that is, to make them simple, static meshes again.


How the Fresnel effect works and how to construct Physically-Based shaders in Blender? In this youtube video Cynicatpro explains how Fresnel works and builds a shader for dielectric materials. In explaining how roughness has an impact on the fresnel effect and how to simulate that in Blender he built this Fresnel node group:

When introducing the Geometry node he loses me. I think I understand why the "standard" Fresnel node has the Normal as an input (EDIT: I now think I don't). And I understand why roughness has an impact on Fresnel. But I don't understand why the Geometry - Incoming should be a "good" approach for simulating the effect of roughness on Fresnel. Who can explain ?

BOUNTY QUESTION:

The answers of @Leander and @lbalazscs were certainly helpful but I still don't truly understand how the current Fresnel node works and why CynicatPro is constructing a Fresnel node group with the "average normal" and the "Geometry - Incoming".

I did some reading like this about microfacet normals (and also papers on that like this one and this one), but most of these papers are full of math and are too high brow for me. This document about PBR was really helpful and it makes me understand things like diffuse, normal reflectiveness, roughness, fresnel and even microfacets.

But I cannot make the switch to Blender. Why is the standard Fresnel node using the average normal and does the Fresnel node group use this average normal and the incoming rays. I think I understand what he tries to accomplish but I don't understand the model. Who can explain and not use high-level math ?

What I am looking for ...

A) an explanation on a conceptual level (without diving into the math) how things like diffuse, normal reflectiveness, fresnel, average normals, incident light and reflected light, microfacets and roughness relate would be very nice but

B) an explanation of the "CynicatPro Fresnel node group" is maybe the most important part of my question.

I am not asking a complete syllabus ... I have done some readings.

I think a real understanding how to construct Physically Based shaders is crucial for photorealistic rendering and this starts with a real understanding of concepts and the tools of Blender. I am happy to raise the Bounty is someone feels that this is adequate.

EDIT: Now I better understand how the normal input is used I understand that the Fresnel node is fed with a normal input. This normal input comes from the Mix node. Now ...

A) what is Geometry - Incoming ? Is this the incoming ray like shown in the image below ? Or is it the incoming ray into the camera ?

B) What is exactly what the Mix node produces ? What normal ??

[Pseudo explanation.]

The normal gives us the normal surface orientation for each surface point. The incoming output gives us the direction of incoming camera ray. In the "middle" of a sphere the normal will be pointing directly towards the camera, hence at that point (only) the incoming and normal vector will be equal.

We are especially interested in the small incoming angle, where the glossyness will be stronger. If we sample a surface area on the "side" of the sphere (from camera view) the incoming and reflected rays have a small angle.

The more rough the surface gets, the more rays will be reflected in the direction of incoming.

With the roughness converging towards 1, the ratio of incoming reflected to normal reflected direction will also converge towards 1. The ratio is represented by the slider, switching from normal glossy reflection to (fake) incoming normal reflection.


Do I need to update sockets of InvokeSubprogramNode from script I am trying to write a addon which uses Animation nodes addon. I am able to create different nodes such as Object instance, combine vector, math, transform output, loop and invoke subprogram nodes.

I can able to connect to all nodes except object instance node to subprogram node. Getting exception saying that out of index for invokesubprogramnode.inputs[0].

I found in one of the templates before linking updateSocketifnecessary() is called but i am not able access that function from my addon. I need assistance with this.

I still plan to make it easier for other addons to use AN so anything I say here might change in the future, not very soon though.

Before you can create the sockets in the Invoke Subprogram node you need to do three things:

Create the subprogram itself (loop, group, script)
Tell the Invoke Subprogram node which subprogram it has to invoke:

invokeSubprogramNode.subprogramIdentifier = loopInputNode.identifier

Every node has an unique identifier (some random string) and every subprogram has an identifier. The identifier of a subprogram is the identifier of its 'owner' node. 'Owner' nodes are: Loop Input, Group Input, Script. Every subprogram has to have exactly one of those.
Update the sockets sockets in the Invoke Subprogram node by calling this function: https://github.com/JacquesLucke/animation_nodes/blob/master/nodes/system/subprogram_sockets.py#L12

animation_nodes.nodes.system.subprogram_sockets.forceSubprogramUpdate()

Alternatively you can also integrate your code into a Template, which is a special class that makes it easier to create node groups programatically.

Here is an example of a template: https://github.com/JacquesLucke/animation_nodes/blob/master/templates/arrange/distribute_instances_on_spline.py

Even if you don't want to subclass a class of AN you can see how the nodes are created there.


subdivide at line at the selected location (vertex) of that line? how can a lose vertex "P" be made a part of selected line in "image 2". So that the mesh act as one entity?

Here is how I accomplish this when I am modeling:

First, select the edge you want the vertex to be added to.  Then hit W > subdivide.  This will add a new vertex on the edge, then select both the new vertex and then the original one (making sure to select them in that order) and hit Alt + M > at last.  This will merge the two vertices to the location where the original vertex was.


Perfectly matching concentric shell walls? I have built two concentric hemispherical shells from two spheres centered at (x,y,z) = (0,0,0), and added a thickness to the outside shell to fill the gap between the two shells. However, I have found that -- despite the shells being of the same proportionality (height = 1/2 diameter) -- I do not get a perfect intersection of the inner wall of the green shell and the wall of the blue shell, as illustrated below.

Am I misinterpreting what I'm seeing? How can I make the inner wall of the thickened green shell exactly match the boundary of the (smaller) blue shell? Thank you in advance.

You can join the two meshes in object mode.  Then in edit mode you you can select the two edge and perform a Bridge Edge Loop.  That will also serve as a check to make sure you have the same number of vertices.

If you want two separate objects. You could start with one hemisphere, [solidify modifier], apply the modifier,  The select the inner portion and menu [separate] to form two separate meshes.


Extrude edges (or a curve) using an offset/inset to create a mitred patch of faces? I'm trying to find a way to quickly use a curve or series of edges as an outline for creating a mitred patch of coplanar faces.
I guess what I'm actually asking is whether there's a way to draw a series of edges and then extrude them into faces, but... rather than extrude all of the new edges in the same direction, can they be extruded so that they each remain perpendicular to their respective original edges, creating a mitre where they meet, like what an offset or inset does?
Here's what I mean:

(A) I start with a series of edges; then I want to...
(B) offset those, like an extrusion inwards or outwards but specifically inwards in this case, so as to create new faces; and
(C) Adjust the thickness later.

I will explain how I've already accomplished this, but I'm hoping someone can help me find a quicker way to do this.
Here's what I already did:

Start with a single vertex, and extrude it to create the edges I want => this gives me (A).
Take that mesh and convert it to a curve (while using Keep Original, and setting the new curve to 2D)
Use Object Data > Geometry > Offset set to a negative value -- this creates the main effect of what I mean by offset/inset, because unlike (say) doing a scale, this method does what I'd call "a perpendicular projection" of each edge.
Convert that offset curve to a mesh again.
Join (CTRL+J) the two meshes, hence giving me now an outline for the outside and inside edges of the faces.
Connect the open ends of those two outlines and fill to create one big polygonal face.
Use the knife tool to cut the mitred corners between each pair of vertices.
Now I have (B).
Finally, I get to step (C) by selecting the inside edges and doing an Edge Slide (with Clamping disabled) to adjust the thickness both in and out as I need.

So, can anyone suggest how I might do this more quickly and easily?

Start with your shape:

Select all the edges and extrude along the Z axis:

Select all the faces, right click and choose "Extrude Faces Along Normals". You can drag the mouse or enter a numerical value - if you want it inwards, use a negative value (ex: -0.5).

After extruding along normals, make sure to check "offset even" in the operator panel.

Next, select the whole mesh and flatten it by scaling to 0 on the Z axis (S + Z + 0).
This will leave some duplicate vertices (as the top and bottom faces are now "flattened" on top of each other). Select the whole mesh, and pick Mesh > Clean Up > Merge By Distance to clean it up.

Now you have your shape: