text:
How to make eyelids react with eye movement?
How do you make eyelids react with a character's eye movements? For example, if the character looks up, the upper eyelid rotates up, but if the eye looks down, the upper eyelid doesn't rotate down past the center point of the eye. I'm guessing with drivers or with copy rotation if I use eyelid bones, but if I want the character to also have the ability to blink, how'd I combine all of these systems? Sorry for the confusing question and let me know if you want more info.

By the way, I know I could just animate them manually, but I wanted to see if there's an automatic way of doing it to save time.

Everyone seems to do eye rigs slightly different, it depends on how detailed you want/need to be, what kind of animations you're going to do, etc. I've made several in the past, and I'll walk you through how I approach creating a rig for something.
The first thing to do is to list what the rig needs to do. You've done that already, but I'm going to add a few more things too.

Have the rig control the eye so that we can make a character look at things.
Have the rig control the eyelids so that they can move up and down. In reality, there is a tiny amount of side to side movement, and you can see the eye moving when the eye is closed, but I'm not going to go into that much detail. If you want me to, ask another question on that and I'd be more than happy to go into even more detail.
Have the eyelids follow the eye as it looks around. Again, I'm going to ignore the tiny amount of side to side movement, so the eyelids need to follow the eye vertically.
Make the eye be able to blink.
When the eye is closed or blinks, make sure the point the eyelids meet can move up and down. When your eyes are closed, it is possible to move your eyelids up and down a little bit, for example when you raise or lower your eyebrows, so we'll try and do that too.
Have the eyelids be manually moveable as well, so we can make different expressions.
Finally, make the rig easy to use, with a few controls as possible. Also make sure things make sense, and it's easy to select the proper bones.

This may seem like a lot, but it's actually not too bad. So let's think about what bones we're going to need that will actually deform stuff.
We'll need a bone to rotate the eyeball, a bone to control the upper eyelid, a bone for the lower eyelid, and that's it. If you want to have a really detailed eyelid you can use multiple bones per lid, animate them closing, and use a single bone with an action constraint to drive them. I'm going to set this up with a single bone for each eyelid, but can go into more detail if you like (If you can't tell already, I really enjoy rigging, so if you want more info I'm happy to help).
Aside from the deforming bones, I can think of two other bones we'll need. A common thing to use for eye rigs is a look target. That is, instead of rotating the eye directly, have a target that you can move around that the eyes look at. It makes it much easier to animate looking at things. So we'll need a bone for the eye to look at. I also want to have a single bone that controls blinking, so I'll add one for that too.
So let's actually get started. I'm just making the rig, and don't have it applied to a model, but it should be pretty clear.
Here's the bone setup I'm going to use. Note that this is the rest pose. The bones were moved in Edit Mode, not Pose Mode.

The world origin would be at the center of the eye. The bone on the far left is the Look Target, and the bone on the right is the Blink Control bone. This is pulled off to the side a bit, and sits slightly lower than the center of the eye. This is because when you blink, your eyelids meet slightly below the center of your eye, with the upper lid moving more.
Next, I add a Track To constraint to the Eye bone, using the Look Target as the target.

Now when we move the look target, the eye will look at it.
Next, the upper eyelid. We need it to do two things here. First, follow the eye, but not completely. Second, be able to blink. We'll do this by having it look at the blink bone, and controlling the influence with a driver. It'll make more sense shortly.
We need three constraints. The first is a Copy Rotation, set to something less than 1, with the eye as the target. Now it follows the eye a bit as it moves. I used .5, but use whatever you need. Next we need another Track To, using the blink target bone as the target. We'll use a driver to control the influence, which is how we can make it blink. Finally, I added a limit rotation constraint, so that the target for the track to constraint can be off to the side without rotating the eyelids sideways. This will help make things less cluttered at the end.
The final constraint setup looks like this:

Next we do the same for the lower lid. I did the exact same setup, just used an influence of .1 instead of .5, since the lower eyelid moves less.
Onto the drivers. My goal here is to have it setup so that we can scale the Blink Target bone and have that open and close the eye.
So I added a driver, selected the rig, then the blink target bone, and chose Z scale.
The expression gets a bit trickier. The scale of the blink target bone is 1 initially, and decreases as we scale it down. We want the influence to be 0 by default, and increase as we scale the bone down. However, it's not ideal if we have to scale the bone to 0 to close the eye completely. Scaling the bone by half would work fine.
The expression works out to be this: 2*(1-var) where the var is the name Blender gives the Z scale that we chose above. Now when we scale the Blink Target bone, the eye closes, becoming fully closed when the target bone is scaled by half.
This is the final driver setup, which is identical for both eyelids:

I also added a Limit Scale constraint to the Blink Target. I chose Z, with a minimum of .5 and a maximum of 1, so that the bone never gets stretched beyond what it needs to be.
Next, I added some custom shapes. I find them really useful on rigs, as they make things a lot cleaner, easier to work with, and the give a visual idea of what each bone does with having to look for names.
If you've never used custom shapes, basically you make a shape out of just edges, and choose it under the Viewport Display heading in the Bone Properties tab.

Circles work great for the look target, the eyelids can be curves or triangles, and I used an eye shape for the blink control bone. Since we never actually use the eye bone itself, I just hid it.
The final setup looks like this (I didn't hide the eye bone here so you can see what it looks like):

The final step is to disable and transforms that we won't need. For example, we won;t need to scale the eyelids, or scale the blink control on any axis but the Z.
The final result:

Here's the .blend file if you want to look at the setup. Feel free to use it if you like.

This is an amazingly detailed explanation on how to do it. Thank you very much! I'll set it up and come back if I'm having trouble with anything.


text:
Can't see the rig/bones
I can't seem to see the rig on a .blend file that I downloaded here. (This one). I have tried pressing Alt-H in object mode, Alt-H on edit mode, trying to scale the bones up in edit mode. I feel like I'm missing something, like the bones are hidden away inside a layer or something. I downloaded the file to see how the control bones worked with the bendy bones, but I can't seem to find the bones.
Any help would be appreciated!

You need to enable this button. See picture in the right-top corner.

Thank you! I managed to fix it the first time by changing to the modelling tab, but this is much easier to do.

No problem. I wasn't used to it either when I upgraded to version 2.8. But once you get used to it, it becomes easy. Have fun and take care!

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
How to achieve uniform Inset and Extrude on multiple nonplanar surfaces?
I'm trying to inset and extrude a peripheral slot as shown on this cube:

Except I'm trying to do it on a rectangular cuboid which has one side/face split into multiple non-planar sub-faces:

Method I used on the cube was to enter the edit mode, create two loop cuts for vertical slot in the middle, then select the outer edges of the front face and inset them. Finally, I selected the faces I wanted to be extruded and I extruded them in the direction I wanted (inwards).
Now, I have two issues when I try to do the same on the cuboid:

The inset of the outer edge is not uniform, i.e. side insets are bigger compared to the top and bottom one. I would like them all to be the same width. Is there is a setting to make this inset an exact value instead of being proportional?

I have no idea how to loop cut the vertical slot in the cuboid - loop cuts are aligning with the slanted edges. Any idea how to cut vertically across multiple sub-faces?

I'd appreciate any advice. Thanks.

Hello :). Inset has an 'Offset Even' checkbox. And for the middle loopcut you can use Knife project if you want a perfectly vertical line.

Something along these lines might do it.. just following my nose, someone might find a snappier way..

The inset of the outer edge is not uniform

I think the only reason for this is that you scaled your cube in Object Mode, and it's carrying an object-level non-uniform scale. CtrlA > Apply the scale of your object, and if your inset is set to even, it should be even.

I have no idea how to loop cut the vertical slot

It's not a loop-cut, because it's not a loop. K Knife, with C to constrain its direction orthogonal to your view, should do that. Cut from an orthographic front view. The only problem is, how to get the cut right in the middle..

I EZ extruded the top edge up in Z..

CtrlX Dissolved the odd vertices, and Edge menu > Subdivided the top edge once to give me a guide-point in the middle. Then, looking from the front, You can K with C to constrain, cut an edge straight down the middle of the front region. You can discard the guide-edge once you're done with it.

Then, as you have before, you can I inset the whole front region twice, remembering or CtrlC copying the second distance, the width of your rebate. Now select the central cut line and CtrlB Bevel it by half that distance. (You can paste in the copied Insert distance and add a /2 after it into the width field of the Bevel's adjust-last-operation panel)

Then E extrude as before, for even, centered rebates:

You can SY (or whatever dimension) 0 with the Pivot set to Median, to flatten the backs of your grooves.

I don't have enough reputation to comment so please forgive me for replying by writing an answer. I just wanted to say thank you Robin Betts and Jachym Michal. It seems that Offset Even was on, however resetting the scale did the trick. I do appreciate the rest of your workflow as well Robin, it's really helpful to gain insight into step-by-step thought process when modelling.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Distance between points - Geometry nodes
Does anyone know how to get the distance between points in geometry nodes?

I attach de 3.5 .blend file:

Thank you,

you can use this node setup here:

as you can see in the spreadsheet: the viewer node shows the distance between point 0 and 1.
Of course you can change the indices to your liking.
By this node setup you get all distances to point at index 0:

Note: that's why the distance at index 0 is 0.

Thanks so much Chris! But what I need is get the distance from each point to the rest of the points.

can u tell us your "end goal" what you want to make with it?

Yes, I want to calculate the distance between all points, so they don't collide when I move them. Like your last example but between all points.

@Miguel If I'm understanding your intention right, it's probably a much more complicated question (for the current state of Geometry Nodes) than you might realize. I'd suggest either taking a look at Simulation Nodes (for ex: https://www.youtube.com/watch?v=OqHOvP59L0o) or for "plexus" setups like this: https://www.youtube.com/watch?v=tj6ZZYO5qPY

Thanks, Kuboå! I had already checked the "merge-by-distance" Seanterelle solution and I've checked the "power-points" Entagma solution but I think none of them is a good option for what I'm trying to do. The first one doesn't give you the distance between points and the second one involves creating many points and it's a bit confusing for me. Anyways, in case someone wants to help me, what I'm trying to replicate in GN is the "Primordial Particle System": https://nagualdesign.github.io/
Explanation: https://youtu.be/makaJpLvbow


text:
Extrude curve along its normal in Geometry Nodes
I need to extrude this curve along its normal in Geometry Nodes.
Instanced lines are for visualization only.

i am not totally sure, do you mean like this?

or do you really wanna extrude like this?

Yes, like the second one, thank you very much Chris! I had tried that but I must have done something wrong.


text:
Geometry nodes - Disappearing points on deforming surface
I have appearing and disappearing distributed points when deforming an extruded curve in GN.
I want the amount of points to remain constant. (Extruded curve is animated with AnimAll) . I attach the .blend:

Unfortunately, the way you are currently implementing this, it cannot be solved with Geometry Nodes. As soon as the topology or the dimensions of your mesh change, the distribution of the points changes as well. The only possibility you have here is to create everything in Geometry Nodes and to create the distribution of the points before the deformation.

Think of the geometry as part of the seed. If you changed the shape of a bingo barrel slightly, you probably would get completely different numbers. Similarly here, you get consistency only if you apply a deformation after randomizing the points. For mathematical deformations that's easy, you just apply the deformation on the point coordinates as well. In your case it's not an option, so here's an alternative:

Duplicate the curve, name it "static", and remove the animation from it.
Distribute points on the static curve.
Spawn as many separate points as in the step above (use "Domain Size").
For each point, find its "brother" point in the geometry from step 2 (sample by index); for that point, get its UVMap attribute, which is its position in the UV (texture) space.
Since you want the point to occupy the same UV space in the animated curve, use the wonderful "Sample UV Surface" node to convert this coordinate to the 3D coordinate of the animated curve.

Alternatively "reusing" the points:

Thank you very much! Any way to align the instances on points to the animated mesh? I've tried using a "capture attribute" and a "store named attribute" from the animated mesh but none of them is working.

@Miguel maybe just sample nearest normal to the point? https://i.imgur.com/XeXQDOr.png

Thank you very much! That worked!


text:
Addon controls Geometry Nodes inputs
Could someone provide an example similar to this?
I need an addon located in View3d > Tools.
It has 4 properties on that panel. Each one controls and updates the inptus of the modifier "Geometry Nodes" of the original object "Cube". It has a node tree linked called "GN_Cube". Each addon property should control and update each "GN_Cube" property as follows:
Property_1(float): default value(1.5), it controls the input_2 of the "GN_Cube".
Property_2(float): default value(25), it controls the input_3 of the "GN_Cube".
Property_3(float): default value(2.5), it controls the input_4 of the "GN_Cube".
Property_4(boolean): default value(unchecked), it controls the input_5 of the "GN_Cube".

What's "View3d > Tools"? Side panel/Sidebar, Tool tab? Or do you want a menu in the header called Tools?

By the way, you can find correct terminology in the documentation if you are ever unsure.

Sorry, I mean Side panel, like "Item", "View", "Tools", another one like this called for example "Addon controls GN".

I mean Sidebar ;)

I took UI Panel example from Text Editor's Templates -> Python menu and changed it:
import bpy

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "My Panel"
    bl_category = "Blah Blah"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

    def draw(self, context):
        layout = self.layout

        scene = context.scene
        # GN Inputs

        o = bpy.data.objects["Cube"] #might not be the best idea to use the name since they change a lot
        #row.prop(o.modifiers['GeometryNodes'], '["Input_2"]') #testing
        for modifier in o.modifiers:
            if modifier.type != 'NODES': # Skip in case it's not Geometry Nodes modifier
                continue
            for input in modifier.node_group.inputs:
                row = layout.row()
                row.prop(modifier, '["' + input.identifier + '"]', text=input.name) #Because the input for modifier on an object(as opposed to modifier node group) is o.modifiers['GeometryNodes']["Input_2"]
                # Apparently has to be '["..."]', not "['...']"

        # Create a simple row.
        layout.label(text=" Simple Row:")

        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")

        # Create an row where the buttons are aligned to each other.
        layout.label(text=" Aligned Row:")

        row = layout.row(align=True)
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")

        # Create two columns, by using a split layout.
        split = layout.split()

        # First column
        col = split.column()
        col.label(text="Column One:")
        col.prop(scene, "frame_end")
        col.prop(scene, "frame_start")

        # Second column, aligned
        col = split.column(align=True)
        col.label(text="Column Two:")
        col.prop(scene, "frame_start")
        col.prop(scene, "frame_end")

        # Big render button
        layout.label(text="Big Button:")
        row = layout.row()
        row.scale_y = 3.0
        row.operator("render.render")

        # Different sizes in a row
        layout.label(text="Different button sizes:")
        row = layout.row(align=True)
        row.operator("render.render")

        sub = row.row()
        sub.scale_x = 2.0
        sub.operator("render.render")

        row.operator("render.render")

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

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

if __name__ == "__main__":
    register()

It will list all inputs of Geometry Nodes modifiers on bpy.data.objects["Cube"] in the Sidebar, Blah Blah tab


text:
How to export an Image(png / jpg) as glTF?
Sorry if I'm a complete noob, this is my first time using blender.
So far, I've managed to import the image as a plane with the addon  (import/export image as a plane), and now want to export it out as a glTF file type.

However when i do so, the exported glTF does not have the image I've placed and is empty.

I've found another forum (link) that guy stated he had a similar problem to what I was having. However, the solution which requires to uncheck/disable the transparency/z transparency, but is missing from my blender project - as seen from the first image above while in materials tab.
Maybe I am at the wrong part of blender or is there a newer solution to this issue?

The imported image is using the "Diffuse BSDF" shader, but glTF has a PBR material system that is based on the "Principled BSDF" shader.
Luckily, you can just swap one for the other to get this working.  Use the "Shading" tab at the top of Blender 2.80 to get to this area, and replace "Diffuse BSDF" with "Principled BSDF":

Additionally, if your image has any translucent parts, set "Blend Mode" to "Alpha Blend" in the material settings (Eevee only) like so:

Thanks emackey, I did what you typed and it works! Cannot mark your answer as resolved though since I asked this question while being a guest.


text:
Converting a lattice in to mesh, best way to connect the edges?
I am writing a script to convert a lattice into a poly mesh.
I was wondering if there is a better optimized way to create the edges the way I am doing in the code below:
import bpy
import bmesh
from mathutils import Vector
lattice= bpy.data.objects["Lattice"]
u = lattice.data.points_u
v = lattice.data.points_v
w = lattice.data.points_w

w_cap = u*v*(w-1)
v_cap = v*u
verts=[]
edges=[]
faces=[]

for point in lattice.data.points:
    verts.append(point.co)

x=0

for i in range(0,len(verts)):
    if i % u:
        edges.append((i-1, i)) #creating u edges

    if (i-x) % (v_cap ):
        edges.append((i, i-u)) #creating v edges
    if (x+1) % u:
        x+=1
    else:
        x=0

    if i<w_cap:
        edges.append((i, i+v_cap)) #creating w edges

mesh = bpy.data.meshes.new('Poly_mesh')
object = bpy.data.objects.new('Poly_Lattice', mesh)
mesh.from_pydata(verts,edges,faces)

bpy.context.scene.collection.objects.link (object)

Any help is highly appreciated.
Thank you!
Maurizio


text:
Match Topology nodes
Hi everybody I was wondering if there is any documentation on how to setup something like the Match topology node in Houdini.
I know the sort elements was node was intended for that but I wonder how I could use that in combination with the topology nodes to sort vertices idx sampling the topology of another mesh based on a face selection?
https://www.sidefx.com/docs/houdini/nodes/sop/matchtopology.html#parameters
Thank you very much in advance

If both geometries are the same but have different indices, you could actually just use the node Sample Nearest and Sample Index. With Sample Nearest you get the nearest point of the second geometry, and with Sample Index you get the index of this geometry. It would look something like this: https://i.sstatic.net/HSp5gxOy.png

What is this Match Topology node you mention and what does it do? Not everyone here is a Houdini user, nor necessarily knows what that does. Could you rephrase your question and explain what you expect to achieve, and also describe with words what that feature does? Ideally in a way that doesn't reference other software so that someone who never used it but knows blender could answer your question? Maybe add a few reference images? or GIF of the desired results

But simple nearest would not actually find a topological match it will match by closest element which is not what I want. What I want the node network to do is matching the indices starting by a 3 points selection on each mesh and find the connected edges starting from there.
There is actually an add on that is doing that.
https://bartoszstyperek.gumroad.com/l/copy_verts_ids
Problem is that python is not really efficient when it comes to iterating a large number of vertices. That's why I was thinking of using a geometry node solution.


text:
bpy.ops.wm.open_mainfile and bpy.context issue
I am trying to run a script that reload a scene and import some fbx.
The python script works wonderfully with blender in Background mode, but if I try to run the script from the blender text editor. I am getting some errors related to the context.
The error I am getting is this
AttributeError: 'Context' object has no attribute 'selected_objects'
I am assuming is something related to context.areas?
Any help is much appreciated!
Thanks!
Here is a snippet of the code
import bpy
import os

file_path = bpy.data.filepath
print("================AREAS=====================")
print(bpy.context.screen)
for area in bpy.context.screen.areas:
    print(area.type)

bpy.ops.wm.save_as_mainfile(filepath=bpy.data.filepath)

bpy.ops.wm.open_mainfile(filepath=file_path)
print("================AREAS=====================")
print(bpy.context.screen)
if bpy.context.screen:
    for area in bpy.context.screen.areas:
        print(area.type)

dir = os.path.dirname(bpy.data.filepath)
def import_fbx():
    fbx_path = os.path.join(dir, "test.fbx")
    bpy.ops.import_scene.fbx(filepath=fbx_path)

import_fbx()

how are you executing the script with blender in background? and which OS are you using? btw i don't see any usage of selected_objects in your script. are u using it somewhere or is it internally accessed?

are you using bpy from pypi? https://pypi.org/project/bpy/ i think, that isn't "full" bpy, i think its intended for using the math parts without the blender parts, for things like testing algebra


text:
Copying drivers and transform_space attribute
I am trying to copy shape keys drivers from one mesh to another.
For some reason when I copy over the variables attributes the transform_space attribute doesn't change.
I am printing the attribute value after I copied it over and it shows it has changed from "WORLD_SPACE" to "LOCAL_SPACE", but the driver's Variable property are still in world space.
Everything else is working so I don't think I am picking the wrong data block.
Any help is highly appreciated.
Here is the code I wrote:
import bpy
import codecs

target_obj = bpy.data.objects["2ndMesh"]
source_obj =  bpy.data.objects["1stMesh"]
source_f_curves = source_obj.data.shape_keys.animation_data.drivers

target_shape_keys_names = [x.name for x in target_obj.data.shape_keys.key_blocks]
for source_f_curve in source_f_curves:
    source_driver = source_f_curve.driver

    # finding the input

    source_shape_key = '['.join(source_f_curve.data_path.split('[')[1:])
    source_shape_key = "]".join(source_shape_key.split("]")[:-1])[1:-1]
    source_shape_key = codecs.decode(source_shape_key, 'unicode_escape')
    if source_shape_key not in target_shape_keys_names:
        continue
    source_channel = source_f_curve.data_path.split(".")[-1]
    # create the target driver

    target_driver = target_obj.data.shape_keys.key_blocks[source_shape_key].driver_add(source_channel).driver
    # copying the data over to the target driver
    target_driver.type = source_driver.type
    # copying variables over
    target_vars = list()

    for source_var in source_driver.variables:
        target_var = target_driver.variables.new()
        for i, source_var_target in source_var.targets.items():
            target_var_target =  target_var.targets[i]
            target_var_target.id_type = source_var_target.id_type
            source_target_id = source_var_target.id
            # replace the shape key target id
            if source_target_id == source_obj.data.shape_keys:
                source_target_id = target_obj.data.shape_keys
            target_var_target.id = source_target_id
            print("Current space is: ",target_var.targets[i].transform_space )
            target_var_target.transform_type = source_var_target.transform_type
            target_var_target.data_path = source_var_target.data_path
            target_var_target.bone_target = source_var_target.bone_target
            target_var_target.rotation_mode = source_var_target.rotation_mode
            target_var_target.transform_space = source_var_target.transform_space
            print("After space is: ", target_var.targets[i].transform_space)

        target_var.name = source_var.name
        target_var.type = source_var.type
    target_driver.expression = source_driver.expression

You need change variable type first.
import bpy
import codecs

target_obj = bpy.data.objects["2ndMesh"]
source_obj =  bpy.data.objects["1stMesh"]
source_f_curves = source_obj.data.shape_keys.animation_data.drivers

target_shape_keys_names = [x.name for x in target_obj.data.shape_keys.key_blocks]
for source_f_curve in source_f_curves:
    source_driver = source_f_curve.driver

    # finding the input

    source_shape_key = '['.join(source_f_curve.data_path.split('[')[1:])
    source_shape_key = "]".join(source_shape_key.split("]")[:-1])[1:-1]
    source_shape_key = codecs.decode(source_shape_key, 'unicode_escape')
    if source_shape_key not in target_shape_keys_names:
        continue
    source_channel = source_f_curve.data_path.split(".")[-1]
    # create the target driver

    target_driver = target_obj.data.shape_keys.key_blocks[source_shape_key].driver_add(source_channel).driver
    # copying the data over to the target driver
    target_driver.type = source_driver.type
    # copying variables over
    target_vars = list()

    for source_var in source_driver.variables:
        target_var = target_driver.variables.new()
        target_var.name = source_var.name
        target_var.type = source_var.type
        for i, source_var_target in source_var.targets.items():
            target_var_target =  target_var.targets[i]
            # target_var_target.id_type = source_var_target.id_type
            source_target_id = source_var_target.id
            # replace the shape key target id
            if source_target_id == source_obj.data.shape_keys:
                source_target_id = target_obj.data.shape_keys
            target_var_target.id = source_target_id
            print("Current space is: ",target_var.targets[i].transform_space )
            target_var_target.transform_type = source_var_target.transform_type
            target_var_target.data_path = source_var_target.data_path
            target_var_target.bone_target = source_var_target.bone_target
            target_var_target.rotation_mode = source_var_target.rotation_mode
            target_var_target.transform_space = source_var_target.transform_space
            print("After space is: ", target_var.targets[i].transform_space)

    target_driver.expression = source_driver.expression


text:
Textures distort if I rotate geometry nodes object

So I made a wall with egyptian symbols tiled using geometry nodes. The background texture of the rock has the texture coordinates of an empty I assiged to it. If I duplicate the geometry nodes wall and rotate it, the background rock textures get distorted. Is there a way to fix this without having to duplicate all of the symbols and assign a new object to use for texture coordinates?
Blend file

Of course the textures get distorted when you rotate them, since they are mapped in relation to the empty you've assigned in the Texture Coordinate node. If you only rotate one of the objects, either the wall or the empty, the textures get distorted. Why did you use the empty at all in the first place? Do you need it for adjusting the texture later?

Since the wall is made up of many individual plane objects, each plane object a symbol on the wall, I used the empty so the background wall texture bound to the coordinates of the empty so the individual planes share a common background texture (rock). I hope that makes sense.

I managed to fix it! I let the empty handle the vector mapping and the normals the rotation of the faces. Then I added a rotation transform node (Or something close to it. I can't remember the name correctly) between the texture mapping - normals to the mapping node and played with the rotations there until I got it right.

If your question was solved, please be so kind and mark your answer as "Accepted Answer". This will make it easier for others to see which way leads to the solution, and the question will no longer appear as unsolved: What should I do when someone answers my question?. Thank you!


text:
Can you fade in and out particles in blender eevee?
I have looked for a way to fade in and out particles in blender eevee, but people say particle info node is incompatible with eevee. Does anyone know of a different method?

Can you give a bit more detail about what you mean when you say "fade in and out"? Do you mean fade over time, over distance, fade in, fade out, both, etc...? Also, are you using emitted particles or hair, and are they native particles or instanced objects?

Fade as in over time. I'm using objects as particles. I want them to fade after a set amount of time instead of just disappearing instantly. I hope that has made it a bit more clear.

Here is an example of one way to do it in EEVEE. The idea is to use an object as the base for a particle instance, then to give that object a material that fades in and out over time.
The setup for the material is this - The primary factor of this is that you can type #frame into the field of a value node, and it will then provide the value of the frame position at any given point. I used some math to make it oscillate, and to slow it down a little. The idea is to use the sine of the frame number as a Mix Factor between the regular material (particle color) and a Transparent Shader, thus making it fade in and out. You can adjust the division number to speed up or slow down the fade. Lastly, don't forget to change the Blend Mode.

Thanks for this. I'll be sure to give it a try!

Just for clarification: do you want to fade with time or lifetime/age of the particles? With the above material, each particle will have the exact same value on each frame. So on frame 30 the time for each particle is 30. With the Partcile Info node a particle born on frame 1 would have an age of 30, but another born on frame 21 would have an age of 10. So materials created on age and/or lifetime would take the time of the particle's existence into account - which is what Eevee can't do. Materials related to frames make all particles the same at any time of the animation.

Oh, that's a bummer. I wanted to make dust disappear overtime, depending on how long it had been 'alive'.


text:
Geonodes: How to raycast from another position?
How can I raycast from a different position? What I am trying to do is shrinkwrap a cube around a sphere using the raycast node whenever the sphere is outside the cube's boundaries. You can see in the image how it works
Problem with my geonodes setup is that the cube isn't shrinkwrapping around the sphere, just projecting the vertex onto the backside of the sphere. How can I make it shrinkwrap around the sphere? I tried using the positions of other objects but that didn't work.
Any ideas?
Blend File

"around the sphere" will not work as long as the cube isn't placed around the sphere - because the Raycast node does what the name suggests, it casts rays. Meaning it's projecting straight lines from one geometry to the other. There is no way it is gonna bend around the sphere and project anything on the opposite side...

Is there a workaround for this? Like using another objects raycast to say where to raycast to? Or another method? Thank you


text:
Blender Geonodes - How to unparent geonodes particles from object so they aren't affected by the spawning object's movement?
How to unparent geonodes particles from object so they aren't affected by the spawning object's movement? I have included a video to demonstrate my problem:

And a picture with my geonodes:

Instead of the particles movement being attached to the parent object that spawned them, I'd like them to be independent of the object's movement, if that makes sense.

the easy solution is use a "wrapper" object that doesn't move and use an object info set to reletive to bring that object in as reletive to the world origin (really the wrapper's origin).

@shmuel That worked well! Thank you!

As Shmuel answered, you need to leave the object that has the geonodes at the world center or static, and then use a Object info node to add an object 'spawner' that can move around set to relative.

yeah that is the simple solution. you could also use the object info node (and self object) to cancel transforms, but that isn't as simple to do.


text:
Blender 2.8 only renders the first frame of an animation
When I render an animation -a simple camera movement over the objects-, Blender 2.8 only renders the first frame continously. Problem repeates in Eevee and also in Cycles. I have checked the parameters and everything appears to be fine. It is getting me crazy.
pg

Update: I am able to render by typing value '2' in the step when I define the frame start and end.

Alright, I had this issue too until a few minutes ago, now it got sorted. What worked for me is changing the composoting nodes. Basically making sure that everything ends up in the "composite" node and not just the "viewer" node.
A safer way I found is once I know how I want the result with the "viewer" node, just get rid of it and point the nodes to "composite"
I hope it helps.


text:
Blender 2.8 create mesh via script
I need to create a mesh by reading a custom file format.
I have a list of vertices, faces and uvs.
So far I am able to create a mesh with vertices and faces with the following script:
import bpy
import bmesh

# verts = [...]
# uvs = [...]
# faces = [...]

mesh_data = bpy.data.meshes.new("cube_mesh_data")
mesh_data.from_pydata(verts, [], faces)
mesh_data.update()

obj = bpy.data.objects.new("My_Object", mesh_data)

scene = bpy.context.scene
scene.collection.objects.link(obj)
obj.select_set(state=True)

However, I cannot find a way to assign the UV array to the vertices. UV is a list of pair of floats with the same length as verts.
I have looked online but couldn't find any solution.
Any tips or resources I could read?
Thank you very much!

UV coordinates are generally per face/vertex (not only per vertex as a 3D vertex could be used several times in the UV map). Could you describe a bit more the input data?

You're right, however in this case each vertex is used exactly once. The input data is an xml that is parsed to a list of vertices (list of tuples of 3 floats each), a list of uvs (list of pairs of 2 floats each with same size as the vertices) and a list of faces (tuples of 3 int each)

OK, so I imagine that 3D vertices are eventually doubled in your case. Anyway, you can set uv coordinates to "o.data.uv_layers['UVMap'].data[x].uv" where "x" is given inside "o.data.polygons[p].loop_indices".


text:
No playback buttons when animating in Graph Editor or Dope Sheet
The small playback buttons when viewing "Timeline" vanish when in the Graph Editor or the Dope Sheet.  Is there a way (other than hotkeys) to bring that little strip of buttons back.  There is room for them.

you mean the Play button? No it is not available in the Dopesheet or Graph Editor, you need to press the spacebar, but maybe Timeline and Dopesheet windows will be merged in the futur?

I have spacebar set for menu.  I know I can use hotkeys but I think that playback buttons should be available in these views considering they still show the timeline. I was hoping it would be a switch or a toggle somewhere, maybe even some python script could do it, not sure.

with ctrl tab you can switch from timeline to graph editor or from dopesheet to graph editor. I remember the merging of dopesheet and timeline was discussed, I don't know what has been decided, it would make sense

Ctrl+Tab is useful, thanks.I noticed that the "animation" tab creates a miniature timeline view at the bottom of the screen to get around this issue too so I think they at least know about this UI oddity.

Just add timeline window at the bottom (Not to view it).
Then drag it down (minimize vertically by dragging it).
In this way Timeline will be hidden, but the top bar will be visible and the playback buttons too.


text:
Force Field/Rigid Body Rotation
I'm trying to sort of float objects towards the camera and have them drift rotate. I have set up a force field and a turbulent force but they only seem to be effecting the position of the objects and not rotation.
I've attached some screenshots of the setup, any help would be greatly appreciated as I'd love to play around with forces a lot more, but can only seem to find tutorials related to particles!
Thanks

Ok, so if i let the simulation run a bit longer the do eventually start rotating. I guess the new question is how to control the rotation to happen as soon as they start moving and how to constrain the direction to 'towards the camera'?


text:
How to Export Into Movie - Ragdoll Scene (Falling Maniquin)
I'm trying to figure out how to export into a movie a scene wherein a manequin falls into the ground. I can preview the animation thru BLENDER GAME engine but I have no clue how to export the movie as a scene itself.
Thanks

it sounds like you just need to render the animation with a transparent back ground and then overlay the result on top of your existing movie.

I'm sorry, I don't understand. I can play the animation thru BLENDER GAME ENGINE but I cannot find any way of exporting that into a movie ?

I am interpreting our use of "Movie" to mean a video already in existence, most likely outside of blender. "Scene" to mean a blender scene, each blender file can have multiple scenes. "Maniquin/Ragdoll" to mean a physics based mesh/rig in Blender. The bit that is confusing me is the Blender Game Engine. Does the physics simulation work outside the game engine? Why are you using the game engine? The built in physics simulator should handle everything you need if you are not constructing a interactive game.

Hi, I'm trying to recreate what was created in this tutorial
https://www.youtube.com/watch?v=vOEO1qLszCw
and it uses the BLENDER RENDER engine to create the effect of RAGDOLLING. Now back to my question, how do I export the animation as a movie from this BLENDER ENGINE and not the CYCLES RENDER?

relevant https://blender.stackexchange.com/questions/48976/export-video-from-game-engine-scene there were also some notes about using a screen capture program to record the whole screen, but the link is dead.

yes, i used a SCREEN CAPTURE app to get the vid because I have no clue how to export the animation in BLENDER ENGINE

i still can't find a solution to this.....or is what I think not possible at all?

I think the point is it is not designed to be recorded. Can you rethink your approach to not use the Game engine?


text:
Mesh Ventilation Grill?
How do you proerply model a MESH TYPE VENTILATION GRILL for a PC? In the photo, this diamond shape object is actually a MESH GRILL from COOLERMASTER MASTERBOX K500L chassis.
I've tried using a PNG file I created in illustration as texture with alpha but it just doesn't look right to me. (no BUMPS, and SHDAOWS)
I'm thinking of manually doing BOOLEAN DIFFERENCE to the surface but I know that's just stupid.
Anybody else have done this before?

Possible duplicate of How can I make a hexagonal grill?

"Anybody else have done this before?"  Yes, many times, see https://blender.stackexchange.com/questions/58811/how-to-create-a-circular-shaped-grid-similar-to-a-manhole-cover and https://blender.stackexchange.com/questions/39460/how-can-a-evenly-spaced-grid-with-a-circular-boundary-be-modeled and https://blender.stackexchange.com/questions/40997/how-can-i-make-a-hexagonal-grill and https://blender.stackexchange.com/questions/3212/how-can-i-create-a-hollow-sphere-with-regularly-spaced-holes/ and https://blender.stackexchange.com/questions/109185/texture-with-a-grid-of-points-with-python

"Stay away from booleans" → Why? It's completely fine to use booleans, they are powerful tools among others. They might not be the best way to go in this particular case, but surely not a "no go".  "Only a Sith deals in absolutes".

Booleans are well known for producing bad topology, causing artifacts and failing often for many common cases. Searching this site should show you how often. Modelling it with proper topology from the start will teach you valuable skills and avoid certain grief down the road

thank you for the response guys. appreciate it!!


text:
Propeller Fan - Array Modifier
Can the ARRAY MODIFIER make a mesh multiply along a side of a round object? Instead of it duplicating vertically or horizontally?

In your modifier you can simply un-tick constant offset and relative offset, use object offset instead, and target an empty at your axis point and rotate the empty to set your increments. You will need to offset you blade from its origin in edit mode to create space for the motor but sure both objects share same origin location.
Another method I prefer is to use duplication.
Create a circle primitive the size of the motor, give it 7 vertices, under the duplication tab in its object properties select verts and tick rotation, parent your blade to the new object and make sure it has the same origin, align it to Y axis. Hit ctrl+shift+A to 'make duplicates real' and you can delete your original blade.

so i followed your first tip, but somehow, it changes the geometry of the object.

I'm not sure sure what you mean by it changing the geometry, how so?


text:
Appending Objects Including Keyframes?
Can you append an object, specifically 3 cameras together with their keyframes?
I have an old blend file that already has the camera movements that I want to replicate in a new blend file.
Is this even possible?
Thanks

Sure, just append the Cameras to the new file (Shift F1). They will bring their associated actions with them by default. If the keyframes aren't ported for some reason, just append the specific actions of the cameras and link them.

thanks @Leander
I was wondering because I tried it yesterday using 2.8 beta but it never worked. maybe with the new build?


text:
Scaling Question On Blender 2.79b
I just started learning Blender yesterday and I'm stuck in scaling. I was trying to recreate a tutorial by Blender Guru creating this coffee mug but early part i cannot do what he is doing.
While trying to scale the bottom of the cup, mine will constrain but Blender Guru's on scale sideways and do not constrain.
I'm finding it hard to expalin here so I put together a side-by-side video of my attempt and the original tutorial.
In this video, LEFT SIDE is my attemp and the RIGHT SIDE is Blender Guru
https://youtu.be/ATWzqG_Kf_k

https://blender.stackexchange.com/questions/33553/change-pivot-point-for-selected-edges and https://blender.stackexchange.com/questions/15150/cant-scale-two-edge-loops-around-the-x-axis/ Related https://blender.stackexchange.com/questions/92606/how-to-rotate-all-objects-along-their-local-z/

Like Duarte posted in the comments it seems that your pivot point is off.In the video you posted it seems that your pivot point is set to 3D Cursor.
You can set your pivot point in the view port menu. In the tutorial you are doing the pivot point is set to Median Point.

Hello there, you solved my problem. I didn't know how it got there but YES, thank you sir :)

If his answer helped you Zamboolah, please select it and give him some points, it will display your question as answered to other users as well.


text:
Default Menu is Gone
I sometimes would get files from my workmate somewhere and everytime I open his files, I notice that the TABS are arranged differently. I'm more accustomed to the default when you open BLENDER for the first time.
Wherein the tabs are arranged from LAYOUT, MODELING, SCULPTING ....... SCRIPTING
His file however looks unfamiliar, starts with 3D VIEW, Animation, Compositing etc..
Is there anyway to reset all these back to normal?

Turn off Load UI when importing his file. This can be done in the import dialog.

To prevent UI modifications by foreign blend files in general, open the preferences, navigate to Save & Load, and untick Load UI

thank you @Tiles


text:
Modeling A Head
I'm modeling a male head and I kinda fell into a bad situation wherein I mistakenly created unnecessary bumps in the surface. Is there a faster way to smoothen it to SKULL FACE without picking the VERTICES ONE BY ONE? thank you!

Firstly - I am kinda confused about what you are asking here. Secondly - Sculpt Mode?

you could try selecting the part you don't like, W > Smooth, and play with the values on the bottom of the Tools panel on the left of the 3D view

I guess there are several ways to do it, here are some:
1 - Switch to Sculpt mode and use the Smooth brush.
2 - In Edit mode, select the faces and press W > Smooth, then play with the values on the bottom of the Tools panel.
3 - Select all the vertices and flatten then on the X or Y axis (depending on the orientation) with SX0 or SXX0. To create your own axis, select at least 3 vertices and press ctrlaltspacebar, you'll see the new axis in the Transform Orientation dropdown menu, keep it selected, select all the faces you want to flatten and Saxisaxis0

thank you very much :) that helped - sculpting


text:
Is Blender 2.79 Obsolete now?
I was excited about Blender 2.8 but was disappointed at the same time because I had to relearn the software. It seem everything is out of place.
Is 2.79 no longer an option? I mean, is it a bad investment to spend time in 2.79 now that 2.8beta is out? The process of relearning the UI is just frustrating for me. :(

I think the big changes with 2.8 are the UI, the  Collections, Grease Pencil and Eevee. But all the basics of modeling, rigging, animating, etc... stay the same, so the time you spend on 2.79 won't be lost. Plus I guess there are still some bugs with 2.8 (?)

If learning UI and getting it into your memory is not your strong suit maybe you should start sooner so you have enough time to adapt so you can jump right into 2.8 when it is released. Maybe 2.8 does not have any new features you want, but in future I am sure it will, so you will switch anyways. You might as well do it now when you are younger and your brain learns faster.

Everything in 2.79 is essentially still available in 2.8 and more. Technically 2.8 is still in the open testing phase, but I would recommend learning it now. It doesn't take as long as one may think to figure out where everything is, and I think it's stable enough to replace 2.79. That being said, there's no shame in sticking to 2.79 for now.

This question was marked as opinion based, however I believe it can have a definite answer that is not an opinion:
No, Blender 2.79 is not obsolete now. In fact it is the current version until 2.80 is released, that has not happened yet at the time I am writing this.
In addition to that it is a fact, that version 2.79 is planned to be made available for download in the future when 2.80 is released like every other previous version same as these here and it is also going to remain free for downloading so there will definitely be nothing stopping anyone from using it in the future.
Those are the facts. Now in regard to your frustration when learning new things I can only say that it is natural. Learning requires some struggling and it can be a slight shock when one is used to working smoothly. I would not worry about it and carry on learning despite the occasional frustration keeping in mind that is a natural process and only means you are learning and getting better. It is very reasonable to assume that the frustration will most likely disappear with time as your skills of using the new features improve and you will be able to enjoy it again once you get used to it.

That depends on a few things:

if your hardware and system meet the requirements: https://www.blender.org/download/requirements
the actual use. If you are into 2D animations, choose 2.8x for the Grease Pencil that now is a proper animation tool
if you feel you are ready to make another step
if Blender is your job or fun (great if it's both)

In fact only dated software, eg. Blender 2.3x/2.4x may be obsolete as it's hardware that it goes way faster with.
So, 2.79 is by no means obsolete. You there in the West have been trained to thrash things even before you get new ones. You go so fast one day you smash your head and won't even notice it.


text:
Is it possible to use geonodes output attribute in a different geometry nodes?
Is it possible to use geonodes output attribute in a different geometry nodes?
For example, I want to use a certain index position value from a cube in a different geometry nodes applied to an sphere. Or any other way to do this?
Thanks!
Miguel

interesting q: I cannot use "Copy as new driver" on a geo output attribute, and if I create driver on a geo input, and use the object data path to a geo output, it doesn't seem to get the updated value.

You can sample the relevant information from another Geometry Nodes setup by bringing that object in via an Object Info node. You could inquire for the data directly, for instance like this:

The monkey has a simple GN setup which moves it on the X axis every second (bottom left). The Sphere has its own setup (on the right) which asks for the Position of the vertex #301 of the monkey, and moves the sphere there. Only the monkey is animated, but since that animation changes the Position continuously, the sphere moves with it.
Hard to imagine all possible scenarios without a tangible example, but if a stable geometry element (like our Vertex #301 here) to sample is not available somehow, a more generalized method could be to capture the relevant value with a Store Named Attribute node, and then sampling that:

Here, I'm storing a Vector value ($[2,2,2]$) on the vertices of the monkey with the name "transfer", then sampling specifically that Named Attribute to move the sphere. Since I captured the value on all points of the monkey, which Index number we're sampling here doesn't matter.


text:
More than 3 hours baking texture?
I'm trying to bake the earth's interior procedural texture, but it says more than 3 hours remaining time.
I'm baking it to a 4k image.
Bake Type -> Diffuse
Contributions -> Only color

Does someone know why?

maybe the sampling is very high?

thank you... yeah I decreased the samples to 20 and now it bakes it in a few seconds but I get a black image

Flip faces is not the problem, lighting shouldn't be a problem as I'm not baking direct and indirect lighting, no intersecting objects... What could I be doing wrong?

Since you have plugged in the Mix node directly into the Material's output slot which makes Blender use an Emission node internally, I would use the Bake Type Emit with 128 samples (or so). This bakes fine for me.

You need to create the same Image Texture in both the 2 materials of your object and keep them selected in order to bake these materials. Also you need to have a shader before the Output in your material called concentric circles. The length of the bake operation will next depend on the size of your Image Texture and on the Render Max Samples. It's pretty fast with a 1024 px image in my case (of course if it's 4096 it will be 16 times longer).

Result:


text:
Capture Certain Vertex Position
How could I capture a certain vertex position in geometry nodes?
For example, the vector position for default cube index=2 vertex.
Thank you very much!
Miguel

I think the best way to do it is with "Field at Index" node:

User Quellenform explains:
This is not necessarily "the best" way...it depends on whether you are querying the attributes within an object, or from another object. In the second case you would use Transfer Attribute (Blender <3.4) or Sample Index (Blender 3.4+).

This is not necessarily "the best" way...it depends on whether you are querying the attributes within an object, or from another object. In the second case you would use Transfer Attribute (Blender <3.4) or Sample Index (Blender 3.4+).

Thank you, Quellenform.  I would need to use it in a different independet object's geometry node. In this case, the "Sphere" object.


text:
Geonodes - ALL Boolean Intersecting edges
How could I select ALL the intersecting edges when I'm doing a boolean difference?
So how could I add the bottom edges to the selection?

'Intersecting Edges' are the new geometry generated at the intersection of surfaces (not volumes).By that definition, you do have all the intersecting edges. If you mean all geometry in the cutter, would this do?

Thank you very much, this is exactly what I need.


text:
Displacement is different from object to render mode
I have a slight problem that never showed on blender2.7. And I'm brand new on Blender 2.9.
When in object mode, my cube touches the surface with a displacement modifier but in render mode and when I render this cube hovers over the surface.
Why is the plane suddenly sinking? And how can I bring it back to level Z0?
Thanks in advance for tips!

Do you have a displacement on the plane shader too ?

Indeed I had one, so dumb I didn't realize it could alterate  that much... ^^' I changed it and it's back to normal. Thanks for the advice!


text:
Imported textures from OBJ/MTL not applying to model correctly
I'm working on re-exporting an existing model to a game and everything imports from the OBJ/MTL files correctly except for 2 materials (textures?).

Here is the photo of the model, all the mapping seems to be correct except for the eyes as they are completely white.

I took a look into the imported TGA and the eyes are in the file.

Looking at the texture previews in blender shows the eye texture as this.

The same exact thing happens with the horseshoes, they are also in the same TGA file as the eyes.
I'm pretty new to Blender and cannot wrap my head around what to even search to figure out how to map these correctly.

The eyeSG texture looks like it might be intended to be used a something of a "refractive glass ball". Is it possible that the other eye texture is meant to line the eye socket, and then have a glass sphere (almost as an eyeball) refract it outwards?

@ChristopherBennett I think you may be correct, when I select the vertices attached to that texture it selects the outer sphere of the eye, but when I select the vertices of the main texture it selects the whole eye (both inside and out). If this is the case is there a way to manipulate the phong2SG texture to make it work?

There probably is, but I'm afraid I'm not sure how to work with it.  I think it's largely dependent on the (intended) geometry of the object (among other things), but the way to implement it is probably unique to that mesh. You might be on to something though - What if the whole eye (both islands) are supposed to represent 2 unevenly-sized sides of the same sphere (the smaller circle is like cutting the "top" off an egg)?


text:
how to transfer rig from one model to another?
I have a rig on a model thats skinned, and I have another model not similar that I wanted to take that rig and transfer from the skinned model and connect it to the unskinned model.
As does Script AutoBiped (Remplace Mixiamo Rig with Biped Rig)
How can I do that automatically, any script or method to do this?

There is no way to do it automatically in vanilla blender, not that I know of. I recommend copying and pasting it, then parenting the mesh to the rig. That's not too long to do and you don't have to search for any scripts

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
There is nothing in header!

I've already deleted and redownloaded it for more than 10 times, but everytime my UI is like this! I could not find any solution from Google. I need 2.70 ver.! I tried to download 2.79 ver instead of that, but it dosen't have anything in header like this too!

Could you tell us what operating system you are using? and perhaps check for strange characters in any of the directory paths involved (which depend on the OS...)

Apart from what reported here in this case Blender UI isn't fully drawn (no buttons, dropdowns, lists etc) which seems to be related to the same as here https://blender.stackexchange.com/questions/19582/text-wont-appear-in-interface - graphic drivers problem of some kind.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Animation interface doubts
I am an animator new to the blender and I have some queries.

Can any one tell me how to move keys in time slider?
How to change from real time speed to Play every frame like maya?
How to key directly without getting insert key frame popup menu while pressing i, like Maya shortcut S?


text:
How can I expand the borders of a exture edge outwards like an offset?

I want to make my own leaf textures for trees, but if I just make a PNG with transparent background it gets a weird white edge. I found that usually they use this effect with an alpha mask to get rid of that issue.
I found the name of the technique is called "Edge Padding" or even "Edge dilate". It creates an offset of the border of the image and expands the pixels outwards creating a "frame" around it.

There is a compositing node called Inpaint that does exactly that:

It can be found in the Compositing Nodes add menu Shift+A in the Filter section:

Nice find, wasn't aware of this. +1 for making it in Blender

An alternative technique using modelling tools
Import you leaf image as a plane using File > Import > Image as Plane (activate the addon in the User Preferences if necessary.
Enter Edit Mode in the imported plane and use the Knife Project tool (K).
Trace over the border of your image with as much detail as desired, making sure you always tread slightly inwards in relation to the alpha edge so the cut is always over the opaque part of the image. (Illustrated below is a quick and dirty, you can follow the image detail more closely)

Once done, eliminate the surrounding leftover faces so only the leaf remains.
Select all border edges and extrude them in place with E then immediately Right Click to cancel. Proceed by scaling them up as desired.

Is there a way in blender to quickly overlay the original back onto the result above?

You could probably do the above operation either in a separate object, or duplicate the original plane in edit mode, then overlay it afterwards my moving slightly in Z axis. You would have to somehow bake or screencapture the result though

Could not really find an elegant solution for this.
In the particular case of a single leaf, or images with simple island shapes you could achieve a vaguely equivalent effect using GIMP's Recursive Transform.

Open the desired image with an alpha channel in GIMP, increase the size of the layer with Layer > Boundary Size as desired, so there is actual usable image space around the leaf layer.
Open Filters > Map > Recursive Transform use the on-canvas gizmos to very slightly scale the image up. The smaller the factor the smoother the expansion, at the expense of having to repete the process to fill the available space.
Tick the option Paste Below so new iterations don't overlap the original leaf, and adjust the iterations as necessary. Repeat the filter with Ctrl + F if necessary to fill available space.


text:
Using TinyCAD XALL feature while keeping faces and their assigned materials
Imgur album with the pictures I will use to show you the problem: https://i.sstatic.net/YaEId.jpg
So, I have many cases like this:

Here I moved the left vertex to show you that the "green" upper edge is not the same of the "red" edge:

When I use TinyCAD add-on XALL feature to add vertices to all the edges which intersect with other edges, the faces which were supported by those edges get deleted:

Then I use Remove Doubles and press F to remake the deleted faces:

But, as you can see, the materials applied to those faces are of course different from the original ones. I could re-assign all the materials but that would require a lot of work since I have many of these cases.
Is there a way to use TinyCAD XALL feature while keeping faces and their assigned materials?

Materials are specifically assigned to faces and faces only, edges can't hold any information about material slots.
If all faces are removed and no renderable geometry is left behind then all material slot assignments will invariably be lost, there is no way to recover material information from edges alone.
This is not a problem specific of TinyCAD or any other addon for that mater, it is just intrinsic to how the data structures work in Blender.
As far as I know there is really no way around this.
You may alternatively try with varying degrees of success using Edit Mode Boolean operations to try and find intersections without loosing the faces; or use tiny cad on a duplicated copy of those edges instead of the original ones attached to faces.

So I guess one way could be creating a script similar to XALL feature in which holes will be filled with faces, and materials will be assigned basing on the previous faces materials on that same location(possibly using a distance threshold)

That would be a possibility. I'm no coder but I am assuming that retrieving face positions and relating them to random newly created ones would not be a trivial task at all, you can't easily guarantee any type of direct correlation. It would probably be a lot easier to make said script copy edges before calculating intersections, at the expense of cleaning up duplicated geometry


text:
Animation Key Frame Summary - Change editor text color
The screen capture shows the area I am trying to change.
Currently the text color is light grey, which I can barely see.
I am using Auto Rig Pro which looks to be changing the background colors, though I do not see where to change the text color. Not sure if that part helps.

I looked at Preferences > Themes
I was not able to find anything that would change the above IK title color.

If anyone can point out where it is I would be grateful.

It's a long time since I changed mine but I think you'll find that setting in Preferences > Themes > Dope Sheet. Scroll down to 'Theme Space List', click the down arrow, and the setting should be under 'Source List Text'. If not, it's in 'Theme Space' settings above that section. Have a play with the colors (making a note of the current setting) and see what's changing in the interface.

That was it, thank you!  -- I would have up-voted but my account is new...

Good! Glad it helped!


text:
My objects will not move, only "orange" cursor moves when I try movement by the axis
I wanted to know if anyone could help me with this problem. I only can move the little "orange ball", not my object. in the workspace settings  I selected the "affect only" and checked all three boxes and its seems to move the "orange ball" and object in the opposite direction of each other. The 3d cursor stays put. Is there some setting I missed?

Well... yeah... you selected affect only origins so now it affects only the origin. Just untick the box and you can move your mesh normally. The orange circle is the origin of the object, the point which everything rotates around and which symmetry modifiers like mirror use as their origin point.

nvm that didn't solve the issue.  when I open blender under the default settings, If try to move a  object. only the orange gizmo moves, the object stays put


text:
Proximity to object scale - Geometry nodes
I want to scale different single objects based on their distances to a cube / null.
I can't figure it out why the "Geometry Proximity" node fails. I've tried to connect it to the scale value in many different ways but as soon as I connect the "Distance"  output to anywhere, it gives me the red line in front of the Scale property. Can anyone help me find the cause?

You're trying to connect a blue diamond to a blue circle. GeoNodes added these extra socket types as they were needed, and it means you need to be extra careful. Unfortunately, I'm not sure what node you need but it's likely that you'll be able to feed your current arrangement through it.

I'm not sure exactly what you need, but try something like this. It uses the location of Cube.001 to control the scale of the base Cube (based on their proximity - father away = larger scale). I added a math node, just to make it more clear what's happening (otherwise the cubes looked "attached" together). Let me know if this is in the right direction:

This second image is the same setup, but with the movement/scale effect restricted to one axis, like your example (in this case X):

It works with multiple objects, and works just as well with an empty. Note that the scale input is expecting a 3 value container, so you cannot "fine tune" the distance using a ColorRamp (or any other non-color manipulation), but you can use RGBCurves as it outputs 3 values - just remember that the R, G, and B channels are responsible for scaling the X, Y, and Z axes, respectively, so you can manipulate the scaling individually by axis if you want, or if you just want to keep the same (relative) proportions, only modify the Combined (C) curve:


text:
Viewport - objects disappeared in solid mode
I'm not sure what happened but at some point everything lost in the solid shading mode. The cone appears to be some residue from a camera angle that was deleted earlier.
The two image are the same, only the shading is changed to material preview.
Does anyone have a guess what went wrong?

Press AltB again to exit from View Clipping Border ("Allows you to define a clipping border to limit the 3D View display to a portion of 3D space")


text:
Selecting Visible Objects Only in Blender 2.8
I can't seem to be able to select the visible objects (in object mode) only without selecting the ones hidden behind other objects, toggling X-Ray mode doesn't make any difference.
Just create two objects one smaller than the other and place the small one behind the big one so you can't see it and use the box, circle or lasso selection tool and it will select both objects.
is there a way to use these selection tools without selecting the non visible objects?

I think this could be considered a bug.

I have  never heard of such an option in Blender. Has this worked in any version before? It's on by default in Edit Mode, but it does not extend to Object Mode, if I'm not mistaken.

I believe @Frederik is right, selection limited by visibility works only in Edit Mode. I just tested it in 2.8 and 2.79.


text:
Converting Nurbspath into Mesh breaks is breaking my Curve Modifier?
I have been watching a tutorial from BlenderGuru in 2012 on how to make an subway tunnel in blender. I need to duplicate my light source along a path.
I figured out how to duplicate and make the lights sources follow along the path -- I figured this out from another question (Duplicating light along path in blender 2.8).
I followed the answers and it says I need to convert my path into a mesh, but when I do this, it breaks the path and none of my other objects will follow it anymore.
I new to blender. Not sure if this is just a thing? Thanks anyway.

Add a blend file.

Nevermind. I've found a makeshift way to work around it. Thanks anyway.


text:
Don't know what's happening with the Smoke Effector (probably simple fix)
Probably and hopefully a simple answer; my smoke effector is just showing a block of smoke, instead of a sort of explosion which I'm making. It was working fine yesterday, but I must've messed with something. Thanks in advance.
(my screenshots aren't working for some reason so I had to take the photo with my phone. Sorry for the inconvenience)

can you show the properties set to the object working as inflow?

SOrry, it was just me being stupid.Literally just because it was set to frame 0


text:
How to append bones to a list in a branching manner
I'm looking to append bones in a specific manner. Currently I'm doing this
https://github.com/General-101/H2V-Blender-JMSv2-Exporter/blob/master/Blend2Halo2-JMSv2.py#L209
nodeslist = list(obj.data.bones)

but it's not accurate for what I need. I basically need to add all of the children of the first bone and then move on to their children and append them all before moving on to the next. Basically appending bones by their layer.

Something like this would be appended in this order with the above code
0 1 2 3 4 5
but I need the list in this order
0 1 3 5 2 4
Any ideas on how I could accomplish this?

Use recursion
import bpy

def walk_bones(bone):
    yield(bone)
    for b in bone.children:
        yield from walk_bones(b)

ob = bpy.context.object
arm = ob.data
rootbones = [b for b in arm.bones if not b.parent]

for rb in rootbones:
    for b in walk_bones(rb):
        print(b.name)

Adjusting slightly to
def walk_bones(bone, level=0, sp="  "):
    yield(f"{sp * level}{bone.name}")
    for b in bone.children:
        yield from walk_bones(b, level + 1)

Can print out the hierarchy, as an example the rigify shark meta-rig
spine
  spine.001
    spine.002
      spine.003
        spine.008
          spine.004
            spine.005
              spine.006
                spine.007
                  eye.L
                  eye.R
                  jaw.master
                    jaw
                      jaw.001
                    jaw.002.L
                      jaw.003.L
                    jaw.002.R
                      jaw.003.R
              shoulder.L
                side_fin.L
                  side_fin.L.001
              shoulder.R
                side_fin.R
                  side_fin.R.001
            top_fin
              top_fin.001
          chest_fin.Bot.L
          chest_fin.Bot.R
    mid_fin.Top
    mid_fin.Bot
  back_fin.T.Bk
    back_fin.T.001.Bk
      back_fin.T.002.Bk
  back_fin.B.Bk
    back_fin.B.001.Bk


text:
Persistent Render region will not disappear
Using blender 2.83. I might misunderstand the terminology but I think the dotted square inside my viewport is the render region? As you can see, even with the checkboxes unchecked it won't disappear.
I've searched everywhere (even found this thread How do I clear the render border?) and all I can find is CTRL + ALT + B, CTRL + B, ALT + B etc etc, to turn it off. I've even disabled it in the preferences, but I cant get rid of this region.
Any ideas what I might have missed?

could it just be the actual camera edge and you're zoomed out? what happens when you press the Home key?

Hello :). You have Use local camera checked in your viewport settings :). That's exactly what it does.

@wilks Is THAT what it is? I come from max and that camera zooms in and out with mousewheel. I pressed home and now that part is zoomed fullscreen. Confusing to say the least. Thank you

@JachymMichal unchecking will not remove the border, but thank you :)

you're welcome. you can check Lock Camera to View, it might help a bit

@wilks YES, this is what I needed. Thank you so much

Go to 'View' in your viewport (usually at the top), then hover on 'view regions' and select 'clear render region.' If it doesn't work, I'll suggest you update a different version of blender.

Thank you but sadly, this didn't work either. I think I have the newest version. So you mean rollback a version right?


text:
Move pivot to bottom or top of object/selection
Sorry if this has been asked many times but I couldnt find the answer that I was looking for.
Coming from Max I used to have scripts that would place the pivot to the left, right, top or bottom of an object by the push of a button. Now im trying to create something similar in blender python but I cant for the life of me figure out how it works.
I've searched online but the answers are all pretty confusing and most of them are written for versions earlier than 2.8.
However I found a script that should place the pivot on the bottom of an object AND doesn't throw an error. BUT actually it doesn't do anything at all either. So i'm wondering why this script won't work for me?
import bpy
context = bpy.context

for obj in context.selected_objects:
    mx = obj.matrix_world
    minz = min((mx @ v.co)[2] for v in obj.data.vertices)
    mx.translation.z -= minz

The pivot remains in the center of the object.

What do you mean by 'doesn't do anything at all'? It doesn't work, but it should move the object up... Does it not do that? How are you using it?

@batFINGER, you marked this as a duplicate of a post that has * instead of @ in the code and will not work with newer Python in 2.8x, so it does not fully answer the question. The OP mentioned specifically "I've searched online but the answers are all pretty confusing and most of them are written for versions earlier than 2.8." I think clearing the confusion here would be in order.

Disagree this time, don't see any issue for the OP. Also, you always can suggest an edit @MartynasŽiemys

Well, alright then. I will try to add another answer to the old question later then.

@MartynasŽiemys Yes, you are right, I saw it now. The object indeed moves up, but the pivot remains in the center. That is what i want to move to the bottom of the object. So again, this script is not correct.

If you need to move the origin to the bottom, you would need to move it down by the distance it is higher than the lowest point, so you could do:
import bpy
from mathutils import Vector

o = bpy.context.object
d = o.data
m = o.matrix_world

lowest = min((m @ v.co)[2] for v in d.vertices)
difference = Vector((0,0,o.location.z - lowest))
local_difference = difference @ m
for v in d.vertices:
    v.co += local_difference
m.translation -= difference

Sorry, I really don't have time at the moment, I will try to put it into an operator that loops through all selected and make a pie menu for setting origin to top, bottom and sides as well and share it here, when I have a minute, since I kind of need it for myself as well.

Thank you, I tried this script but my object disappears...


text:
Import "bpy" could not be resolved
I'm trying to edit and save a script in 'vs code' but somehow I'm getting the [Import "bpy" could not be resolved] error in the problems console below.

I tried the solution posted here: Linting Blender Python in VSCode
But adding that line to settings.json will not solve the issue. Any idea what I might be missing?

I had the same issue, installing the fake bpy module helped me.
https://pypi.org/project/fake-bpy-module-2.80/

Uninstall Blender Dev

Uninstall Python

Reinstall Python

Reinstall Blender Dev


text:
Registering panel error (Trying to run old script in 2.93)
I've downloaded a script for blender 2.8 that im trying to get to work in Blender 2.9.3 but it gives the following error:
Traceback (most recent call last):
  File "\monkeyrobot.py", line 64, in <module>
  File "\monkeyrobot.py", line 57, in register
NameError: name 'MonkeyRobotPanel' is not defined
Error: Python script failed, check the message in the system console

I'm still beginner at blenderscript so how much I look at the script I have no idea what is wrong. Any suggestions how I can find what is wrong? I assume something with bl_idname?
import bpy

def main(context):
    #body
    bpy.ops.mesh.primitive_cube_add()
    bpy.ops.transform.resize(value=(1.2, 0.8, 1.5))

    #head
    bpy.ops.mesh.primitive_monkey_add()
    bpy.ops.transform.translate(value=(0, -0.3, 2))

    #arms
    bpy.ops.mesh.primitive_cylinder_add()
    bpy.ops.transform.translate(value=(2, 0, 0))
    bpy.ops.transform.resize(value=(0.5, 0.5, 1.5))
    bpy.ops.transform.rotate(value=-0.523599, axis=(0, 1, 0))
    bpy.ops.mesh.primitive_cylinder_add()
    bpy.ops.transform.translate(value=(-2, 0, 0))
    bpy.ops.transform.resize(value=(0.5, 0.5, 1.5))
    bpy.ops.transform.rotate(value=0.523599, axis=(0, 1, 0))

    #legs
    bpy.ops.mesh.primitive_cylinder_add()
    bpy.ops.transform.translate(value=(0.7, 0, -3.5))
    bpy.ops.transform.resize(value=(0.5, 0.5, 2))
    bpy.ops.object.duplicate_move(TRANSFORM_OT_translate={"value":(-1.4, 0, 0)})

class MonkeyRobot(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "myops.add_monkeyrobot"
    bl_label = "Add Monkey Robot"

    def execute(self, context):
        main(context)
        return {'FINISHED'}

class MonkeyRobotPanel(bpy.types.Panel):
    """Creates a Panel in the Tool Shelf"""
    bl_label = "Monkey Robot Panel"
    bl_idname = "OBJECT_PT_monkey"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_category = "My Tab"

    def draw(self, context):
        layout = self.layout

        row = layout.row()
        row.operator("myops.add_monkeyrobot")

def register():
    bpy.utils.register_class(MonkeyRobot)
    bpy.utils.register_class(MonkeyRobotPanel)

def unregister():
    bpy.utils.unregister_class(MonkeyRobot)
    bpy.utils.unregister_class(MonkeyRobotPanel)

if __name__ == "__main__":
    register()

    # test call
    # bpy.ops.myops.add_monkeyrobot()

Don't get the error mentioned, Rather one complaining about bl_category  For 2.8+ is fixed by putting panels on the RHS "N" panel ie bl_region_type = 'UI'

@batFINGER hmm thats odd, I have changed the region_type to UI but now im getting an additional error:  ---Warning: 'view3d.origin_to_pie' does not contain 'MT' with prefix and suffix
Traceback (most recent call last):
File "\monkeyrobot.py", line 64, in
File "\monkeyrobot.py", line 57, in register
NameError: name 'MonkeyRobotPanel' is not defined
Error: Python script failed, check the message in the system console


text:
Unable to Unwrap 3D object
I imported an SVG, extruded it and now it's a 3D object, and I want to add a texture from a JPG.  I have a photo of some glasses that I'd like to recreate as a 3D model.
I followed all the instructions on Unwrapping and UV Editing, but I can't get the Unwrap menu / options to appear.
I have my object in Edit mode, I press A to select all, and when I press U, nothing happens.  I've been searching everywhere for an answer but have come up short.
I know it's a super basic thing, but it's driving me nuts!  (I'm new here).  Please help.  Thanks!

I don't really have much experience with it, but the fact is that you can't uv-unwrap curves, only meshes!

As impresso says, you need to convert your curve to mesh: Select your object in Object mode and go into the Object menu > Convert to > Mesh from Curve.

Thanks you @impresso and moonboots !  Worked perfectly once I converted to a mesh :)


text:
How do I export hair as a 3D object?
I'm trying to make a 3D model of some hair.  I started with a basic head that I downloaded, and then I selected the section of the scalp that I wanted the hair to grow on, and separated it from the rest of the head.
Then I created the hair using particles.  Then I selected it and exported as an Object file.  But when I import it, it's just the surface of the scalp with no hair (3rd screenshot)
How can I export the particles as well?
I'm still very new to Blender, so I'm watching a TON of tutorials.  In this case I feel like i'm missing something simple.
Thanks.  I hope all is well.
Dustin

obj do not support particle, why do you want to export your model? Game develop? Web 3D object? Particles usually strongly tighten with its own rendering and building system

I'm just making an instagram story filter for a friend... and I'm using this as a way to learn Blender.
Is there any other way for me to export and have the hair included?

You may need to convert the particle system to a mesh. IE Apply the particle system.

@Dontwalk when I do that it creates around 7 million vertices.. haha... so I've tried to use the Decimate modifier, to lower the number of polygons, but the modifier is only applied to the scalp that the hair has grown on, and not the actual hair.  Not sure what I'm doing wrong...

I have the same issue and I think it is impossible for now. I hope blender update it in future. the other option for making hairs is Zbrush


text:
I would like to apply high mesh details such as wrinkles and pores. Should I apply to the base sculpt or to a lower poly retopology?

If I'm to apply to a low poly, do I need to use the multiresolution modifier?

Have you considered baking a normal map so that you can keep your second object low-poly?

Yeah, that's what I was thinking. But I was following some tutorials, and people used to do a low poly, then more sculpt in the low poly, using a multiresolution modifier, and then baking the normals to use on another low poly mesh. Kind of confusing

Yes, multires is very convenient to sculpt, and once you've finished you bake the result and you don't need the mutlires any more

watch this video: https://www.youtube.com/watch?v=_0FwsMkWm0k

Understood! Thanks man!

You could duplicate your object, sculpt on the copy with Dyntopo, then bake the result on the original object.
Another method is to use the Multiresolution modifier then bake the result on the same object as explained here by PIXXO 3D. It works fine with 2.79, not with my version of 2.8 but it may have improved since.

Subdivide your object a bit. Shade Smooth it. Unwrap it (Smart UV Project for example).

Give it a Multiresolution modifier, click Subdivide 2 or 3 times, sculpt the object.

Create a blank picture, prepare your node setup, make sure that the Image Texture is set to Non-Color Data.

Bake the normals.

Deactivate the Multires modifier. Check the result.

Thanks! I'm going with the mutiresolution method. Saw a tutorial by Grant Abbit, in which he also follow this process


text:
Make grey background while using HDRI for renders
I just want to ask if anyone knows how to make background grey while using HDRI so it would be the same as in Substanse painter "Environment Opacity slider" or basically the same as in Material Preview Mode in Blender?
Is it possible to make it without options that listed below?:

Not a transparent background and then add grey background picture in photoshop;

Not a heavily blurred background (I found this option here but it still has colors);

Without adding a grey plane at the back while rendering

Just pure grey

https://blender.stackexchange.com/questions/178080/can-i-use-an-hdri-for-reflections-only-and-not-have-its-light-affect-the-scene

Does this answer your question? Can I use an HDRI for reflections only, and not have its light affect the scene?

Thank you for the answer but I just did a quick test and it looks great but not exactly what I'm looking for :(
It adds some white background but image with this setups looks different than with just HDRI
Don't know how to submit picture in comments but it look like this: https://i.ibb.co/wNHyrJL/Test.png
1- with just HDRI
2 - same HDRI but with light rays added

So you want Hdri lighting and reflections but leaving the background as completely grey?

The best way is to use film->transparent.
Now go into compositing section and click on use node.
Add an alpha over node before output node and chose your desired color.
This way,the render will use the HDRI and then make background as chosen in the apha over node.
Also,if your entire render comes as single color,try switching the color inputs of alpha over node

Connect it by using 2 Background shader nodes - one connected to the image texture, and the other with just your grey color - and then connect them with a Mix Shader using the Is Camera Ray output of a Light Path node as a mix factor.

Thanks a million!! That's what I was looking for


text:
Multiple checkboxes
I'm trying to create a simple checklist with multiple (over 30) checkboxes that can each be checked separately. My checkboxes are currently connected to only one BoolProperty which means I check one and they all get checked. Is creating a new boolproperty the only way to check them separately? If so that means with over 30 checkboxes my script is gonna be quite long. Is there an easier or shorter way to do this?
import bpy
from bpy.props import BoolProperty

# add your custom property to the Scene type
bpy.types.Scene.my_prop = BoolProperty(
    name="Prop name",
        description="Checkbox fanatic",
        default = False) #sets checkbox state to true or false

class CBMENU_PT_main_panel(bpy.types.Panel):
    bl_label = "Checklist" #name of the menu top
    bl_idname = "CBMENU_PT_main_panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "CheckList" #name of the tab menu

    @classmethod
    def poll(self, context):
        return True

    def draw(self, context):
        layout = self.layout
        sce = context.scene
        # draw the checkbox (implied from property type = bool)
        layout.prop(sce, "my_prop", text="Checkbox1")
        layout.prop(sce, "my_prop", text="Checkbox2")
        layout.prop(sce, "my_prop", text="Checkbox3")

classes = [CBMENU_PT_main_panel
]

def register():
    for cls in classes:
        bpy.utils.register_class(cls)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)

if __name__ == "__main__":
    register()

You need a separate property for each Boolean value.

thank you, I've done it like that now.

The easiest way should be to use a BoolVectorProperty addressed via index
import bpy
from bpy.props import BoolVectorProperty   ## changed

# MJF: Use a list to store the names you want to give each checkbox
checkbox_names = [ "Hi", "I", "am", "a", "checkbox"]

# add your custom property to the Scene type
checkboxes = 5   ## new
bpy.types.Scene.my_prop = BoolVectorProperty(   ## changed
        name="Prop name",
        description="Checkbox fanatic",
        size = checkboxes,   ## new
        default = (False,) * checkboxes)    ## changed    #sets checkbox state to true or false

class CBMENU_PT_main_panel(bpy.types.Panel):
    bl_label = "Checklist" #name of the menu top
    bl_idname = "CBMENU_PT_main_panel"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "CheckList" #name of the tab menu

    @classmethod
    def poll(self, context):
        return True

    def draw(self, context):
        layout = self.layout
        sce = context.scene
        # draw the checkbox (implied from property type = bool)

        for idx in range(len(bpy.context.scene.my_prop[:])):       ## new
            # MJF: CHANGED to use checkbox name
            layout.prop(sce, "my_prop", index = idx , text=checkbox_names[idx])   ## changed

#        layout.prop(sce, "my_prop", text="Checkbox2")
#        layout.prop(sce, "my_prop", text="Checkbox3")

bpy.utils.register_class(CBMENU_PT_main_panel)

Oh wow, thank you this is much shorter and cleaner. I'm sorry but I forgot to say that all checkboxes will be named differently (e.g. 1. pasta, 2. pizza, 3. sushi etc etc) , how would I add an ID to each checkbox?

@JeeperCreeper I've just made two small changes to the original script that will give you the ability to use unique names for each checkbox.  Since this works for you, you should accept this answer (click the checkmark sign next to the answer).  Be aware that this will only work for up to 32 checkboxes.

Apologies, new years holidays. Thank you @MartyFouts this is wonderful. Any ideas why it's limited to only 32?

No need to apologize. StackExchange takes some getting used to.  The 32 limit is because Blender uses the individual bits of an integer as the Boolean values. It can store one Boolean in one bit, and integers have 32 bits.


text:
Blender scripts not showing in Blender
Started using Blender yesterday (Blender 2.8 on windows 10 system) and created two small blender scripts.
Today I opened blender and the texteditor and I wanted to open a previously made blender script but the list is empty. As you can see from the photos, I have two scripts in the folder but even with that directory open in blender it doesn't see the scripts.
I have checked all types to be viewable.
What am I missing?

Do they have a file extension? It should be createmonkey.py and mirrorscript.py

Hero! That was it. I added .py to the filenames and now they show up. Doesn't blender automatically save them with an extension? Have to add them yourself?

@tiles how can I upvote your comment and mark this solved, thats the least i can do for you.

I have added it as an answer now so that you can vote it :)

The file needs to have the proper file extension. Files without the proper file extension gets filtered out in the dialog.
Or you need to turn off the file filter. This can be done up right in the filter settings. The better way is to name the scripts proper though, with its correct file extension. Python scripts ends with *.py

Thanks again, that answered my question. Again, I assumed typing just the filename would suffice and after pressing enter Blender would automatically add the .py part. learned something. :)


text:
Bottom of object with Geometry nodes
I'm diving into geometry nodes today and I have a problem aligning the bottom of my object to Z=0.
I've learned that to achieve this you have to add a [divide node] and [combine node]. You take the total height, then divide it by 2 and with the combine node you can select just the Z axis. The object bottom should align to Z=0 but somehow it wont and the aligning just looks off. At least it wont take half of the object height.
I've tried it both with a Mesh Primitive and without (so just the normal cube in the viewport). Any idea what I might be missing? I've looked everywhere but sadly cant find anything yet since geometry nodes is still a rather new concept in blender.

You need to use a Vector Math instead of regular Math for dividing. You can use a single node set to divide by (0, 0, 2) that will output a vector with only a 2 component. Using a scalar Math node will average the input values along each coordinate which you don't want

use this node setup: (thanks to Robin)

I think your arithmetic is upside-down: https://imgur.com/a/MVInRin

Everything else, just about :D. It only works with the default cube (or other objects, on creation)  because the origin is halfway up the mesh. Shift the defaut cube in Edit Mode, to see what I mean..

you are right - i updated my answer, thank you Robin.

Phew! I just updated that link to try to explain what I meant.. I'm not very good at expressing these things except in jumbly ways :)  I already prematurely +1'd :)

Thank you that did it.


text:
Autosmooth checkbox not being checked
I had a small autosmooth script based on this post by user @zeffii
And recently updated to blender 3.4 alpha and somehow the checkbox is not being checked when running the script. Here is the script:
import bpy
import math

selected_objects = bpy.context.selected_objects

for ob in selected_objects:
    ob.select_set(True)
    ob.data.use_auto_smooth = True
#        ob.data.use_auto_smooth = 1
    ob.data.auto_smooth_angle = math.radians(60)  # 40 degrees as radians

bpy.ops.object.shade_smooth()

"use_auto_smooth" part is not working. The checkbox is not being check but the angle is updated. Not sure if its a bug or a mistake in the code?
Also, I used to use 1 but saw that True is now the correct way. Or are both correct to use?

Hello ! As a heads-up we don't really encourage questions and answers about alpha or beta versions. Usually most of the problems are solved at the official release date either by being fixed if they come from a bug, or by being included in the release notes if they come from a breaking change in the API. In this case it's the call to bpy.ops.object.shade_smooth() that unticks the checkbox. Call it before your for loop. (It was the same in realier versions)

And using True instead of 1 is more semantically correct because the property is representing a boolean value, although I don't think there is any impact code-wise, 1 is cast to a boolean value automatically. It might have been the only way to set this property in the past.

Sorry I was wrong, the change was introduced in 3.3 which is a released version. :) Writing an answer right now

Since Blender 3.3 bpy.ops.object.shade_smooth takes use_auto_smooth as an argument. By default it is set to False, which means if you don't explicitely add the argument as True it will set data.use_auto_smooth to False.
The good thing is that it renders the for loop useless.
import bpy
import math

bpy.ops.object.shade_smooth(use_auto_smooth=True, auto_smooth_angle=math.radians(40))

Or if you don't want to rely on having to select the objects in the interface, use an Operator Override :
import bpy
import math

objects_to_smooth = [
    bpy.data.objects["Cube"],
    bpy.data.objects["Cube.001"],
    bpy.data.objects["Cube.002"],
    # etc.
]

with bpy.context.temp_override(selected_editable_objects=objects_to_smooth):
    bpy.ops.object.shade_smooth(use_auto_smooth=True, auto_smooth_angle=math.radians(40))

By the way there is now an operator to do exactly what this script does in the interface. Search for "Shade Auto Smooth".

Sorry you are right about the alpha version, ill keep that in mind next time. Thanks for the quick and detailed answer, it works perfectly. :)


text:
Can't sample grease pencil color with a hotkey
For some reason, pressing S doesn't sample grease pencil stroke color in vertex mode. I can still do it through the color wheel though. Keymaps look fine. I'm using blender 2.93.1


text:
How to add gradient between colours in object?
New to Blender but can't seem to find an answer to this.
I have an object with different colours applied to different faces of the object.
I would like to make the colour change between grey and red softer, rather than the hard change seen in the image.
Is there an easy way to do this? For example a short gradient.

There are several ways to do it, you could use an Image Texture node and paint on your object.
You can also do it procedurally with a Texture > Gradient Texture node and a Converter > ColorRamp node:


text:
Trying to make it rain donuts using particles
Im new to blender.
have created a low poly version of the blender guru's donut. I linked it to a particle system that drops down on a collision plane in an attempt to make it rain donuts on my kids.
problem is: the particles end up embedded halfway in the plane.
I tried to use size deflect but they stop midway in the air.
also, they don't behave as rigid bodies. they don't topple over and most cases just stick up sideways un-naturally.
is it even possible to make particles behave as rigid bodies?
I saw this older blender version tutorial
https://www.youtube.com/watch?v=G1ysjPeLKSQ&t=148s
which appears to do just that.
here's the blend file:
https://www.dropbox.com/sh/qofhga0gz0z2nq0/AAAno6xMNvYhfwMcKxPqWkZQa?dl=0
help would be most appreciated.
thnx

I think you should go with Rigid bodys and if there colission makes problems you can try to change the collision type to mesh and turn the samples up(under the rigid body world settings)

Ill try , thanks!

I'm not the expert, but I might be able to help...
I've had something like this, but not with doughnuts (unless that is why the cake... never mind). I would suggest some form of applying the particle system, prefferably somehow starting all the doughnuts in different positions mid-air. You may be able to randomize their positions with a script.


text:
Selected item not outlined. Rotation gizmo shown instead
Somehow I have entered it a mode where a selected item  is not outlined. Instead, the rotation trackball gizmo is shown. How can I get the outline visible again?I have ticked the box: "outline selected".
See attached screen dump. I have selected the TV and  the rotation trackball is shown.

See on the left side of the viewport, where the toolbar is?
The one highlighted in blue is your selected tool, the scaling tool. Instead, select the very top one with the picture of the mouse. That is the selection tool, and it will give you the default behavior.