text:
Shadows not reaching all the way to the ground in Eeevee
Take a look at the shadow cast by the leg on the sofa in the foreground. Even though the object is touching my shadowcaster surface, the bottom part of the leg casts no shadow.
Larger objects seem to cast shadows just fine, but table & chair legs pose a problem! Any suggestions as to how to approach this would be MUCH appreciated!
(This is some virtual staging for a real estate listing.)

have you enabled the Contact Shadows option of the light?

Hey, that did it! An option I never even knew existed, "contact shadows"! Thank you!

Enable the Shadow > Contact Shadows option of the light:

Also for the shadows quality, take a look at the Shadows in the Render panel (and increase the Sampling value):

Uploaded a new pic - much better shadows. Moved some lights around a bit, too.
I knew how to tweak for shadow quality already, just needed that nudge toward "contact shadows". Always so many details to know in Blender - I'd be lost without this forum!

yes Eevee gives headache sometimes, but I guess it's the price to pay  ;)

Yup! Now I need to fix that damn carpeting...
:)


text:
Boolean difference acts differently for different planes in the same object
I've got on object made with two walls and a floor for a virtual room, shaded as an Eeevee shadowcatcher, and have created some transparent cubes to act as window openings in the walls. So, the room has Boolean modifier running for two of the window "cutout" objects on one wall, and they work great. When I move the cutouts into the wall, holes appear! Whoo hoo!
But if I copy one of these cutout objects and move it to the adjacent wall, Boolean difference doesn't work. It looks more like union, with "exact" box checked. I've tried copying the Boolean difference modifier to make sure settings are exactly the same, and they are.
It's just that the difference modifier works on one wall and the floor, but not the adjacent wall!
Here's a pic - you can see cutouts 1 & 2 work great, cutout 3 does not.

Any ideas?
Check out the video, too.
Here's a video showing the normals of the cube. Sorry - don't know how to embed these videos!
You can see how the cube I'm trying to use as a "cutout" interacts with the various walls.

OK, solved! It was an issue of non-manifold geometry. I extruded the walls to give them some dimension, so now they have an official inside AND outside. Works now!

The normals on the mesh determine how boolean operations work flip the normals and try again.

I did this - flipped the normals back and forth, and nothing changed.

Don't use videos or external links. Use the tools from this site to add images that are displayed as part of the question. Some of us will not look at links or download files.

Gotcha. Need to figure out how to embed video!
What I did to solve this was to extrude faces to give the walls some dimension, and now my cutouts work fine on all walls.
So, it's a "non-manifold geometry" issue, I take it!

source: Stack Exchange

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

sort: votes


text:
Armature X Axis Mirroring Copy and Paste Only Affecting Same Bones
I select all of the bones of my left side arm, and I copy pose with Ctrl+C

and then select the corresponding right side bones and press Ctrl+Shift+V, but get the following result of the left bones moving:

I've also tried it with this box selected:

my file:

edit:
Since the problem was due to Mixamo's naming convention's not matching up with Blender's (Blender's L/R suffixes vs Mixamo's Left Right prefixes) Here's a workaround Mixamo Rig Blender Bone Naming Convention

Hello could you please share your file? https://blend-exchange.com/

@moonbots I added the .blend to the bottom of my post using your site

Your bones need to be correctly named, with the suffixe .R, .L, or _R, _L. Once done on a side, delete the opposite side and Armature > Symmetrize. Also apply the rotation of the object in Object mode.
Right now, as the name are not correct, you're just copying-pasting the pose from a bone to the same bone, and as the local orientation is bad, it flips the bone to the current opposite X side.

The bones were named by Mixamo after loading my mesh into their online rigger. AFAIK, they need those names in order to utilize all of the animations provided by Mixamo. Is adding L and R to the end of each bone name the only way for symmetry to work?
I'm not sure what you mean that I'm "just copying-pasting the pose from a bone to the same bone." I copied from the left arm bones, then highlighted and pasted onto the right arm bones.
Also, how is the local orientation bad? The X rotation on the armature is set to 90 by Mixamo as well. Not sure why.

Paste Pose Flipped will flip the pose. For a bone called bone.L for example (or bone_L or bone.left, etc, but not leftbone) it will flip the pose to the bone called bone.R. If Blender doesn't identify a bone that has the opposite suffixe the flipped pose will be assigned to the bone itself on the armature X axis, that's what happening right now.

Ok I see now, your response has opened up some better searches for a solve, but the Mixamo facet is another subject, so I think your answer satisfies my question. Thanks for your help with my first stack question ever haha

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


text:
Is it possible to have two different sets of normals for one mesh?
I'm working on a material for Eevee. It has two Diffuse BSDF nodes in it, called "Toon" and "Diffuse". Toon works with actual mesh normals, then I convert shader to RGB and use Color Ramp, creating typical toon shading.
"Diffuse" supposed to use smoother normals of the same mesh and then I combine them. The final result looks something like this:

Here I achieved it by using an object-space normal map baked from same mesh but slightly smoothed and with normals smoothed trough Alt+N → Smooth Vectors repeated multiple times. However because it's an object-space map, it won't work correctly with deformations. I also tried to bake tangent-space map and use it, but the result was not satisfying:

Though I am inexperienced user and I'm not excluding that I baked it wrong or I'm using it in a wrong way or perhaps what I want to do isn't possible at all. However I would like to know if there is any other way of implementing this idea.
Here's my blend file:


text:
Blender 2.90.1 - Random errors while baking actions from a rigify rig to a separate, game-ready rig
Recently I started noticing these itty bitty random errors when I bake my animations to a rig made using Game Rig Tool. Like, bone rotations and/or locations will be slightly wrong. As mentioned, this only started happening recently. Before I post more details I just wanted to ask if there's such a thing as .blend file rot? As in, .blend files accumulate more and more gunk the bigger they get and then they start to go erratic like this one seems to do?
This is starting to drive me a bit nuts so I'd really appreciate any thoughts or ideas on what might be going on.

Hey, this is CGDive :) Since this is a problem is with Game Rig Tools, feel free to send me a file I can test. I guess you could say that blend files do "accumulate gunk" in some ways but it shouldn't cause incorrect results. If it does, there is a problem that needs to be fixed.


text:
Select and join specific objects into one in python
I'm making a plugin to extract meshes from a game.
Actually, it extracts well the vertices and indicies/faces of each mesh.
Blender version: 3.2.0
Addon target: 2.80.0-3.2.0+
A "Tie" (terrain component) is a group of mesh, and as you know a mesh is a group of vertices and indices.
I want to know how I can join these meshes into ONE object, and to that for each TIE of a map.
        for tie in assetmanager.ties:
            for idx, vertex in enumerate(tie.vertices):
                meshdataname = "TieData_{0}_{1}".format(str(tie.tie.tie.tuid)[:5], idx)
                verts = list[tuple[float, float, float]]()
                faces = tie.indices[idx]
                uvs = []
                edges = []  # Ignore
                for mesh_vertex in vertex:
                    verts.append(mesh_vertex.__loctuple__())
                    uvs.append(mesh_vertex.__uvstuple__())
                meshdata = bpy.data.meshes.new(meshdataname)
                meshdata.from_pydata(verts, edges, faces)
                print(meshdata)
                obj = bpy.data.objects.new(name="Tie_{0}_{1}".format(str(tie.tie.tie.tuid)[:5], idx),
                                           object_data=bpy.data.meshes[meshdataname])
                print(obj)
                if not operator.parent_meshes_to_objects:
                    ties_collection.objects.link(obj)
                else:
                    tie_blenderobjects.append(obj)
            if operator.parent_meshes_to_objects:
                bpy.context.selected_objects = tie_blenderobjects
                bpy.ops.object.join()

Legend:

mesh_vertex.__loctuple__() -> Gives a single tuple[float, float, float], it's the postion for ONE vertex.
tie.indices -> List of lists, themselves containing a tuple[int, int, int] (it's triangles)
tie.vertices -> List of lists, themselves containing a custom class with location tuple of a vertex.

bpy.context.selected_objects looks like it is readonly, so I don't know how to select these objects...
The tie.indices and tie.vertices are in the exact same order, it means that index of mesh_vertices matches tie.indices[index_of_mesh_vertices]
And I need to know how I can make all the meshes look right into one object.
I want to proceed that way because I want to make these objects easy to use for users and I don't want to merge vertices and indices because of technical restrictions/limitations/complications.

Hello ! You can join two mesh data containers easily, you'll have to extend the first vertices location list with the second one, and extend the first face indices list with the second, but add an integer offset to the second face indices list equal to the length of the first vertices location list(=number of vertices of the first mesh). But the final result will depend on the actual input meshes, if you have overlapping mesh you may need to add a cleaning pass to remove duplicate geometry for example. If the two meshes can be connected you'll also have to merge vertices with the same location

Thank you for your answer ! I already tried, but the second mesh indices are starting from 0-1 again, how can I fix that ? I think I have a little idea, but I'm not sure
The second thing is that I want to know how to fusion several meshes data/meshes objects because in my case it's an option at the import, but I also thought to another possibility: Make groups of objects ? iirc we can move these like if they were single objects ?

You can use a separate counter defined earlier in your code like idx_offset and use it in your faces index lists with faces = [i + idx_offset for i in tie.indices[idx]] then increment it every time you finish a tie idx_offset += len(tie.vertices) Another solution though is to join your meshes after you imported them with bpy.ops.object.join(). Grouping in Blender can be done with parent objects. Parent everything to an empty for example and you'll be able to move everything when you move the empty.

Yeah, grouping is defo better, thanks !!
However, I would love to know how I can select several meshes and merge/join them into one


text:
White frames appear after rendering na animation
I have got a problem with rendering an animation (eevee). In my viewport everything works fine and the animation looks cool, but when I render it (I have tried to render as png and also as ffmpeg video) everything turns into just white frames. It is totally weird, because during rendering correct frames are appearing, but each frame turns white at the finish of rendering.
Do you know what's the reason? :)

That's how rendered frame looks

And that's my viewport

Ussually in outliner is something hidden from viewport but still enabled for render. Or ... Saved image is white or render in blender? In first case it can be something in Compositor. In the second you could accidentaly use short key to display Alpha channel in render window only? Better to post a simplified blend where issue still persist.

You're right, I accidentally disconected render layers node with composite. Thanks!

Okay, I fixed it. The reason is quite silly - my render layers node wasn't connected to composite... :)
So the solution is to check nodes in a compositor and connect everything what is important.


text:
Blender 2.8x bug
This code doesn't work at render time perhaps it's because a blender bug what do you think about, there's the same problem with animation nodes 2.1 ?
when i render an animation there no motion of the curve but in the viewport animation work and motion of the cure is present.
There's no error message in console
Configuration : blender 2.8x on Kubuntu 19.10

import bpy

def nettoi():
    for o in bpy.context.scene.objects:
        print(o.name)
        if("myCurve" in o.name):
            print("found")
            bpy.context.scene.collection.objects.unlink(o)
            bpy.data.objects.remove(o)

nettoi()

# sample data
coords = [(0,0,0),(0,0,0)]

# create the Curve Datablock
curveData = bpy.data.curves.new('myCurve', type='CURVE')
curveData.dimensions = '3D'
curveData.resolution_u = 2

# map coords to spline
polyline = curveData.splines.new('POLY')
polyline.points.add(len(coords)-1)
for i, coord in enumerate(coords):
    x,y,z = coord
    polyline.points[i].co = (x, y, z, 1)

# create Object
curveOB = bpy.data.objects.new('myCurve', curveData)
curveData.bevel_depth = 0.01

# attach to scene and validate context

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

def mafoncanim(scene):
    current = bpy.context.scene.frame_current
    empx = bpy.data.objects['Empty'].location.x
    empy = bpy.data.objects['Empty'].location.y
    empz = bpy.data.objects['Empty'].location.z
    polyline.points[1].co.x = empx
    polyline.points[1].co.y = empy
    polyline.points[1].co.z = empz

    if(current%15 == 0):

        #print(str(empx)+'  '+str(empy)+'   '+str(empz))
        print(str(current))

bpy.app.handlers.frame_change_pre.append(mafoncanim)

'''

Bugs are off-topic for this site.  If you are asking whether this is  a bug or expected behaviour, please show t he error message.

Similar to https://blender.stackexchange.com/questions/161758/typing-animation-in-2-81 in that swapping font body doesn't render either.  See comment re rendering image for each frame.


text:
Python script unable to import modules
I'm trying to follow the scripts from the book The Blender Python API by Chris Conlan, and I've been unable to import modules in Python from Blender (2.81) on osx 10.15.2. What file structure / linking is needed to import modules in Blender 2.8?
The closest question I've seen here is Error: No module named ' .... ', which seems to be close, but the single answer there doesn't work for me. (I don't currently have enough reputation to comment over on that question.)
Specifically, I'm trying to run this example from the code given in the book. The problem is that I don't know how the file ut.py should be handled. Where should it be placed? Does it need to be linked into the blender file somehow?
I've so far been unable to set up a minimal example to get anything to import from another module source file, either using the code from the book or with a minimal example like this. The source code from the book needs minimal refactoring to work with 2.8, but otherwise seems functional.

Refers to ut.py  in  https://github.com/Apress/blender-python-api/tree/master/utility_code

Thanks @batFINGER - yes, that's the file that has been causing me trouble in the example from the book. I updated the question to be more specific.

See https://blender.stackexchange.com/questions/5287/using-3rd-party-python-modules

Thanks @batFINGER for pointing me in the right direction! I posted my solution below for reference.

For me the answer was to put the entire project into a folder with the proper structure and set this as the scripts path in preferences.

This is the folder structure I used, and I was able to run the example scripts from the book:


text:
When I quit Blender, I get: "Blender has stopped working, windows is looking for a solution"
I had to install a new motherboard, and with it, I had to reinstall my Windows 7 OS.
Everything works well, I had reinstalled Blender also.
When I quit with CTRL+Q or from the menu: File/Quit, I get a windows popup:
"Blender has stopped working"
"Windows is looking for a solution."

When I quit by making the console visible (Window/Toggle system console), then closing with the red "X" button, I don't get the message.
How can I make this message go away? It's quite annoying.
Googling shows no results for this problem. I've been using Blender for years (not so much recently), I never had such a problem.
Edit:
hardware: Intel Core 2 Duo CPU 2.80 GHz, 4GB RAM. Motherboard: Asrock G41M-S3
software: 64bit Windows 7 professional

Have you already installed latest drivers (graphic) and Windows updates?

First thing was to update my windows, and also I've installed the drivers from the cd which came with the motherboard. (Currently I use the integrated video card)

the bundled CDs are usually outdated, try to install the latest drivers available online.

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


text:
Accurate IndexOB and IndexMA passes
I'm trying to get an accurate index pass for compositing. My geometry (a window in this case) consists of straight lines and it would be nice to have a perfect mask for color correction. As you can see Anti-Aliasing is enabled, but there are still some weird pixels:

Until now my workaround was to blur the image, but in this case straight lines are key to work with. How to achieve this? Is there a render setting to prevent the noise or make it less noisy?

add a additional layer that has nothing but the index pass, and see if its output is  better

Thanks @Chebhou. Already tried, but this can't be a permanent solution. What if I need more than 20 id passes?

you would use one layer just for  index pass ( one layer for all indexes ), not each object or material with its layer

@Chebhou Mhhh. I'm searching for a solid solution - using IndexOB makes more sense than using render layers.

is that what you have tried ?

@Chebhou looks Interesting, I will try it.

@Chebhou unfortunately the same result. I think it's caused by Depth of Field settings, I ever thought index ob passes ignores Depth settings, anyway still testing :)

if you are going to use two linked scenes then do a very high-res render of the index then scale it down

@Chebhou good point.

You will have to render without DOF, and add it in during compositing in order to get clean IndexOB masks. Otherwise you'll probably have to separate via layers if you want in-camera DOF.
Alternatively, you could try this solution, which creates a second Scene, linked to your main scene with the camera DOF turned off. That way your second scene would have IndexOB masks with clean edges, and you can work with both scenes in the compositor. Would that solve your issue?
I'd be interested to know your final pipeline, I'm dubious that the clean masks would help you modify your DOF renders, but I would be interested to see more about it if it can.

Thanks Todd :) The image above almost has no depth, it's a really bright scene and F-Stop is at ca. 8, but it seems that this setting has a major impact. As I said, I ever thought index ob passes ignores the depth settings, because it's only a black and white calculation and gradients are not supported. In this context it makes no sense to provide this feature at all, but maybe it's not complete... I don't know if it's mathematically possible to calculate soft transitions like a mist pass, but I think we can create a cycles shader for this case. I'll try and let you know. Thanks again.

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


text:
How to exclude objects from light sources in cycles?
Some of my scene objects need a little bit of extra lighting, but it would be nice to exclude the my reflective ground from that (see the picture bellow).

Is there an option in cycles to don't effect objects or exclude objects from lights?


text:
Geometry Nodes - How to maintain individual instance index after Mesh Boolean operation?
I am instancing shapes on the points of a mesh, assigning each instance an index, which I then put into the group output to be used in the shader to make each instance a different colour.
I am doing this by capturing the Index (I have tried ID as well) before realising the instances, and this is working fine.

The problem comes after I am applying the boolean, which makes sense to me since I am modifying the instances and new geometry is being created, but I would still like to be able to have each instance be one solid colour. Instead, it looks like the new geometry is created with differing Indexes than what I would expect based on the attribute I am capturing. Is there some way to reapply the Index that I have captured? See the images for the output I am getting.

Apologies if any of my terminology is incorrect, I am still learning.

Hi, could you share your blend file? Would make it much easier to understand and develop the setup. You can use https://blend-exchange.com/ if you want. Thanks.

Sure @Kuboå, you can find it here: https://blend-exchange.com/b/6AYnqJbo

Don't have much time atm so I'll have to come back to this later if no one else answers, but from a cursory first look I wondered if capturing the attribute after the boolean operation (as Mesh Island Index rather than normal Index) would work for you? https://i.imgur.com/0UPgG7d.png Or do you need to do it before because of some other reason?

That was it, thank you! No I didn't need it before for any reason, still learning so I had no idea Mesh Island was an option. You rock, thanks for the help!


text:
Volume colonization by capillaries/roots
I'm trying to render a 3D space (defined by an object) occupied by randomly generated capillaries or roots. Imagine a gel with blood capillaries developed inside it.
The result would be something similar to what can be obtained with Ivy Generator add-on, but with a tridimentional distribution of the capillaries inside the selected object instead of placing them just on surface of the object.
Does anybody have any idea about how to do it?
Thank you

https://blender.stackexchange.com/questions/261818/how-can-i-make-my-character-look-like-it-is-made-out-of-spaghetti-noodles

The new (version 3.4) shortest edge paths nodes takes a start vertex on your geometry and finds the shortest path along the edges.  By adding noise and resampling the curve, you get interesting branching structures.  Of course it only generates these lines on the surface of the object, but you can scale it down.   For example, Suzanne here:
The node tree looks a little like this.  It uses a null object to select which side of the object the shortest edge paths will start from.:

In order to get mesh, you have to convert the curves.

Another interesting effect also generated with geometry nodes is called the plexus effect. It basically throws some random points in your volume and connects the dots, but it takes a lot of math to figure out how to that. There are some great youtube tutorials demonstrating how to put together the node trees.   like this, which is also Suzanne:

While I don't understand all the math required to create the plexus effect, (I referenced Entagma on Youtube) basically it involves faking a loop in geometry nodes by copying the positions of all the end points, and connecting them based on distance.

I thought it would be interesting to combine what I had learned about the shortest edge paths and the plexus effect together and see what would happen. It turns out it takes a lot of nodes to do what I had in mind, but it does work.  I think by creatively setting the materials of the skin and capillaries, you can get something very organic.  Combining it with the ivy generator will certainly yield some interesting results.

I am trying to send my blend file, maybe you can experiment with it.


text:
Is it possible to export fur on a kitten, created use the new hair tool from 3.3, into gltf?
New Blender user here, trying to learn the ropes :>
I've added some fur on a (rigged and animated) kitten mesh using the new blender hair tool which uses curves. It looks good and nice performance too.
I want to export it to gltf to use in Three.js, but the fur is not visible because gltf doesn't support curves or particles, only meshes.
I've tried a few things, like adding a Curve to Mesh geonode to the hair curves, going to curves -> convert to -> mesh and converting hair curves to particles and then turning them into mesh (in this case, new mesh for hair doesn't follow armature/animations, even if I join). The fur will not show after the export.
Should I conclude that it's impossible to have hair/fur on a gltf created by the new hair tool or is there a way for them to show?

The short answer is: hair cards. You can use your groomed hair curves for the layout so it's not a waste. I'll post an answer later. Sorry for the teaser, but right now don't have the time to write it down completely.

Blender can export meshes, loose edges, and loose points to glTF. Some other formats may only support meshes. Anything else would likely need to be baked down to those, but if it's fully baked (all modifiers applied etc.) then there should be no reason it won't export.


text:
solve twist on animated object - custom orientation
I have a regular hexagon with 36 triangle faces.
I have created a custom orientation/workplane.
I can rotate the triangle face on the Y axis using the custom orientation as the edge and it rotates perfectly in alignment.
When I keyframe this motion,  the triangle rotates to the extents  as expected ok,but twists along the custom orientation plane.
I have tried using the Object - Transform - Align to Transform Orientation and also tried various options of the custom , local and global orientations just in case.  However, I am unable to stop the twist but retain the desired rotation of the triangle.
I seek to be able to rotate all 36 triangles individually eventually.
I apologize if any of this explanation is unclear as I am a beginner.
Blend file linked via Blend Exchange - my thanks to those people.

Hi falcon, welcome to BSE. i would recommend three things to attract more people: 1) provide your blend file 2) provide an animation/gif/video how it should look like (can be a link to an animation) 3) provide an animation/gif/video how it looks now. This would make it much more easy to understand what you want instead of reading a lot of text and that's stressful and a bit boring ;)


text:
Implement "while" loop in Geometry Nodes
Blender 4.0 introduced Repeat Zones, however they represent a for loop without a way to break early. This means a while loop can't be implemented in Geonodes as: [not using Python as an example as idiomatically it doesn't provide a traditional for loop]
for (i=0; i<MAX; i++) {
    // usual body of a while loop
    if (condition) break;
}

What you can do instead is:
for (i=0; i<MAX; i++) {
    if (condition) continue;
    // usual body of a while loop
}

This however has a very significant performance problem: it doesn't scale; if only a small number of iterations is needed, the loop may be no-oping basically through its entire lifetime, e.g. if the condition is met at the 2nd execution of the loop's body, and MAX equals a million, the loop will be "idle" (no-op) 99.9999% of the steps! In such case the execution will unnecessarily take at least 8 additional seconds! [I benchmarked using a simple test]
Even if you assign MAX adequately to the same order of magnitude as the actual Iterations needed, you can waste 7 seconds if you guess a million and it finishes early after a little over 100k iterations.
Here's one example where the number of Iterations is unknown: Refining material assignment in Blender geometry nodes based on neighboring faces
So until proper while loops are implemented, I'm looking for the best workaround and posting my proposition below.

Couldn't we for all problems find the scale of iterations needed to solve it (except NP-hard problems I think or something similar) ? Even if I know it means sometimes really hard math problems. Also in Blender 4.1.1, the Timings overlay in the editor doesn't take into account empty loops (1M iterations took 2s for me but displays <0.1ms). Super interesting topic and workaround !

@Lutzi yes, in general Timings lie, don't trust them. I think for the example given, figuring out the number of iterations needed is pretty much applying the algorithm - what you can do is figure some obvious truths e.g. the Iterations don't need to be higher than the number of faces. That is unless you unmute the node in "Loop Body".

This is a workaround I came up with:

You can see it's just a fragment - you can keep adding repeat loops following the pattern of the 2 outermost repeat loops visible on the screenshot.
The purpose of the blue, innermost "Optimization Inner Loop" is to execute the "Loop Body" more than one time before making a conditional check - it's useful only if the conditional check is actually expensive.
The red "Conditional Loop" is the one loop that executes the "Loop Test".

Here's a full example with a shape of 10×10×10×10×10 = 100'000 iterations:

Loop Body:

Mat Fix:

Loop Test:

Code equivalent:
# ...
def loop_test(before, after):
    # count red faces
    a = sum(1 for f in before.faces if f.material_index==1)
    b = sum(1 for f in after.faces if f.material_index==1)
    return a == b

def loop_body(geometry):
    for f in geometry.faces:
        if matfix(f, 'grow'):
            f.material_index = 1
#    for f in geometry.faces:
#        if matfix(f, 'shrink'):
#            f.material_index = 0

done = False
for _ in range(10):
    if not done:
        for _ in range(10):
            if not done:
                for _ in range(10):
                    if not done:
                        for _ in range(10): # conditional loop
                            if not done:
                                after = geometry
                                for _ in range(10):
                                    after = loop_body(after)
                                done = loop_test(geometry, after)
                                geometry = after

It's supposed to grow the single red face on its column to completely fill this column:

Simple benchmark:
from bpy import context as C, data as D
import time

start = time.time()
mod = D.objects['Plane'].modifiers['Benchmark']
for i in range(10):
    mod.show_viewport = False
    mod.show_viewport = True
    C.view_layer.update()
print((time.time() - start)/10)

Competitor:

Iterations actually needed: 5000 (4999 faces in a loop will turn red, then one additional Iteration is needed  to discover the algorithm finished), so the estimation here is 20× too big.
Nested Repeat Zones: 6.94 s
Competitor: 12.69 s
And without a check for those wondering, I got 135 s for the simplest approach (I dared to test only once though):

This is an ingenious and highly useful solution that proves to be exceptionally handy in a variety of situations. It serves as an excellent interim measure until we receive a native while loop node.


text:
Can I change recursive depth limit of instance ownership?
I'm creating Sierpiński triangle by chaining "Instance on Points" nodes like so:

The Instance socket implicitly converts the passed geometry to an instance. Upon conversion to an instance, instances in the geometry aren't realized; this means the first IoP node receives a simple instance of a triangle, but the second IoP receives an instance that doesn't contain its own mesh data - it just contains 3 other instances, with their properties (position, rotation, scale). The third IoP receives an even more complex instance, and so on.
However, at some point it breaks: (empty output)

Inserting a "Realize Instances" node before reaching the recursion depth limit, fixes the output:

But then again after 7 IoP nodes in a row, the output becomes empty:

Adding another "Realize Instances" node, and 4 more IoP nodes takes about a second for the node tree to evaluate, though the timing of the "Group Output" lies it took only 53 ms. Then adding yet another "Realize Instances" (this time it's not needed, but just for benchmarking purposes), lags the evaluation of the node tree considerably for over 10 seconds (though the measured timing says 2000 ms), which reveals the problem of realizing instances especially when generating very complex geometries.
Apparently only the last "Realize Instances" node is needed. What I understand by it, is that geometry nodes don't see a problem with the complexity (depth of recursion) of an instance, only the viewport/render can't support an instance more complex than this:

Perhaps worth to note, "Join Geometry" node adds another level of complexity if it mixes instances with other type of geometry:

Therefore it would be nice to just change the limit of recursion, so when an instance owns an instance, which owns an instance, which owns an instance, which owns an instance, which owns an instance, this last instance can still own an instance (which owns another instance, which owns yet another instance, which…)
The need for optimization is perhaps not obvious with the simple example of a Sierpiński Triangle, but I stopped working on animating the extruded tetrahedron, in hopes I could save some CO₂ emissions:


text:
Make object transparent only on bottom
I have a hat object, and I want to make most of the bottom transparent. I'm making an app where a user can place a hat on their head. However, if I place the hat in the correct position, and the camera angle is from the bottom, the hat will block the users face.
I've downloaded other objects that had transparency only in certain areas, which could only be seen from certain angles, but I don't know how to create this on an existing object.
I attached a screenshot of the area I would like to make transparent.
Thanks!

Hello and welcome :). This can be easily achieved by assigning different materials (transparent and opaque) to different parts of your hat. The process is described in this answer.

Thanks! I followed the answers you linked with no success. I created a new material while the area is selected, and tried making the alpha 0.0. Also, I made the surface Glass/Transparent/Translucent, but none of them work either. I'm also very new to Blender, is there a step-by-step example of doing this? Thanks again!

Hello again :). Alpha set to zero is enough. Just make sure to set your material's Blending mode to Alpha Blend. I posted a full answer for you.


text:
Does Blender provide a web-compatible codec-container combination that allows for transparent backgrounds in videos?
I want to output a video file from my blender animation that (1) has a transparent background, and (2) is supported by the major browsers via a <video> element. Ideally, it also won't be a massive file.
Does Blender support such a codec-container combination?

I've found that container=WebM and codec=WEBM/VP9 seems to do the trick (though Safari doesn't support VP9 at this moment in time).


text:
How to script a command to make a single-user copy of a Texture (withoug pressing the correspoinding button)
If I have many objects with the same texture and I would like to make a single-user copy for every object, it would be very tedious to do it by hand, clicking the button next to the texture's name, thus I would like to script this.
I know of the command
bpy.ops.object.make_single_user(type='SELECTED_OBJECTS', object=True, obdata=True)

It can be used to copy materials, actions and other things, but I didn't achieve an application to textures, I don't know if this is possible.
Maybe it would be possible to make a copy of a texture from a previous object but I don't know how to script this.

From API you just need to add material=True in your command for blender 2.81

This just makes a single-user copy of the material, I would like to make a copy of the texture, which is used in the displace modifier for example.


text:
Deform mesh based on proximity
I have a scene where I want my character to sit on a sofa. To make it look better, I want the sofa to deform like it would in reality. What is the best way to do this?

I can try and sculpt shapekeys, but this is a real pain if I have an animated scene.
I know there is a Cast Modifier which does exactly that. But the Cast modifier cannot be applied
to geometry. This only works for cubes and spheres.
I can also use Soft Body, but it takes too much time to simulate that. I'm looking for a more simple solution.
There is also the possibility to archieve this using dynamic paint, but isn't there an easier way?

Does anyone have an idea on how to do this? With the new geometry nodes and proximity attribute, I'm sure there is someone who knows ;)
Thanks!

An alternative way would be to use a lattice on the sofa, which is sculpted to deform it like someone sits on it. Than you would need to link the horizontal position to the character using constraints and the deformation amount to the characters hips Z position.

It's not physics but you could do it with shape keys: Create a basis shapekey, then a second one, keep the second one selected, sculpt (in Object mode with the Value at 1) or model (in Edit mode) the sofa in order to create the shape it is supposed to get when the character sits down, then keyframe the shapekey's Value:

Man I really appreciate the quick response! I once used this method too. But the scene I am trying to create is a character sitting down, turning and laying on his back looking up. I can create multiple shapekeys and animate that using this method, but that takes too much time. Using soft body would be much easier for me. But i'm trying to avoid that because baking around 1200 frames takes time and lots of space :P. What I am looking for is a Cast  modifier, but for geometry objects. Thanks!

With bones? Mesh Deform? Vertex Weight Proximity? https://blender.stackexchange.com/questions/153177/worms-crawling-under-skin ... I guess it also depends on the style

It's kinda cartoony, so it doesn't have to be that complex or convincing. But using bones needs to be animated. The downside is that if I have to adjust the characters animation, I also need to adjust the entire sofa animation. I'm beeing lazy I know XD. My best bet is to use soft body, unless I know how to use the proximity in the new geometry node system. I couldnt find a tutorial on this.

YES!!!! That's it!!! Thank you so much!!! I couldnt find this!!

well, you need to thank Duarte  ^^  for a cartoon I would use bones or Mesh Deform I guess, but maybe you'll get what you want with Vertex Weight Proximity


text:
Deform bones configurations produces a bad deformed beak
yesterday I bought the addon called "re-face!" and I have completed the rigging tutorial contained inside the package using the character that I'm creating,a bird with an humanoid face. The script uses two armatures : Body_rig and Face_rig. The first one is for the body and the second is for the face. I have parented the Face_rig to CTRL_head bone,as the tutorial says. The eyes are parented to the DIF_head bone and all other TRK* bones to the CTRL_head bone. I can add more bones to the Face_rig armature,but I can't delete the default bones. If I do it,I get one error that says that the deleted bone is not present and the script does not generate the facial rig. Also,the script generates two armatures,on the first one there are the deform bones and the control bones,but on the second the deform bones disappear. Problem is that when I do the automatic weights,the beak is deformed bad. This deform bones configuration :

after the automatic weights,produce this outuput :

and this :

generates a situation like this :

as you can see,in any case,the beak is deformed very bad. How can I fix it ? thanks.

could you please accept the answer if it helped you?

Please check the answer found here. This will give you two options to fix this:

Modify the weight painting to tweak what parts of your mesh are
affected by each group.
Create empty vertex groups and then do
the assignment manually, this will give you a bit more control over
how your groups are created as you can see it on the fly and edit it
further.


text:
What happens to my 3d model when I apply the mirror modifier ? it adds extra vertices
I don't understand what happens to my 3d model when I apply the mirror modifier. It seems that it adds a lot of vertices that I can't remove anymore. Anyway the modifier is able to mirror the eye socket correctly. Check the pictures attached and help me to understand how to fix the problem. Thanks.

What are the 3 meshes?  One is not visible except at render.  Do you have two copies of the Bird?  Examine this by clicking objects in the outliner window.

What, exactly, are you trying to achieve with the mirror modifier? Is the cylinder around the eye socket a separate object? You might bet a better answer by uploading a copy of your blendfile to Blend-Exchange

http://blend-exchange.giantcowfilms.com/embedImage.png?bid=1043

The mirror modifier has a center.  You need to place your model on the correct side of its origin. You may just create vertices on one side of the local origin. You only need model on one side ... the left or the right.  There are more flexible alternatives than this but this is the good way to start.
In the image lets assume I am trying to make a sphere with just half a sphere. The blue sphere is almost correct.  I wanted the separation to be a little obvious visually for purposes of explanation.
The next attempt is where the model has too much separation.
In the last model I have unfortunately placed vertices on both sides of the X axis.  This may be what you did also.
You can either remove the mirror modifier. Or make a selection on the undesired vertices and grow the selection with Control+, then delete the vertices.
I wonder if you are seeing another mesh in the same place as the bird.  I suggest you change the names of the mesh to something like Bird so as to explain the issue better.

Hello. I want to mirror only the eye socket,but I see that when I select the mirror modifier the whole bird is mirrored. I'm in edit mode and the cylinder around the eye is not a separate object.

I need to mirror the eye socket from the left side to the right one. can you help me ? here you can find the blend file : http://psychonews.it/dati/Pierino0.blend


text:
Problems while creating a City using the OpenStreetMap maps
I've found this blender tutorial :
How to Create a City Covered with Fog
and I've tried to do it. And then I've chosen the map of the city where I live and I have selected a small area,but when I have imported it in blender I have seen that something hasn't worked correctly. Please check the screenshots attached to understand better where could be the problem,thanks.

What exactly is your question? Are you missing some buildings? As far as I can see from the screenshots, all the buildings from the map (dark brown areas) were correctly imported into Blender. In the rest of the map there are no buildings marked, so there is nothing to import.

this has nothing to do with blender , It has to do with an external program

In OpenStreetMaps only the buildings in dark brown have had their shapes made available for blender. This means that what you are experiencing is normal. If you would like more buildings, select a different area of your city, preferably with more details.
[Edit by Brasshat] Or create the bit of the city you want, and use Blender to add the buidings not provided by OSM.

Are there shapes available for the google maps or some other kind of map ? This method make easier and faster building big cities. Do it by hand takes too much time...

I believe there are for Google. I would do it by hand though. Import the map as an image, and just extrude vertexes to the corners of each building. When the shape is complete, fill it and extrude.

authors: Егор Дмитриев


text:
How to weight paint more accurately
I'm trying to weight paint the beak and the jaw of my bird,but I realize that I'm not able to get the result I want. Infact,when I weight paint the jaw in red and I rotate it on the X axis,it works,but the beak doesn't. When I weight paint the beak with the red color nor beak nor the jaw are colored perfectly.
I would like to know if I can weight paint only a part of the bird,not everything. For example,in edit mode,I have selected only the vertices of the beak and I have inverted the selection with CTRL + I and then I hid them because I want to weight paint only a specific section. Why I want to do this ? Because when I paint a specific region of the model in weight paint,the painting is not carefully and I paint also the borders of a region that I don't need. I don't know if I can do it in weight paint mode,so,I thought that I could do it in edit mode....check the attached video,thanks.
video

You can use face selection masking or vertex selection masking to select only vertices or faces, that You wanna paint on.This are options located on the bottom bar of 3D view port.

very useful functions,man,very thanks. you are the man.

authors: Дима Карпеко


text:
Issues with using painting tools via python script
I am trying to apply colour to an object with a python script. I have found several other posts that were also struggling with this. However, their solutions didn’t fix my problem. Drawing on the object in 3d View manually works just fine. I am using the function below.
def paint(_PATH_,_SWITCH_):

stroke = [{
"name":"paint",
"mouse":(0,0),
"mouse_event":(0,0),
"x_tilt":0,
"y_tilt":0,
"pen_flip":False,
"is_start":True if _SWITCH_==0 else False,
"pressure": 1.0,
"location":_PATH_,
"size":1.0,
"pressure":1.0,
"time":1.0}]

bpy.ops.paint.image_paint(context_override(), stroke=stroke)

The function is running in a for loop. PATH is a coordinate triple and SWITCH is the current index of the for loop. Before executing this loop I have set the brush strength and radius to maximum and selected the brush by using
bpy.ops.paint.brush_select(image_tool='DRAW',toggle = True)

I am using basically the same setup for sculpting, and it is working perfectly fine.
Short note, I must do the painting in 3D View because the UV map of the object is very convoluted.
Long story short, the code compiles with no error messages, but nothing happens.
EDIT: Using fill instead of draw works for some reason.
EDIT: After going through several stages of desperation, I have found something.
I used code from another forum post and replicated the setup and was rewarded with a result that confused me even more.

The code is as follows.
EDIT: Because I was in a hurry i accidentally copied the wrong code.
I have now postet the right code.
def paint_start():
stroke = [{
"name":"stroke",
"mouse":(0,0),
"mouse_event":(0,0),
"x_tilt":0,
"y_tilt":0,
"pen_flip":False,
"is_start":True,
"pressure": 1.0,
"location":(0,0,0),
"size":100.0,
"time":0.0},
{
"name":"stroke",
"mouse":(500,500),
"mouse_event":(500,500),
"x_tilt":0,
"y_tilt":0,
"pen_flip":False,
"is_start":False,
"pressure": 1.0,
"location":(50,50,0),
"size":100.0,
"time":0.0}]

It seems that location is pretty much useless, while mouse or mouse_event are the essential values.
Changing the angle in the 3d View will affect the result.
Can someone explain how these values and the angle in 3d View lead to the resulting brush stroke?

Ok, I think I understand how this works. When I used this method for sculpting, I only used "location" and ignored the rest. For painting you can discard location and as far as i can tell "mouse_event" as well. To specify the location for painting the "mouse" value is used. The vector passed to mouse refers to the cursor position in the 3d View based on a 2D coordinate system where (0,0) is the bottom left corner and around (720,720) is the top right corner.
So to paint with the python API one has to adjust the angle and distance with which the object is spectated(I will just use the camera view to do this).
I hope this can help others to use the API for painting.


text:
Shaders turns transparent
I am struggling to make this object fully opaque when rendering. It shows up fine before but once I render it, it becomes transparent. I noticed that on the shaders, the texture is also semi transparent but the original image is not. How do I fix this?

Hi Tiffany, since you didn't show us your shader node tree or any other settings, pls provide your blend file so we can check it out on our own. thx.

Hi, Tiffany, and welcome. At least the shader-node tree is needed to give a rational answer to your question. Consider using  https://blend-exchange.com/ to share your file.

@Chris  Hello! Thanks for your guys comment. I've attached the shader node tree above in the post. Thank you.

@RobinBetts Hello! Thanks for your guys comment. I've attached the shader node tree above in the post. Thank you.


text:
Why are parts of my greasepencil animation rendering black?
I'm making a hybrid animation (3d + greasepencil) stickfigure fight in blender. When I render, some parts render with the vertex colours that they're supposed to have. In others,the stickfigures are appearing fully black in the render.
I've had this happen in other parts of the animation (on different project files). I've looked at other forum posts that had the same issue, but I couldn't find a universal solution.
I've tried resetting the vertex colours, changing the composition nodes, changing the world lighting settings, changing the material colours to match the desired vertex colour, appending the work onto another file, but nothing worked.
Specs: 6 core AMD Ryzen 5500U Processors, 2.1 GHz processing speed, Integrated AMD Radeon graphics, 12 GB RAM


text:
Why Custom Group behaves differently in a Simulation Zone and in a normal chain of nodes? [Bug fixed in 4.0α]
Consider this Custom Group:

It adds a line segment to existing path of the "Lazer", by raycasting towards a default geonode cube using provided position, direction and index of a face to ignore. Then it passes the information needed for the next line segment. Since there's no recursion in Geonodes, a setup like this has to be chained like so:

(the Cube visible in wireframe mode has been added outside this setup)
So if the above works, why doesn't the below?

Apparently, it works for the first evaluation, but then fails. I have done some more investigation, but haven't yet gained a full, satisfactory explanation, and I don't want to suggest a potentially wrong answer, so here it goes, do you know what's going on?

Is this the real bug? Is this just design?

A workaround is easy (and this could be a part of an answer…):

But the question is why the workaround is even needed, what's the logic (and fully understanding the logic might result in a better solution).

Maybe a good fit for another question, but while I test various workarounds, I find myself in this situation: https://i.imgur.com/nP8i0eC.png - how could possibly the 0 or 1, plus 2, become less than 2?

Most likely it was a recently fixed bug, can you check in new versions?

@modnop the above was originally tested on stable 3.6 from 27 jun, which version do you have in mind? Is there a newer 3.6 or do you mean 4.0? There's a .blend file link in the question btw.

Yes, 4.0. Example file also work correct in today 4.0.

@modnop thanks for your input, I'll observe this until B4.0 goes to β, I thought this is a bug at first (but as you noticed on Discord, sometimes I'm wrong on that), and then thought maybe it's about the geometry already existing in a custom group chain (which is evaluated from right to left), but not yet existing for a given frame (frames are evaluated from beginning to an end). However no explanation would fit my prior understanding on geonodes evaluation (here the constant outputs shouldn't be dependant on future geometry…). I confirm currently it works as expected (is fixed) in 4.0α

Then it's a duplicate of https://projects.blender.org/blender/blender/issues/109341


text:
What's the conditions of the modifier mirror?
What is the conditions of modifier mirror? isn't true that modifier mirror should create first at the right side? anything else other conditions should to do?? hope will success always making while need modifier mirror.

uhm no. It depends how your view is orientated. So e.g. if your x axis is "looking" down, the mirror won't show up on the right side. i would recommend watching some basic beginner tutorials about blender. Tons of material are provided if you search on google.

It doesn't matter what side you choose. You need to know that the origin will be the center of the mirror. If you choose to model on the right side don't put vertices on the left. Enable the Clipping option if you want the vertices along the center of the mirror to stick to each other.

oke... thank you very much


text:
Can't see rig in pose mode (blender 3.4)
I am very new to Blender and rig animation. I have downloaded this model and select the rig object (the one with orange human icon) and change to pose mode. However, there is no rig (the circle/square around the character for you to change limbs position) for me to select. I did alt + h but still no help, don't know I miss something, or this model doesn't have that. Can someone help me check it? Thank you in advance.

Sorry but that model requires you to register and login to download it.

You cannot expect people to help you by downloading content that you have to register for - it's a free model, but still it's not everyone's wish to register everywhere where people download models they have problems with. You could at least try to show some information on the model with screenshots of your Blender scene, the model, the outliner for example. The pictures on the download page have no usable information on how the model looks/works in Blender.

While this model has been setup with an armature, it hasn't been rigged for easy animation.
Adding a skeleton is the first part of rigging while using inverse kinematics, constraints, drivers and custom shapes for intuitive control of your character is the rest.
If you're serious about rigging and animation I would take the time to learn it properly. For this, I can't recommend Pierrick Picaut's tutorials enough. They're paid for but worth every penny.
https://www.youtube.com/watch?v=4kNLgpc2mlA
https://www.youtube.com/watch?v=K6lYYgLKH04


text:
constant move mesh (straw) along curve, only at desired distance [geometry nodes?]

Hi community,
I want to constantly move scattered geometry along the curve (bending straw) using geometry nodes. (picture above)
Similar to curve modifier x location offset but only on selected distance. It's quite common problem and I couldn't find any answer yet. Probably the best and fastest results could be achieved using geometry nodes, but I'm open to other ideas too.
Fading in and out (changing transparency locally using proximity node would be nice addition but not required)
UPDATE:
I found out simmilar example by youtuber Cartesian Caramel: Traffic system
https://youtu.be/yqTXiw6MJgI

It's near but:
1. geometry (straw) should bend on corners (like with array+ curve modifier setup)
2.Scattering is a bit odd-not uniform (packed all over one point)
I know some node setup must be added after straw geometry (my red mark, picture 2) to force it to bend, but I can't get to it yet and i haven't been able to incorporate any other bend mechanic to my example.
(like this: https://youtu.be/M-fOsAcGtFg)
Deform object along curve

Does this answer your question? Rotate Spheres according to height of other points

Or maybe "Shortest Path" and sample the resulting curve by a factor

Not exactly, but I updated post with my current knowledge and some example node setup (problem is lack of bending moving geometry accordingly to curve shape).

What you have combined with this might do the trick: https://blender.stackexchange.com/q/245282/157965.


text:
Run bpy.app.handlers.frame_change_post.append without running script every time
I have bpy.app.handlers.frame_change_post.append(my_handler) in my addon. I found that this function runs only if I clicked "Run Script"  my_handler is
def my_handler(scene):
    print('entered')

If I run my script then I change the frame the text entered is printed, but if I reopened my file without closing blender then change the frame it doesn't print unless I press on run script button in the text editor again, why this is happening? Does bpy.app.handlers.frame_change_post.append needs me to press the Run Script button every time I want it to be executed? The problem is that I installed my_Addon.py and when I close blender and open it my addon menu is there but when move frames the text entered is not printed.

Are you using the @persistent decorator?

@batFINGER no, where I should use it?

Like the example in link


text:
Show progress python
I wonder if it is possible to have a progress bar in blender's GUI not in the console to show the progress of my script. For example in my addon I have 3 buttons, 1 of them loads an obj file and do some processing on it, second one does some processing and animation and the third one reads a file. So I want when I press on any of the buttons somehow I will be able to see the % progress of the button script through blender itself not through the console.

related: http://blender.stackexchange.com/questions/3043/how-can-i-visualize-progress-in-a-panel

related: http://blender.stackexchange.com/questions/3219/how-to-show-to-the-user-a-progression-in-a-script

I think your best bet is either use the cursor or make your own progress bar with opengl and bgl module.

@Jerryno thank you. I followed this: https://blenderartists.org/forum/showthread.php?286682-Setting-progress-bar-values&p=2339247&viewfull=1#post2339247 and it works, but how I can incorporate it with my button operator? like make it works when my button is pressed and then update it's progress to looks realistic and finishes when my button's functions finishes?

You can draw from a modal timer operator, then self-terminate that operator when the job is done, or you can use threading and do the job in separate thread updating some property and draw from (for example) app.handler according to the property.

@Jerryno Thank you very much, but what about the steps? so I have an operator for a button which imports an obj file then do some processing on the imported object. And I have the other modal time operator drawing the bar. How I can use the modal time operator together in my other operator?


text:
Find out perpendicular vectors of a normal
I want to find out the direction of a certain axis in a normal, for example the Y axis. So for an edge finding the direction would be to subtract the location of its vertices. I want to use that normal direction to move a face along the Y direction of its normal rather than the Z axis. I'm looking for a python solution.

I've figured it out using bm.face[#].calc_tangent_edge(). Although I can't figure out why it goes to X axis then to Y axis when selecting faces in other parts of the mesh. I also need a 90° equivalent of this tangent to able to use this on a gridify script.
import bpy
import bmesh

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
f = bm.select_history.active
n = f.calc_tangent_edge()
vec = 0.1 * n

for v in f.verts:
    v.co += vec

bmesh.update_edit_mesh(me, True)

Moving across a plane, horizontally
import bpy
import bmesh

threshold = 0.0001

obj = bpy.context.edit_object
me = obj.data
bm = bmesh.from_edit_mesh(me)
f = bm.select_history.active
normal = f.normal
tangent1 = f.calc_tangent_edge()
tangent2 = normal.cross(tangent1)
if abs(tangent1.z) < threshold:
    vec = tangent1  # this tangent already is horizontal
elif abs(tangent2.z) < threshold:
    vec = tangent2
else:
    ratio = tangent1.z / tangent2.z
    vec = tangent1 - tangent2*ratio

vec.z = 0  # it's close to 0 but let's just round it exactly to 0
vec.normalize()
vec *= .1

for v in f.verts:
    v.co += vec

bmesh.update_edit_mesh(me, True)

" I can't figure out why it goes to X axis then to Y axis when selecting faces in other parts of the mesh." - according to docs, the tangent is based on the longest edge of the face. Think about it this way: what if the face was a perfect circle (which is impossible, but let's say it is) - then you wouldn't be able to determine in which direction to move the face, unless you want to favor some direction, e.g. horizontally. Maybe you want to detect the most horizontal edge and move along that edge.

Similarly   https://blender.stackexchange.com/questions/207859/align-empty-to-normal-with-object-matrix-world-rotation  https://blender.stackexchange.com/questions/118763/set-a-polygons-normals-orientation-as-the-objects-local-rotation-orientation  https://blender.stackexchange.com/questions/118763/set-a-polygons-normals-orientation-as-the-objects-local-rotation-orientation   all of which have issues if matched against the face normal axis displayed. (There is another that investigates the matrix used by the source code to display the axis, couldn't find)

@MarkusvonBroady Makes sense. I was actually avoiding the per face info and just use the normal information from a rayhit since the target objects are using modifiers. To use the face info I'd have to create an applied data linked to the scene to actually take the hit. I was looking around if a normal can somehow be converted to tangent but alas my math skills ain't up to the task.

@batFINGER I wonder if the mesh data can be locally transformed to match the orientation of the normal then just use that temporary switch to move the face to the x-y axis using local coordinates. After the operation, switch back to the old matrix. Bit hacky though.

@Blenderguppy When you have a normal, you can derive a plane which is perpendicular to the normal. If you have a position (as you do in a shader), you can also position this plane so it overlaps the face having this normal. But what you end up with is a plane and a point on that plane, no direction. Maybe you want to find a horizontal vector parallel to that plane?

Yes. A horizontal vector parallel to the plane. Any additional data will be helpful.

@Blenderguppy take a look at the edit

@MarkusvonBroady Thanks a lot!


text:
Boolean causes texture of object to be displayed in gap
I'm pretty new to blender and this is hard to explain.
I'm using a boolean to make a house look like it's rising up from the ground, but in some parts of the animation, you can see some texture between the parts of the house that aren't connected.

As you can see, there's a weird texture connecting the sides of the house.
Is this some UV issue? Am I really dumb?
Thanks!

I see that you had added a boolean modifier on the roof, when I disabled it, it went back to the normal texture. I thought you wanted to keep the modifier right, so I applied it instead, did the unwrap, and went into the uv editing to fix how the texture displays.
here is the file https://drive.google.com/file/d/1pPQCjvSgh2-fplPbc6MaWUn2Ij_FWE4h/view?usp=share_link

press the key tab (or go into edit mode [![enter image description here][1]][1]
[1]: https://i.sstatic.net/DGclx.jpg Then select the part that don't look right, press the key "u" and click "unwrap"
for example, if you have a cube, it has 6 sides right? so instead of selecting all the sides and pressing the key "u", then do the unwrap, you will in most cases want to select one side by one.
If you don't seem to make it work, I recommended you upload the blender file and I'll take a look for you

I'm probably doing it wrong, but selecting the faces of the roof and unwrapping doesn't seem to do it.
If you could take a look, that would be great!
https://drive.google.com/file/d/1BvJYlwLA_MwLXqP-YHoENXA3QNhFYt5d/view?usp=sharing

I just answered the question again!


text:
Joining objects causes some to be displaced
I recently bought a house model, and after joining the objects that comprise the house, some objects are displaced and have their scales reset.
Anyone know what I'm doing wrong?
Example: https://i.sstatic.net/Z42yz.jpg
Thanks!
edit: there were some objects "nested" within other objects. I'm new to blender so that's likely the wrong term
I individually selected each "nested" object and then joined the objects, but is there a way to go about doing that faster?

In your scene some objects are parented to others:

That's why they are under their parent in the Outliner hierarchy
An object that is parented will visually follow its parent transformations (location, rotation and scale) but it’s only visual, it will keep its own transformations unchanged. If you un parent an object, or parent it to another object, it will go back to its original transformations (unless you unparent with the Clear and Keep Transformation option), it’s probably what’s happening here.

It’s not clear what you’re currently doing but you could select all your objects and press J to join them all into one object, it won’t change them visually.


text:
Grease Pencil thickness inconsistency causing line boil/flickering/shimmering on camera move
I work only in grease pencil and have a possible anti-aliasing issue (I attempted to increase the grease pencil anti-aliasing past 1 to 10 to 100, while it looks different than 0 it is pointless past 1).
(edit as links were requested to be removed)
it is as though a thickness noise modifier has been applied but only when the camera moves.
I had a similar line boil but less drastic issue in 2.93.0 and 2.93.14  I labeled the different render settings, image sequences tend to do slightly better than video.  I did renders from blender at it's factory default as well as my normal default,it looked the same.
I wish to know if there is a current work around for the flickering lines.  the go to in 2.8 was render at 200% and shrink it which diminished it some.
Am I looking in the wrong place? Are there stroke settings that can cause this?  Are there Camera settings? is there another area in render settings other than grease pencil anti-aliasing that can affect line quality? is there more than one area where you have to change anti-aliasing settings?
I have looked up this issue and have found other people who mostly just use grease pencil who have run into this problem and they were either using a very old version or they went unanswered. this was practically nonexistent as a problem for me in 2.79b (possibly 2.80).
I have windows 10 with 16 gigs of memory
nvidia GeForce GTX 970 with most recent drivers.
some friends rendered on theirs to see if it happened to them.
-linux 2.93.
-similar windows 10 3.1.2 same.
all answers I found seem to imply that this is a problem only in pre 2.9 but here it is.
List of solutions for other's looking, like me, and finding nothing about settings
Render at 200%-300% and shrink it back down in a composition program that doesn't have this problem.  it's still present but diminished.
use thick lines.  Stylistically limited
Boil the animation on purpose. Stylistically limited.
Add style filters in a composition program that doesn't have this problem.  Such as recreating a CRT television.  Stylistically limited.

Hello and welcome. While files, images, and external videos or links may be helpful additions they should not be the only way to obtain information about your issue. Don't make understanding your question rely on downloading a file, watching a video or visiting an external site. Use the builtin tools to upload images or gifs, along with thoroughly explaining the problem in written form so it can be indexed and searched for thus helping future visitors with similar issues.

That flickering is driving me nuts as well. Besides the solution you mentioned there is one more that in my opinion gives best results. Instead of using solid materials for strokes you can use textured one. If the texture  has soft edges it would create kind of a fake anti aliasing which reduces the flickering. It will still boil when the lines would be too thin or would be too close to each other but the flickering would be significantly reduced


text:
Why the material showing reflection
I have assign same material (Glass) to all the Balcony Glass. Why the material showing reflection like a mirror. I have check face are correct. Whats going wrong. Any suggestion. Thanks

Try lowering the IOR of the Fresnel on your glass shader (closer to 1).

@ChristopherBennett It work but why the same material show transparent other side and same material show reflection, Any explanation plz

I'm sorry to say that, but looking at your file you should definitely go through some beginner tutorials, especially on how to use modifiers like the Array modifier and the Mirror modifier... and on Scaling with negative values regarding face normals.

Your glass have different thickness.
If you lower your thickness (y dimension value) to 0 (as you did with the others) it has no reflection anymore.

While making the thickness 0 might work in this particular case, that surely is not the solution for any generic case. Changing a mesh thickness to zero would just risk z-fighting issues. Better to resolve the actual problem (glass materials can certainly have thickness) that just masking it.

@RichSedman : you are right

The other glass planes have a thickness of 0 because they are just simple planes with no backfaces. Decreasing the thickness of the glass that has a thickness with a backface to it would not make it the same as the others. And as @RichSedman says, you risk Z-fighting (which wouldn't happen on the single-sided planes).

Most likely a problem with flipped normals. With incorrect normals you'll see 'total internal reflection' where the surface acts as a mirror when viewed from an angle greater than the critical angle. Recalculate Normals or manually flip them in Edit mode.

The normals are alright, at least on the glass object. Although not all of the supporting posts are correct.

The problem here is the glass material. It's quite a complex setup that I have seen many times before whenever someone had problems with a glass material. If I remember correctly this is the glass setup produced by the Archimesh addon.
I think the purpose of this setup is to make interior renders brighter if lit from the outside by a window, because using the default Glass BSDF lets less light pass through thus making the interior darker.
However, quite often this results in unwanted behaviour especially when using (physically correct) glass plates that have a thickness instead of being a single sided plane.
If you simply plug the Glass BSDF directly into the material output, the glass is alright. It's still reflecting like glass usually does, but not like a mirror. Notice that the one-sided glass now shows extreme refraction of the object behind, that's due to the Fresnel value which makes the object behind the glass appear as if it was stuck inside a block of glass, because the backside of the glass is missing.

If the other glass objects would have a thickness to them like those on the corner, the refraction would be looking correct, too. And notice in this picture that the floor behind the glass isn't darkened as much as with the one-sided glass.


text:
How to distribute without the occurart tool?
I can use array modifier, but I want to align four different objects.
It could be a script. Please teach me.
And why was oscurart deleted

Objects I want to distribute.

Related: Oscurart Tools: Not included in 2.91

Distribute Objects Addon Full disclaimer, I am the author

Distribute Object addon not provide 2.92 T.T

@Duarte Looks cool and easy to use :). Blender should really include this functionality by default tho.

Create four objects. Enter the names of the objects at each end, A and D. Type B and C in the middle. Then spread the distance on the y-axis.
import bpy

#Compare y-axis distances

dif = bpy.data.objects["A"].location.y - bpy.data.objects["D"].location.y

#There are four objects, so do 4-1.

chunkglobal = dif / (4-1)

chunky = 0

#Sets the initial location value.

deltafst = bpy.data.objects["D"].location

OBJECT = bpy.data.objects["A"]

#In object, enter the location information for A.

OBJECT.location.y = deltafst.y + chunky

#Add the total length divided by the average length.

chunky += chunkglobal

#Repeat to the following object

OBJECT = bpy.data.objects["B"]

OBJECT.location.y = deltafst.y + chunky

chunky += chunkglobal

OBJECT = bpy.data.objects["C"]

OBJECT.location.y = deltafst.y + chunky

chunky += chunkglobal

OBJECT = bpy.data.objects["D"]

OBJECT.location.y = deltafst.y + chunky

chunky += chunkglobal

Hi, thanks for the post. This site is not a regular forum, answers should be substantial and thoroughly explain the solution and required workflow. One liners and short tips rarely make for a good answer. If you can [edit] your post and provide some more details about the code and how it works feel free to restore it, otherwise it may be deleted or converted into a comment. Perhaps add a few images illustrating the workflow and final results. See How do I write a good answer?


text:
How to slow down the flames with simulation?
I want to slow down the speed of flames. I am trying to create smaller flames but slower. Which simulation settings do I need to dial?  I tried smaller simulation time steps but that made it worsts, I think the time steps do not work well with smaller objects.

The simulation is based on physical real world behaviours and so you might br able to get the results you want by simply changing the scale of your simulation.
Small flames like candles are naturally fast and flickery as everything is happening over such a small scale. Increase the scale of your fire and the reactions and interactions happen over a much larger scale, taking longer - and so slower.
In Blender you can either set the scale of the scene or use the default 1 Blender Unit = 1 metre. A 10cm flame will react and move much quicker than a 10m flame.
After resizing your emitter mesh and domain, don’t forget to Apply Scale so that Blender recognises its new size.

Did you try the "Time Scale" Parameter?
This should change the relation between your simulated time and playback time.
Alternatively, you could run your fluid calculation with a high framerate (eg. 100 or more) and after finishing the calculation, you can set the framerate back to your animation needs, which will effectively slow down the simulation.

This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review

You're right, I edited the answer to be a bit more "answery"

Thanks for the reply but I already mentioned it "I tried smaller simulation time steps but that made it worst, I think the time steps do not work well with smaller objects."

Did you try it? The "Time Steps" setting does something quite different from the "Time Scale": Time steps shouldn't have an actual effect on the speed of the flow but rather on how accurately it is calculated. Time scale on the other hand does actually control the flow speed of the fluid


text:
Animating screw modifier with custom start and end
Please consider the following animation:

It is created with the help of the screw modifier applied to a simple broken line shown here:

What I need, however, is for this broken line to start out and end up as a flat vertical line, so that the final model would look like this:

In other words, I need to animate the creation of a surface formed by the screw motion of a broken line that changes shape from a straight line to a broken line and to a straight line again.
Can this be done? Thanks in advance.

What about a boolean modifier to cut a fragment out of the beginning and end of the screw?

or putting the screw inside a cube for Boolean instead, so the caps get filled?

An array modifier allows to add caps, but you might as well manually position caps to your screw modifier and animate their visibility - which will only work if you're fine with the entire cap showing in a single frame. This is similar to the srew modifier, which makes entire segments appear suddenly.
An alternative is to add shape keys to the caps and animate them before (start cap) and after (end cap) the main screw animation. But it can be tricky to tweak the animations speed so the caps appear with consistent speed to the screw.
Yet another option is to apply the modifier, then flatten the ends of the screw, sort the faces from bottom of the screw to its top, and apply the Build modifier.
The problem is, if you use Mesh -> Sort Elements, you will get the effect like below on the left. You need to tell Blender to respect the connections of the faces. For that, add two shape keys (base and temporary), edit the mesh in the 2nd shape key (temporary), enable proportional editing with linear falloff (most falloffs probably work) and connected only enabled, select starting or ending edge and move it a lot (10000 m) to the side. Now sort elements horizontally. The shape keys can be removed or they can stay to e.g. re-sort after adding some loopcuts.

sort
stretch, then sort
python script

Remember to set the length of the build modifier to the number of faces divided by the number of faces per each segment. As you can see below, in my case that's 640/4 = 160:

As for the Python solution, select whole segment (column) at the start or end of the screw, then run the script below:
import bpy, bmesh

limit = 10_000  # protect from infinite loop if something goes wrong

me = bpy.context.active_object.data
bm = bmesh.from_edit_mesh(me)
previous = set()
current = {f for f in bm.faces if f.select}
stride = len(current)
for i in range(limit):
    for j, f in enumerate(current):
        f.index = i * stride + j
    neighbors = {n for f in current for e in f.edges for n in e.link_faces}
    next_faces = neighbors - current - previous
    if not next_faces:
        break
    previous, current = current, next_faces
bm.faces.sort()
bmesh.update_edit_mesh(me)


text:
Geometry Nodes: Get Instance Scale?
Is it possible to capture Scale like I am using Position below to capture Scale of Instances?

The 'Object Info' node has an (object level) scale output.. you can point that at the modified object.

@RobinBetts this is all entirely inside GNodes, there is no outside geometry unfortunately. I am scaling instances and then trying to capture scale per instance (after realizing them).

What version are you using? If you scale your instances, you already have a scale value and you only need to capture it, right? Modify instance geometry based on the location of the instance

@MarkusvonBroady thanks for the link that was helpful and also it looks like 3.1 resolves my issue! I was trying to use Instance Scale to pass curve radius to realized instances based on their position on the curve, now I can just use the Capture Attribute node directly in 3.1. The Transfer Attribute node did work, but because it uses proximity it was causing issues when the host curve was twisted too much.

Just to be able to close this question, a short answer:
Since you create all geometry with Geometry Nodes, you already have the corresponding value for Scale somewhere here.
According to your description, you influence the Curve Radius of the curve points with this value.
To get this value per instance after using Realize Instances, you would have to use the node Capture Attributes on the domain Instances before. If you actually control the scaling on instantiation directly using the Radius node, then you get this value using Transfer Attributes.
It might look like this:

(Blender 3.1+)


text:
Geometry Nodes: How to Make Randomly Varying Offsets in Mesh Line?
This works so-and-so, but not perfectly.

What I want is to add a new line section with every new iteration, in 1-3 meter line lengths randomly. But now they increase the line length overboard as I up the iteration.

How would you optimize this node graph and make it work as it should? I still don't have internalized how Repeat Zone should be used :/

Remember the title of your question should be specific to the problem you are having and not just the general topic, see: How do I ask a good question?.

@MarkusvonBroady I admit, I was having a difficult time with coming up the title, that edit you made taught me a lesson, yes

Note Though That Putting Too Many Capitalized Letters In A Sentence Hurts The Reading Comprehension. I've been guilty of that, too. ;)

@Gorgious I'm not a native English speaker, I thought it's just the way it goes in this language... :) https://en.wikipedia.org/wiki/Title_case

You could iteratively extrude like so:

Nicely optimized! Do they keep their positions if you go through iterations?

@ManuJärvinen yes because it's just extruding the last point

Ooooh! I think I got it! I used 'Curve Length'!


text:
How to loop-cut *beyond* the middle?
I often am using the following sequence in Edit mode...

Loop Cut (snaps the planned cut location to the middle when moving the mouse)
Move (moves the performed cut location)

...which effectively moves the cut position beyond the middle after the cut was performed.
I wonder if there is single-step replacement operation, where the planned cut position of the Loop Cut operation is not snapping to the middle when moving the mouse, but followes exactly the moving mouse tip (just as the later Move would do)?
That would spare me a lot of mode switching while editing, hence would me much more fluent to work with.

Hello and welcome. Please don't write in all caps in the title or body of any posts, it is the written equivalent of shouting, is harder to read and may be considered rude. Please use the [edit] button below the post to change you text into regular case.

I don't really understand that question. If you loop cut, you use Ctrl-R to initiate the loop, then left-click once and the loop follows the mouse until you left-click again to set the loop position. How else would you want that to work?

@JohnEason I think he'd like the planned loop cut to show where his mouse cursor is on the object, rather than have it pop up at the middle of the relevant faces for it to then be dragged where it has to be.
I think this post describes the same problem.

@Zoukeau Ok, but that's just the way loop cutting works (and the most convenient way as far as I'm concerned). It only takes a second or so to move it exactly where you want and set it in place with another click.

Additionally to what @JohnEason said that it's very quickly done so I don't see the need to change it either because I prefer to have the cut exactly in the middle without any effort - if I have the cut line somewhere where the mouse is placed I think it's harder to find the middle so I prefer that as a starting point.

Thank you all for your kind comments. They were very useful. I learned that I must not use all uppercase and edited my posting, to not get recognized as being shouting or rude. I learned that Blender's UI on Windows does not work like other Windows software, and certainly do accept that. Please vote for my answer, so other Windows users learn how this works like. NB: Windows typical usage is to hold CTRL pressed if no snapping-to-middle is wanted instead of holding left mouse button like Blender does. Thanks to everybody! :-)

Blender 3.4.1's default settings on Windows works like this:

Initiate loop-cut tool either by pressing Ctrl+R or by clicking on the menu item / menu icon.
Press the left mouse button and keep it pressed while moving the mouse; the intended cut position follows the mouse movement.
When at the intended cut position, release the left mouse button; releasing will perform the cut.

Note: This is not how the majority of applications work on Windows, but it is consistent with how other Blender functionality works on Windows. On Windows, other software moves the intended cut positiony directly after enabling a tool (without pressing the mouse button; pressing it down will perform the cut in those applications).


text:
Blender PLY export makes Vertex Colors darker
I wrote a Python script that exports Pointclouds (only vertices) and their vertex-colors (stored in color_attributes) to a .PLY file. The color on the exported .PLY file is way darker than the original color in Blender. I suppose this is due to sRGB - uchar RBG conversion issues. How can I convert the colors correctly so the exported pointcloud appears like in Blender?
import bpy
import os

# Get the active mesh object
obj = bpy.context.active_object

# Extract vertex coordinates and color values
verts = [v.co for v in obj.data.vertices]
colors = [(obj.data.color_attributes["col"].data[i].color[0], obj.data.color_attributes["col"].data[i].color[1], obj.data.color_attributes["col"].data[i].color[2]) for i in range(len(obj.data.vertices))]

# Convert float color values to uchar RGB values
colors = [[int(c * 255 + 0.5) for c in color] for color in colors]

#Combine vertex coordinates and colors
vertex_data = [(*verts[i], *colors[i]) for i in range(len(verts))]

# Get the path to the desktop
desktop_path = os.path.join(os.path.expanduser("~"), "Desktop")

# Create the .ply file on the desktop
file_path = os.path.join(desktop_path, "pointcloud.ply")

# Write the data to the .ply file
with open(file_path, "w") as f:
    # Write the header
    f.write("ply\n")
    f.write("format ascii 1.0\n")
    f.write(f"element vertex {len(verts)}\n")
    f.write("property float x\n")
    f.write("property float y\n")
    f.write("property float z\n")
    f.write("property uchar red\n")
    f.write("property uchar green\n")
    f.write("property uchar blue\n")
    f.write("end_header\n")

    # Write the vertex data
    for v in vertex_data:
       f.write(" ".join(str(x) for x in v) + "\n")

# Close the file
f.close()
print("success")

Since version 3.4 there is a color_srgb property for color attributes that will return the color in sRGB space.
colors = [
    datum.color_srgb[:3]
    for datum in obj.data.color_attributes["col"].data
]

I notice however you are using 3.3, in which case you can use mathutils.Color.from_scene_linear_to_srgb (added in 3.2) to convert each color from linear to sRGB.
color_linear = mathutils.Color(datum.color[:3])
color_srgb = color_linear.from_scene_linear_to_srgb()

Thanks a lot, that soled the issue.


text:
How to scale a Texture in an Atlas without seeing neighbouring Textures
I'm working on this jar of peanuts, I have one texture atlas which consists of various bottle contents.
I would like to reduce the size of the bottle contents, one way I have tried doing this is by scaling up the UV's so that the peanuts will appear smaller, but this doesn't work because when it gets scaled up the material shows the neighboring bottle contents, which is a problem.
How can I achieve this scaling without seeing the adjacent textures in the atlas?

You can change the scale value of your mapping node or go to the UV editor and scale the uv.

@NascentSpace when i scale in mapping node image beside also coming

Remap the coordinates.
We benefit from the fact we know it is a Texture Atlas, with regular row and column sizes. Take the UV coordinates, check the local X and Y coordinates and remap it to the current Texture by adding it to the Start X and Y of the target Texture.

Result (With a scale of 6)

Unfortunately the individual textures are not seamless as it seems, so you will see Seams every time the UV snap back to the start coordinates.
Small helping addition if you are using V 2.92+. Create two custom properties in the object properties.

Instead of the Current Column and Row nodes, use Attribute nodes, set the type to Object, and type in the name of your attributes.

Now you can directly edit the Texture in the 3D Viewport :

Also, if you want to have a random Texture with each pot when you duplicate it :
Use the Random output from the Object Info node to randomize Atlas Position.

Result :

Thanks for the detail answer and the cool tips

@Gorgious does this method work when exporting though? I want to make models for a game which require them in obj format and I'm curious to know if the coordinates still work after exporting or if this is only a blender solution.

@cuppajoeman this effect is for Blender only, I think the simplest is to deal with this in your game engine using a custom shader, you can use the same logic. If you really want to have an out of the box solution you can use Geometry Nodes to bake the UVs directly I think.

@Gorgious Ok, thanks for that. I'm going to write the custom shader for this, but the thing is that I don't fully understand how your original graph actually does this because I am newer when it comes to the blender graphs. Would you be able to add a description of how this works in your answer?


text:
How can I automatically move a robot's body to the correct height based on its leg(s) rotation?
When I rotate the leg the body or the luggage bag should come down slowly. Which constraint or any other way will achieve this?
 video
Blend File

you could use a driver (or simply move the luggage down with some keyframes)? Please edit your question and put some pictures

i am not totally sure, but do you want something like this?  https://youtu.be/YjzCMA_TxBA.  -> be a bit patient, my internet upload speed greets every bit with handshake.... :(

i upvoted the question, because of your blend file ;)

You can parent the leg to the body so it moves automatically when the body moves, then with the leg selected, in the Numbers Panel right-click on the X rotation, Copy as New Driver, select the body, right-click on the Z location, Paste Driver. The body will now drop down to Z = 0, because that's the current rotation of the leg (at least in my case). Now you may notice the body moves based on the leg's rotation, but not yet correctly:

To properly convert the angle to a vertical offset caused by it, trigonometry has to be used:

In my example the length of the leg is not exactly 1, so I need to multiply that length (2) by the cosine, and the formula, in my case, becomes: 2 * cos(rotation_euler).
With the body selected, right-click on the Z location again, and choose Edit Driver. Change its type from Average Value to Scripted Expression, and update the formula to correctly base the body's height on the leg's rotation:

Effect:

There's some additional problems to be dealt with:

position of the leg lags 1 frame behind, because while it's based (due to parenting) on the cube, the cube is also based on it (due to the driver); the solution is to clear the parenting and copy-paste the driver from the cube's position also to the leg's position;
the formula assumes the leg has 0 thickness; the simplest solution is to put a sphere on the bottom of it and add an additional offset in the formula equal to the radius of the the sphere;
the body can fall through the floor; the solution is to either use a constraint (and because the leg is not parented that means another constraint for it as well), or use max() in the driver to clamp the minimum value, like so: max(1, 2 * cos(rotation_euler))

Thanks what needed can u plz show me on the attach blend file.

@atek tell me what's confusing in my answer and I'll try to clarify.

I have a limit rotation constraint on the leg. Do i have to remove or not and from here i did not get and add an offset which was the original body's position before adding the driver. Now you may notice the body moves based on the leg's rotation, but not yet correctly:

I updated the answer, hopefully it's less confusing now.

When i parent the bag to the handle the bag is not connected to the handle. https://imgur.com/a/VtLoEnK.

@atek see if rotating the handle afterwards will fix that - see "position of the leg lags 1 frame behind" and how to fix that. I think an even better solution than what I proposed is to parent the bag to the handle, and drive the handle's position based on its rotation, not the bag's position based on handle's rotation.

Its not working on the model


text:
increment value in blender
I am new to python and blender and I need to increment a variable value in blender but I can't! When I run this code, my cube is translated but I can't add another translation, so I can't increment a value of my variable bpy.context.object.location[0].
import bpy

bpy.context.object.location[0] = 1

if bpy.context.object.location[0] > 0:
    # I corrected the formatting
    # and assumed the indentation is correct - MvB
    bpy.context.object.location[0] += 1

print(bpy.context.object.location[0])

Are you sure you can't increment the value? Try doing it without a conditional statement - perhaps the problem is not about incrementing but about the conditional statement, or the object of interest not being active. I tested your code and got 2.0 as output, as I expected (first set to 1 then add 1). Also, when you paste code, select it and press codeblock button to make sure it's shown properly https://i.imgur.com/XGtH11e.png

Every time you run your script you begin by assigning the value of 1 to your objects location. As such it will increment from 1 to 2 then when you re-run your script it assigns the value 1 to the x location again and increments by 1 again. remove the bpy.context.object.location[0] = 1 from your script to be able to add one each time you run the script.


text:
Displace an object by the height of a rotating oval shape

What I'm looking for is if I rotate the round button, the lever should move up, and when the button down lever should come down, which constrain and how should I use it?. Any suggestions or help? Thanks
I tried floor relationship, but instead of moving up and down it's moving to the side.

video

The Floor constraint exists to prevent an object moving to the 'forbidden' side of a given plane.
The Srinkwrap constraint might be more appropriate here:

Set up as above, first, the block is moved in XYZ to the nearest surface point of the target cam, and then is bullied back to its original XY by the Limit Location. With this geometry, that happens to work.

If the objects are given a common parent, the rig can be translated and rotated freely.

You could use Geometry Nodes to make it work with any shape:

Create a single vertex mesh (Cube, merge at center)
Parent your plate to that vertex (not object), by selecting that vertex and then shift-click on the plate in the outliner and ✲ CtrlP.
Add a Geonodes setup to the single-vert object: