text:
Avoid self penetration/intersection of parts of a plant during manipulation
I have a model of strawberry plant (see bellow).
(a) I want to be able to do 2 things without all the different parts of the plant intersect/penetrate each other or surrounding objects:

deform the plant - e.g. tilt it to one side, press it down or pull it up, etc.. (I would prefer to be able to manipulate the plant as a whole AND part by part, if possible).
press the plant against a wall a bit and get a realistic deformation (without intersections).

I need a static picture, no need for animation.
(b) I'm wondering how those models are created in the first place without the leaves, flowers, fruits penetrating each other?
I can't upload the strawberry model because it is copyrighted, but maybe you can show me how to do the above mentioned 2 things (deform and press against a wall) on this free plant model (by GerhardH):

sweet...and what did you try so far?

@Chris - I tried to separate the model into subobjects (stems, leaves, fruits, flowers), but I don't manage to move them around manually without them hitting other subobjects... Probably there is a technique to do so, but I'm not aware of it...

Note: The model in the attached blend file has duplicated vertices. You need to merge them (key M, Merge By Distance) or the cloth simulation will not work properly.

I don't know an easier way for this, but maybe some professionals here have a better solution ;)
One way you could go is this (but it is pretty tedious and lot of work):
Give your fruit, leaves etc. a cloth modifier with some pressure + collision + pin group.
You have to play around a bit with the settings so that it fits your needs.
Then you can get something like this:

thank you! I have attached an example model to my question - maybe you can show this effect on it?


text:
How do I render out a single mono audio track?
I have a single audio strip (its occupying a single channel of the 32 in the VSE)  that is mono (a voice recording done in audacity as a mono track). I imported it into blender. I want to render it out with a single video strip.....every-time I do it goes stereo.
All I see is the ability to "split channels" tracks into mono under mixdown options (just audio render).
Why do I have to split channels and lose data if its a mono track? Is blender just automatically duplicating the mono track 2x and making it a stereo? So I'm fine if I choose split channels as it'll just render the one mono track as I wanted? I don't wanna lose data is all I'm saying. If it was a stereo and I did this, I'd lose half the data technically unless I recombined the 2 mono tracks later right?

In the VSE properties - press N - under sound there is a mono option as well as a pan setting to send audio to one side, this might stop the duplicate output. Blender doesn't give many encoding options for audio, there is no option to make the output video have a mono audio track, so even if one is silent the video might still have two audio channels. The audio in the scene properties relates to speaker objects in the 3d scene, I don't think this has any effect on the vse output.

says pan is just for playback. the mono option didn't do anything either, made sure it was selected for the audio strip then rendered just audio via 'mixdown'. maybe mono option only applies when you video+audio render (*edit: nope!). So no luck :/ I'll test splitting the tracks in mixdown options and see if its close to my original mono or not. No idea how you would render a video WITH mono volume using blender...since its mixdown only that has tracksplit option

If you go to Scene Properies you can change the audio format https://developer.blender.org/F351924.

Is blender just automatically duplicating the mono track 2x and making it a stereo?

Joerg Mueller answers this: https://developer.blender.org/T54418#492826

source: Stack Exchange

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

sort: votes


text:
Animation extends beyond last keyframe
I purchased an animated model of an opening book originally designed in 3ds Max and have been working on converting it to a COLLADA file for use with Apple SceneKit. I was able to get the vendor of the model to convert it to a Blender file, and theoretically Blender can output .dae.
I noticed that the animation was too long, with a delayed start, and continuing several seconds after the book was open. So I thought the right thing was to use the Dope Sheet to delete the unnecessary keyframes, and then shift the remaining keyframes back towards t=0. But As you can see in this screenshot, even after doing this, the timing of the animation is unchanged: the book is still only partially open when the Timeline scrubber is past the last keyframe.

This is my first time using Blender, so please don't hold back on spelling it out for me (e.g., key shortcuts to perform actions).

The related question I had asked about "" is answered here: https://stackoverflow.com/questions/24539607/how-can-i-export-dae-files-for-use-in-scene-kit-without-seeing-untitled-animati

Maybe it has something to do with a mesh cache modifier attached to each animated object. If I "Apply" the cache, the animation becomes frozen.

Look at the very bottom where it says start and end with a number. The start is the frame it starts on, end is where it stops. You will want to set end to the last keyframe. You have yours at 160 while the last keyframe is at like 90.

It looks like a few objects in the model had "mesh cache modifiers" which were affecting the geometry in order to create the animation.
I followed the instructions on this answer to "bake" the mesh cache into regular animation steps. I used this .pc2 importer add-on to use the point caches that had been provided to me; exporting them to .mdd and then importing again did not work.
Once that was done, I exported to a COLLADA file but it was huge—80 MB. I applied this trick to merge animations into one. But the animation does not work yet.

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

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


text:
What kinds of animations can be exported to SceneKit?
Blender offers many ways to animate a scene, but some of these do not seem to get exported to the COLLADA (.dae) format that can be consumed by Apple SceneKit. Which approaches to animation can be exported?


text:
Blender cycles bakong awfully
I am baking the leather of a seat in cycles. I bake it and it looks like this.
But in rendered view with the material it looks like this.
This has never happened before. Does it have to do with my mesh? It has a lot of vertices.
these are the uv unwraps.

There are no extra faces. I did remove doubles.
The random black things on the uv map  are wrong.
also it won't let me comment to anything even though i can edit i cant respond to comments

What does your UVs look like? Are you sure there are no duplicated faces in that mesh, or duplicated objects? Are you using the same UVs for the texture in the bottom image as the bake?

Repardeimaj please contact the SE team about your two accounts. (when I did they said it would be better if you did.) You can use the contact form then choose "I need to merge user profiles."


text:
Is it possible to save plane positions in edit mode?
I am creating a 2D character and have set up UV warps for parts of the face such as the eyes and mouth.
However, when using the UV warp to change the eyes from facing front to facing the right, the eyes image changes as expected, but the position stays the same.
I need to be able to change the position of the plane in edit mode and save it as a "key pose" or something like that, so that I am able to change the position of the plane automatically whenever needed.
Is this possible?  If so, how?
Let me know if I need to elaborate more or show some pics of my situation for you to be able to help.

This is how the eyes and mouth appear after transforming them from their front view to their side views using the UV warp.

This is how I need the planes to be positioned after the UV warp takes place.

I need to be able to automatically switch between the plane positions shown for the eyes and mouth.
Would this work, for example?; creating a bone for the eyes, linking that bone to the bone for the head so it rotates along with the head as necessary, and then using the eyes bone to create poses in the pose library for moving the plane left and right as needed for the side and front views?

some pics would actualy be nice :)

@J.Doe I have updated with pics and a possible solution that I was thinking of but have yet to try, let me know if you think that would work or if you have a better and or easier solution.  Thanks!


text:
Subtracting overlapping 2D mesh with Python using Blender API
Supposing I have two 2D mesh objects, A and B.
I would like to programmatically subtract the overlapping portion of one from another.
I am almost there, just need to fix two problems:

The point of intersection has no edges.
There are random edges where there should not be any.

What causes this?
Screenshots and script code shown below.
EDIT: I'm a dingus, forgot to upload the file >.<

before

after
It is clear that there are the following problems:

The newly added vertex at the point of intersection has no edges
there are random edges where they should not be any
intersecting edges not deleted

script1
import bpy
import bmesh
from collections import defaultdict
import mathutils
from mathutils.geometry import intersect_line_line_2d
from mathutils import Vector

# convert_vertex_to_local_coords
#   Converts a vertex from one object's local space to that of another.
def convert_vertex_to_local_coords(source_obj, target_obj, vertex):
    # Convert the vertex from the source object's local space to world space
    world_coords = source_obj.matrix_world @ vertex

    # Convert the world space coordinates to the target object's local space
    local_coords = target_obj.matrix_world.inverted() @ world_coords

    return local_coords

# move_vertex_to_global_point
#   Converts global coordinates of a vertex to an object's local space.
def move_vertex_to_global_point(obj, vertex, global_point):
    # Convert global coordinates to local coordinates
    local_point = obj.matrix_world.inverted() @ global_point

    # Assign the local coordinates to the vertex
    vertex.co = local_point

# edge_intersect_2d
#   (boolean) Determines if two edges intersect, returning `True` with the point of intersection,
# or `False`, `None` if not.
def edge_intersect_2d(edge1, edge2, tolerance=1e-6):
    def vector_between_points(p1, p2):
        return p2 - p1

    def is_point_on_segment(p, segment_start, segment_end, tolerance=1e-6):
        segment_vector = segment_end - segment_start
        point_vector = p - segment_start
        cross_product = point_vector.x * segment_vector.y - point_vector.y * segment_vector.x  # Scalar cross product in 2D
        if abs(cross_product) > tolerance:
            return False
        dot_product = point_vector.dot(segment_vector)
        if dot_product < 0 or dot_product > segment_vector.length_squared:
            return False
        return True

    p1, p2 = edge1
    q1, q2 = edge2

    r = vector_between_points(p1, p2)
    s = vector_between_points(q1, q2)

    cross_r_s = r.x * s.y - r.y * s.x  # Scalar cross product in 2D
    q_p = q1 - p1
    cross_q_p_r = q_p.x * r.y - q_p.y * r.x  # Scalar cross product in 2D

    if cross_r_s == 0:
        if cross_q_p_r == 0:
            return (False, None)
        else:
            return (False, None)

    t = (q_p.x * s.y - q_p.y * s.x) / cross_r_s  # Scalar cross product in 2D
    u = (q_p.x * r.y - q_p.y * r.x) / cross_r_s  # Scalar cross product in 2D

    if 0 <= t <= 1 and 0 <= u <= 1:
        intersection = p1 + t * r
        if is_point_on_segment(intersection, p1, p2) and is_point_on_segment(intersection, q1, q2):
            return (True, intersection)

    return (False, None)

# get_edge_vertices_in_world_coords_2d
#   Converts two edge vertices from object-local coordinates to global coordinates.
def get_edge_vertices_in_world_coords_2d(obj, edge):
    vert1_world = obj.matrix_world @ edge.verts[0].co
    vert2_world = obj.matrix_world @ edge.verts[1].co

    vert1_2d = Vector((vert1_world.x, vert1_world.y))
    vert2_2d = Vector((vert2_world.x, vert2_world.y))

    return vert1_2d, vert2_2d

# add_edge_to_mesh
#   Adds an edge between 2 vertices to the mesh provided.
def add_edge_to_mesh(bm, v1, v2):
    v1_local = bm.verts.new(v1)
    v2_local = bm.verts.new(v2)
    bm.verts.index_update()
    bm.edges.ensure_lookup_table()
    new_edge = bm.edges.new([v1_local, v2_local])
    bm.edges.index_update()

    return new_edge

# is_inside_mesh_2d
#   Determine if a point is inside a given polygon.
def is_inside_mesh_2d(point, obj):

    x, y = point.x, point.y
    vertices = obj.data.vertices
    num_vertices = len(vertices)
    inside = False

    p1 = vertices[0]
    for i in range(num_vertices + 1):
        p2 = vertices[i % num_vertices]
        if y > min(p1.co.y, p2.co.y):
            if y <= max(p1.co.y, p2.co.y):
                if x <= max(p1.co.x, p2.co.x):
                    if p1.co.y != p2.co.y:
                        xinters = (y - p1.co.y) * (p2.co.x - p1.co.x) / (p2.co.y - p1.co.y) + p1.co.x
                    if p1.co.x == p2.co.x or x <= xinters:
                        inside = not inside
        p1 = p2

    return inside

# split_edge_at_intersection
#   Splits an edge at the point specified.
def split_edge_at_intersection(objA, objB, bm, edge_index, intersection_point):
    edge = bm.edges[edge_index]
    v1 = edge.verts[0]
    v2 = edge.verts[1]

    # Check if v1 or v2 is inside objB
    v1_in_objB = is_inside_mesh_2d(objA.matrix_world @ v1.co, objB)
    v2_in_objB = is_inside_mesh_2d(objA.matrix_world @ v2.co, objB)

    # Move the vertex that is inside objB to the intersection point
    if v1_in_objB:
        move_vertex_to_global_point(objA, v1, intersection_point)
    elif v2_in_objB:
        move_vertex_to_global_point(objA, v2, intersection_point)
    else:
        print("This is FUBAR.")

    bm.verts.index_update()
    bm.edges.ensure_lookup_table()

    return edge

# is_edge_entirely_inside_mesh
#   Returns true if and only if both vertices of an edge are entirely within another object.
def is_edge_entirely_inside_mesh(source_obj, target_obj, edge):
    v1 = convert_vertex_to_local_coords(source_obj, target_obj, edge.verts[0].co)
    v2 = convert_vertex_to_local_coords(source_obj, target_obj, edge.verts[1].co)
    #print(f"{edge.verts[0].co},{edge.verts[1].co}\t{v1},{v2}")
    return (is_inside_mesh_2d(v1, target_obj) and is_inside_mesh_2d(v2, target_obj))

# replace_edges_within_2d
#
def replace_edges_within_2d(objA, objB):
    meshA = objA.data
    meshB = objB.data

    bm_a = bmesh.new()
    bm_a.from_mesh(meshA)
    bm_a.verts.ensure_lookup_table()
    bm_a.edges.ensure_lookup_table()

    bm_b = bmesh.new()
    bm_b.from_mesh(meshB)
    bm_b.verts.ensure_lookup_table()
    bm_b.edges.ensure_lookup_table()

    intersection_points = []

    for edge1 in bm_a.edges:
        v1, v2 = get_edge_vertices_in_world_coords_2d(objA, edge1)
        for edge2 in bm_b.edges:
            v3, v4 = get_edge_vertices_in_world_coords_2d(objB, edge2)
            intersects, intersection_point = edge_intersect_2d((v1, v2), (v3, v4))
            if intersects:
                local_intersection_point = objA.matrix_world.inverted() @ Vector((intersection_point.x, intersection_point.y, 0))
                split_edge_at_intersection(objA, objB, bm_a, edge1.index, local_intersection_point)
                intersection_points.append(local_intersection_point)

    edges_within_mesh = [edge for edge in bm_a.edges if is_edge_entirely_inside_mesh(objA, objB, edge)]
    bmesh.ops.delete(bm_a, geom=edges_within_mesh, context='EDGES')

    edges_within_mesh = [edge for edge in bm_b.edges if is_edge_entirely_inside_mesh(objB, objA, edge)]
    new_edges = []

    for edge in edges_within_mesh:
        v1, v2 = get_edge_vertices_in_world_coords_2d(objB, edge)
        local_v1 = objA.matrix_world.inverted() @ Vector((v1.x, v1.y, 0))
        local_v2 = objA.matrix_world.inverted() @ Vector((v2.x, v2.y, 0))
        new_edge = add_edge_to_mesh(bm_a, local_v1, local_v2)
        new_edges.append(new_edge)

    # Close off the shape by adding edges between intersection points and the first/last new edges
    if intersection_points:
        first_intersection = intersection_points[0]
        last_intersection = intersection_points[-1]

        # Connect intersection points to the new edges
        bm_a.verts.ensure_lookup_table()
        bm_a.edges.ensure_lookup_table()

        first_new_edge = new_edges[0] if new_edges else None
        last_new_edge = new_edges[-1] if new_edges else None

        if first_new_edge:
            first_new_edge_v1 = bm_a.verts.new(first_intersection)
            first_new_edge_v2 = first_new_edge.verts[0]

            bm_a.edges.new([first_new_edge_v1, first_new_edge_v2])

        if last_new_edge:
            last_new_edge_v1 = bm_a.verts.new(last_intersection)
            last_new_edge_v2 = last_new_edge.verts[1]

            bm_a.edges.new([last_new_edge_v1, last_new_edge_v2])

        bm_a.verts.index_update()
        bm_a.edges.index_update()

    bm_a.to_mesh(meshA)
    bm_a.free()
    bm_b.free()

# subtract_mesh_2d
#   Subtract meshes and find intersecting edges
def subtract_mesh_2d(objA, objB):
    print(f"Subtracting {objA.name} from {objB.name}")
    replace_edges_within_2d(objA, objB)

# Get the collection objects
col1 = bpy.data.collections.get('countries')
col2 = bpy.data.collections.get('lakes')

objX = col1.objects.get('Kenya')
objY = col2.objects.get('Nyanza')
subtract_mesh_2d(objX, objY)

This is a different approach to an earlier question of mine; due to never being able to solve that with built-in tools I am instead trying it solve it programmatically.
Thanks for any light you can shed; you have no idea how long I have been at this frustrating dead end!

I think you wanna look into the built-in mathutils.BVHTree object. I'm not 100% sure it will be a silver bullet fix for your issue, but that's specifically what it's designed for. Finding overlaps, raycasts etc between meshes.

Ah, so I had recently discovered BVHTrees!  And was very much looking forward to to using them for the next phase: efficiently detecting overlaps of all objects in one collection (e.g. countries, in this example) with another (e.g. lakes).
https://docs.blender.org/api/current/mathutils.bvhtree.html#mathutils.bvhtree.BVHTree.overlap looks very promising.
While it is evidently much, much better at detecting, I am still on my own with regards to actually making the modifications, correct?

Well, yes. But also I think you can replace a huge chunk of the code you have already for checking overlaps with a few lines. Convert your bm objects into a BVHTree then just do a bvh1.overlap(bvh2). That should return two list of indices of vertices that overlap in between both trees. Then just delete the non-intersecting geo.

Not an expert by any means but it looks like you're only working with vertices and edges, so a BVHTree (BVH stands for Bounding Volume Hierarchy) is not really suited for that. You can however use a KDTree (k-dimensional) structure. Thankfully it is also supported by Blender https://docs.blender.org/api/current/mathutils.kdtree.html

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


text:
Colors look much different in solid view than the render view

My image looks fine in the solid view, but get flattened and lose colors in the render view. Anyone know why this might happen?

which render engine you are using

Also material setup could help. Check color management (unlikely, but not impossible)

also also, if "use lights" is enabled there will be differences between solid and rendered view. But anyway, without more infos or a file it's pretty much impossible to work out what the problem is

I was using Workbench for render, but it didn't seem to make much a difference whether I switched to Eevee. I also played with 'use lights' to see if it made a difference. No success there either. Uploaded the blend if you'd like to check it out. Thanks for the responses!

thanks for the file. actually after writing my answer i realised it's the same problem as in this question: https://blender.stackexchange.com/questions/196019/my-grease-pencil-colours-go-different-colours-in-render-mode

Thanks again wilks! Very helpful. Seems like such a technical issue for a newb like me. I'll be sure to pay attention to the vertex and material modes next time.

The problem: When in solid view there's no way of seeing if Vertex Colour mode is enabled or not. In your case it was enabled, which means that whatever material you used when drawing was being overridden by the brown colour selected for vertex colour. That only becomes visible when you switch to material preview or rendered mode.
The solution: I'm not sure there is an easy way to revert this. I looked but can't find a switch to disable vertex colours (whether at the object or layer level), which would be ideal.
So you could switch to Vertex Paint mode, select the same colour as your material (with the picker) and using the replace tool, fix every stroke's colour. This is gonna be long and tedious. You might be able to speed things up in some cases by isolating a layer and increasing the tool radius to do a whole layer at once. Also you can select everything that has a specific material by going in edit mode and clicking Select in the material panel.
A much simpler way would be to render the solid view with View > Render Viewport Animation. But then that limits what you'll be able to use in terms of effect and lights, as they won't show up in solid view.
Good luck and basically the advice is that in the future you should draw in Material Preview mode.

UPDATE: According to the following answer, as of 2.92 Alpha, there is an option in the Paint menu to Reset Vertex Color, which should solve this problem: https://blender.stackexchange.com/a/204738/168

https://blender.community/c/rightclickselect/h5gbbc/


text:
make swosh fluid stylised motion graphics
is there a way to make such designs in blender? like fluid moving stylized mograph style. have been trying, not very good in blender.
Thanks

I believe there is, but it depends on how you want it done, i.e. how you want it to be flexible after making it.

could you explain one way to me pls. much appreciated

Well, the first thing I think of is a very blobby looking circular curve extruded along a large wave one, but the trick then is how to make the yellow areas. Maybe the blobby one has one long arm that forms the curtain… I’ll try it.

Missed that it was motion graphics. Can you provide an example where it is moving? I'm not familiar enough with this style.

Please be more specific about your problem or provide additional details to show exactly what you need. The way it's written now, it's hard to see exactly what you're asking for. Thank you!


text:
Video Editing: Camera view
I would like to know if it is possible to see that what camera see in the layout in video editor, but not a full rendered movie just a render preview. I need it because I need to switch to change the animation while I manage subtitles.
edit:
The method of Crantisz work but the preview is a little different that the preview that I have in the layout. It miss something in the animation. In my animation the spheres follow the polyhedrons and in the video edditing preview it don't.

...

You can do this in the separate scene. If your animation in the default Scene, add a new one.
In the new scene, you will be able to select your first scene:

Preview by default is solid, but you can change if you want:

I answered you lower.

This is not the answer, edit your question instead

To get instant updates of the 3D View in the VSE, you'll need to do a Linked Copy of the scene and add this scene as Scene Strip to the Sequencer. As described here, you'll need to switch off the cache and update with Crtl+R and/or move the play head to see the updates: https://devtalk.blender.org/t/suggestion-make-the-sequencer-contents-into-data-block-which-can-override-the-switched-to-scene-sequencer-contents/16562/9
Alternatively, you can use the alternative version of Scene Strip Tools, which will set up the Linked Copy scene automatic for you when adding a camera: https://github.com/tin2tin/scene_strip_tools/tree/linked_copy

Hello. Idon't understand clearly how to download and install the scene strip tool in your link. When I click on "Download and install this file: https://github.com/tin2tin/scene_strip_tools/raw/master/scene_strip_tools.py" it show me a huge page whith scripts.

At the begening of the script it says "# Run the script:
1. Run the script in the text-editor." But what is the text editor?

I found how to install it. Now I selected the scene strip then click on "link sequencer to 3D viewport" but nothing change.

You'll need to select a camera in the 3d view and click on the Add Camera button, Then repeat until you have several strips in the sequencer. With link sequencer to 3d viewport checked the cameras should now be switching in the 3d view according to the strip lengths in the VSE.

Why "several strips" while I just need one? I did what you say but still no change.

You won't see any camera switching if you only have one camera.

Still I don't see change with various little camera strips.

And I I don't follow the Crantisz method there is nothing on the screen.


text:
Boolean Intersect is not working well
I try to do an animation with a cube with intersected parts with two tetrahedrons that move in scale. For This I'm using the Boolean modifier.
The problem is that some parts of the cube pop outside of intersection randomly in the animation.
Some parts pop as well if I select "Exact" solver.
As you can see in the gif.
Is there an solution for this or an alternative to this modifier that can do the same job?

Turning on Self intersect and/or Hole tolerant will probably solve the problem, however beware that it will cause a noticible slowdown.

I tried with Self and/or Hole tolerant it didn't change anything then I got back to solver fast and the bool is now working correctly :/

But it was glitch. When I repeat it doesn't work.


text:
Animation Nodes: cube root function
I need to use the cube root function in animation nodes but there is no cube root in the math node.
Is there anyone who know how to do ?
Thank you

You should raise the number to the power of 1/3 or 0.3333333333333333 that will be 1/3 in 32bit float precision that numbers in Blender are.

Use Power function with 1/3 as exponent.

Thank you very much.

If you know your way around python basics, you can also use an Expression node :


text:
Bones are not moving in pose mode
They are not even rotating . The bones stays at there position without any movement .I am doing this for 2D animation and not 3d if anyone could help it would be great.
https://pasteall.org/blend/f0dc519c38194cfa9a0b9bc415c9e819

maybe your armature is in Rest position (in the Object Data panel)

Unfortunately it's not

could you please share your file (armature only)? https://pasteall.org/blend/

ok, I uploaded it or do i have to share it here?

pasteall will give you an URL.  Edit your question on add the URL to it.

Hi. This question was put on hold because as it stands it is not answerable for lack of essential details to understand the issue. Remember only you have access to your scene, so unless you describe it thoroughly only you know your exact setup, settings and what steps you took to arrive where your are now. Please describe in detail what your issue is, possibly supported by some accompanying screenshots with the [edit] button above. Don't post a comment or ask a new question, editing will automatically put it up for review so it can be reopened.

In the Pose Options panel, disable the Affect Only Locations option:


text:
How to handle thousands of lights
I'm trying to create a night-time city in Blender 3.2. For streetlights I've tried two approaches with geometry nodes:

Instance lots of balls with an emissive texture.
Instance actual point lights.

Neither does much in Eevee. Emissive materials don't light surfaces. With more than 128 point lights they get ignored. Cycles is slow in both cases.
I wonder if there is a clever solution? Can I somehow bake this lighting so the roads and buildings get a fast lightmap texture? I want to animate some stuff, but the lights and buildings will be static.

Here is a dark city scene setup with emissive materials for the windows and emissive spheres used as street lamps (EEVEE)

As you noticed, the emissive lights do not cast light on the surrounding objects - to do this in EEVEE, you will need an Irradiance Volume. Scale the Volume to your size requirements and bake the lighting in the render properties tab. You can adjust the cube-map size if you need better resolution (right side)::

You can also select the Irradiance properties and change the resolution - don't go too high or performance will suffer:

Here is the scene after the bake - the lighting will stay the same until you delete the lighting cache or bake again:

Thanks, much appreciated! I haven't been able to get it working so far, but I'm still pushing the buttons and hoping for the best. (Somehow a different part of the city ends up lit than the one where I put the irradiance volume, and it's not looking great. I'll experiment with a smaller piece to get the hang of it.)


text:
Strange lines on top of mesh (in edit mode)

Hello. I am new to blender 3.0. I have started learning it from Andrew Price's(Also known as Blender Guru https://www.youtube.com/c/BlenderGuruOfficial/) Donut series. While learning from the series, I came across a something which isn't problematic as of now. But out of curiosity and in an effort to reduce future storms, I decided to find about it by googling it but didn't find any result.
What I want to know is what is the zig-zag pattern as shown in the image that appears in the edit mode?
What I have tried so far:

Checking if there are overlapping meshes. I had done this using merge by distance.
Flip the normals.
Delete the modifiers and again use them.

Some Deatils:
Modifiers used : Solidify, Subdivision Surface
Blender Version : 3.0
Blend File

I would think this is because there is a subdivision surface modifier on the mesh which is also previewed during edit mode. The preview intersects with the edit mode 'cage' resulting in these patterns. It's display related and nothing to worry about in terms of mesh quality. Could be any other modifier as well(e.g. solidify)

Sorry for replying late. I had disabled subdivision surface, solidify in edit mode. I guess they can't be the troublemakers.

Disabling it in edit mode does not mean it disables the preview of the final surface. You can still see the solidify result. Try applying all modifiers. Then you should be able to see what your actual mesh looks like in edit mode.

Without a blend file you can sadly not say much about this. You can use blend-exchange.com to share your file.
My assumption here would be that your icing is clipping through the actual donut. Thats what causes those lines. Its where both start intersecting. This shouldn't be visible if you are in object mode because of the Solidify modifier which us disabled in edit mode (probaly for easier editing). This wont be visible in the final image. But if you would still like to have it fixed you could try to scale it up as a whole or move it slighly up on the Z axis.

Sorry for replying late. I have uploaded the blend file. I did what you said. Moving up did solve the problem at that place. But it gave rise to problem at other place. Scaling up didn't minimize the problem. After scaling up, vertices of some inner rows disappeared as if they had had gone behind the donut surface touching that part of icing.


text:
Looking to change the color underneath the skin
so I've been making a character in Blender and long story short my topology is horrendous but has produced a really cool effect that I want to play with but don't know how.
Basically there are these white lines underneath the skin which I painted on using vertex paint and the node editor. Here's a photo.
They appeared when, in vertex paint, I began using the blend brush. I think basically the blur brush brought these white lines out on my horrendous topology and highlighted the seams, bringing out some glowing white material underneath that I don't know how to edit.
My question is this:
How do I change the color of these lines?
I want to change them to a red color or possibly a blue or purple so they look like alien markings but cannot for the life of me figure out how to.
If you need any more information please let me know. Hope to hear from you soon!
Here is the link to the file.

Andrew.

Since it seems to depend on your specific topology, maybe you should share it (if you feel so, use http://blend-exchange.giantcowfilms.com/  then edit your question and paste the provided link)

you'll have to excuse the topology. I've been learning as I go how important it is and how to better manage it. I'm very new to this. This is pretty much the first game character I've tried to develop and it's more of a learning experience than something permanent.

Use Bake, and then edit them outside blender (for example with Gimp).
The vertex paint can replaced using dynamic paint.
You can bake the vertex colors at the render panel. There, you will find the bake mode "Vertex Colors" which will export the vertex painting.
In your image editing software, you can change the hue or brightness or whatever and after image processing, you can bring it back as a texture.
As for applying the modified vertex paint to your model, the following QA will be helpful.
How to bake uv map texture to vertex color (selected to active)?

First of all, imho it could be difficult to "control" this "effect" since it is applied on, as you say, a wrong topology: but how bad is it? Using the 3d print toolbox addon, this bad:

That said, you are mixing (multiplying) the vertex colors and a color ramp, so you can, at least, act on

vertex colors
colorramp colors and settings
mixing properties (mode, amount)

This is the current setup:

If you just change the color of the selected point of the colorramp to something very different than white:

but if you change the mixing factor amount:

then, if you also change the mixing mode:

Then you could change other materials setting, add more nodes and mixing modes, but to have a full "control" of the result, I would first remove unpredictable factors like (so much) bad geometry because tools are thought to be used with good geometry, not whatever you come up with...

There are several answers now but I think none of them describes what you basically wanted to do: change the color. There are 2 solutions for this. The first being drawing your vertex color with red or something. The second is the one I prefer. Add a color mix node in between your vertex color node and the other color mix node and set its blending method to Multiply so you have first your vertex color input. Going in to a color mix node with blending method multiply. That node should have a Fac value of 1 and the second color is the color your want your pattern to be. The output of that node goes into the input of the next mix node where you currently have your vertex colors attached to.


text:
keyframe animation mesh changing color
I need to make keyframe animation from animation below to see color changes not only while rendering, does enyone know how to deal with this?
 The main reason is to export it in .json to use with three.js

Thanks.

.blend file and animation copied from another question:
Animating a material change along an axis of a mesh
 thanks @lemon

possibly related https://blender.stackexchange.com/questions/75783/growing-a-shape-with-changing-color/75798#75798

Can you use armatures or shape keys?

@OmarAhmad yes, probaly shape keys may solve this

@m.ardito thanks for link, I found some useful info there


text:
Distorted texture

Not sure what the reason of this distorted texture is. UVs are projected using Smart UV Project, and Subsurf modifier is used then. Tried subdividing the plane, but nothing changed.
How can I resolve this? I am assuming it has something to do with the mesh?

I hope you do not mind my edit. Let's try to use the terminology correctly. If I changed something not to your liking, please edit the question and correct it again. Hope this helps you to get better answers sooner.

I was able to replicate your issue:

The problem comes from the subdivision surface modifier and the option "adaptive subdivison"
There are several ways to fix this, depending on how you want your end result to look like.
Adaptive Subdivision doesn't like triangles very well (from my experience, could be wrong tough), so one step would be to try and reduce those as much as possible.
It also yields better results if edges are parallel to each other. So, essentially just a subdivided plane.
You can also turn off the adaptive subdivision, depending on what you want to do with your scene.

My question to you is, what do you want to do with the adaptive subdivison, do you want to make the stones "stick-out" as a real mesh? If not you can use a normal map.

First connect the vertices that i marked with green lines then remove the vertecies/edges that i marked in red.
you can connect vertices by pressing J and to remove vertices/edges press Ctrl + X.
also you should unwrap the model by just pressing unwrap instead of smart uv project.

Did you add the subsurf modifier after unwrapping the object?
You have to do it the other way around: Try adding the modifier first and then unwrapping the object. Open the unwrap - menu and select "use subsurf modifer"

I have tried your suggestions before hand. No results. Thanks anyway!

"Distorted Texture" probably because UV's are distorted. Subdividing will only make the mesh more complex and so more difficult to correct and why would you want to use a subsurf modifier on such a model? What you need to do is straighten out the left and right hand side of the UV's Then try to sort out the scaling problems of the different faces. In the UV editor select all the vertices on the left hand side > W to open the Align menu and choose the Align X option. repeat for the right hand side. Then  the UV island rotate 90° so that its probably aligned with your stone texture.

Then try scaling along X axis. But really you need to sort out those ngons in the mesh and make sure that both rotation and scale have been applied before unwrapping. Don't use the Smart Project for such a model. All that sloping wall needs to be unwrapped as a single island. Add Seams along top and bottom of the wall if necessary (and perhaps a couple off vertical seams if really needed) then use the simple basic UV unwrap. Then straighten top and bottom edges of the slope and scale along X axis. Without seeing the whole sloping wall I'm just guessing :)


text:
Parenting messes up transforms - where is the offset stored?
When I parent an object to another object with keep_transforms=True The object stays in place as expected, however I noticed that the location attribute of the child did not change.
If I zero out the location, my child object goes to the center of the world. I would expect that if I parent something with keep transforms, an inverse transform is applied to my location (location would not stay the same), I would also expect if I zero my child location attributes that the resulting position would be the same as the parents location.
There must be an extra transform offset kept somewhere which is trying to preserve the original location coordinates, basically storing the inverse that I feel should be applied to my child location as an offset attribute when I do the parenting. Where can I find info on this invisible attribute/offset?
This behavior is simply bizarre to me.
Steps to reproduce:

In the default scene Add->Empty->Plain Axes
set Empty location to (-2.0, 10.0, 2.0)
Translate the default cube 5 in the X direction
Select Cube then the Empty
Object->Parent->Object->Keep Transforms
Select Cube, notice Location X is still set to 5
Zero out location of Cube, notice Cube goes to world center.
Rotate or move Empty and the cube is no longer at the center, but has 0,0,0 for location.

Where is the extra transform stored and why is it stored at all?? If the parenting took place at world space 0,0,0 for both objects, it works as expected, but that is not convenient and seems ridiculous as a workaround.
Using Blender 2.68

The difference between the parent and child is stored on the child when the parent is set.
It's a matrix that can only be accessed through Python: bpy.types.Object.matrix_parent_inverse

Sure enough, setting the matrix to Identity it behaves as expected now. Thank you!

Any idea why this is not visible in the UI? It's so hard to understand what's going on as a result of this. From a UI perspective, a completely identical pair of elements can behave differently. It's especially challenging because of the ambiguity in the "keep offset" (i.e. keeping the parent offset or the world offset). I'm having an especially difficult time positioning a newly created child on a linked element. I don't want to delete the entire parent structure just to duplicate it again, some children have positioning... ;(

What I mean, is, have you read or heard a reason why the Blender team hides this information? Otherwise, I will try to figure out how to add a feature request.

Interestingly, "Clear Parent Inverse" seemed to solve my problem in this case. I think, though, it wouldn't have if my child object hadn't been properly created at the origin, initially, due to more hidden information...

Should future searchers find this answer, there is an option to parent without inverse. By default, this operation is called "Make Parent without Inverse" and is searchable in the spacebar menu, with a default hotkey of CTRL-SHIFT-P. This sets the parent, then clears transforms on the child object, snapping it to the parent.

This is one of the most annoying things and the main reason I try to avoid parenting. It just causes Blender to behave unpredictable!

@Italic_ : Thanks for mentioning it. I was getting frustrated with this issue. In the latest versions of Blender when you press Ctrl+P it has an options 'Object (Keep Transform)', this seems to solve the problem for me, but I am wondering if this is same as 'Make Parent Without Inverse' - is it effectively the same?

@saicode As far as I can see, no, they are not the same. In fact, the behavior of Parent and Parent (Keep Transform) are exactly the same and they both behave as a normal parent. I'm not sure of the "proper" way to use Parent (Keep Transform).

ok. i found this question when researching about an similar problem where an empty following a path (both are child of another obj) behaves unpredictable. what i found out is that you cant parent the empty just the path. thought that might help someone that has some problem like this.
-laurin


text:
Attribute ImageFormatSettings.file_path doesn't exist
I'm trying to make a script and I'm having trouble with this line:
bpy.data.scenes[0].render.file_format = 'PNG'

And it prints this error:
AttributeError: 'RenderSettings' object has no attribute 'fileformat'

Of course it's no big issue to click the mouse and set it, but I want to find out why it doesn't work. When I hover over the File Format menu in the render settings I see this:
bpy.data.scenes["Scene"] ... file_format

I noticed that there are a few other commands which show "..." in the attribute's "path". I checked out the docs, it doesn't say that file_format is deprecated. I'm using the latest version and Blender's default renderer.
Any idea why it doesn't work?

It seems that the path you tried to use only exists in a context for UI elements, from properties_render.py:
def draw(self, context):
    layout = self.layout

    rd = context.scene.render
    image_settings = rd.image_settings
    file_format = image_settings.file_format

    layout.prop(rd, "filepath", text="")

In a script you could use something like:
bpy.data.scenes[0].render.image_settings.file_format="PNG";


text:
Slanted loop cuts
I'm trying to make some loop cuts in the mesh I'm using to create a house in order to add interior walls to the house.  Every time I try to make a loop cut, it starts rotated across the faces of my mesh rather than straight across the mesh.  Is there any way to keep loop cuts from doing this?

loop cut follows the topology of the mesh, in your case just add the loop cut then hit S  Y 0   to aline it on the Y axis

After you hit Ctrl+R buttons and place the loopcut in the location you want, press E button to make alignment with the side edges and then F button to change to which side to align. Then you can slide the loop and apply the location with Left Mouth Button.

Note: If the model is unwrapped, Correct UVs option should be enabled in the Loop Cut and Slide operator panel.

more people need to know about this.

Just like Chebhou said the loop cuts follow the topology. See examples below:

What you can do is use the Knife Tool instead of loop cuts. Press K, then C and drag the mouse from left to right.

You may also select the loopcut, position the cursor on it and press S,Y(orX or Z, depending on your situation) and then 0.


text:
Saving texture painted material externally?
Is there a way to save the texture of a mesh that was painted with the texture painter externally?  I'm trying to create a mountain for use in a game and, admittedly, my texturing skills are garbage unless I can just paint on the model (I'm more of a programmer).  I have a mountain with acceptable textures in Blender, but I need to save the painted texture externally for use in Unity.  Google hasn't turned up anything useful.

What do you mean by 'texture painter externally'? I can open up gimp with a texture created (and saved) within Blender. When externally edited you need to reload it from menu or Alt-R

When you paint a mesh with Blender's texture painter, how do you save that painted texture to a file or is it even possible to do so?

Select it in the UV-Editor save it while you're in Blender, edit externally and reload in Blender.

So you can't save the texture as defined on the mesh in Blender, huh?  That sucks.  Every time I try to edit a texture in an image editor, it never turns out looking like I want.

If you unwrap an object, the texture should always be applied to the object in the same way.

Open the texture in the UV image editor. If you have multiple textures beside the one you want to save, click the little PNG icon and select the proper image.

To save the image, click Image*> Save As Image.
You can also hit F3 while viewing the image.

You will be asked to give a file location.

Nothing shows in the UV image editor's preview window.  It's just a black image.  If I try to save that image, it just saves a black image.

Edited the answer accordingly.

@Carnivoris Did it work?


text:
Animation Nodes: How to cut copy and paste functions
For example I want a function who is
cossinus from less infinite to zero (time info)
then square root frome zero to 100
then end here.
How could I combine this ?
More explanations:
I got a funtion cossinus who use time frame for x. I want to cut it for the x value from less infinite to 0.
Then I have an other function who is square root and have frame time for x. I want to cut it for the x values from 0 to 100. Then I want to paste both cut to make one function.

Hello, it seems the title of your question and its body are not asking for the same thing. Could you elaborate a bit more on what you are trying to do ?

I got a funtion cossinus who use time frame for x. I want to cut it for the x value from less infinite to 0 (sorry I forget the "less" in he first description). Then I have an other function who is square root and have frame time for x. I want to cut it for the x values from 0 to 100. Then I want to paste both cut to make one function.

Use a switch node and a compare node to evaluate the input x.


text:
Animation Nodes: loop list to vertices of a mesh
I try to make a loop with a spherical mesh and make it loop in a way that each iteration go to the location of respectfully each vertices of a random mesh like suzana the monkey for exemple.
Is there a way to do it?

I found my way by doing like this:


text:
Dark camera view problem
Hello I have a blender file with an animation that is the fruit of a long work. The problem is that now I need to use the camera view on it and when I click on the camera view it show me a total dark view with not even the usual camera rectangle borderlines.
Render image work correctly but I need only the camera view.
If I make a new blender file everything  work correctly I see well that what camera see. But I don't want to restart all my work for this problem. Maybe that I did tick a wrong option somewhere?

...
Edit: I tried to press the home button in camera view like Crantisz suggest but it only make the view back out of the camera view.

When you are in camera view and see the dark background, press Home button to reset the view, or use menu:

I'm sorry but I don't know what is the home button. How could I have access to it? (my laptop has no numpad)

You can find it in menu: View → Frame all

I edited my post.

Oh! that's fun, this works different from menu. I'll check if I can solve this

All right, I've found it: View → Cameras → Frame Camera Bounds

I work ! Thank you so much.

Should be an issue caused by using Orbit around selection option. Not very useful, I don't suggest using it. You can always set center of viewport rotation by alt+MMB. But it's up to you


text:
How to apply force to a face of an object?
I wanna do a test on an square (softbody) where the top surface is fixed and i want to apply a force to the bottom surface toward down to see the deformation of object due to the applied force.
Does anyone know how to do that? Thank you in advance!

The result is likely to be something like this:

Cheers

Please could you add a screenshot?

Yes sure, i have attached.

Something like this? https://i.sstatic.net/S11SU.png

Close!! but it looks like the object deformed due to gravity. Can you try to turn off the gravity and for example apply 5 N force to the bottom and see how much it will deform?

So should the bottom be fixed? If it's a soft body, the sides are bound to squish in.

Please fix it and then apply the force! Thanks

https://blender.stackexchange.com/a/187769/107247

modifiers - Soft Body - Preserve Volume when deformed - Blender Stack Exchange? This is so called volume preserve soft body deform in CG

5N is very specific.  If you're trying to do simulations, you'd be better with Finite Element Analysis software.

Ok, here is a thing. You know that in the GSoc 2020, there is a volumetric solver (ADMM) has been developed and it is able to simulate hyper-elastic material. I know FEA very well so i am curious to see how big is the difference between the volumetric solver in blender and FEA. So i wanna carry out this test.

Now i can run the ADMM solver created by Matt in that project, and i know how to fix the top plane. Just not clear about how to apply a accurate force to the bottom plane... If i know that i will compare with FEA result and see how big is the difference when testing hyper-elastic material.

Does this answer your question? Can a custom optimization code be added for doing accurate mesh deformation simulation in Blender?

You can add a 'force', but you can't specify newtons. Blender is for making things look right, not be right.  As an example, here's a quick gif I made: https://i.sstatic.net/UYb0I.gif

Hi thank you very much for reply! The gif you made looks very nice. Can you tell me how did you do that. I appreciate it a lot.

So there are a few questions here.  First, how to anchor the top of the soft body?
Soft body physics are anchored through the use of the "goal" trait, which is by default set to 0.7 strength for all verts-- so once you start using goal to pin soft body verts, you might find that your soft body physics change.
Create a vertex group for your mesh.  Assign the top vertices to that group, at weight 1.0.  Now, on properties/physics/soft body/goal, specify your vertex group as the goal vertex group, then in soft body/goal/strengths, set the default weight to 1.0.  Your assigned verts will no longer move with the sim-- they'll act pinned, as with cloth pinning.
This will prevent the other vertices in your soft body simulation from having any goal weight.  You can assign the other vertices to your goal group (at a lower weight than 1.0), or you can set the "Min" goal in soft body/goal/strengths.
The next question is, how to apply a force to a soft body mesh?  There are a number of different ways.  You could set collision type to "face" and then use a collider to press down on the mesh.  You could use a force field.  You could just use gravity.
What you describe in your comments is the desire to exert exactly 5 Newtons on your bottom verts.  That's the force necessary to accelerate 5kg by 1m/s/s, or to accelerate 1kg by 5m/s/s.  Using default Blender scales, and default soft body mass settings of 1kg, the simplest and easiest way to exert this force is via gravity.  In properties/scene/gravity, set your gravity vector to 0, 0, -5.0 and your softbody's 1kg verts will be accelerated downward at a force of 5 newtons.
But maybe you don't have constant mass for your soft body.  You can use a force field to do the same thing, just without quite as much precision.  Make a new force field, of "force" type.  To make it directional rather than radial set the shape of the force field, in properties/physics/force fields/settings/shape, to "plane".  Then, in force fields/falloff/Z direction, choose an axis for the force field to operate along.
But what strength to use to represent 5 Newtons?  Tests on 1kg and 5kg rigid bodies suggest that a strength of 120 is about right for 5N at 24 frames per second.  If you want to get more exact, remember that the distance that an accelerating body travels is equal to at^2/2, where a is acceleration and t is time.
But if you want to know what it's going to look like after that?  The answer is, it depends not only on your forces, not only on your soft body settings, but on your vertex density and your topology.  Soft body physics are not real physics.  Even though I did my best to answer your question, if you're wanting exact numbers for your forces, you shouldn't be using Blender's physics for your problems.  Blender's physics are tools to create pictures.  They bear only the tiniest resemblance to actual, real world physics.

Hi Nathan, thank you very much for the detailed description, i understand what you said. For the gravity method you mentioned, is that possible to make the bottom face not change its shape during the process?

@MengzheLyu You could adjust spring strengths on the soft body, possibly in conjunction with vertex groups to control differences in spring strengths, which will never give you zero deformation on the bottom face but can reduce it, or you could use an armature and bone constraints to translate the "average" transformation of a non-rendering, physics-deformed face onto a rendering, armature deformed face.

This is a great answer. The concave deformation in the original question is due to cross-links in the internal structure of the material and as you say, the Soft Body physics is not the right tool to accurately model that (certainly couldn't be done with only the outer surface modelled in the mesh).


text:
How does Subsurface work?
I followed a tutorial to get a milk-like texture but I wanted it in an orange color, when I applied the same settings to my texture there is now a blue tint in the material. Can someone explain why this is happening? Is this also related to Subsurface Scattering? In the first image is my material preview, I believe the surface radius relate to RGB value which should mean that it should be more red than blue right?
I've disabled mix shader and glossy shader but it seems that didn't fix the solution. The last image is of just the liquid with a subsurface of 0.1 with the cup turned off and the edges seem to be clear white

Hi :). Your Scattering depth is 10x larger than should be for milk. This can cause blue tint, because physics.

Mute your Mix Shader and see if the problem goes away.
My suspicion is that since the Principled BSDF already has a glossy component, mixing in another Glossy BSDF is messing up the light response.
If you need more gloss, try using the Clearcoat setting on the Principled BSDF.

VS

thank you I will definitely do that. I did disable the mix shader and glossy shader but there still seems to be the blue tint  @allensimpson
https://imgur.com/a/yXLhSsz
https://imgur.com/a/VOXljXX

@jk123 Seems like that is coming from the plastic shader and not the liquid.

Here is my render with subsurface at 0, 0.1, and 0.5. I also included a last render that has a subsurface of 0.1 but with no cup and it seems that the edge is clear. Is this what's causing the blue tint and how could I fix that?

@jk123 please edit your question and add new images there. The comments are not always completely visible and not everybody reads them all. --
Blender 3.0 uses the "Random Walk" option by default. This uses the thickness of the mesh to calculate the SSS. If the mesh is too thin (the plastic?) then you can get this blue-ish color. Try the "Christensen-Burley" option and see if it's still blue.

@Blunder I have some similar model here, the bluish tint also appears if you render only the drink inside without the plastic cup. It's like you say, "Christensen-Burley" does a better job. Also "Random Walk (Fixed Radius)" is better than the default "Random Walk". And I just realized "Christensen-Burley" renders much faster, the default "Random Walk" renders slowest. Never tried that.


text:
Eevee Intel integrated graphics GPU
I recently got a new laptop, and I want to use it to animate in Blender. It has Intel Iris XE Integrated Graphics. I understand that OpenCL and OpenGL are no longer supported for cycles rendering, but I want to use Eevee to render. NOT run.
Is there a way to use Iris XE graphics with Eevee. It does support OpenGL so I would suppose so. Would it work by default or would I have to change some variable? Would this functionality continue to new blender versions?

The answer is a resounding YES! Eevee is the way to go with Intel GPUs. Sad that I can't use Cycles, but it isn't the end of the world.
When testing I figured out that while rendering with eevee, the GPU performance was at 100%.

Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.

List of supported GPUs
It looks like Haswell was Gen7, and Iris XE is Gen12, so it should be fine.
https://en.wikipedia.org/wiki/List_of_Intel_graphics_processing_units

Thank you for your time. This answer is not complete. That page is NOT for rendering in Blender, just running it.

Since Blender is free and you already have the laptop, I recommend you try and give a self-answer to this Q

An excellent idea, I don't currently have access, but If this question isn't answered when I do I will for sure. Thanks for the suggestion.


text:
Particles Emitting out of the mesh. Leaving the object
I am new to Blender and I am using Blender 3.0.0 and I was making a city scape and I sculpted some buildings and I want to place them on the plane as particles but the building particles are emitting outside the plane.

and also the particles are submerging under the plane a bit even though the object origin at its base.

And also the particles are not coordinating with the weight paint. and I want it to coordinate with weight paint desperately.
Here is the blender file.
https://drive.google.com/file/d/1XpTrFCb3NUI797dO8dt1qX9GR5jjHMX2/view?usp=sharing
Edit:- Just now I realized that the plane face was wrong side so I flipped it but it didnt solve the issue.

The origin needs to be at the base of the particle object. If I select one of your particle object, here is what we can see, it's not the case:

Also you have a Clip problem, in the N panel > View > Clip End, lower down the value to 100000 m for example.


text:
creating a stamp from 3D object
I am trying to create a "stamp" in Blender from overlapping objects, but boolean Modifier doesn't work properly if some faces have the same z value.
I have tried different sequences of using boolean and join.
I would like to have an easy way to set the depth of the stap to a specific height for easy handling.
I think the best solution would be to create one face from the outline of the top down projection and extending it in the z-axis, so the boolean modifier works correctly without coplanar faces, but I don't know how to do that.
I would also appreciate other possible solutions to this problem.
I know my issue is having coplanar faces, but how do I clean them up in my case?
Thanks in advance.

correct stamp result rendered (faces : stick -0.01002m; triangle -0.01m; circle -0.0099m)

result with stick and circle bottom-face same z-value (similar result, after join)

edit view with highlighted circle bottom

Solution to getting a clean stamp to then boolean afterwards:

Move all stamp objects to a collection (In my case "Stamp"). Then move all but 1 of those objects into a new nesting collection (In my case "Bits").

Select the object that's not in the "Bits" collection, and add a Boolean modifier set to Operand Type of Collection, and select the "Bits" collection. The Solver must be set to Exact. Add a Decimate modifier set to Planar. (Decimate modifier not necessary)

Now duplicate the object with shift+D. Right click to cancel move. Press ctrl+A to open the Apply menu, select Visual Geometry to Mesh. Press G and move the new object to the side. Doing this makes the stamp one object whilst keeping all the old stamp objects untouched.

With the new object selected, enter Edit Mode and select any of the top faces. Press shift+S and select Cursor to Selected. Exit Edit Mode, open Context Menu with right click > Set Origin > Set Origin to 3D Cursor. This allows the stamp to be scaled in one direction in the Z axis.

When using the Boolean modifier set to Difference. Faces on the same plane must not overlap. In this case, the top of the stamp is just above the cube. The previous step helps keeping that top face where it is.

Thank you very much. Setting the cursor position, with collection was what I needed. That way I can scale to an absolute position in meters.

Put all of your overlapping objects into a new collection. On the object being stamped, add a boolean modifier with the Operand Type set to "Collection" and select the newly made collection. This will repeat the bool modifier separately with each object in the collection. The final mesh may come out quite messy, but should be easy to fix with a limited dissolve. (Mesh > Clean up > Limited Dissolve)

Using a Collection helps with the Management a little bit, but I still have the same issues if the objects overlapp with same height faces. I don't want to apply the boolean modifies yet, because I would like to move the stamp freely. Just having a Stamp as one Object, so I can change size and height easily. Thanks!

I would like to apply a cleanup on the stamp itself, but limitted disolve doesn't look good in my case and the issue persists.

For 3D printing you just have to join them (ctrl+j), if you're preparing models in Ultimaker Cura for print, in properties find Keep Disconnected Faces and turn it on. Go to PREVIEW and ensure that all layers are good and the model is ready to print.

I would like to print the object beeing stamped and the preview doesn't look good in Cura either after appling join. I would also like, if it also looks ok inside Blender itself, because I plan to use more stamps, but thank you.


text:
How to bend a 3D scanned tubular object without altering its diameter?
I am creating an insert/shim (something like a last for shoemakers), namely a stiff 3D-printed part designed to permanently distend a plastic tracheostomy tube's inner cannula. This inner cannula has an inside diameter of 5.5 mm.
Here is the unbent inner cannula insert:

Here is the bend plan for this object:

I want the inner cannula to take on a different shape, namely when held with the open flared top facing me and the tube curving away and down from me, I want an additional 10 degrees of front-to-back tilt (so the distal end comes towards me) and 28 degrees of left-leaning tilt (distending the tube in two dimensions).
I have been experimenting with Blender's simple distortion tools, but I'm finding that the distorted 3D figure becomes flatter.  I need to constrain the distortion so that the diameter of the tube remains intact throughout the whole bending process (I intend to place the plastic tube in hot water and soften the plastic enough to allow it to be permanently distended and shaped to the ideal shape that I require).
I took a 3D scan of the outside of the inner cannula and then used 3D Slicer's Margin tool to reduce the diameter evenly by enough to ensure there will be a 0.25mm gap between the outer wall of the insert and the inner wall of the inner cannula.  I hope this will be enough to allow me to slip it inside gradually as I distend it.  The challenge is that this kind of plastic cracks if it is distended too quickly, so this is very much a work in progress.
Does anybody know how I would use Blender to achieve this complex bend?  This is a medical application for my special needs 16-year-old son.
Hint : I'm a Python programmer so if the solution is complex I'm up to the task, I just need a pointer in the right direction.
Here's a link to an OBJ file of the unbent insert.  The side of the tube that is sharper and noncylindrical is the top.  The top third of the object must not be distended, the bending needs to be kept to the bottom 2/3 of the tube.
Here's a picture
Power to the people !  Blender rocks !

hello could you please show some pictures, it would help to visualize

Look more carefully, I already have links to applicable pictures.

it's better to directly show them in your message   ;)

@ Myles Dear so from what I understand you basically need to 3D print a shape in order to bend another one, have you tried to bend the object with a curve modifier?

I managed to hire a developer to take care of this for me.  Check him out!  https://www.upwork.com/freelancers/tadsouza  .  Check out our final product :  https://opensea.io/assets/0x495f947276749ce646f68ac8c248420045cb7b5e/62747652541663514507087434811839774222596193624949302758567741995891971588097/

Nice, so did you 3D print it?


text:
Rotation matrix to_euler, Euler angle decomposition order reversed?
Is Blender's euler decomposition order reversed from common convention? I have written some code below that demonstrates this, and am wondering if I'm making a mistake.
I'm having trouble understanding the Euler angle decomposition order when defining a rotation matrix manually, via the python api, and then using matrix.to_euler() (from mathutils). I want to do an 'XYZ' euler decomposition, which in common convention assumes a rotation matrix composed of Rx * Ry * Rz (eg. see wikipedia page on Rotation matrices)
Wikipedia also lists how to decompose angles x, y, and z (alpha, beta, and gamma) from the rotation  matrix:
However, if I use mathutils "to_euler('XYZ') on the same matrix, I do not get the same euler angles as the above implementation from wikipedia. Instead, I get these when I call to_euler('ZYX'). Hence, Blender's decomposition order seems to be reversed from common convention (for instance, wiki's implementation seems to be based on this document, and I can confirm that my dynamics textbook implements euler angles similarly).
Am I making a mistake, or is Blender's implementation reversed (and thus potentially confusing)?
import mathutils as mu
import numpy as np
import math

R = mu.Matrix([[ 0.95178465, -0.30668812, -0.00695456],
 [ 0.30676697,  0.95154004,  0.02157744],
 [ 0.,         -0.02267051,  0.99974299]])

 # xyz

phi_y = np.arctan2(R[0][2], math.sqrt(1 - (R[0][2])**2))  #angle beta in wiki
# or just phi_y = np.arcsin(R[0,2])
phi_x = np.arctan2(-R[1][2],R[2][2])    #angle alpha in wiki
phi_z = np.arctan2(-R[0][1],R[0][0])    #angle gamma in wiki

print('Manually computed XYZ Euler angles =')
print([phi_x, phi_y, phi_z])

print('Euler angles using to_euler function in Blender=')
print(R.to_euler('XYZ'))
print(R.to_euler('ZYX'))

Yes, I'm pretty sure the order string is in natural reading order, ie. "XYZ" means "first X, then Y, then Z". In terms of matrices of course, the first matrix applied is on the right, and the last is on the left.

I don't understand how that is the natural reading order? The to_euler('ZYX') command provides the euler decomposition of [Rx * Ry * Rz ]

XYZ order means that you rotate first around X, then around Y, then around Z axis. Natural reading order, from left to right.


text:
Can't remove an unselectable face

I am making my microphone in Blender I ran into a little problem.
I can't seem to remove that face, because I'm unable to select it.
Please , any suggestions?

Upload file to: http://blend-exchange.giantcowfilms.com/ and mark this face on screenshot.

The reason you cant remove that face individually is because it's part of another face. Your object has at least one concave n-gon (a face with more than 4 sides where one of the sides comes back towards the center of the face) and that is what is causing you your problem. All the faces of an object are converted into triangles before they can be displayed, and with the faces on your object it appears the triangulation process causes a face to go outside the boundary of the n-gon. You can better visualize what I mean if you select the face (the one shown in the bottom screenshot) and press Ctrl T to convert it to triangles. You will then see one of the triangles causing the issue.
The best way to solve the issue is not to delete the face, but instead help blender out by giving it smaller, convex faces to work with. I can't see your entire mesh in the screenshots, but you should be able to select one of the vertices near where the issue is, then select another vertex somewhere on another side of the face either below or to the right. If you press J then it will connect those two vertices into an edge and split the large face into two smaller ones that should be easier for blender to triangulate.
In general it's best to avoid faces with more than 4 sides. The only place n-gons are usually ok is when they are perfectly flat as well as convex (think classic pentagon or similar). If you can, it would be best to convert you mesh to being made out of 4 sided faces only. It will be easier for blender to display without any glitches, it will save you headaches down the road if you have to work with this object again, and it will also be good practice to be able to make any object with good geometry.


text:
After finishing using blender, I tried to render it but the render icon won't show up at the top left of my laptop screen. How do I fix it?

I finished using blender and all for bending limbs for this game called ROBLOX but when I actually finished it, it won't show up. When I say it won't show up, I mean the icon you use to render something in blender literally won't show up. All I saw were the icons View, Select, Add, and Object. Please get back to me ASAP

Can you post some screenshots?

I just added a picture

"icon you use to render something" do you mean OpenGL render? Only this icon is present in the header of the viewport which is shown on the screenshot. Normal (Cycles or other engine render options) are located in the Info header menu, top left part of the screen by default.

I rendered it before but then didn't like how it looked when I rendered it so then I moved the light and camera a bit then next thing I know, the render button at the top left of my screen is gone

So what seems to have happened here is you switched out the main menu bar for another 3d view. If you look at the extreme top left of your screen, to the left of what you have in the screenshot there should be a little icon with two small arrows. Click on that and a menu will pop up showing all of the different editors in blender. To get the menu you had before  you will want to select the info editor (the one with the blue i icon third from the bottom). That should get you back to where you were before.


text:
Dynamic Paint texture with Cycles
I started following this tutorial from Blender Guru to do a rainy scene. While most of it works, he's using Blender Render, and by the end the process of setting up the dynamic paint just doesn't work the same way in Cycles. Specifically, after this moment (21:24), the process changes completely, as Cycles Render uses nodes, while the Blender Render does not. Anyone can assist me in setting this up for Cycles, taking into account that all my materials are using the new Principled shader?
I have tried using the baked image sequence as the factor for a mixed shader but have gotten no results. The material remains the same after plugging it in.

Further screencaps, I got it to try to work for one frame, I don't even know how, and I should've screencapped it, but some more as proof that this is not working.

Notice how that's supposed to be frame 46, have a look at the mask for frame 46.

This should be very much mixed down to the other half.

If it is just about how to use the result image sequence, then add the image sequence as a node into the material and use it to split the mix of the principled shader and another shader to get your result, or use it directly to input the amount of gloss shader, etc. Show us a screens hot of what you have so far and we can try to help you figure out how to plug it in.

@CraigDJones I tried out what you suggested, have a look at the lack of results. It won't even actually work as a mask to mix the shaders.

It looks to me like your result is too dark, and that means there is something wrong in your dynamic paint setup prior to getting this far. You should have much higher contrast there to get white areas in a black map that shows where the materials will split. To test, go to a simple cube scene and try working out the settings to get a simple 30 frames sequence that has the high contrast you are looking for. Work that out, and then you can rework the dynamic paint for the complex scene.

@DuaneDibbley - Damn, it was that and I had to put the alpha into the factor. You should post that as an answer so I can mark it as correct in case someone else has the same issue.


text:
Problems with denoising in rendering
I'm starting to take my first steps in Blender. I recently did the BlenderGuru's light bulbs tutorial. I have problems with rendering. The two images attached were rendered using Cycles (Blender 2.79), by CPU, 16x16 tile size and 1000 samples (all other parameters by default). The first image presents an excessive amount of noise (fireflies).

To mitigate this problem I used denoising (with default parameters), but another problem arose: black areas appear around the brightest reflections in the off bulbs (zoom in image).

I duplicated the number of samples in both cases with the same reder results.
Anyone knows how to solve this? What am I doing wrong?
Here is the .blend file
Thank you very much!

Hello @cegaton. I have been very busy the last weeks. I tried without denosing and  Clamp indirect = 10. The render improved a lot. Thank you very much! In my opinion, your suggestion is the solution to the thread, but I can't mark it as such.


text:
Accessing geometry node curve length output using python API
Main question:
I want to access the curve length value from the geometry node setup via the blender python api (see the screenshot). In the pictured node setup, you can see that I have it hooked up to a viewer node, and the instantaneous length of the curve is displayed on the curve points (1.00337). I want to access this value via the python api. I can't apply the modifier stack to the curve via the depsgraph and use calc_length on the spline, because of other modifiers added for visualization. Is it possible to access the value in Geo nodes via python?
Background:
I'm working a blender plugin, and one of the functionalities depends on interactively creating poly curves, where the individual points are hooked to specific empties. A curve can have an arbitrary number of empties and corresponding hook modifiers, then the last two modifiers in the stack are always one that adds a profile curve & custom material, and then a bevel modifier. These last two steps are for visualization purposes only (the curve is an abstract representation of a muscle, hence the name in my screenshots).
I have a python script that programmatically moves some of the empties around (thus changing the curve length), and then using the depsgraph, computes the instantaneous curve's length (by applying all the modifiers in the depsgraph evaluation). The curve itself remains unchanged, but I can get the length this way. This works with only hook modifiers, and also other custom node groups that I add to modify the curve's path, but it's more complicated if you add the geometry & bevel nodes add the end for visualization because then the curve gets transformed into a mesh. In geometry nodes, it is possible to access the curve's instantaneous length, and this updates automatically as I move the empties around (see screenshot). Is there some way to access this value outside of geometry nodes? I tried several approaches (accessing the curve length's own output, and hooking the node output to the group output and then trying to access the group output), but these approaches did not seem to work. Any suggestions would be welcome!
Cheers,
Pasha

Can you possibly rephrase your question to disinclude the less-relevant background details and to show what it is you're trying to achieve? Reading your whole post it's not made clear what your actual end goal is, we only know that you want to access the curve length with Python but if your actual goal is "move the empties with Python and have the curve always follow" then it's possible there are a number of non-python solutions we could suggest, if we understood the actual end-goal. We won't know if we can't even tell what your actually aiming for. See XY Problem.

Sorry for responding so late, I was quite ill the last couple of days. The goal is to access the curve length parameter from geometry nodes via the python API. I want to perform several calculations that require repeatedly accessing the curve length as the empties are systematically repositioned via a script.
I gave the information to outline what I'd already tried (applying the modifiers in the depsgraph and then calling calc_length() on the spline), and why that solution wouldn't work here (the extra geo nodes & bevel modifier that are essential in my plugin).

I've edited my original post, hopefully this helps

I found the answer to my own question. In fact, I found two approaches that work, and the second approach is slightly faster (0.05s versus 0.035s when evaluated 10000 times on my laptop which has an i7).
1) The answer to my actual question is a modification of this post. Basically, numbers within geometry nodes are not directly accessible via the blender python api. You have to assign the value to a custom attribute, evaluate the object in the depsgraph, and then find the value of your attribute there. I think this is a strange workaround for something that appears to be available in real time within the node setup, but perhaps there are reasons for this. Here's the code:
import bpy
C = bpy.context
obj_ev = C.object.evaluated_get(C.evaluated_depsgraph_get()) #assumes the target object is selected.
obj_ev_mesh = obj_ev.to_mesh()
length = obj_ev_mesh.attributes['length'].data[0].value
obj_ev.to_mesh_clear()

This requires the following additional node in the geo node setup:

2) The faster solution to my problem is essentially the solution I already had. Basically, you get a depsgraph copy of the curve with modifiers applied, and then apply 'calc_length()' to the (only) spline. I thought this wouldn't work because of the curve to mesh node in the geometry node, and the bevel node, but apparently these both simply get ignored by the "_.to_curve(depsgraph, apply_modifiers=True" call. Here's the code:
import bpy
C = bpy.context
obj_ev = C.object.to_curve(C.evaluated_depsgraph_get(),apply_modifiers=True)
#assumes the target object is selected.
#apparently, geometry nodes and bevel modifiers are ignored
length = obj_ev.splines[0].calc_length()
C.object.to_curve_clear()


text:
Why is the Y axis pointing upward? I don't want it to
I am working on a project right now and somehow the axis went all out of whack. When I use the gizmo under global mode, the z axis is the one pointed up. But when I put it under Normal mode, or try "G + Y", the Y axis is going up. Can someone help me get the Z axis back to the up/down position?

When I apply rotation and scale, it does this when I click "G + Y"

Here is an image of my viewport navigation gizmo, and I have it set to global orientation, not normal. Still doing the same thing.

Maybe what's confusing is the camera orientation - maybe you need to change your view, not your objects... Can you make a screenshot of your viewport navigation gizmo?

I edited my original post to show the viewport navigation gizmo.

You need to apply the rotation to make sure that it resets the rotation and again the Z will show up as usual.
To do it, simply press Ctrl+A, and then apply rotation.

And the reset needs to be done in Object Mode, otherwise in Edit Mode the shortcut Ctrl+A is Skin Resize. I just mention it because the screenshot shows Edit Mode.

I tried applying rotation in object mode and in edit mode it is still the same. Y is the up and down.

The whole point to orientations, like global or normal, is to give you useful axes to move things-- different axes.  If you want Z to mean globally up, use global orientation.
Normal orientation is an orientation where +Z points in the direction that the normal points-- generally speaking, the direction that a face is facing (but it depends also on selection mode and pivot point.)  Using normal orientation is useful precisely because this +Z is a different direction than the world +Z.


text:
Weird behaviour when assigning material to specific faces

I'm following a guitar tutorial, and I created a material for the sides of the guitar. I assigned it to the sides, but in rendered view I get a band of the other material above and below the side material.

Any Idea why this is happening? Any help is appreciated!
EDIT: .blend file

Subdivision surface modifier is the problem. Select the side material faces in edit mode and expand (Ctrl Numpad+), then assign them to the side.

The subsurf modifier is smoothing the edges which allowed the above material to bleed out to the sides.
Add two loop cuts to the sides to fix it. (shortcut ctrl+R, then sroll up once)


text:
un-ghosting or un-meshing my model
I'm trying to switch back to solid view on my model...
At the moment I have this...

And I want this.

Possible duplicate of Where is the smooth / flat shading property of an object?

You have a fox and want to turn it into an elephant? That's gonna take some serious morphing! Just kidding. Also see https://blender.stackexchange.com/questions/3690/toggle-wireframe-mode-with-hotkey

...what does the edit (the added image) mean?

It means the OP needs to recalculate normals

There's a little white sphere icon at the bottom of the 3D viewport, right next to the "edit mode" button. there you can switch between different viewport shading modes.
right now you are in the so called wireframe mode. switch it to solid mode to see the faces of your mesh.

Thank you... But now I have a SMOOTH object. How can I have flat faces again please? (Uploading photo...)

Invert normals with ctrl+n and set the shading to flat in the left hand panel.


text:
Weird shadows when adding normal map
can someone explain to me how i got these weird shadows and how to get rid of them?

And another problem, when I use a normal map in the princepled shader it's not working and affecting the color, why is that?

Thanks!
i already tried to recalculate the normals it didnt change anything

Also there may be duplicate and overlapping geometry

recalculating the normals is not fixing it, i found out its only when i add the normal map

Are there any objects at the same place overlapping with the shown one? (e.g. like duplicate of it) Did you check what's rendered with either Rendered shading mode or when rendering with F12? How does your normal map look like? How was it generated, baking from highpoly to lowpoly or baking data from image source? Provide more info about the project please. You can also share file https://blend-exchange.giantcowfilms.com/ (make sure to pack textures if they are free of course, they are important here)


text:
Create a energy beam
I have the following objects. The cage of the lamp is one object, and the dome is the other. How would I go about having the dome emit a beam of energy or light? I am using Cycles Render
Clarification: like the beacon in wreck-it-ralph

Which renderer are you using: Internal, Cycles, Lux etc?

Using Cycles render

Related: https://blender.stackexchange.com/questions/67309/how-to-create-a-ufo-pickup-light-ray/67336#67336

Thanks. I should be able to mess with this to get it to work.

Possibly helpful: https://youtu.be/PXGFNdvLyBU https://youtu.be/S6lSfOfiXHY?t=3172

If you want it simple you could use a cylinder with an emission shader to it. With compositing you could apply a glare node.

Emission node into volumetric material output node. Use a texture to drive intensity if you want texture and flickering.


text:
How to save curve shape of cylinder with such deform?
It's difficult for me to make clear this part of bullet.

I use cylinder with 16 vertices, add 2 horizontal loops "ctrl+r", insert "i" 2x loops. Then I extrude with individual origins and normal transform orientation polygons

Then I add subdivision surface and some loops to save form. But there are problem with entrance 5 edges in vertices and bad form of curve shape

How to save curve shape of cylinder with such deformations and to get it with clear topology?
LukeD, thanks for solution to the problem. Here's my result:

You can use Shrinkwrap Modifier with Vertex Group and another Cylinder as Guide mesh to do this.

Create Cylinder in the same place as original. Lets call it Guide Mesh. It can be higher (Z axis) but it should have exactly same Radius. Without top/bottom faces. Add to it Subdivision Surface Modifier - Subdivisions 6. You can Hide it.

In Original Mesh (the one you have modeled) select outside vertices. The ones that should be perfectly round. Add Vertex Group and Assign them.

Add to the Original Mesh Shrinkwrap Modifier and choose created Vertex Group and Guide Mesh as a Target.

Note: You will need to Apply Shrinkwrap modifier in order to
  move/scale/rotate mesh or you can do this with Guide Mesh selected
  also.

Try to avoid inset geometry on curved surfaces. Try something like this:


text:
two textures using Object ID "Random" to generate colors with colorRamp always picks the same color sets together
Hopefully, I can explain this well.
I'm using geometry nodes (not sure that matters) to generate some objects that have two different textures assigned to parts of the geometry.  There is a 'main' color texture and a 'detail' color texture.
Both textures are set up the same general way:

Object ID Node--->"random"--->links to ColorRamp set to "Constant" and a set of colors is selected in the ColorRamp node.
The "Main" texture has some colors like blue, green, yellow, red.
The "Detail" texture has some colors like white, purple, orange, gray.
The idea is that whenever I create a duplicate of the object, a new random color set gets chosen.
The problem I face is that the colors always "match" a particular set.  e.g. when the random color for the "Main" texture is blue, the "detail" texture ALWAYS picks white. When green, it ALWAYS picks purple. And so on.
So it's not truly random, it will not generate for example a red object with a purple detail.  Red always gets gray, every time.
It seems as though if it's picking e.g. "Slot 0" for the 'Random' on the main texture it also always chooses 'Slot 0' on the detail texture for the same object.
Is there some way around this so that each color choice is randomized independently of the other, and creates truly random combinations?

please provide blend file and/or screenshots of your node setup. This is much easier to understand than 1000 words.

"The problem I face is that the colors always "match" a particular set. e.g. when the random color for the "Main" texture is blue, the "detail" texture ALWAYS picks white." That's how the random works, it generates one random value per object, if the object is the same then the random value is always the same. See https://blender.stackexchange.com/questions/145641/what-is-the-range-of-random-values-given-by-object-info-node/145645#145645

Be interesting to go back and take another look at this, as I remember RNG changes being mentioned in some talk recently.

The Object Info node's Random slot is a fixed random number based on the object's name. This is the reason why you always get the same color combinations. It doesn't matter for how many materials or other nodes you use the value. It's always the same number for the given object.
You need two random numbers for the two random colors.
The White Noise Texture node can create another random number for you. Set it to 1D and feed it with the random number of the Object Info. The result is another random number based on the input W. Same input results in the same pseudo-random output.
The following is the Detail material with the changes. The Main material does not need to be changed.

If you need another random color material then just add a unique number ("material id") to the Object Info->Random value with a Math node and it will get its own random numbers.