Geometry Nodes: Point Instance Collection use count (object weighting) I'm trying to recreate the donut sprinkles tutorial (by Blender Guru) but instead of using a particle system for sprinkles on the top of a donut, I want to use the new geometry nodes system.
When using a particle system you can use a collection as the objects and then the "Use Count" option allows you give different objects in the collection different count.  This means you can make certain objects in a collection appear more often than other objects.
When using a Point Instance Geometry node you can choose "collection" but there is no option to "Use Count".  Is there some chain of nodes you could use to accomplish the same thing?

The easiest way I found was to add separate "point distribute" and "point instance" nodes for the spheres and then you can independently control the density of the spheres and sprinkles. You then join the geometries.
The two nodes controlling the spheres are circled in red.


How to determine right vertex count for mesh? So i'm back with another stupid question about low-level 3d :D
I'm writing addon that will count the number of vertices that is needed to render the mesh say in Unity.

For now i've decided to first count how much normals re there on every visible vertex, so this unique normals would be the number i need.

But UVs add verts too, so i decided to count all the UV verts, subtract number of visible verts and add this number to total count (normals).

That worked fine for simple and complex meshes and i was happy. But now i've created another model and addon failed to count right number.

After investigation a narrowed the issue down to that thingy (see below). It is mesh with smooth shading. Blue - hard edge, orange - uv seam.

My addon shows 13 verts for it and it is right according to its algorythm. But there are 14 verts, because 4 separate polygons would be drawn.

So i'm stuck because i totaly do not know how to get such information from blender api (and actually i don't know what information i need). Anyone familiar with this can advice me something useful?

link to full addon code: https://github.com/curly-brace/Blender-Vertex-Counter

The strange hexagon:

List of objects in scene with counts (verts, faces, tris)?

I think a suitable solution can be found here. They use a len method which I'm sure might be useful in your case.


Maximum number of materials that can be added in a scene? I have very large number of planes in my scene and each needs to be assigned a color, and to do that, I am assigning a material to each plane. Blender is allowing 2^15, i.e. 32768 materials.  But the number of planes in the scene are on the order of millions.

How can I make blender handle more materials so that I can color all the planes?

Use the same material for every object but have different colors for it.

I assume you will generate this dynamically. Some methods I can think of:

Generate a 4096x4096 texture and assign that. Use nearest interpolation (like in minecraft). Have each planes UV-coordinates point out what pixel to use.
Use vertex colors for each plane. Have the material use the the vertex colors. Use the attribute node: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Attribute
If you don't need exact colors, if you are content with a random color, use the object info node to get a random value for each node, insert it into a color ramp node.


how to create vertex groups from materials using python? I have assigned different materials to a single mesh. I want to create vertex groups from the materials assigned. Is it possible to create vertex groups from materials using python?

This script adds the verts assigned to the face assigned to a material to a vert group with the materials name.

import bpy
context = bpy.context
obj = context.active_object

for index, slot in enumerate(obj.material_slots):
    #select the verts from faces with material index
    if not slot.material:
        # empty slot
        continue
    verts = [v for f in obj.data.polygons
           if f.material_index == index for v in f.vertices]
    if len(verts):
        vg = obj.vertex_groups.get(slot.material.name)
        if vg is None:
            vg = obj.vertex_groups.new(name=slot.material.name)
        vg.add(verts, 1.0, 'ADD')


How to dynamically set Current_ Frame in Driver Namespace Function Call? The driver namespace function call(wiggle_z) gives a float error even when float values are provided for the framerange in the driver scripted expression field .
How to resolve this ?
TEST  CALL
wiggle_z(50.0,200.0)

ERROR:
Error in Driver: The following Python expression failed:
    'wiggle_z(50.0,200.0)'
TypeError: a float is required

SCRIPT:
import bpy
ob  = bpy.context.object
scene = bpy.context.scene
frame_current = bpy.app.driver_namespace["frame"]

import math

def wiggle_z(frame_start,frame_end):

    if frame_current > frame_start and frame_current < frame_end:
        ob.rotation_euler[2] = math.sin(frame_current)/ 10

    else:
        ob.rotation_euler[2] = 0

bpy.app.driver_namespace["wiggle_z"] = wiggle_z #wiggles object around Z axis within frame_range

#def main():
#    wiggle_z(50.0,200.0) #Test Call
#main()

Return the value from a driver, don't set it.
So many things wrong with such a little script.
In addition to comments below question:
Don't mix context and drivers, the driver returns a value to the property it is driving.  To drive the z rotation of an object with wiggle, simply type directly into field.  Using hash as first character when first entering informs blender to treat input as  a driver expression #wiggle(1, 35)
Here it is seen as purple (a driver) after being added as above

The frame is known to the driver namespace as "frame", have used that rather than passing frame via arguments or setting up a variable using scene.
import bpy
from bpy.app import driver_namespace as dns
from math import sin

def wiggle(frame_start, frame_end):
    frame = dns["frame"] # saves passing it
    if frame_start <= frame <= frame_end:
        return sin(frame) / 10
    return 0.0

dns["wiggle"] = wiggle


Unable to Extrude a Plane Whenever I add an Object or import an SVG object, I am able to extrude it either by E or by the extrude tool in object data, but I can't do that for a plane ( and just saw for a cube as well ). I get no options for it in the Object Data section nor does Pressing E Extrude it.
What have I done wrong or not installed?

In order to edit an object, you must be in Edit mode.

You can set the mode in 3D view > Header, or by pressing ↹ Tab:


Use multiple bl_space_types to place the same toolbar on multiple locations So I'm not sure if this will be possible at all, but someone might have an idea for a workaround for this problem.

So if I have made a toolbar, e.g. (short version)

class add_item(Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'

But I would like to have this toolbar placed in multiple toolbars so it'd become something like this (code below doesn't actually work, just an example of what I'd like):

class add_item(Panel):
    bl_space_type = ['VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR']
    bl_region_type = 'TOOLS'

Would something similar to this be possible to do without duplicating all the code for the toolbar multiple times, just to then change the bl_space_type?

You can do this using a loop to generate dynamically named panels, each with the desired bl_space_type (based on this nice answer):

import bpy

def panelFactory( spaceType ):
    class NewClass( bpy.types.Panel ):
        bl_space_type = spaceType
        bl_region_type = 'TOOLS'
        bl_label       = "add_item_%s" % spaceType

        def draw( self, context ):
            layout = self.layout
            layout.operator( "mesh.primitive_cube_add" )

    NewClass.__name__ = "add_item_%s" % spaceType
    return NewClass

spaceTypes = ['VIEW_3D', 'IMAGE_EDITOR', 'NODE_EDITOR']

for spaceType in spaceTypes:
    panelFactory( spaceType )

def register():
    bpy.utils.register_module(__name__)

def unregister():
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

This code will add the "Add Mesh Cube" operator in a new panel to the "Misc" tab in each of the desired windows (space types).


How to rig a cartoon-style hose limb? (cartoon arm) I was wondering if anyone knows how to set up a hose-like, cartoon-type limb like in this picture?

My current setup for my model's limbs uses Inverse Kinematics and actually works quite well for the moving whole arm around, although I do get some really nasty-looking deformations I get when I try to bend the limb, but this isn't my primary concern right now.

My main concern is that while I can manipulate the arm as a whole without trouble, trying to get the arm to bend like in the first picture is an extremely frustrating and finicky affair.  Basically, I need some method of being able to improve control over how the arm bends in order make more manageable for posing the model.

My first solution was to try and add a second IK controller to the arm that could be used as a bend point to create a curvature in the arm.  Unfortunately, trying to manipulate this second controller doesn't seem to do anything at all, and I'm not too sure whether or not I screwed something up in setting up the IK controller or if you simply cannot attach another IK controller to another IK chain (I assume the answer is the latter, although me screwing up in setting up something is also quite plausible).

Another potential solution I saw on various tutorial videos was using a Bezier Curve to control the overall curvature, but I'm not too sure whether or not I can attach a Bezier Curve to only part of a model rather the whole thing.

I tried looking for a solution by searching YouTube for a tutorial on how to rig cartoony hose limbs, but instead I was surprised by the dearth of materials on the subject, especially since its been a staple of animation since pretty much the very beginning of the medium.  I mean, I get that the standard skeleton armature is a lot easier to setup than the classic hose-style limb, but it is simply not the look that I want for this particular model.

One final thing to keep in mind is that I've been making this model for a game project that I've been working on, and thus any potential solutions for this problem must be compatible with game engines like Unreal Engine or Unity.

I hope that what I'm not asking for too much, and that I would greatly appreciate it if anyone could offer any potential help with this endeavor.

Sorry for not responding earlier, but thanks a lot for going to the effort of responding to my question, although it would appear that it wasn't needed to begin with.  After going back and playing with the armature some more, it turns out that Inverse Kinematic chains that I set up for the arms actually do work for posing, I guess I just didn't have a very good grasp of how to properly control them.

It's probably for the best that I use Inverse Kinematics anyway because I am trying to make a model that can be imported into Unreal Engine 4 and my understanding is that game engines like Unreal and Unity are incompatible with Bendy Bones.  At least that's what I have read in the past, I'm not sure if that has changed recently, but my recent attempts at trying to look into the matter has mostly come up with older information, so I have to assume that nothing has changed so far.

However, despite the fact that I won't be using your solution, I still think it was worth posting anyways because while I might not use it, there's always the possibility that it might help someone else out.  There is after all, a distinct lack of info out there on how to do cartoon-style hose limbs and having this information out there means that others can now find it and use it to help themselves out.  Its because of this I decided to go back and add some additional tags to my original post to make it easier for others to find this info.

Regardless of everything, thanks again for the help!

I think you could test at least 3 solutions, the classic rigging with bendy bones playing with Easing In and Out, the Stretch To constraint solution, will allow you to stretch the arm, and the Spline IK constraint solution, which is a bit more complicated but will deform more nicely.

1) CLASSIC RIGGING

Create a chain of bones: upper arm, lower arm, hand, etc. Flex the elbow a bit so that Blender will know how it will have to bend.
Create a controller bone at the wrist position, deparent it and unclick the Deform option in the Properties > Bone panel.
Parent the hand to this controller with ctrl P > Make Parent > Keep Offset.
Create a Pole Target bone from the elbow, deparent it and move it a bit backward, unclick the Deform option in the Properties > Bone panel.
In the Properties > Data > Display panel, choose B-Bone instead of Octahedral. Give your upper and lower arms several Segments (for example 6). You'll see later that the Easing options will allow you to bend the arm in a rounder way. Maybe you'll have to correct the rotation of some bones with ctrl R so that they all follow the same axis.
In Pose mode, give your lower arm bone an IK Constraint, choose the controller as the Target, choose the Pole Target, and choose 2 for Chain. You can also give it a Copy Rotation constraint with the hand as the target, so that when you rotate the hand, the lower arm will follow.
Parent your mesh to the armature.
Don't forget to put the Armature modifier of your mesh above the Subdivision Surface modifier otherwise your mesh could be weirdly deformed (maybe it's the problem in your screenshot). Also, click Preserve Volume in the Armature modifier.
Now you can control the arm with the controller.
Sometimes it will go crazy because the Pole Target is not enough to show how to rotate, in that case select your arm, go in Pose mode, then in Properties > Bone > Inverse Kinematics, limit the rotation on the axis you want.

2) STRETCH TO CONSTRAINT

If you want your arm to be more free and elastic you could also try the Stretch To constraint:

Create a chain of bones with shoulder / upper arm / elbow / lower arm / hand / hand controller.
In the Properties > Data > Display panel, choose B-Bone instead of Octahedral. Give your upper and lower arms several Segments (for example 6). You'll see later that the Easing options will allow you to bend the arm in a rounder way. Maybe you'll have to correct the rotation of some bones with ctrl R so that they all follow the same axis.
The hand controller needs to be deparented, the hand is parented to the controller, the elbow must be deparented, the shoulder is parented to the torso of course. For the controller, unclick the Deform option in the Properties > Bone panel.
In Pose mode, give the upper arm and lower arm a Stretch To constraint.
In the lower arm constraint, select the hand as the Target. In the Properties > Bone > Bendy Bones panel, click the Use Custom Handle References and choose In > elbow and Out > hand.
In the upper arm constraint, select the elbow as the Target. In the Properties > Bone > Bendy Bones panel, click the Use Custom Handle References and choose In > shoulder and Out > elbow.
To test the arm, move the hand controller and the elbow, there are independent.
Parent you mesh to your armature.
Don't forget to put the Armature modifier of your mesh above the Subdivision Surface modifier otherwise your mesh could be weirdly deformed (maybe it's the problem in your screenshot). Also, click Preserve Volume in the Armature modifier.

3) SPLINE IK CONSTRAINT

Third method is Spline IK, a bit more difficult to set but very flexible and will probably preserve the volume better:

Create an armature as long as the arm, subdivide it for example 7 times, with one bone for the hand, deparent this hand bone
Create a curve as long as the arm (until the wrist), subdivide it once (so it has now 3 vertices), align it to the bones of the armature. In Edit mode make sure its direction is good, if not press W > Switch Direction.
Switch the armature to Pose mode, give the 6th bone a Spline IK constraint with the curve as Target and a Chain Length of 6 if you have chosen 6 bones for the arm. Now your curve controls your bones.
Choose the B-Bone display type for your armature, and segment your arm bones, for example 3 times.
Create a second armature, with one bone for each curve vertex.
Switch this armature to Pose mode, select one bone, shift select the curve, go in Edit mode, select the corresponding vertex, press ctrlH > Hooked To Selected Object Bone. Do it for the 3 vertices. Now the 2nd armature controls the vertices position. It allows you to come back to a rest position whenever you want.
Parent the 7th bone (hand) of the first armature to the 3rd bone of the second armature with a Child Of constraint so that this 3rd bone control the hand position and rotation. In the constraint, press the Set Inverse button so that the bone stays at its place.
Now parent the mesh to the first armature With Automatic Weight. Put the Armature modifier above the Subsurf modifier, enable the Preserve Volume option.


Is it possible to get a proper terrain-like height map? So I've been working with a displacement map through the shader editor in 2.8 because I need to create a terrain, I need it in Unreal but given I don't have the means to something like World Machine it seemed like Blender would be able to do it, but I haven't had that much luck, I've got a height map but it really looks nothing like the displacement I have in Blender so I'll cut to my question. Can I get a proper terrain height map in blender?

Can I get this

Out of this? Or is Blender or any plugin not capable of getting that kind of definition out of a displacement map or modifier?

Let's say you have a landscape like this:

Set the camera to orthographic mode, and place it so that is perpendicular to the landscape.

Adjust the Orhographic scale so that the landscape is completely viewable through the camera (You might need to adjust the render resolution size in the render settings)

Render the image.

In the compositor connect the depth socket of the render layer to a Vector->Normalize Node. (This will convert the depth information to a scale from 0 to 1).

Make sure that the Display Device in the color management section is set to None (so that the image information is not distorted using a view transform).

When importing into other software you will need to set the image to be interpreted as data, not using any color transform.

The quality of the heght map will depend on the amount of detail in the original geometry of the landscape, and of the size (in pixels) of the final image.


How can i get 'shining' borders to a material in Blender Render? I'm using Blender Render right now and i'm trying to achieve something like this picture:

With that i mean, if its possible or is there a way to render the object with Blender Render, but adding those kind of 'shining borders'? (circled in the picture)

I need to make that kind of material, is there any setup to do it?

Thanks in regard.

Finally i found a solution, at least, it's working, but isn't a configuration based on the material, but in the lighting on the scene itself.

Afte creating a regular basic Fresnel texture, with geometry bump added of a texture based on a photography of rocks (on this case) and added two Sun type lamps at the side of the scene based on the position on the camera.

The 'effect' didn't worked at first due to the specular activated, it was too shiny and it even looked like plastic, but after deactiviting it, it worked a lot better, and also i added a little translucency parameter of 0.028.

And the light strenght itself, based on the distance has a parameter of 7.

Also, as a tip, the effect worked since the camera only 'zooms' into the objects and rotates but following a direct (invisible) line between only two points. Still, i rotated every single DNA object with their respective individual parameters and the effect doesn't change at all, because the position of the lighting also doesn't change.


Quick and Precise Angle Measurement in Blender? I'm looking for a precise way to measure angles in blender.  The ruler/protractor tool is very limited with the snap to vertex frequently failing in edit mode and only showing two digits beyond the decimal point when it does work.

Are there any addons that will let me do something like select two points and measure their angle relative to the 3D cursor?
(preferably with the ability to attain more than two significant figures beyond the decimal point - somewhere beyond 6-8 would be ideal, but even just a smoother workflow than that damned ruler/protractor tool built into Blender would be amazing to have)

When in edit mode  press N and then select Mesh display> angle.
Then take a vertex and move it.


CUDA // Building Blender Vs pre-Built binaries? Please answer me this. Provided that I have installed and working CUDA (CUDA 8.0 in my case), is there a difference between building Blender from source with CUDA option enabled Vs. using pre-built binaries from Blender web site?

Building Blender with CUDA support currently requires the CUDA Toolkit 10.1. If you want to create your own build with CUDA support, you will have to install the required dependencies. If you have all the dependencies installed, correct build configurations and create a release build (make release), then it should have the same features as the official release.


Play animation frame by frame then pausing Python I want to play animation as long as a specific condition is true, once the condition is false the animation will be paused and a specific function will run. The problem is that when I run the below code I find blender pausing (hanging) then jumping to frame 70 straight away (as the condition is always false, which is fine) instead of playing frame by frame. Any thoughts how I can run the animation normally frame by frame through python then pausing it when needed?

i = 0
while i < 70:
   if condition == True:
     #go to next frame
     scene.frame_set(scene.frame_current + 1)
   else:
     #pause animation and call my function
     myfunc()
   i += 1

As suggested by @batFINGER, frame_change handler was used as shown below:

def my_handler(scene):
    retVal = myFunc()
    myFunc2(retVal)

if __name__ == "__main__":
    register()
    bpy.app.handlers.frame_change_post.append(my_handler)


[Blender2.8]When getting vertex belongs to vertex group I tried to get a vertex belongs to a vertex group like below. But nothing is returned.
import bpy

obj = boy.data.objects['Cube']
obj.select_set(True)
obj.vertex_groups.new(name='Group')

vertexgroup = obj.vertex_group.get('Group')
for v in obj.data.vertices:
    for g in v.groups:
         if g.group == vertexgroup.index:
             print(v)

to check if it's working I called print(), but nothing happened.What is wrong?? can anyone help me??

No verts are assigned to the group
The trivial error in question code (bpy not boy) aside, you have not assigned any vertices to the new group.
Test script, assigns verts indices 0, 1 and 4 to the new vertex group of object named "Cube" if it exists.
import bpy

obj = bpy.data.objects.get("Cube")

if obj:
    vg = obj.vertex_groups.new(name='Group')
    # need to assign some verts to group
    vg.add([0, 1, 4], 1.0, 'REPLACE')
    for v in obj.data.vertices:
        for g in v.groups:
             if g.group == vg.index:
                 print(v.index)

If you already have a vg named "Group" and wish to use it, or create if non existent
vg = (obj.vertex_groups.get('Group')
     or obj.vertex_groups.new(name='Group'))

Feel it is important to note that question code
obj.vertex_groups.new(name='Group')
vertexgroup = obj.vertex_group.get('Group')

will work "as expected" only when there is no prior vg named "Group".  Other wise the newly added group will be named "Group.001", "Group.002" etc etc, yet you are only ever getting the one originally named "Group".


python : re-use class name Simple addon template :
import bpy

bl_info = {
    "name": "test",
    "author": "me",
    "version": (1, 0),
    "blender" : (2, 80, 0),
    "location": "",
    "warning": "",
    "wiki_url": "",
    "tracker_url": "",
    "category": ""
}

class OBJECT_OT_CustomOp(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.test"
    bl_label = "test"

    def execute(self, context):

        None

        return {'FINISHED'}

addon_keymaps = []

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

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

if __name__ == "__main__":
    register()

My question is about that class name (-> OBECT_OT_CustomOp). I just want to know : Whatever name it is , can i really re-use it for other customop/addon ? since i've tried to use that same class name for different op and it doesn't conflict. Everything works fine, because that customop is unregistered when i exit the tool ? But will it break at some point ?

Same class name is not an issue.
when a register-able class is registered it is added to bpy.types with a name generated from the bl_idname.
eg
class Foo(bpy.types.Operator):
    bl_idname = "object.test"

if succesfully registered will be known to blender as the class
bpy.types.OBJECT_OT_test

or similarly after running question code in text editor (__main__ thread)  The OT stands for "Operator Type", similarly PT and MT are Panels and Menus respectively.
>>> bpy.types.OBJECT_OT_test
<class '__main__.OBJECT_OT_CustomOp'>

>>> bpy.ops.object.test.idname()
'OBJECT_OT_test'

>>> bpy.ops.object.test.idname_py()
'object.test'

Can also import it as a module from text block, and run the register method. This is, IMO, a better way to test simple addon code in blender as it gives the option to unregister, since the classes are no longer "lost" in the main thread.  Find Link
>>> myaddon = D.texts['Text'].as_module()
>>> myaddon.register()
>>> bpy.types.OBJECT_OT_test
<class 'Text.OBJECT_OT_CustomOp'>

So has now re-registered the operator, this time belonging to the "Text" module.
Having a variable the same name in the scope of its own  module is no issue.  Having another matching bl_idname will overwrite the one registered previously.
Would either stick to naming convention and
class OBJECT_OT_test(...):
    bl_idname = "object.test"

or not at all
class TestOperator(...):
    bl_idname = "object.test"

whereas feel question's OBJECT_OT_CustomOp is some hickly-dy pickle-dy in-between sort or arrangement.


Snake hook in sculpt mode is creating glitch like shapes instead of smoth tentacles I don't have too much expirience in sculpting, but I have seen on videos i'ts seemingly easy to make smoth tentacles. But in my case what I get are ugly ditortions on ends. I tryed adding more verticies and using Multires modifier but it hardly helps. Is it just how snake hook works ?

Dytopo efects

You need to enable Dyntopo in the left panel, otherwise the tool will only displace geometry, until it gets horribly mangled and creates artifacts.
Dyntopo will generate new geometry on the fly, provided you don't move your mouse too fast it should create a smooth hook.
Don't forget to tweak the detail size if you think the generated geometry doesn't fit.

Also consider using the latest version if you can, there has been gigantic improvements since 2.79 in the sculpting area.
Link to the official download page


Using python to create freestyle line groups I am trying to make a python script that creates a 3-d graph and automatically puts certain edges in a freestyle line group.  So far I am able to create a surface with the code

import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from mathutils import Vector
import bpy
import bmesh
import numpy as np

xmin,xmax,ymin,ymax = -3,3,-3,3
N = 30

def f(x,y):
    return (np.sin(2*x)+np.sin(2*y))/2

verts = [Vector((x,y,f(x,y))) for y in np.linspace(ymin, ymax, N) for x in np.linspace(xmin, xmax, N)]
faces = [(i+j*N, i+1+j*N, i+1+(j+1)*N, i+(j+1)*N) for i in range(N-1) for j in range(N-1)]

mesh = bpy.data.meshes.new(name="New Object Mesh")
mesh.from_pydata(verts, [], faces)

mesh.update(calc_edges=True)

obj = bpy.data.objects.new('new object', mesh)
obj.location = Vector([0,0,0])
scene = bpy.context.scene
scene.objects.link(obj)
scene.objects.active = obj
obj.select = True

I would like every other line of edges to be marked as a freestyle edge.  By hand, I would go to edit mode > edges, alt+click on every other edge (to select the whole line of edges) and then do a "Mark Freestyle Edge".  However, I would like my script to automatically mark the edges when the mesh is created.

Below is a picture with every other row of edges selected.

To mark a freestyle edge use MeshEdge.use_freestyle_mark

Here is some pretty ugly demo code to select every second line of edges in the x direction, that works because mesh is aligned x, y.

import bpy
import bmesh
from mathutils import Vector

context = bpy.context
mesh = context.object.data
N = 30
TOL = 0.0001

# clear all freestyle mark edges

for e in mesh.edges:
    e.use_freestyle_mark = False

def edge_by_value(e, axis, value):
    v1, v2 = e.verts
    return getattr(v1.co, axis) == getattr(v2.co, axis) and abs(getattr(v2.co, axis) - value ) < TOL

bm = bmesh.new()
bm.from_mesh(mesh)
bm.edges.ensure_lookup_table()

x = -3
while x < 3:

    edges = [e for e in bm.edges if edge_by_value(e, "x", x)]
    print(x, len(edges))
    for e in edges:
        mesh.edges[e.index].use_freestyle_mark = True
        mesh.edges[e.index].select = True # selected
    # every second edge
    x += 2 * 6 / (N - 1)

mesh.update()

Running with this line of code

    edges = [e for e in bm.edges if edge_by_value(e, "x", x)
               or edge_by_value(e, "y", x)]

Probably a better approach is: if you know the index order of the edges, would be using row/col integer modulus and div on the edge index.


Weight Paint works on only one area So I got a problem. I recently started with Blender and I created this low poly character. I already rigged her and moving the bones works good. Now I wanted to do some weight painting to prevent certain bones to move certain parts of the mesh. The problem is that I cant use weight paint properly.

So here is my mesh with weight paint. You can see that when I select the bone the automatic weight paint works just fine.

On the second image though you can see the only part i can actually paint. Its only this specific part of the head, thats it. Someone ever had this problem and knows a fix for this?

Thanks for your attention!

The problem is in your Mesh. Go to edit mode, select all Polygones an then click ALT+N and chose recaculate outside.
That is because the Polygon have 2 sides. Front and Backside. You cant paint on the backside of the Polygon


Particles facing wrong direction I added the particles to a plan and they stood up as expected. I then applied a lattice to the plane and now the grass is sideways. Is there anyway to rotate the grass upwards again?

never mind. I changed the velocities and it fixed it


My attempt to construct transformation matrix using 3 vertices (didn't work, need help) Smart people in the past offered a solution to construct transformation matrix using 3 vertices:

How do I construct a transformation matrix from 3 vertices?

I tried to test it but I could not get it right. Please see attached code, screenshot, and blender file.

I would like to align Suzanne origin to K and align Suzanne's y axis to the normal of the plane defined by (k, i, j). I don't need (i, j) beyond defining the plane. My problem is my code doesn't do it. And I couldn't figure out why.

Thanks!

# https://blender.stackexchange.com/questions/30808/how-do-i-construct-a-transformation-matrix-from-3-vertices

import bpy
from mathutils import *

# randomly selected 3 vertices
i = Vector((0.778421, 0.112746, 1.402834))
j = Vector((1.444566, 0.088229, 2.944015))
k = Vector((1.476759, 0.047526, 1.439882))

# to visualized the points
bpy.ops.mesh.primitive_uv_sphere_add(size=0.05, location=i)
bpy.ops.mesh.primitive_uv_sphere_add(size=0.05, location=j)
bpy.ops.mesh.primitive_uv_sphere_add(size=0.05, location=k)

a = i - k
b = j - k
c = a.cross(b).normalized() #y axis?
d = c.cross(a).normalized() #z axis?
e = c.cross(d).normalized() #x axis?

m = Matrix.Translation(k) * Matrix.Scale(1,4) * Matrix((e, c, d)).transposed().to_4x4()

obj = bpy.data.objects['Suzanne']
obj.matrix_world = m*obj.matrix_world

As answered by batfinger in the comment. Just change the last line to

obj.matrix_wolrd = m

everything works well now. Thanks!


How do you make a light streak like this one on Blender Internal? Full Video: https://www.youtube.com/watch?v=_eNtjpurVwQ

I already tried searching here on stackexchange but can't find anything that is related to creating a light streak like this one.

To animate the streak, create two curve objects. Shape the first one to be the shape of the extrusion, the second as the path that it will follow.

In the curve settings for the path select the other curve to be the Bevel Object, then animate the start and end of the bevel factor. You could also add a solidify modifier to get some thickness to the shape.

As a starting point for the material, you want to have it emit a little and to be mostly transparent, you can add a texture to get the striped variation in transparency. For cycles use a mix node with an emission and a tranparent node.

Add a glow in the compositor to finish off the effect, maybe some motion blur as well.


Create a filled curve with python I can make a curve with python, but I'd like to convert that curve into a renderable tube. In blender 2.6 and up, I can just select the "Fill Mode" of the curve as "full", change the "Preview U" and "Bevel" properties, and I haz a tube.

How I can I do that in python?

This script will add a new bezier curve, and set its bevel and resolution properties:

import bpy

bpy.ops.curve.primitive_bezier_curve_add()

c = bpy.context.object

c.data.resolution_u     = 24     # Preview U
c.data.fill_mode        = 'FULL' # Fill Mode ==> Full
c.data.bevel_depth      = 0.02   # Bevel Depth
c.data.bevel_resolution = 4      # Bevel Resolution

On a more general note, Blender can help you find the Python API commands and properties for doing most anything. When you hover with your mouse cursor on a property in the UI, you'll see a tooltip message, that includes the Python API at the bottom (in the example below I placed the cursor over the Bevel Depth property):

Also, the online API documentation is your best friend. There's a convenient search box on the left menu, that will get you all kinds of useful stuff if you type in "curve bevel", for instance.


change object position for a keyframe When I tried adding keyframes from my second object I got this result:

Result

is there any way I can change specific keyframes to match the animation?

You've pasted an armature animation (series of bones keyframes) after another one. But when it plays, your bones jump from their position at the end of animation 1 to their position at the beginning of animation 2. Like that:

As we can see your bones are not at the good position on the X axis at the beginning of the second part of the animation. The simplest solution to fix this is to use the Graph Editor:

Select the root bone of your armature (the bone that is the parent of the bones hierarchy), if you don't have any, select all the bones. Open the Graph Editor, enable the Only Include Channels Relating to Selected Object (arrow icon) so that you only see the curve of the selected bone(s), lock all the tracks (padlock icon) except the X Location one.

On the horizontal axis you have the timeline in frames, on the vertical axis you have the position of the bone on the X axis. As you can see in my screenshot the X Location curve clearly shows the jump at frame 21 that makes the bone go back far from its position at frame 20.

With B (box select) select all the curve vertices on the right of this frame (frame 21 to 40 in my example), and move down so that it aligns with the previous position (position of frame 20 in my example). Now the armature has moved on the X axis at the good position.


What's going on with my UV Map This is a Cheetah mesh. I double checked that the seams were marked correctly and I don't think I'm missing anything. Should the seams be blue? Aren't they usually red?

Then when I unwrap, my UV map turns out like this.

It's as if the whole mesh is stretched out for some reason. Any ideas what's going on?

Solved. I accidentally marked sharp instead of seams.


Why do my video and audio lenghts not match when I cut? I love this program! But for some reason I keep having this problem! The video clip is not sped up, or altered in any way. It's just cut off.

My FPS does match my file, I checked and double checked! That was my problem before... Some of my videos work, while others are cut off. I use the same recording software and settings for both. This is crazy and I'm very upset. The video is not slow or glitchy at all! Just CUT OFF.

Set your project Frame Rate properly to match the one of your footage.

Mikeycal Meyers has got some great tutorials on this topic. He explains it pretty well in #2 - Blender Video Editing (Importing video) starting at 3:35. If you want to do speed change stuff instead you should follow his #24 - Blender Video Editing (Speed up & Slow Down Audio/Video | Snap Strips option)

So to fix it for you, you need to calculate your footages frame rate and set it up in Blender. You can do so by dividing your Audio Length (which is 42389 as you can see on your teal/lightseagreen/darkcyan colored Strip after the "|") by your Video Strips Length (that 3284 next to your darkblue strip) that is about 12.907... When you then multiply this result by your current Frame rate (which is 30 right now in your Properties) to get the Footages Frame Rate. Which is about 2.32418... in your case. It seems to be a timelapse Video Capture with a pretty low frame rate.

Here the result isn't a already predefined common Frame Rate. So you need to select a "Custom" Frame Rate in your Properties and leave this FPS setting at 30 and use this 12.907... as your Framerate base below (you can directly enter "42389/3284" into the box and let Blender do the math. Your result should be the "Custom (2.34 fps)" in the Frame Rate Dropdown box.


Deform a hole on a torus I'm new to Blender.
Is there some way to animate a deformation of a hole on a torus by expanding it?
Like in this video. (until 2.5 second, I don't need to completely shrink it)
I tried to use shape keys and manually sliding edges, but that would be a long process, as I can't merge vertices, so with every slide I need to move more and more copies of edges:

I've also tried using parts of Nurbs Circles with Screw modifier to reverse animate it using angle, but I would still need too change curve points' positions for better animation, it would be easier if curve had something like 2 angles, one around axis and one capturing part of used curve. Moreover, curves are not connected.

This can be done by building the torus from 8 different vertex objects, each with 2 Screw modifiers.
One Screw modifier for making a circular section of the torus, and another one to rotate or loop this circle around a center (with an offset) thus creating a torus. The torus turning into 2 rings, and the 4 corners of the hole, warrants the total number of vertex objects and modifiers.

Linking the Screw modifier Angle values with drivers allows a single Angle value to deform the torus.
Making the inverse of this was my starting point so all the drivers are linked to a modifier on the initial vertex I used to make this. In hindsight a bit of a weird place but it works just the same. (So changing the Angle value of the top modifier on the "Vert" object makes it all move.)
I intent to elaborate on this solution a bit when i have more time (especially if you are new to Blender, drivers might take some explaining), but in the meantime...
...Here is the file:

And here is another file utilizing Mirror modifiers on only (and reducing the number to) 2 vertex objects:


Can't see a glass object through another glass object in Eevee I was just testing Eevee and found that you cannot view a glass object through another glass. Is there any workaround? It works fine only If I rotate the glass window or put my camera to the back side of the scene

Unfortunately this is a limitation of the render engine.

https://blenderartists.org/t/glass-material-cycles-vs-eevee-object-with-thickness/1113232

"You can’t. Cycles properly emulates refraction because it is a ray tracing engine, where light rays are simulated and change direction as they enter and get out of the glass, in a realistic way. For every pixel, it finds what parts of the scene affect it.

Eevee is a rasterization engine: for every vertex (part of the scene), it finds what pixels it corresponds to. It is much faster, but doesn’tactually emulate light. It uses tricks to have shadows, etc. In this case, refraction uses the normal of the point in the surface to deform what part is seen behind it, using information from the screen, but there is no light being deformed. The same happens for reflections.

The only way would be to add ray tracing to some parts of eevee, as real time raytracing is developed (which the recent announcements from microsoft and ATI were about).

PD: this happens with every single real time engine: UE4, Unity… refractions are one of the areas that really need ray tracing."


One Material not rendering Does anyone know why this is happening?  Render view shows the material, while the final render does not, and it is only one material (black plastic renders a standard while clay).

Solved.

A couple of the node settings were set way too high and applying the effect over too great an area making it appear as though there was a white material over the whole thing.

Thanks for the help.


Texture showing differently on 2 Objects Could someone tell me, why a texture shows differently on 2 Objects?

This is my material setup

Normal maps usually need to use Non-Color color space.
When set to sRGB they give unexpected results.


Some partial animations cannot play as additive in Unity I am making a character in Blender and animating it through Unity's Animator Controller.
I have a Base layer in Unity which animates the basic body movements, and an Additive layer which animates the expressions.

The setup is working fine, but something is wrong with some of the partial animations. They get imported into Unity just fine, but will only play as Base-animations or Override animations, not Additive. As Override (when they are the only animations playing) they play just fine in Unity.

None of the bones in the expression-animations are referenced in the base/body animations and vice-versa.

At first I thought this was a Unity issue, but I fear it is my Blender animations that are to blame.

Anyone have any ideas or pointers as to why this could be happening?

Best,

/John

I had no luck getting the additive animations to work. Still have no clue why my head animation won't play as additive, only as override.

I ended up making an Avatar Mask and masked the character's body parts with it.

This way, my "additive" animations can play as Override. Not the perfect solution -- but a working solution.


A sequence of 90-degree rotations with Python I am trying to do what I thought would be a simple task but turned out to be a very frustrating endeavor.

I need to program an object to undergo a long series of random 90-degree rotations around the origin of the object, which coincides with the World's origin. I am using Python to set the angles and create keyframes. Let's say I need a 90-degree rotation around the global X, then 90-degree around Y and then -90 around X again. The following code does not work properly:

obj = bpy.data.objects["Sphere"]
obj.animation_data_clear()

obj.rotation_euler = [0, 0, 0]
obj.keyframe_insert(data_path="rotation_euler", frame=1, index=0)
obj.keyframe_insert(data_path="rotation_euler", frame=1, index=1)
obj.keyframe_insert(data_path="rotation_euler", frame=1, index=2)

# rotate 90 around x
obj.rotation_euler.x += pi / 2

obj.keyframe_insert(data_path="rotation_euler", frame=20, index=0)
obj.keyframe_insert(data_path="rotation_euler", frame=20, index=1)
obj.keyframe_insert(data_path="rotation_euler", frame=20, index=2)

# rotate 90 around y

obj.rotation_euler.y += pi / 2

obj.keyframe_insert(data_path="rotation_euler", frame=40, index=0)
obj.keyframe_insert(data_path="rotation_euler", frame=40, index=1)
obj.keyframe_insert(data_path="rotation_euler", frame=40, index=2)

# rotate -90 around x
obj.rotation_euler.x -= pi / 2

obj.keyframe_insert(data_path="rotation_euler", frame=60, index=0)
obj.keyframe_insert(data_path="rotation_euler", frame=60, index=1)
obj.keyframe_insert(data_path="rotation_euler", frame=60, index=2)

Depending on the rotation mode (XYZ, ZYX, etc.) the results are different and never what I want them to be. For example, under XYZ, the first two rotations are correct, but the 3rd rotation ends up being around the Z-axis instead of Y.

So how do I make those rotations consistent, and without wobbling? Someone please point me in the righ direction. Thanks!

To do this with matrix multiplication & globally.  As for the "wobbling" do  you mean the interpolation?

import bpy
from math import radians
from mathutils import Matrix

mat_rot_x = Matrix.Rotation(radians(90.0), 4, 'X')
mat_rot_mx = Matrix.Rotation(radians(-90.0), 4, 'X')
mat_rot_y = Matrix.Rotation(radians(90.0), 4, 'Y')

obj = bpy.data.objects["Sphere"]
obj.animation_data_clear()

obj.rotation_euler = [0, 0, 0]
bpy.context.scene.frame_set(1)
obj.keyframe_insert(data_path="rotation_euler", frame=1)

obj.matrix_world *= mat_rot_x
obj.rotation_euler = obj.matrix_world.to_euler()
obj.keyframe_insert(data_path="rotation_euler", frame=20)

obj.matrix_world *= mat_rot_y
obj.keyframe_insert(data_path="rotation_euler", frame=40)

obj.matrix_world *= mat_rot_mx
obj.rotation_euler = obj.matrix_world.to_euler()
obj.keyframe_insert(data_path="rotation_euler", frame=60)


Edited texture not replacing old texture in render I was working on a tower and painted my own texture for it. I saved halfway though and took a break.
When I returned to my little project, I could paint on the image and it shows up in the material view but not the render.
I did everything in my power but still couldn't understand why?

I have used:

Nodes, including mapping and insert UV coordinates.
Unwrap UVs
Used lights
Deleted and replace nodes
Deleted and replace Mat
Removed image and replace it
Reload image
Painted on mesh

Even though use blender, I am not a programmer. So I find it really helpful if someone could give me an answer.

No programming required to paint in blender. :)

It looks to me like you simply did not save your image after you painted it.

Blender will display the changed image in the viewport, but until you save it blender will not render it (and your work will be lost if you close blender, even after CtrlS).

With the mouse in the UV/Image Editor press AltS, or from the header Image > Save Image. That writes the changes you made in blender to an image file, actually saving your image. Now your render will look as excepted.

Here is an animated gif showing me painting on an object in the 3D view, then rendering it without saving the edited image.


Bendy Bones alternative Bendy Bones is an impressive tool but i can't export it to UE4.
Do you have any alternative way ? If you have it, can you explain me ?

Thanks !

Here's my file.

Link - File address

I tried something like this but the Beziercurve doesn't follow in pose mode.

PS: i would like to create an animation and then export it to UE4.

Thanks !

Use Spline IK instead.

Here's some documentations for you to explore:

Spline IK - Blender Manual
Creating an IK and Spline IK switch in blender for beginers ans advance by the luwizart Animations
Spline IK - Unreal Engine Documentation

More tricky to setup, but does the job quite right.
Have fun with that.


Blender Smoke Domain Cube casts a shadow This is what I see when I try to render smoke.

The smoke itself renders okay, but there is a problem that the domain cube itself casts a shadow. How do I solve this?

material of the domain object :

Enable Shadow > Receive Transparent in the ground plane's material:


How do I make the 3D manipulator straight instead of sitting at an angle? How can I make the 3d manipulator straight again after being angled like this:

I am now only able to drag verticles diagonally but what I want is to drag them straight along the x, y or z axis.

Maybe your transform manipulator orientation is not set to Global:


Only the first objects i made are rendering Hi i am pretty new to blender but i was practicing with this logo but only the first two objects i made are rendering. however everything seems to render fine in my camera preview. if somebody could look at my file and help me out i would appreciate it. file

>

File is here: http://s000.tinyupload.com/index.php?file_id=06456673312295020538

Press the / key in the numpad (or on the menu go to View->View_Global_Local) to exit local view. –  cegaton 2 hours ago


Bend the Extrusion of a text here is what I want to achieve:

As you can see the Extrusion of the text is bent and twisted. Can I achieve that WITHOUT converting it into a mesh? I tried Lattice, Curve, Deform etc...

Thnx,

Cheers

Convert the text to a regular Curve object(Alt+C). Add another curve, and make the text that curve's bevel object. Select "Fill Caps" option for solid text. Add Edges Split modifier for sharp edges. You can control (and even animate) extrusion with Bevel Factor Start/End.


Can you render using the CPU with Eevee Is there a way to render things in eevee using the CPU or is it just a GPU render engine?

The Blender EEVEE render engine uses OpenGL for all the rendering, so YES, rendering on the CPU should be completely doable, as long as a viable CPU-based OpenGL implementation is also installed and enabled.

In particular, Blender lists system requirements of only "OpenGL 3.3", which is officially supported by both softpipe and LLVMpipe.

Base Knowledge

OpenGL is just a standard interface that programmers can use to perform operations that are commonly related to computer graphics. What happens when a program actually runs that code is completely up to the system it's running on.

In most cases, a program that runs OpenGL code will have its processing redirected  by the OS to the GPU, because the GPU is specifically designed to be more efficient than the CPU at running the kinds of operations that OpenGL is used for.

However, there is nothing fundamentally different about the mathematics that the CPU is capable of doing and that the GPU is capable of doing, so it is also possible for the OS to simply compute the result of each OpenGL operation entirely on the CPU, without the program ever touching the GPU (or knowing any better).

Analogy

Imagine that the CPU is a secretary, and the GPU is a group of workers. Usually, when a blueprint (OpenGL call) comes in, the secretary passes it along to the workers to do the heavy lifting (rendering).

However, there's nothing that's actually stopping the secretary from rolling up their sleeves and helping with the work themselves— so long as they have the proper training (OpenGL software implementation). They might not be as skilled or in as great shape, so they'll be slower, but they can still do it.

Caveats

There are only some limited situations where this would come in handy:

You do not have access to a GPU, for either a lack of compatible hardware or software.
You have a surplus of CPU power, and you want to squeeze out as much rendering speed as possible from what you have without caring about the efficiency and electricity usage.

Basically, if you have the choice, using the GPU will almost certainly be both faster and more efficient than the CPU. In order to match the speed of a \$50, 30 watt integrated GPU, you would probably need a \$400, 150 watt server-grade CPU. But in cases where GPU-rendering simply isn't an option, setting up a CPU pipeline should be fully possible too.

Addendum

Wikipedia has some information on the software OpenGL capabilites on most Linux desktop and workstation computers:

https://en.wikipedia.org/wiki/Mesa_(computer_graphics)#Software_renderer

The following software projects all purport to offer some degrees of support for CPU-only software rendering of OpenGL (and potentially other graphic APIs):

https://www.openswr.org/index.html
https://dri.freedesktop.org/doxygen/gallium/softpipe.html
https://www.mesa3d.org/llvmpipe.html

Phoronix.com has also done a performance benchmark of two of the above options:

https://www.phoronix.com/scan.php?page=article&item=llvmpipe-swr-xeon

(Note that the above tests were done on an 80-thread server-grade CPU— and it still struggled to reach a playable framerate in simple video games.)

These guys seem to have successfully run Eevee using openswr:

https://www.highperformancegraphics.org/wp-content/uploads/2018/Posters-Session/HPG2018_BlenderRenderingAbstract.pdf
https://www.highperformancegraphics.org/wp-content/uploads/2018/Posters-Session/HPG2018_BlenderRenderingPoster.pdf


Rotationally stretch or compress 3D texture around Z axis I want to distort a 3D texture around the Z axis in Cycles.
I found here that you can convert cartesian texture coortinates to polar coordinates but the problem is that you end up with a projected 2D texture. I want to preserve all the 3 dimensions and stretch or squash the texture around the Z axis to get a behavior like this :

...but with 3D texture coordinates.

Can we achieve that with Cycles nodes ?

Found it.
The idea is to use a gradient node in radial mode and plug it to the angle of a rotation node (just like a Mapping node but with an input socket for the rotation). Since such a node doesn't exist in Blender we make it with math nodes.

First the rotation node itself (it's a node group) :

then the general setup (the green node is the rotation we made above and the yellow node is the one to animate (the second value in the Multiply node) :

Result :

Here is the file :


How can I duplicate parented objects properly? So I am working on a sculpt with seperate eyes. I parented this pupil to the eyeball, but when i try to duplicate it just the eyeball gets duplicated. How can I do this properly without joining the pupil to the eye mesh?

The simple anser is: select both of them. It's easier to see in wireframe mode. When you duplicate several objects together, their relationships get copied, too.

If you have selected both of them and the pupil doesn't move, it may be the pupil's location is locked. It will be duplicated but it won't move, so you have two pupils at the old position.


Inverse Kinematic Panel disabled from Bone tab I cannot restrict the rotation of a Bone in Blender... I have done it on the previous project, but now it is disabled and I cannot figure out why..

Any ideas would be much appreciated, thanks.

Stupid me...

As soon as I added an IK (inverse Kinimatics) Constrain from the Bone Constrains tab, it worked....


How can an equidistance, spherical panorama image be generated from Blender Cycles? I'd like to use Blender cycles to generate an image which can be used as a world background image. An example is this kind of image is from hrdmaps.com

How can a blender scene be rendered like this?

This is natively supported in Cycles.

Set your output resolution at a 2x1 ratio (e.g. 2048x1024).
Select the camera.
In the properties window, camera tab, select "Panoramic."
For "Type" select Equirectangular.

Here's what it looks like for me:


Cloth Simulation Getting Eaten By Mesh So I'm making a model for animation, and I wanted it to have some clothes that are all flowy. I modeled the body and one piece of clothing so far, and it looks fine barring one glaring issue:
https://cdn.discordapp.com/attachments/507298799169830941/645122008480219144/blend.mp4
This happens.

I've tried increasing quality steps and the thickness of the collider.
Increasing quality has no effect outside slowing the program down and increasing the thickness of the body just makes it worse.
I've tried smoothing the collider, smoothing the body, doing both and adding more verts and smoothing them again, and no matter what, the cloth wants to get eaten by the body.
I've also tried to use another 3rd party cloth solution and it behaves the same way so I figure I must be doing something terribly wrong. If someone could point me in the right direction on this I'd be very grateful.

Alright so after around 8 hours of trying to figure this out, I've done it but I don't know why.

The normals apparently got screwed up at some point. I had to recalculate the inside, and then the outside, and flip the normals after that.

And now it works perfectly.
I don't know why this works, but I'm thankful that it does.


Right method to use for tiles of buildings in various phases of construction We are working on a game with isometric tiles. We have decided to use blender to create models for objects we need (mostly buildings) and render to image to get our tiles.

Now we need different tiles showing progress of a building being built, say at 20% of construction progress, then 40, 60, 80 and 100%.

We initially used different layers to add the new brick layers added between two stages. The problem with this approach is that we do not get a single object and it is a collection of objects scattered on different layers which are tricky to correctly position.

Another method we thought of was saving the model at various stages of construction progress. This method also has the disadvantage of having multiple files for a single object.

Update:
Yet another method we just briefly checked is using shape keys. That too, seems to serve a different objective. So the main question still is:

Is there a better method to use?

I don't know which game engine you are using. But probably you could use 'shape keys'. At least in the bge that would work fine and it would be easy to set up.

you crate different shape keys.

Than you create an animation with all the shape keys.

You can use logic Bricks to create a logic which controlls the animation with a property.

Than you just have to change the property and your building gets upgraded.
It also would be easy to crate a little blending animation so that the new stage doesn't just pop up.

Probably I didn't describe that too good so I added a .blend to Download where you can see what i mean. Just start the bge with p and use w and  s to transform the building.

I see that this method doesnt serve the job very well for a 2D java game.
Another method would be to use the 'restrict Rendering' Button in the Outliner.

The workflow would be:

Create the Building...

Than you mark everything which should be visible in the first stage. Go to frame 1 in the 'TimeLine' an Press i over the Camara Icon of ALL the Objects of the building.

Next you do the same for frame two...

The nice thing with this Method is that you now just can render an animation from Frame 1 to the Frame with the final stage (for example 5). If you configure your render output as in the picture below than you will get seperate Images of all Stages.

than you will get separate pictures of all stages.
I just pressed the animation button and had all the images int the right folder and with good names.

you also can configure the names by just writing the name behing the path.

Hopefully this is a good method for your project.


Compositor Problems when working with alpha over and blur nodes I am doing an animation. The images I have attached show 2 different render layer view node results.

Image one shows a cube on layer 1, and 2 icosphere on layer 2. I have layer 2 set to fast blur. I have to use transparent film and therefore I use the Alpha over nodes in composition.
Image two shows a cube and 1 icosphere. Image 1 should not be showing 2 icospheres, as the left most one is behind the cube.

Image 2 is from the same render result, and is correcting showing only 1 icosphere. However, that icosphere should be blurred as it is on layer 2. It seems for whatever reason I can not have both the correct composition effect and also have every object's visibility render correctly. I can only either have everything work fine, with no composition, or composition with every emission object showing through every other object in the scene.

I am aware that masks would solve this problem, but because of the complicated setup of object materials and particles, masking produces these very strange and suddenly appearing artifacts. Material Indexing also produces odd artifacts and does not consistently effect the appropriate materials.

This is also a new problem, I did not have this issue in the last blender version. So, material indexing is out, masking is out, object indexing is out.

I want to use the compositor to blur certain layers, but every emission object in the scene shows through. It shows through as though it was on x-ray, regardless if it is behind another or inside another object. The first image is an example of this, the left icosphere is behind the cube, and should not be visible. That is the problem. Why is it visible when it shouldn't be?

It's not a bug, it's the expected behaviour, what you need is to use the "Z combine node". In my example I've set layer 1 into render layer1 only, and L 2 into RL 2. As the blur increases the size of the icosphere, i've added a dilate/erode node on the Z channel of render layer 2.


How can I 'stamp' a fingerprint onto an object's geometry for 3D printing I need to make a pendant (jewelry) with a fingerprint pressed into it — this will then be 3D printed (see image attached for an example of what I'm looking for).

Am I correct in thinking that a displacement modifier is the way to go? I have the image of the fingerprint which I was then going to use as the displacement modifier on the object. I have tested this out and it works to a certain extent but I was just wondering if there was a better method for doing this?

Many thanks in advance for any help or advice on this.

I would think displacement is the way to go. An alternative would be to try making a textured sculpt brush with the texture set to stencil and use Dyntopo.


how to create a texture like granite? I want to create a granite tile design in blender.
But I dont know how to get the white dot like pattern on my mesh ( like in the picture attached).
Someone please tell me how to acheive this.

Using this texture (https://freepbr.com/materials/polished-granite-top-pbr-material/) and this node configuration

you can get something like this (you'll need some minor fix, but feel free to try and comment this answer to get further support)

Texture coordinate: this node is useful to tell how the texture should be placed on the mesh (UV setting refers to how the mesh is unwrap in 2d)
mapping: this node is used to scale the texture, rotate or move it
texture image: you choose the image you want to use to "colorize" the mesh
color ramp: this is used here only cause the original texture is white with black dots and you need black texture with white dots. You can control black and white stops to find best results
principled BSDF: this is a shader that contains some attributes to tell blender engine how to render the "colors"
material output: this is mandatory node used to tell Blender that all the settings are applied to the surface of the object


Scene color/contrast changes based on camera perspective I have a multi-camera setup for viewing the scene at different perspectives. The top perspective view looks correct but my straight on view looks washed out without changing any of the settings. The cameras are at the same distance from the scene. I can change the render settings before I render but I would like to know why it looks so different.

Perspective View

Straight View with same render settings.

I lowered the "Specular" slider for the objects material that has the image using the shading tab. I did this for each object that has an image.


Adding a reinforcing rib to STL model with blender I'm wondering about how to add a reinforcing rib to a stl model with Blender.
I have a shape like the one in the picture below and  I'd like to add a rib that perfectly match with the inner surface which is curve.

In a CAD modeler such as Inventor there is the possibility to extrude a sketch to a face, but no idea about how to do it in Blender.

I'm able to add a cube and resize it to the approximate shape of the rib, but how to make its border to match with the inner surface of the original stl?

Thanks in advance for help!

In this particular case, I think it can also be done in this way:

put the original mesh in front view, wireframe shading,in edit mode,
then select just the central array of vertices,

then duplicate (shift-D) and separate (P => "selection") those vertices (to a new mesh)

as you see in side view, you now have a "section" object made of two "loops".

deleting the "inner" vertices from both loops, you can then make a single "face" joining the remaining vertices on their edges in pairs (upper and lower) using F then, after selecting all of them, make it a big "face" pressing F

now you can extrude this face on left and right (I would not bother using mirroring), obtaining a solid central shape that perfectly follows you original mesh curvature.

Then I would join both objects, and export to .stl again.


Dashed line and Wireframe I'm trying to render a cube with 2 additional vertical edges on a one of the faces.
I use the wireframe modifier for making faces transparent and freestyle for making the dashed edges.
The issue is the fact that these 2 dashed edges become non-dashed in render.
Can I somehow make the edges to be dashed while the wireframe modifier is applied?

Using the Wireframe modifier and Freestyle seems to me to be using two conflicting tools to do the same job, The modifier doubles up existing edges, which overlap in the Freestyle output.

At first sight, unless you have special reasons, an option would be to remove the wireframe modifier, and leave the transparency to Freestyle.

Here, the cube's material is set to be transparent so no faces are shown, and the 'Visibility' selection criterion is removed for  the solid Freestyle Line Set, so it can be seen through the cube.

For the face transparency to be effective in EEVEE, the Alpha has to be set away from 'Opaque' in the material's Settings panel.

As @Gorgious has commented, for EEVEE, it's probably better to set Alpha than Transmission on the material.

If you need to see one object inside another, and have it occlude the Freestyle lines (while they are not occluded by the containing object), this is one possible logic:

In order not to have the internal object display Freestyle, separate the Freestyle objects into a different Collection, and add a 'Collection' constraint to the Line Set selection criteria.
To have the outer object's Freestyle occluded by the inner object, you can use a QI range, which makes the display of a Freestyle stroke contingent on the number of surfaces between the edge and the eye point.


How blender got its name? Like the title,how blender got its name.I just want to know why Ton Roosendaal call it Blender.Is it from the blender machine or something like that?

Any help was very appreciated.

Blender got its name from a song used in NeoGeo's showreel, the company that started developing Blender.

The song's name is Blender by Yello, a Swiss electronic music band, as stated at the Wikipedia Page.


Hole at the edge leaves empty faces (boolean difference) I am cutting a whole into a block using a cylinder and boolean difference modifier, exactly at the edge of a block. This cuts 50% of the cylinder from the block.
The problem with cutting a whole right at the edge is that it leaves empty faces in the cutout.
If I move the cylinder by a fraction away from the edge (either direction), the coutout will close the faces.
This does not seem to happen with a cube, although the 3D preview looks a bit confusing.
Is this expected or a bug? Is there a way to cut a cylinder while keeping the face closed? Or is it actually closed and just looks open?
I tried the "Solidify" modifier but that doesn't seem right to do for such a simple operation.
Blender version 2.9 here.

Boolean will break if there are intersecting edges at the cut. In this case there are the edges on both sides of the cylinder and edges of the object you are cutting. They are intersecting and Blender doesn't know what to do with them.

You can fix it by moving the cylinder by a small amount so there are no intersecting edges. If you want exactly half of the cylinder you can rotate the cylinder around z axis by a tiny amount.

It would be create it the boolean modifier was smart enough to reroute the intersecting edges. Maybe it will come sometime in the future but at the moment there will be many cases where you have to fix bad booleans by hand.


How can I model the crevasses in this low-poly sphere? I've been trying to recreate the main grey sphere in this image:

My guess so far is that the approach should be to decimate an icosphere, then inset and scale down to make the crevasses. If that's the best approach, I can't figure out how how to get nice variability in the size of the faces.
Is my idea there right, and if so how can I achieve that geometry?

The Cell Fracture add-on would be a good start.
(The Cell Fracture add-on comes with Blender, all you have to do, is activating it via Menu -> Edit -> Preferences -> Add-ons)

Create a sphere (icosphere or rounded cube work best) with a decent polycount.

Initiate Cell Fracture via F3 - Search - Cell Fracture.
In the settings dialog under "Own Particles" - "Point Source",
change the Source Limit to 50 and under "Recursive Shatter", change
the Recursive Subdivision to "Big" and hit "OK".

Hide the original sphere, then select all objects with "_cell" in
their names.
Go to the "Transform Options" dropdown menu and check "Locations".
This will provide us with the option to "explode" the individual
objects away from their origins, which in our case is the center of
the original sphere.

Hit S and scale the selected objects, until the desired
gap size is reached.

You can then unhide the original sphere and proceed from there with
additional modifications (decimate, boolean, etc)


How to copy/paste rigid-body-constraints in 2.73 rc1? How do I copy/paste rigid-body constraints in 2.73 rc1? (I Have a lot of objects)

You can use Copy from Active. To do this, first select all your objects that will receive the Rigid Body physics, and then the one which already as it; This is so that the object which has the Rigid Body physics becomes the Active object.

Then, open the Toolbar (press T) and switch to the Physics tab; There, you can press Copy from Active to copy all the physics to the new objects.


Cannot enter Pose Mode with an avatar with a grayed-out name I recently downloaded an avatar in .blend format. I don't know what version of Blender created it, but I'm using Blender 2.8. The avatar has its name ("Character") grayed-out:

What I would like to do is pose this avatar. So, I'm selecting "Pose" in the object hierarchy above, and then trying to change to Pose Mode. However, when I click on the top-left to change the mode, I seem to be trapped in Object Mode:

If I instead select "Body", I can change to Edit Mode, among other things, but I still can't pose.

Additionally, I normally can't select "Armature" at all, however, if I fiddle around with it, sometimes I can select "Armature", but then I'm locked from switching back to "Pose", and neither state allows me to enter Pose Mode.

If I select the Bone Context in the bottom-right menu, I can select bones in the hierarchy and manually change the numbers for position and rotation etc, but I'm still not in Pose Mode and I can't see any visual representations of the bones.

If I right-click "Character", I also noticed there are buttons for "Pose Mode Set" and "Pose Mode Clear". Clicking "Pose Mode Set" doesn't do anything, and clicking "Pose Mode Clear" gives the error "Active object mode not changed".

Other things I've tried so far, all of which haven't changed anything:

Switching tabs between Layout, Modeling, Animation.
Closing and re-opening Blender.
Re-downloading the file.

Weirdly, I was able to get into Pose Mode if I exported the avatar to FBX, then imported it. However, this is a sub-par workaround, I don't think it should be necessary to export and import a model just to pose it.

If it helps, here's the .blend file: https://www.filefaucet.tk/file/?code=5d9025a3acf00

The armature is disabled in view port. If you go to your filter menu (little funnel icon at the top right of your object list) and enable the "disable in view port" filter you will be able to eneble the armature again.

Don't ask me why these buttons don't show by deafult.


How to run an external command, showing its progress without locking Blender? (Escape to cancel for eg) Currently if you run an external process from Python the command and locks  Blender until it finishes, eg:subprocess.check_output(["sleep", "2"]).

Whats the best way to wrap an external call in way that the user can see whats happening, and can escape from if its taking too long?

External processes can be run while collecting their output using non-blocking file reading.

This example uses a mix-in class (works the same way as Import/ExportHelper) which you can subclass to create your own operator that runs a command.

Each line printed by the external application shows in the header,
and pressing escape kills the process.

Notes:

For reliable updates, the process your calling may need to explicitly flush the standard output (sys.stdout.flush() in Python).
This only works with a recent build & upcoming 2.77 (a minor change was needed commit).
Unfortunately, non-blocking reading from a processes requires some black magic with ctypes.Though it may be supported in Python3.6).
In practice you may want to have a cleanup operation when canceling. (if the process works on temp files for example).

Example script:

"""
To test this operator, run the script, then open operator search (space-bar)
to execute: External Command Example
"""

import subprocess
import os

# ----------------------------------------------------------------------------
# Portable non-blocking pipe.
#
# This is really black magic on ms-windows!

if os.name == "nt":
    def pipe_non_blocking_set(fd):
        # Constant could define globally but avoid polluting the name-space
        # see: https://stackoverflow.com/a/35052424/432509
        import msvcrt

        from ctypes import windll, byref, wintypes, WinError, POINTER
        from ctypes.wintypes import HANDLE, DWORD, BOOL

        LPDWORD = POINTER(DWORD)

        PIPE_NOWAIT = wintypes.DWORD(0x00000001)

        def pipe_no_wait(pipefd):
            SetNamedPipeHandleState = windll.kernel32.SetNamedPipeHandleState
            SetNamedPipeHandleState.argtypes = [HANDLE, LPDWORD, LPDWORD, LPDWORD]
            SetNamedPipeHandleState.restype = BOOL

            h = msvcrt.get_osfhandle(pipefd)

            res = windll.kernel32.SetNamedPipeHandleState(h, byref(PIPE_NOWAIT), None, None)
            if res == 0:
                print(WinError())
                return False
            return True

        return pipe_no_wait(fd)

    def pipe_non_blocking_is_error_blocking(ex):
        if not isinstance(ex, PortableBlockingIOError):
            return False
        from ctypes import GetLastError
        ERROR_NO_DATA = 232

        return (GetLastError() == ERROR_NO_DATA)

    PortableBlockingIOError = OSError
else:
    def pipe_non_blocking_set(fd):
        import fcntl
        fl = fcntl.fcntl(fd, fcntl.F_GETFL)
        fcntl.fcntl(fd, fcntl.F_SETFL, fl | os.O_NONBLOCK)
        return True

    # only to keep compatibility with nt version
    def pipe_non_blocking_is_error_blocking(ex):
        if not isinstance(ex, PortableBlockingIOError):
            return False
        return True

    PortableBlockingIOError = BlockingIOError

# end magic!
# ----------------------------------------------------------------------------

class SubprocessHelper:
    """
    Mix-in class for operators to run commands in a non-blocking way.

    This uses a modal operator to manage an external process.

    This class defines:

        process: The running process object.

    Subclass must define:

        command: Sequence of arguments to pass to subprocess.Popen
    """

    @staticmethod
    def _non_blocking_readlines(f, chunk=64):
        """
        Iterate over lines, yielding b'' when nothings left
        or when new data is not yet available.
        """

        fd = f.fileno()
        pipe_non_blocking_set(fd)

        blocks = []

        while True:
            try:
                data = os.read(fd, chunk)
                if not data:
                    # case were reading finishes with no trailing newline
                    yield b''.join(blocks)
                    blocks.clear()
            except PortableBlockingIOError as ex:
                if not pipe_non_blocking_is_error_blocking(ex):
                    raise ex

                yield b''
                continue

            while True:
                n = data.find(b'\n')
                if n == -1:
                    break

                yield b''.join(blocks) + data[:n + 1]
                data = data[n + 1:]
                blocks.clear()
            blocks.append(data)

    def _report_output(self):
        stdout_line_iter, stderr_line_iter = self._buffer_iter
        for line_iter, report_type in (
                (stdout_line_iter, {'INFO'}),
                (stderr_line_iter, {'WARNING'})
                ):
            while True:
                line = next(line_iter).rstrip()  # rstrip all, to include \r on windows
                if not line:
                    break
                self.report(report_type, line.decode(encoding='utf-8', errors='surrogateescape'))

    def _wm_enter(self, context):
        wm = context.window_manager
        window = context.window

        self._timer = wm.event_timer_add(0.1, context.window)
        context.window.cursor_set('WAIT')

    def _wm_exit(self, context):
        wm = context.window_manager
        window = context.window

        wm.event_timer_remove(self._timer)
        window.cursor_set('DEFAULT')

    def modal(self, context, event):
        wm = context.window_manager
        p = self._process

        if event.type == 'ESC':
            self.cancel(context)
            self.report({'INFO'}, "Operation aborted by user.")
            return {'CANCELLED'}

        elif event.type == 'TIMER':
            if p.poll() is not None:
                self._report_output()
                self._wm_exit(context)
                return {'FINISHED'}

            self._report_output()

        return {'PASS_THROUGH'}

    def execute(self, context):
        import subprocess
        try:
            p = subprocess.Popen(
                    self.command,
                    stdout=subprocess.PIPE,
                    stderr=subprocess.PIPE,
                    )
        except FileNotFoundError as ex:
            # Command not found
            self.report({'ERROR'}, str(ex))
            return {'CANCELLED'}

        self._process = p
        self._buffer_iter = (
                iter(self._non_blocking_readlines(p.stdout)),
                iter(self._non_blocking_readlines(p.stderr)),
                )

        wm = context.window_manager
        wm.modal_handler_add(self)

        self._wm_enter(context)

        return {'RUNNING_MODAL'}

    def cancel(self, context):
        self._wm_exit(context)
        self._process.kill()

# ------------------------------------------------------------------------
# End generic code, now to show an example operator using SubprocessHelper

import bpy
from bpy.types import (
        Operator,
        )

class MyCommandOperator(Operator, SubprocessHelper):
    bl_idname = "wm.my_command"
    bl_label = "External Command Example"

    command = (
        # Run Blender's Python, but could be any other command.
        bpy.app.binary_path_python,
        # pass in a script to execute
        "-c", """
import sys
import time

# Some dummy status reports
status_report = ('Hello World', 'Blender is working!', '... almost done', 'Task Complete!')

for word in status_report:
    # Will show in the info area.
    print(word)
    # flush to ensure we get the output immediately.
    sys.stdout.flush()
    # wait a second.
    time.sleep(1.0)
"""
        )

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

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

if __name__ == "__main__":
    register()

    # bpy.ops.wm.my_command('INVOKE_DEFAULT')


Slide frame offset inside a strip I have several small strip of different video who match beats of background music.
Later I have the same sequence of beats so I want to reuse my strips but with a slight difference of offset for each strip.

The issue is than the only way I see to do that is to pick each strip, grab the end until I found the sequence I want then pick the start to shrink it again to the right time. This is really not handy and time consuming (knowing that the media is about 10 minutes and the seq I want is 10 frames long)

Is there a way to "slide" the frames inside a strip ?


How do I make a separate mirror copy of an object (and do I need to?) I am making my first character model and want him to have a left arm to go with his right one. As of right now, he has one object for his right shoulder, one for his right arm, one for his right leg, one for his left hip bag, etc. And these objects all just have unapplied mirror modifiers on, to give his right limbs some left counterparts. If I apply the mirror modifiers then the right and left arms will both be part of the same object. Do I want this when rigging? I am concerned because later, in the rig and for importing to Unity, I want to allow the bags around his waist to hang and bounce independent of one another. If the left hip bag is a mirror of the right object hip bag, will I be able to move it independently? What Imagine I want to do instead is to mirror the objects, then separate the mirrored components into separate objects, but I haven't managed to figure out how.

Use aplied mirror modifier, after! go to edit mode, in edit mode, go to mesh -> Separate Loose Partes! after! Go to object mode, and press in "new" object! and object -> set origin -> origin to geometry


How can I use physics connect functions in Blender 2.8? I've been taking tutorials of Blender at the age of 2.79(we still live in this age basically), and I am pretty used to the physics tool bar functions in 2.79, you can create physical constraints between a bunch of object for example. I used to made caterpillar track with that function at that time.
However in 2.80 when I find connect inside the object menu, it just doesn't work.

you need to create an empty and go to physic tab and add constraint ! the empty is the link between 2 rigid body object :)


Blender Eevee lighting Rendering - Flashes of light in animation I am experiencing a strange lighting effect with my last 2 rendered video animations in Blender.

The only thing I think my last to video animations had in common is the presence of more than one source of light in the fixed camera scene.

At random times during the animation strong and 1 frame long flashed of light appear.  They have the colour of one of the lights present in the animation in the screenshot below you can see one of these flashes.

I would like to know what I am doing wrong and if I can eliminate all the flashes.

Thanks in advance.

I just ran into what may be the same issue rendering out some of my scenes with eevvee.  See screen shot.  I did a bit of investigation and where I have a stack of point lights in a complicated mesh every now and then I'll get that flash.  If I turned off bloom it stopped, looking at the rendered image it would have a few super white pixels for some reason that bloom was really blooming on causing the flashes.
I added a clamp value to the bloom (20 in my case worked) and it stops that happening.
To re-render the affected scenes without redoing the whole thing I tweaked my command line batch render as below just to re-render the affected frames.
"--path to your blender install--\blender.exe" -b  "P.Scene4.Cut1.blend" -f 2,5,36,51,52,53,70,75,77,78,104,105,114,119,137,149,169,174,186,221,232,233,241,246,247,250,252,259,266,276,277,280,283
Perhaps you issue is different but check bloom clamp, 0 is the default and that means no clamp at all.


Use less memory in for faster rendering (32GRAM) In better way to explain it. I have a project with a lot of details but also a lot of duplicated objects. It took a lot of time just to calculate for rendering and in some computers it showed me 'out of memory' message in 32GB RAM computer. I used CPU render method and all duplicated objects was using 'Alt + D' so it should use same source to avoid wasting memory. I don't know if it would help to append objects all to make groups? any other ideas to handel projects like that?

Linked Duplicates
https://docs.blender.org/manual/en/dev/editors/3dview/object/editing/duplication.html?highlight=duplicate%20instances

Mode:   Object Mode
Panel:  Tool Shelf ‣ Tools ‣ Edit ‣ Duplicate Linked
Menu:   Object ‣ Duplicate Linked
Hotkey: Alt+D

You also have the choice of creating a Linked Duplicate rather than a Duplicate; this is called a deep link. This will create a new object with all of its data linked to the original object. If you modify one of the linked objects in Edit Mode, all linked copies are modified. Transform properties (object data-blocks) still remain copies, not links, so you still can rotate, scale, and move freely without affecting the other copies. Reference Expl. Duplicate Example for the discussions below.

Note
If you require the applied material to not be linked you will need to turn on "Object" data on the material panel here.


Render has strange artifacts I've got a problem with my rendering! I'm trying to render some objects:

But, this is how it renders:

Can somebody help me out?

Your object's normals are not in the right direction.

You have to select all your object one after one and do this :

Tab for edit mode, then go to the Tools panel on left of the 3d view (t)and click on Recalculate on the Normals pannel.

This will correct how your normals are directed and also in your case your render.

If you want to see the direction of your normals (which have to always go on the outside of your object) go on the UI panel on right of the 3d view (n) go to mesh display and select display face (or vertex) normals as line here:

and little line are going to show you were your normals are pointing.

Last but not least : For a better render (a smooth shading of your object) you can add a smooth on the Tools pannel on left


View follows object when object moves? How do I turn this off? I did something unbeknownst to me and have made my view constantly follow an object. If i move that object it remains constant in the center of my view while the rest of the scene moves around instead.

What is this setting? I've tried pressing . on the number pad and it did nothing.

Press the N key to bring up the right tool bar, and delete your cog object from the Lock to Object field.


OBJ Export (Pivot Points Wrong) I believe I've tried every export setting I can think of. I'd like objects I export from Blender to keep their pivot point, but they never seem to do that. Is there a secret way to do this, or does Blender not have that ability??
Thank you for your time!

First off, you need to correct the origins in blender. While the four cubes are selected, right click to bring up this panel.

Then navigate to 'set origin' and select the 'origin to 3d cursor'. This will set the four cubes origins to the cursor position and you should be good to go! Then inside unity, make sure to set tool handle position to 'pivot'.
Hopefully this works!


Baking path animation deletes poses? Ok, total edit:

I found out that I have to bake the entire length of the animation to keep all of my keyframes. BUT, now that I've done that, now all of my poses are deleted. The movement stays there, but my character is just in the T-Pose throughout the whole animation. Any help?

Ok, I basically messed around with it until I figured out that selecting the 'Pose' option in the bake settings only works if you have a bone selected in pose mode, so I just selected all my bones in pose mode, chose 'Pose' and 'Object' in the bake settings, deleted the path, and now it works. Thanks to @joshsanfelici for giving me the idea to check edit mode, which made me think of selecting the bones.


How to obtain accurate depth maps using nodes and visualize them? I want to render depth maps and surface Normal maps of different 3D shapes using Cycles.

To be able to get depth maps, I attempted the two used methods that includes creating nodes here and played around with the parameters to get depth maps.

However, I run into the same problem that the question asker has run into (getting almost completely white images): I know accurate depth maps must only be stored in OpenEXR files but I also need to be able to view the depth maps for visualization purposes.

I am pretty new to the concepts of node trees in Blender and would appreciate if someone can give me some step-by-step instructions on how I can create node trees that store the depth maps (with a black background) on disk in OpenEXR or .txt files and map the values to 0-255 so that I can have some visualization, although less accurate.

Another thing: how can I avoid getting truncated depth maps?

Here is the best results I could get through trial and error:

And here is a .blend file which includes the 3D mesh I am trying to render depth maps for, in case you need.

To visualize the Z depth just use the Normalize node. Normalize will take the lowest and highest values of the image and scale them to be 0 (black) and 1 (white) respectively. All values in between will be scaled linearly as well.
And maybe also enable transparency...


Baking onto different uvmaps Let's say I have a object that has a uvmap called uv1 and has a color,roughness,bump etc applied in cycles through image textures with texture coordinate set to uv using uv1 and the image textures are meant for uv1, is it possible to transfer the colour,bump etc to another image which uses another uvmap uv2.
Note: it would be easy for me to do so if the object was textured using procedurals all I have to do is bake the textures using uv2, but I hand painted details onto the object using uv1

Cycles bakes with the active (selected) UV map and to the selected Image node.


Node Transparent Material Not Working So I set up a mix shader node and added a transparent bdsf node to it and am trying to change the blend of it to alpha blend but the property tag isn't showing my blend settings.

You need to switch to the Options tab to see the Blend Mode setting.


Cutting Holes with Boolean Modifier Makes Subdivision Surface Impossible I am trying to cut numerous holes into a cylinder to create the barrel of gun. I used the Boolean modifier to cut the holes but now when I try to apply a subdivision surface to the cylinder I get horrifying results.

Would applying the subdivision surface first give better results or should I abandon the Boolean modifier entirely and opt for the knife project tool?

EDIT: Thanks to cegaton I am now able to cut the holes and use a subdivision surface. I still end up with an issue when smooth shading is applied though.

Invert the order of the modifiers, do the subsurf before the boolean.

Instead of this:

Do this:


Is it possible to add noise or other type of texture between color ramp stops? I'm trying to duplicate the following type of gradient like the horns in this picture:

I saw an example of that uses a texture as a transition, but it only shown just a duo-tone gradient using a gradient texture. I want to know if is possible to either influence the stops on a color ramp or modify the technique mentioned in the link to get the desired effect?

It's time to dig this up and make it right.

Final

Object and UV Map

Create your horn using chosen technique and UV Unwrap it with Follow Active Quads as in my answer here: How to Straighten Curved UVs into Straight Belt

Using this method is somewhat crucial as we need to have UV Map straighten to X axis.

Material

Extending a bit setup from your link we will make 3 maps. Base color, Roughness and Normal than use them with Principled Shader.

For Base color we mix main gradient with light and dark spots.

For Roughness and Normal we will use stretched and mixed Noise Textures.

Most important things here are Mapping nodes with stretching along X and Y axis.


how to make "operator_menu_enum" keep the selected value displayed I created a drop-down menu, with a operator_menu_enum referring to an EnumProperty.

When I select an entry in this menu, it closes, and display the default text string, instead of displaying the selected entry's string.

How to keep the selected entry displayed in the menu's head after selection ?

Edit : Here is an example script of the way I make the menu :

import bpy

class STUFF_PANEL(bpy.types.Panel):
    bl_idname = "SCENE_PT_stuffSelect"
    bl_label = "Stuff selection"
    bl_space_type = "PROPERTIES"
    bl_region_type = 'WINDOW'
    bl_context = "scene"

    def draw(self, context):
        layout = self.layout
        row = layout.row()
        row.operator_menu_enum("stuff_list.menu", 'stuffList', text="Stuff list")
        if bpy.props.selectedStuff:
            row = layout.row()
            row.label("Selected stuff :")
            row.label(str(bpy.props.selectedStuff[1]))

class STUFF_LIST_OT_Menu(bpy.types.Operator):
    bl_idname = "stuff_list.menu"
    bl_description = "select something here"
    bl_label = "Menu"

    def get_stuff(self, context):
        return bpy.props.config_stuff_list

    stuffList = bpy.props.EnumProperty(
        items = get_stuff, name = "Stuff", description = "The stuff list")

    def execute(self, context):
        bpy.props.selectedStuff = [
            n for i, n in enumerate(bpy.props.config_stuff_list)\
            if n[0] == self.stuffList][0]
        return{'FINISHED'}

def register():
    bpy.props.selectedStuff = False
    bpy.props.config_stuff_list = [
        ("1","stuff 1","0"),("2","stuff 2","0"),("3","stuff 3","0")]
    bpy.utils.register_module(__name__)

def unregister():
    del bpy.props.config_stuff_list
    del bpy.props.selectedStuff
    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()

This feature isn't supported by operator_menu_enum, the purpose of this is to be a submenu containing options. Not a persistent drop-down selection box, you may be better off to add an update callback to an enum property, then selecting an option can run some python code.

What you wan't can be done, but I think you're looking in the wrong place.

Simple answer:

You could replace the row.operator_menu_enum line with this.

    if bpy.props.selectedStuff:
        label = str(bpy.props.selectedStuff[1])
    else:
        label = "Stuff list"
    row.operator_menu_enum("stuff_list.menu", 'stuffList', text=label)

Longer answer:

it looks like this is not using the API correctly. You can't easily access operator properties from a panel (when the operator isn't running), you're better off to add a property-group to the scene that contains all your tool properties, then have the operators invoke function initialize from these settings (this is how most Blender operators do this).

Note:

Setting attributes in bpy.props is bad practice, just store this in the script. (as a class attribute for example)


Transparency in image as plane In blender 2.8 when brought in as a reference or background, .png file, the transparent layer is retained however if broght in as a plane the transparent layer is not respected and the whole image is rendered.

Is this true or am I missing something? Please keep in mind that I'm a newbie and looking for a relevently easy fix.

Thank you.

Here's the file the comments don't allow you to post a picture

In 2.81
I needed to tick "Use Alpha" and was able to use transparency.


Copying animation keyframes from one bone to another with flipping Problem:
I have two hand bones on a character that are meant to do the same animations, but on different sides of the character (left hand and right hand). This is on Blender 2.92.
I've gone ahead and animated from the side, before realising I've only animated one hand. I did not have the other bone rig selected, so the other hand missed out on getting the keyframes.
I would like to copy over the animation keyframes from the left hand over to the right hand, with little to no re-work needed.
What I've tried:
I've tried to copy and paste the keyframes from the animated left hand to the non-animated right hand. It however, does not seem to work.
If the hands are holding something, the alternative would be to make the right hand a child of whatever the left hand is holding via a bone constraint. I'm not seeking to do this though, I would like to have the keyframes available for both for tweaking down the line without messy constraints logic.

Figured out how to mirror the same animation keyframes to the other bone hand, without any re-work or manual labor required.

With the animated hand's bone rig selected, select all the keyframes in the Timeline (Shift+F12 to get the Timeline view and use your mouse to box-select them all or press Ctrl+A) and copying them with Ctrl+C.

Then proceeded to select the other hand's bone rig (the non-animated one). With the non-animated bone, first setup at least one initial keyframe in the timeline. I did this with hitting i to put in an initial keyframe.

Lastly, the trick to get the animation pasted and flipped for this other hand bone is to have the Graph Editor open (Shift+F6) and right click in it and press Paste_Flipped (or alternatively press Shift+Ctrl+V).

Done! Now the other previously non-animated hand bone rig is now animated with the exact same keyframes as the other hand, just flipped so it looks correct!
This was all done whilst in Pose Mode.