text:
Is it possible to change rotation order of existing animation?
there is animated armature but some bones euler rotation order needs to be changed due to gimbal lock. Is it possible to change rotation order of existing animation without changing original animation? I've tried it but animation looks strange. it does not look like original animation.

So in 3D, gimbal lock isn't really some kind of lock, that happens at one specific orientation, like it is in engineering, which is where the term comes from.  It's really just wonky Euler interpolation that exists at all orientations, but is most apparent at certain orientations.  It's not some special thing that happens sometimes; it is always happening, and it's the way that Eulers interpolate.
So you can't really change the rotation order just for cases of gimbal lock, without affecting interpolation on other frames.  You can bake rotation to a bone with a different rotation mode, and then delete redundant keyframes, but that will change your interpolation for all frames, not just the ones that you've identified as gimbal locked.
What we can do is tell a bone to use a different rotation order for the span of a few keyframes via copy rotation constraints and visual transforms.

We're going to start with an XYZ Euler bone with interpolation we don't like across two keyframes.  (Here, we're rotating from 0,0,0 to 180,90,180.)  We'll add an empty, set its rotation mode to whatever we want (quaternion is usually best here, nobody actually wants Euler interpolation, they want the per-axis control), and then give it a copy rotation constraint, world->world, targeting the bone we want.
Then we'll go to the locations of each of our bone's keyframes, select the empty, apply visual transform, and keyframe rotation.  Then we'll delete the constraint.
Now we can constraint the bone from our empty.  We'll give it a copy rotation constraint targeting the empty, world->world.  At our current rotation keyframes, we'll keyframe that constraint to 1.0; at one frame earlier than the first keyframe, and one frame later than the last keyframe, we'll key it to 0.0.

Now, our XYZ Euler is using quaternion interpolation (from the empty's keyframes) for this span of our animation.
If we'd like, we could go on to bake this span of the animation with visual keying and clear constraints, so that we are no longer dependent on the empty.  This will create a keyframe every frame so that we are no longer relying on Euler interpolation:

your information is useful but what I want to do is not changing rotation order for a few keyframes, but I want it to be changed completely. RIght now I animated characters shoulder bone using wrong rotation order XZY, but it causes gimbal lock because I need to rotate Z axis by over 90 degrees so I want to change XZY to ZYX. Is it possible? I simply changed rotation order but it doesn't work.

How many keyframes?  You can do the same thing as I described, but over all keyframes, if you want.  If there are a lot of keyframes, that can be unwieldy, and scripting (or an addon if you can find one) would make it easier.  But, be aware, it will change your interpolations between keyframes; that's the whole point, after all.

it is 50 frames animation but it only has 3 keyframes. frame 1, frame 25 and frame 50 but its has bezier interpolation and I  need to change shoulder, forearm, and hand too. If it's not easy I will remake all manually. it will be impossible to make same bezier curve though.

Create an empty with appropriate mode, copy rotation to it local->world, bake keyframes on empty, delete all keyframes except 1, 25 and 50, change rotation on your bone, copy paste keyframes from your empty.  Yes, you're right, the custom f-curve handles are going to be lost; they're just not things that make sense in terms of a different rotation mode/Euler order.

ok. I will copy and paste animation using copy rotation constraint + empty.thank you!

Since Blender v3.1, there is a new addon named "Copy Global Transform".

The Copy Global Transform add-on makes it possible to copy the world-space transform of the active object/bone, and paste it onto any object/bone.
Source: Reference/Release Notes/3.1/Add-ons - Blender Developer Wiki

What this allows you to do, if for any given keyframe, or selection of keyframes, you can copy the global transform, changed the rotation order, then paste the global transforms again.
Be aware though, that because of the rotation order difference, the interpolation that used to happen between frames before the rotation order change might change, sometimes drastically. So if you want to preserve the interpolation, use the "Paste and Bake" pasting, so that it will make new keyframes on every frame with whatever animation you had when copying.


text:
How do I assign vertices to variables
As you probably know, you can assign almost anything in Blender to variables, for instance
obj = C.object
scene = D.scenes['Scene']

I want to do the same with vertices you access from obj.data.vertices
#assign like this:
vert = obj.data.vertices[2]

I expected this to not be a problem, but I realized that if you change from Object Mode to Edit Mode and then back to Object Mode again, vert will not refer to obj.data.vertices[2] anymore, instead it's suddenly a different (and weird) vertex instance:
bpy.ops.object.mode_set(mode='OBJECT')

mesh = C.object.data
vert = mesh.vertices[2]
print(vert == mesh.vertices[2]) #prints 'True'
print(vert.index)

bpy.ops.object.mode_set(mode='EDIT')
bpy.ops.object.mode_set(mode='OBJECT')

print(vert == mesh.vertices[2])      #prints 'False'
print(vert in list(mesh.vertices))   #prints 'False'
print(vert.index) #suddenly a very high random number, even if the mesh only has like 25 vertices total. sometimes negative.

So my question is: How can I assign vertices to variables without them becoming invalid?
My main intention is to save certain properties of vertices (like e.g. their selection state) together with the vertex they belong to at a specific point in a script and then at a later point compare these saved properties with the current ones.
Example:
mesh = C.object.data
select_states = {}

for vert in mesh.vertices:
    select_states.update({vert: vert.select})

#do a bunch of different stuff, including multiple switching between Edit and Object Mode...
#then, later:

changes = 0
for vert in select_states:
    if select_states[vert] != vert.select: #old vs current selection state
        changes += 1
print(changes,'vertices changed their selection state')

Due to various operations, using a bmesh is not possible.
Vertices might get deleted or added, so using indices as an identifier doesn't work either.
I already checked the internet for answers to this question, but I didn't even find anyone who encountered this problem.

Related https://blender.stackexchange.com/questions/123742/uniquely-addressing-vertices-in-python

This might be of interest too : https://developer.blender.org/T88914 Basically, it means that every time you access a vertex, a new python object is created from scratch. I assume it gets collected and re-assigned by the garbage collector once it is used, and keeping a reference to that object then leads to weird behaviour.

Okay, if what user Gorgious commented on my question is indeed true, there likely isn't a direct way to assign a vertex to a variable. At least not in a stable way.
I would still appreciate to be proven wrong though.
So I decided to switch to an indirect way, which is:
We give vertices some kind of tag, and then later identify them by their tag again. This isn't optimal, but it does work for instance even if the vertex indices change.
Note however that vertex objects don't support custom properties.
Below you can see code for a class I wrote that tags vertices by assigning them individual weights in a (new) Vertex Group. It hasn't experienced much testing and looks a bit complicated, but it can work correctly and has documentation included.
import bpy
import math
C = bpy.context
D = bpy.data

class tag_vertices:
    """
    Helps keeping track of indivual mesh vertices by creating a vertex group and "tagging" them in it via individual weights

    Unlike with most other objects in Blender, it seems like you cannot assign vertices to variables in a stable way. Once you switch to Edit and then back to Object mode, they lose their validity.
    See https://developer.blender.org/T88914 for more on that.
    To circumvent this, this class assigns each vertex an individual weight in a newly created vertex group and is then able to later identify the origianl "identity" of a vertex via its weight.

    ...

    Attributes
    ----------
    obj : bpy.types.Object
        The object whose vertices are being dealt with
    VG : bpy.types.VertexGroup
        The vertex group in which the vertices have been assigned individual weights
    dicts : list of dictionaries
        every dictionary is from different points of time, with the layout {weight_of_vertex: vertex_index or None}
    increment : float
        Used by class functions; is the smallest allowed difference between weights; is based on the total amount of vertices in the mesh
    highest_digit : int
        Used by class functions; position of the first digit after the decimal of increment that isn't a zero (increment == 0.0001 -> highest_digit == 4)

    Methods
    -------
    create():
        Called automatically at the creation of a class instance. Assigns weights to all vertices in VG and saves first dictionary in dicts. Do not use it yourself.
    add_current():
        Checks which vertex currently has which weight in VG and saves resulting dictionary in dicts attribute.
    compare_indices(old_dict = 'DEFAULT', new_dict = 'DEFAULT'):
        Compares two dictionaries of attribute dicts and returns a dictionary with the following layout: {old_vertex_index: new_vertex_index}
    truncate_decimals(number, highest_digit):
        takes in a float number and returns same number with all digits after the highest_digit cut off. Used by other class methods.
    get_highest_digit(float_number):
        takes in a float number and returns the position of the first digit that isn't a zero . Used by other class methods.
    """
    #
    def __init__(self, object = 'ACTIVE', VG_name = 'tagged_vertices'):
        """
        Creates object attributes, VG and calls create(). Cannot be called from edit mode

        Parameters
        ----------
            object : bpy.types.Object OR 'ACTIVE'
                The object that gets the new Vertex Group. If == 'ACTIVE', defaults to the currently active object.
            VG_name : str
                The desired name of the new Vertex Group.
        """
        #
        if C.mode == 'EDIT_MESH':
            raise RuntimeError('__init__ of tag_vertices class cannot be run while in Edit Mode')
        if object == 'ACTIVE':
            object = C.object
        self.obj = object
        VG_i_active = self.obj.vertex_groups.active_index #using active instead of active_index is possible too, but assigning active = None crashes Blender as of version 2.93.2
        self.VG = self.obj.vertex_groups.new(name = VG_name)
        self.obj.vertex_groups.active_index = VG_i_active #setting the previously active VG as active again, as creating a new one makes the new one active
        self.dicts = []
        self.create()
    #
    def create(self):
        """
        Called at the creation of a class instance. Assigns weights to all vertices in VG and saves first dictionary {weight: vertex_index} in dicts attribute.
        """
        #
        t_dict = {}
        #VG weights only accept values between 0 and 1, so we need to calculate how big our increment needs to be to not reach that weight of 1 with a vertex.
        self.increment = 1/len(self.obj.data.vertices)   #since weights in a VG can only be between 0.0 and 1.0, we need to calculate the smallest "distance" between weights we should use.
        self.highest_digit = self.get_highest_digit(self.increment)
        self.increment = self.truncate_decimals(self.increment, self.highest_digit)  #an increment of 0.00384123 gets changed to 0.003, rounding up might mean that the last assigned vertex has a weight over 1.0
        weight = 0 #first vertex gets a weight of 0
        for index in range(len(self.obj.data.vertices)):
            self.VG.add([index], weight, 'ADD')
            t_dict.update({weight: index}) #using floats as keys might lead to problems due to how floats "actually" look, but that's a problem for future-us. Other methods might increase calculating time of this for-loop.
            weight = round(weight + self.increment, self.highest_digit) #floats behave weirdly sometimes, so 0.003 + 0.001 might actually give you 0.00399999999, which we don't want.
            #we must not use truncating on anything other than calculacting the increment value, since truncating a value like 0.00399999 returns 0.003
        self.dicts.append(t_dict)
        #Vertex Groups dont support custom properties, so we cannot save the increment to the VG object
    #
    def add_current(self):
        """
        Checks which vertex currently has which weight in VG and saves resulting dictionary {weight: vertex_index} in attribute dicts.
        """
        #
        t_dict = {}
        for index in range(len(self.obj.data.vertices)):
            try:
                weight = self.VG.weight(index)
                t_dict.update({round(weight, self.highest_digit): index})
            except:  #VG.weight(index) gives an error if vertex isn't in that VG
                None
        self.dicts.append(t_dict)
    #
    def compare_indices(self, old_dict = 'DEFAULT', new_dict = 'DEFAULT'):
        """
        Compares two dictionaries of dicts and returns a dictionary with the following layout: {old_vertex_index: new_vertex_index, etc.}

        Parameters
        ----------
        old_dict : dictionary
            an older dictionary from attribute dicts. You most likely want to use the one that's from the time of creation, AKA the first in the list.
        new_dict : dictionary
            a newer dictionary from attribute dicts.

        Returns
        -------
            t_dict : dictionary
                {old_vertex_index: new_vertex_index or None, etc.}
        """
        #
        if old_dict == 'DEFAULT':
            old_dict = self.dicts[0]
        if new_dict == 'DEFAULT':
            new_dict = self.dicts[1]
        t_dict = {}
        for weight in old_dict:
            old_index = old_dict[weight]
            try:
                new_index = new_dict[weight]
            except:
                new_index = None
            t_dict.update({old_index: new_index})
        return t_dict
    #
    def truncate_decimals(self, number, highest_digit):    #truncating is the process of basically cutting off all numbers after a certain position in a number. The default math.trunc() function is only able to delete *all* decimals, so we have to make our own custom one to work with certain decimal places.
        """takes in a float number and returns same number with all digits after the highest_digit cut off"""
        multiplier = 10**highest_digit
        circumsized = math.trunc(number * multiplier) / multiplier
        return circumsized #lol
    #
    def get_highest_digit(self, float_number):  #returns the position of the "largest" number in a float. 0.00052013 would return 4, 0.00000123 would return 6.
        """takes in a float number and returns the position of the first digit that isn't a zero"""
        pos = 0
        while True:
            pos += 1
            if self.truncate_decimals(float_number, pos) > 0:
                break
        return pos

If I were to use that class in the example from my original question, it would look like this:
import bpy
C = bpy.context
D = bpy.data

obj = C.object #using C.object.data is not recommended since it can be unassigned by Blender
select_states = {}
for vert in obj.data.vertices:
    select_states.update({vert.index: vert.select})   #{0: True, 1: True, 2: False, etc.}
t_verts = tag_vertices()

#do some stuff in viewport, such as deselecting, moving or deleting vertices, switching modes, etc.

t_verts.add_current() #needed to compare
old_vs_new = t_verts.compare_indices() #returns a dictionary with this layout {original_index: current_index or None(if deleted)}
changes = 0
#comparing selection states
for old_index in select_states:
    new_index = old_vs_new[old_index]
    if new_index == None:
        changes += 1
    else:
        old_state = select_states[old_index]
        new_state = obj.data.vertices[new_index].select
        if old_state != new_state: #new state can also be None
            changes += 1
print("a total of",changes,"vertices either changed their selection state or have been deleted")

IMO it is indeed true.    For me seeing your answer is a bit "full circle"  . Using vgs or uvs to store other info, led to the advent of the data layers.   Using data layers (as outlined in other link  https://blender.stackexchange.com/questions/123742/uniquely-addressing-vertices-in-python) is akin to setting custom props on the verts..

Yes, as I said it's not an optimal solution, just the best I could come up with. The answer you linked only works with bmesh AFAIK, something I tried to avoid.

Was tempted to close this on asking. Commented re the dupe a month ago. Ignored. Commented above, ignored &  answer accepted (whatever). Closed question... ---> Prompted feedback.  IMO  Reinventing the wheel is never optimal. See edit to dupe, re another misunderstanding.

source: Stack Exchange

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

sort: votes


text:
How to link the adjust last operation menu to object? Blender 2.80 - 2.81
What am I missing or doing wrong?
I made this script to add a cylinder ( just to learn ) but the adjust last operation menu does not work all.
What do i need to do to get this linked to the cylinder?
In the end I want to add some functions same as current add cylinder but also other funtions.
I guess there is no link between the bl-idname and the cylinder
This is my code
    bl_info = {
    "name": "New Object",
    "author": "Your Name Here",
    "version": (1, 0),
    "blender": (2, 80, 1),
    "location": "View3D > Add > Mesh > New Object",
    "description": "Adds a new Mesh Object",
    "warning": "",
    "wiki_url": "",
    "category": "Add Mesh",
}

import bpy
from bpy.types import Operator
from bpy.props import FloatVectorProperty
from bpy_extras.object_utils import AddObjectHelper, object_data_add
from mathutils import Vector

radius = 1
depth = 2
location = (0, 0, 0)
rotation = (0, 0, 0)

class OBJECT_OT_add_object(Operator, AddObjectHelper):
    """Create a new Mesh Object"""
    bl_idname = "cylinder.add_object"
    bl_label = "Add Mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):

        bpy.ops.mesh.primitive_cylinder_add(radius=radius, depth=depth, location=location, rotation=rotation)

        return {'FINISHED'}

# Registration
def add_object_button(self, context):
    self.layout.operator(
        OBJECT_OT_add_object.bl_idname,
        text="Add Object123",
        icon='PLUGIN')

# This allows you to right click on a button and link to documentation
def add_object_manual_map():
    url_manual_prefix = "https://docs.blender.org/manual/en/latest/"
    url_manual_mapping = (
        ("bpy.ops.mesh.add_object", "scene_layout/object/types.html"),
    )
    return url_manual_prefix, url_manual_mapping

def register():
    bpy.utils.register_class(OBJECT_OT_add_object)
    bpy.utils.register_manual_map(add_object_manual_map)
    bpy.types.VIEW3D_MT_mesh_add.append(add_object_button)

def unregister():
    bpy.utils.unregister_class(OBJECT_OT_add_object)
    bpy.utils.unregister_manual_map(add_object_manual_map)
    bpy.types.VIEW3D_MT_mesh_add.remove(add_object_button)

if __name__ == "__main__":
    register()

That's pretty close. Just add real properties to the operator class. Minimal example:

import bpy
from bpy.types import Operator
from bpy.props import IntProperty, FloatProperty, FloatVectorProperty

class OBJECT_OT_add_object(Operator):
    """Create a new Mesh Object"""
    bl_idname = "your_category.add_object"
    bl_label = "Add Mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    my_radius : FloatProperty()
    my_depth : IntProperty()
    my_location : FloatVectorProperty()
    my_rotation : FloatVectorProperty()

    def execute(self, context):
        # Call primitve_add
        bpy.ops.mesh.primitive_cylinder_add(
            radius = self.my_radius,
            depth = self.my_depth,
            location = self.my_location,
            rotation = self.my_rotation)

        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

Further reading: https://docs.blender.org/api/current/bpy.props.html

Thanks for your answer This was what i was looking for. May i ask you where i can find documentation about FloatVectorProperty? For example what kind of property is align?

Added the link to the API, there you have a list of all available properties. Properties are basically data types (int, float, string etc) so in case of "align" it depends what do you want to do (Yes/Nope? -> Bool). Also I'd suggest read How to create a custom UI? @DGRL

Maybe keep  the AddObjectHelper subclass to deal with the usual suspects loc, rot, scale, align.

With the AddObjectHelper class

Further to @brockmann's answer
The AddObjectHelper class sets up some of the usual suspects for us, including location, rotation and align.   It appears you have used the text editor > templates > python > Addon add object template, so let's stick with it in.
If we simply ourselves add
rotation : FloatVectorProperty()

the rotation will always show in the base unit of radians.  360 degrees = 2pi radians.  In scene unit settings degrees is the default set to display in the UI
rotation : FloatVectorProperty(unit='ROTATION')

is required in the property definition to make it behave like other rotation props.  Just as unit='LENGTH' will add metres etc.
All this is done for us by the helper class..
class OBJECT_OT_add_cylinder(Operator, AddObjectHelper):
    """Create a new Mesh Object"""
    bl_idname = "object.add_cylinder"
    bl_label = "Add Mesh Object"
    bl_options = {'REGISTER', 'UNDO'}

    # set other args like name and description for all
    vertices : IntProperty(
            name="Vertices",
            description="Number of Vertices",
            min=0,
            default=32)
    radius : IntProperty(default=2)
    depth : FloatProperty(default=2)

    def execute(self, context):

        bpy.ops.mesh.primitive_cylinder_add(
                vertices=self.vertices,
                radius=self.radius,
                depth=self.depth,
                # those defined in AddObjectHelper
                align=self.align,
                location=self.location,
                rotation=self.rotation)

        return {'FINISHED'}

Note: I've adjusted the classname OBJECT_OT_add_cylinderand bl_idname = "object.add_cylinder" to match desired naming convention
One issue tho is that its draw method puts its stuff first, so may need to add your own draw method to re-sort as desired
    def draw(self, context):
        layout = self.layout
        layout.prop(self, "vertices")
        layout.prop(self, "radius")
        # and so on

Other examples based on add object template
https://blender.stackexchange.com/a/133880/15543
https://blender.stackexchange.com/a/102239/15543

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


text:
Python select specific edge loop based on diameter and height
As seen on the screenshot below, How can i select 1 edge loop based on its diameter (radius) and height?
For example
I only want to select 1 of the 2 edge loops that has different diameter but are on same height
I tried
`my_verts = [v for v in verts if (10 / 1000)  <= v.co.z <= (30 / 1000) and (-80 / 1000)  <= v.co.y <= (80 / 1000) and (-80 / 1000)  <= v.co.x <= (80 / 1000) ] `

But that does not really wors well

On creation
Started as a comment and became an answer

Could you add some context on how the mesh came to be, are you
  creating from scratch with a script.

If using bmesh operators often the new geometry is returned, for example making question model from  a circle primitive using the extrude and inset operators.
Example using bmesh to add a cylinder bmesh.ops.create_cone(...) find the top face, then inset in and up.

import bpy
import bmesh
from mathutils import Matrix
me = bpy.data.meshes.new("Wedding Cake")

segments = 16 #oops got cut

bm = bmesh.new()
bmesh.ops.create_cone(bm,
        diameter1=2,
        diameter2=2,
        cap_ends=True,
        depth=0.5,
        segments=segments)

top_face = [f for f in bm.faces
        if len(f.verts) == segments
        and f.normal.angle((0, 0, 1)) < 1e-5]

ret = bmesh.ops.inset_region(bm,
    faces=top_face,
    thickness=0.5,
    #depth=0.1,
    use_relative_offset=True,
    )

ret = bmesh.ops.inset_individual(bm,
    faces=top_face,
    thickness=0,
    depth=1,
    use_relative_offset=True,
    )

bm.to_mesh(me)

To continue the "hard sell on bmesh over bpy.ops" what if we want to make something like this

is a matter of extending above to inset the faces returned from the inset operator
for f in ret["faces"]:
    ret = bmesh.ops.inset_individual(bm,
        faces=[f],
        thickness=0.4,
        depth=0.4,
        use_relative_offset=True,
        )

or instead with
bmesh.ops.extrude_individual(bm,
        faces=ret["faces"])

Another example, adding circles and bridging edge loops (ribs)  As could be done with prior, some data is used and looped.

import bpy
import bmesh
from mathutils import Matrix
me = bpy.data.meshes.new("Wedding Cake")

segments = 16
steps = ((0, 1),
        (0.3, 1),
        (0.3, 0.7),
        (0.5, 0.7),
        (0.50001, 0.4), # gltches on same
        )

bm = bmesh.new()
def create_circle(h, radius):
    ret = bmesh.ops.create_circle(bm,
            radius=radius,
            segments=segments,
            matrix=Matrix.Translation((0, 0, h)))
    return list(set(e for v in ret["verts"] for e in v.link_edges))

ribs = [create_circle(h, radius) for h, radius in steps]
for i in range(1, len(ribs)):
    bmesh.ops.bridge_loops(bm,
            use_pairs=True,
            edges=ribs[i-1] + ribs[i],
            )

bm.to_mesh(me)

Nothings happening

what version can this script running on? i try 2.81 but does not
  produce anything

Note script only creates a mesh, the data part of an object, we only see a mesh if it is assigned to an object.  To assign in UI (image above) go to properties data and change the linked mesh..
Or via python, create a new object using the mesh and link it to the context collection.  Append following to scripts above
ob = bpy.data.objects.new("Wedding Cake", me)
context.collection.objects.link(ob)

or if using in a create mesh operator (self)
object_data_add(context, me, operator=self)

Selecting the verts
For finding from height and radius, and assuming the origin (0, 0, 0) lies on symmetry axis (0, 0, 1) ie the z axis , would look at the distance of verts from (0, 0, h)  (v.co - Vector((0, 0, h))).length
A vector length test searches within a sphere of influence. Could narrow down further by looking at z component, I go old-school here and look for within a tolerance, abs(v.co.z - h) < TOL where TOL = 1e-5
For really large meshes instead of sorting based on distance, could use mathutils.kdtree to find closest.
Utilize the ngon
For this particular example the inner loop is the verts of the ngon.
Here is an example that finds the ngon whos face is closest to (0, 0, h) and selects its vertices.
Test script, Assumes mesh in edit mode, no selection.  If run on default cylinder selects verts of top face.
import bpy
import bmesh

from mathutils import Vector

context = bpy.context

ob = context.object
me = ob.data
bm = bmesh.from_edit_mesh(me)

h = 1
radius = 1
eps = 1e-05

ngons = [f for f in bm.faces if len(f.verts) > 4]
# sort by distance from (0, 0, h)
ngons.sort(key=lambda f : (f.calc_center_median() - Vector((0, 0, h))).length)
if ngons:
    for v in ngons.pop(0).verts:
        v.select = True

bmesh.update_edit_mesh(me)

The edgeloop of the ngon would be ngon.edges or l.edge for l in ngon.loops
can grow the selection to next loop, will be the edges in  e for f in edge.link_faces for e in f.edges if not any(v.select for v in e.verts).

I am using a script to place a cilinder and use inset to extrude the faces up or down
Im not yest good in bmesh so i use bpy.ops for this
Currently i try to make vertex groups and select these but the bpy.ops.mesh.bevel command seems to divide the new edge loops between multiple groups and thats not really what i am lookng for
I will try your soution also to see what i can learn from it
bmesh seems to be shorted coding then bpy

Really strongly recommend ditchng bpy.ops.mesh for  bmesh.  It takes a bit to get the hang of but once you do you wont go back.  Added example of inset using bmesh to add to the sell.  We can keep pushing the top face into the operator and need only adjust thickness and depth.

Am i correct by saying that the difference between bpy.ops and bmes is that all the operators for example bpy.ops.object.vertex_group_select can be used in bmes except that bpy.ops is not present?
What i see on the API page is that BPY.OPS is always not bold and the rest is bold
So to me it looks like that the operator object.vertex_group_select can be used in combination wit py.ops as well as with bmesh I.E. bmesh.object.vertex_group_select or am i wrong?

Whoa there... Let's not make sweeping generalizations and just move slowly.  Check out the bmesh inset example just added  (against perhaps the code used to produce yours) .  bpy.ops.mesh.primitive_cylinder_add() correlates with bmesh.ops.create_cone(...).  then the inset region operator should look familiar. But there's no need to select vertices and other blah that is required to use edit mode bpy.ops.mesh....  simply keep driving in the top face.  Would like to change this question to making a "wedding cake" mesh.  Would be much the same as, as I understand it, selecting that loop has

become your impasse, and selecting it based on radius and z location is probably not the way to go.

Ok ok lets move on slowly
Reason why i asked this is because i would like to add a bevel (CTRL B) to the edges. In order to do this you need to select te vertices after extruding them up
You cant add a bevel to a vertex without having to planes

what version can this script running on? i try 2.81 but does not produce anything

Dunno prob 2.6x onwards.  Read the answer, Note script only creates a mesh, need to assign it to an object to view, eg assigned to icosphere in image It makes a mesh named "WeddingCake" assign it to a mesh  object's data.....  read the code.


text:
Flipped Normals after export
My problem is that after I export my meshes to Ue4 it shows me that the normals are flipped. I tried both way, flipped and not flipped normals. This is what I get every time.
Any tips what I might be missing?

It looks like maybe it's culling the front faces instead of the back faces. Try checking in Ue4 for "backface-cull", "front cull" or "two sided faces" and see if they do anything.

Also, what file format are you exporting to?

I exported it in .fbx. I have since resolved the issue. Pretty simple, flipped the normal until it finally went through. It was just a bug I guess. Thanks for the help anyway, im sure it'll be useful in the near future. Since I have this problem whenever i boolean meshes


text:
Strange Color-Banding Problem
The color-banding is only in the image when saved from blender.
I screenshot the render and it has almost no color-banding.
How can I have no color-Banding when Saving from Blender?
the images were too big so they are drive links
Render.png (https://drive.google.com/file/d/132FNi4RITUSi9AQbE7WmcaqUTBgcqfew/view?usp=drive_link)
Render.exr (https://drive.google.com/file/d/1MKKZtpsu-Dh1IUg1zVZEelAXNx27Tu8Q/view?usp=drive_link)
Screenshot (https://drive.google.com/file/d/1FImKST7hTYPgR70u2k52ciERZgSIb7kv/view?usp=drive_link)

Did you try to set Color Depth to 16 bit? You can find it under Output Properties > Output if you set the File Format to PNG. For OpenEXR, try Float (Full).

yes I on the png the color depth is 16 and the exr is float Full

It seems that 16 bit is the highest PNG can support, and the general suggestion is to use OpenEXR. Since you're not satisfied with the OpenEXR output, I think you need to use another solution to get rid of banding. Dithering is a good option. The image I uploaded here was dithered in GIMP. I assume that the screenshot uses compression or something that breaks up the banding. Without more information I can't tell for sure.


text:
How to extrude plane and subdivide at once
Halo.. im new in blender.. and i found sclupting tutorial video,there he made a plane, mirror it, scale, rotate. But then he made an object from a plane very quickly, and i don't get it how he do that. He extrude the plane and subdivide it at once can you explain please?..

Could you add a link to the video?

Maybe he has created a shortcut, in 2.7 press W then go over Subdivide and right click to give it a shortcut


text:
How to show python information when Mouseover in Blender 2.8?
How to show python information when Mouseover in Blender 2.8?
Blender 2.7x

Blender 2.8x

system preferences> Interface> enable python tooltips

@susu Cool. It's exactly what I need:)


text:
How to change the default system console to Windows Terminal?
Any way to change the default system console to Windows Terminal?

For what purpose? You can open a console window and launch Blender with "\Program Files\Blender Foundation\Blender 2.83\blender.exe" but if you accidentally close the console, Blender closes, too.

@RonJensen Just want a console with more customization. This is a solution. Thanks. If possible to run Windows Terminal after blender launching? That'd be better.


text:
What's wrong with my batch script?
I want to batch packing every single object's UV. But the script can't go throw everyone. After packing one object, it stopped with no error. What's wrong?
(I've already did Cube Projection for all objects beforehand.)
import bpy

for obj in bpy.context.selected_objects:
    bpy.ops.object.select_all(action='DESELECT')
    obj.select_set(True)

    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.uv.pack_islands(margin=0.001)
    bpy.ops.object.mode_set(mode = 'OBJECT')

Due to some silly mistakes. This one works.
import bpy

objs = bpy.context.selected_objects

for obj in objs:
    bpy.ops.object.select_all(action='DESELECT')
    obj.select_set(True)
    bpy.context.view_layer.objects.active = obj

    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.uv.pack_islands(margin=0.001)
    bpy.ops.object.mode_set(mode='OBJECT')


text:
Is it possible to use custom properties as driver to control an action?
Looks like with Action Constrain, only transform attributes can drive actions. Is it possible to use custom properties to do this?

By driving  the transform of the target object with a custom prop?

@batFINGER That'll work, but I want more clean way.

Enable Evaluation Time check box. Then drive the value from any custom property. In this case you do not need to specify any target object.

finally, a perfect way, thanks


text:
How to export emission pass of one specific object?
I want to make one specific object glare in composition. But there are other objects have emission materials, too.
My question is how to export emission pass only for one specific object?

Check here object index:

Basically in Cycles you can do this node setup:

and if you set your pass index to 0 for your object, it will have no glare, all others will have glare.

object index is exactly what I need, big thanks!

You are welcome


text:
Basic concept question of Scripting
What does class here mean?
Does it mean blender will use this class as blueprint to create a instance object of bpy.types.Panel?
(I'm new to python and blender scripting.)

Please post code as text.

The syntax class DerivedClassName(BaseClassName): is for declaring a class DerivedClassName that inherits from BaseClassName. In the case of your code example VIEW3D_PT_monkey_grid inherits from bpy.types.Panel. More information about Python's syntax and concepts can be found in its docs.
The code does not instantiate an object from the class, it only declares the class. In order to use the panel VIEW3D_PT_monkey_grid you will have to register/unregister it in the register/unregister function. This is how objects for UI elements are instantiated in Blender.
This answer by p2or should give you a complete overview of UI creation through Blender's Python API.

Thanks, I'll check the docs.


text:
How to unwrap a ring to straight gird?
I want my texture to circle around the top of the ring.
Any solution to unwrap the ring to straight grid?

To get a perfectly straight strip, select 2 points on one side of a section of your unwrapped ring (preferably one that already has 2 "flat" edges - such as the one at the top). Set your transform pivot point to "Active element".

Scale the 2 points to 0 on whatever axis you are using (I used X) to make the points straight in line on this axis. Do this on both sides until you have a rectangle.

Now select the whole thing, keeping the "rectangle" selected. Press U for unwrap in the 3D viewport and select "follow active quads". This will make your selection into a strip.

That's exactly what I need. Big thanks!

You can do it before the unwrap:
Select the ring of your object, then select one of its face to make it active, and unwrap with the Follow Active Quads option (you may need to unwrap > Reset before):

If you've already unwrapped you can still make your ring a straight line in the UV Editor with the help of the UV Squares addon (which must be in Blender by default): Select the ring, press T to display the tools, and in the bottom you should see all the addon's tools. Press on the To Square Grid button:

Thanks for the help


text:
Replace object with another on collision
I'm trying to make a grass cutting animation. A blade rotates and when it collides with grass, I want to replace the grass object with the sliced variant.
I tried the particle system with 'die on hit' ticked, and to the blade I added collision with 'kill particles' ticked, but that didn't work.
But even if it worked, I still don't know how to replace them.
Sample video: https://youtu.be/YpSQlPAyW3g

You might find the (free) "Molecular" add-on useful: https://blender.stackexchange.com/q/69836/111042  But the documentation is AWOL.

What should happen with cuted part? Disappear from frame to frame or animate a fail? If fail where and what kind of motion?

be sure to follow this for any clues when someone comments or answers (How to cut hairs in two pieces in blender?): https://blender.stackexchange.com/questions/181530/how-to-cut-hairs-in-two-pieces-in-blender

@vklidu Like a regular grass, it should fall down. I would like to apply physics to it.

There may be something like Hair and the python "bpy.ops.particle.brush_edit()" method to "cut" the "hair"?

I don't want to cut it, though that would be great, but too difficult. It suffices just to replace it with the sliced grass variant.

version – Boolean
Some kind of illusion can be done with boolean operation. You can start with Geometry Nodes to create grass object ...

... but final "cut" is boolean operation (grass differenced with Circle object displaced by Radial Texture), that results in glitchy anim (doesn't matter if I use boolean operation inside GN or as modifier).

What solved this is Solidify modifier for grass object, but in cost of viewport playback (1 fps).

Falling parts are particles emitted from Blade object ...

version – Particles
Another illusion can be done with two exactly the same overlapping particle systems.
One with tall grass and hidden blade on plane surface level to kill particles ...

... in combination with second one identical Plane. The only difference is Render as Object with shorted grass model.

This gives you an illusion

Falling cute grass can be faked in the same way like in the first version.

Notes:

Particles works here only because I disabled Gravity
I wanted to use Hair system, but it didnt react on collision object Kill Particles.
Another thing that doesn't work is to use blend texture controlled by another object (that is known issue)

That works great, thanks! I would also like the grass falling and possibly regrow it so it would make a nice loop, I thought about replacing the dead particle with the sliced part and the shortened grass, which would have an animation of regrowing, and after the blade hits it, it would repeat. But unfortunately I don't know how to do any of these, could you please point me it the right direction?

great idea man!!!

I stacked today with idea make it much easier and "cut" grass just by material transparency ... But I could not figure out how to apply radial gradient that could handle "regrowing" grass ... To animate cut parts can be faked simply by emitting particles from blade ... Again illusion but it could work.

It hurts my mind that blender is incapable of such a simple task... never mind, thanks for your time!

I'm not saying blender is not capable ... I have a trouble :) For someone else it can be easy-peasy ...

Updated version with Boolean operation ... I skipped details, so if you will find it useful and blend would not be self-explanatory, don't hesitate to ask :)

@vklidu That works great, I also thought about a version where the grass would have a growing animation and the blade would just reset it which would perform better (using animation nodes maybe), but given my zero experience, I sticked with yours. After a few renders, this is what I ended up with, it looks great, except the blade particles glitch a few times, this didn't happen in the editor, have you got any idea what's happening?

Great it worked for you ... with Anim nodes I cant help, sorry :)


text:
Assign material to multiple objects in edit mode
I selected parts of multiple objects (in edit mode) and assigned a material to them, but it only assigned it to the active object.
How to assign a material to all the parts of objects?

How to assign materials to all or part of a single object
This is a simple process. Here's a screenshot:

Go into edit mode. Select the geometry that you want to be a different material (you can select faces individually, or press L when hovering your mouse over a mesh). Then simply click on Assign as shown in the screenshot above.
How to assign materials to multiple objects while in Multi-Object editing mode
Select one of your objects and create two material slots, and then also create two materials. Tweak your material settings for the second material to whatever you wish. I just used a bright blue color here.

Select all of the objects that you want to edit, shift click the first one so it becomes active.

Press CTRL + L to open the links pop-up, and then select Materials.

Make sure the number that appears on the materials panel matches the number of objects you have.

Select all of your objects and TAB into edit mode. Select what you want to change, be it faces or meshes, and then simply assign the new material.

Done!

Yes, this is simple, but I am trying to assign a material to multiple objects, not multiple meshes.

Please check my post above, I updated it to reflect how to do this in Multi-Object editing mode.

I exactly followed your steps, but it still works just for the active object

Can you clarify where in the process it failed? Can you try creating a new scene and replicating the process with some simpler geometry?

Ahh, figured it out... I had to select the material in each object, that's why it didn't work. But it's quite annoying selecting it for every single object, is there a simpler way of doing it?

Sorry not following you, what do you mean by "I had to select the material in each object"? You should be able to select whatever you want, select the material (once), and then press Apply. If you're still having trouble I can record my screen.

Hi, sorry for the late reply, I have recorded my screen for you to better understand. Available here: https://youtu.be/HxDA_d68aQs

I can't seem to reproduce the behavior in your screen cap. Here's a video of my screen: https://streamable.com/yf3k4e Maybe this will help?

In my case, I have to select the mat individually, there must be some error in the software, or maybe I messed up some settings, but thanks anyways.


text:
Blender Best Car Crash Problem
I have been trying to find the best car crash with the following conditions:

Rotating wheels when car is accelerating
Car skidding, thus front wheels turn left or right (image the driver trying to take but control of the vehicle and end up drifting)
Car hit an obstacle on the road at high speed and fly off course
Car Crashing (glass shattered, metal part tented)

I have looked through plenty of tutorials on Youtube. How, I am unable to find one tutorial that fulfill all the above conditions.
If I use bones to rig a car, does it mean that there is no possibility for parts of the car to fly off? example the door or a wheel.
--> How can I dent the metal parts? Which modifier should I use?
On Youtube, there are these 2 channels Albin MERLE and TopChannel1on1. Their method require creating a mesh to wrap around the main part of the car and 4 separate cylinder mesh for the wheels.
---> What are the constraints using this method? What are the things I can't do?
I am trying out using this beautiful Mercedes (https://free3d.com/3d-model/mercedes-amg-c63-hi-poly-model-partially-rigged-805791.html). Credits to wishingchain. Whenever I try to add a rigid body onto part of the car, the part will just fall off.
---> What is the reason for that?
This is my first post here. I've tried all avenues and can't seem to find a solution. Will any kind soul please help?
I look forward to a Youtube tutorial on this topic in the near future.
Thank you.
John

Thats a pretty complex topic. Just answering some question because other way it would be too long. I have done it and its hard and you have to be organized. Look into rigid body contraints when you want something to fly off during the animation. You can dent the metal with a second mesh wrapped around your car and using a soft body on the mesh. You can then bind it to the real car with a mesh deform modifier. Your car is falling apart because and thats only a guess its not one object and the rigid body sim is on every part separately.

Hi. I appreciate you have a complex problem and have found a solution to part of it, but this is a Q and A site is for specific questions that can have specific answers. The fact that you have a 4 part answer probably shows this question is too broad at the minute. Please only ask one question at a time. You are welcome to ask multiple questions but as separate posts. I suggest editing your question down to just one question (by using the [edit] link below it) and asking the other ones separately. Thanks.

After a day of research, I found out some of the answers and I am going to answer to my own questions

Rotating wheels when car is accelerating <- for the wheels, add drivers to an empty axis, then move the axis, the wheels should rotate (tested out, it works)
Car skidding, thus front wheels turn left or right (imagine the driver trying to take but control of the vehicle and end up drifting) <- rotate the front wheels on the z-axis via the empty axis in between key frames (haven't test it out, still figuring out how to add drivers on the z-axis)
Car hit an obstacle on the road at high speed and fly off course <- parent the empty axis to a cube, the cube is in the shape of the car, wrapping around the car (tested out. tried hitting the cube together with the car to a stationary pole straight on. not sure why, but upon impact, the pole was absorbed into the cube and car and stayed inside them. the cube and car then kept shaking while the pole is inside of them)
Car Crashing (glass shattered, metal part tented) <- upon impact, manually dent the car and use key shape key function. not sure about shattered glass. perhaps separate the glass parts from the car at the key frame upon impact? I know about cell fracture but not unsure how to make the glass break upon impact. the windscreens are tempered glass, depending on impact, it should either crack or break. (tested out only on denting the car, it works)

It seems like there's no way to add a rigid body onto the car. That is why I have to parent the car to the cube (that is in the shape of the car). Because every time I add a rigid body to the car, those parts that have a rigid body added will just drop onto the ground all over the place. Please let me know if there's a way around it.
Hope someone will be able to help, especially with the cracking of tempered glass and glass shattering part. Windscreen should crack while side and rear windows should shatter. Because every time I try to add a rigid body to the car, everything just fall apart. I will update again if I can find out more.
Have fun crashing.
John

There is also a quick explode effect you add to the glass. Just select the glass, press the Object menu on the top bar and press quick effects then quick explode.


text:
Cycles Line style node editor keyframe or driver not working
I'm using blender 2.79b in cycles. I can see freestyle after rendering and manage freestyle line set and freestyle line style by the render layers tab. When I activate "Use node" in node editor + line style button or in render layer tab, freestyle line style, texture I can see the node (eg. line style output).
I'm tring to keyframe (eg. alpha) and set 1 in frame 1 and 0 in frame 2. But when I set the second keyframe on frame 2 the value setted on frame 1 change to the last setted value (in the case 0). So seems keyframe don't work
I try also to manage via driver but after adding driver, manually create later (as I do usually for other) I cant see the driver in the graph editor, driver button.
Is it possible to manage line style node?
My current workaround is to disable use node and keyframe using the keyframe on the freestyle line style panel.
Another question:
Using node editor for line style i can't see many shaders as i can find when i use node for material (eg. i'm looking for emission).
Is it possible to use them?
Thanks


text:
Cannot See Pasted Object
When I copy/paste an object I want from one blender file to another (which normally works) I cannot see the pasted file. I have checked to see if it is on a different layer, and it is not. I have also checked to see if the scaling is merely off, or if the perspective is clipped too close. I have changed the scale by a hundred fold, and still see nothing and have adjusted the clipping to closer, and still no dice.
Any ideas?
Images attached (I want to place the cylinder onto the rectangular surface). Photo three suggests that the object is there, but something happened to it.

To see if objects were pasted check the 3D View header and see if geometry counters changed. My guess is that it is probably a scale issue, third screenshot shows object dimensions in microns

You were right. Astute observation! I have no idea why it got so small when imported.


text:
Overwrite instead of combine results of bmesh's convex hull operator
When using bpy.ops with the convex hull operation as shown below, the mush comes out combined, but I want it instead to have the convex hull only. Can you see what I'm missing in my script? See image for the current and desired results.
import bpy
import bmesh
from math import radians
def convex_hull(obj):
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')

    mesh = obj.data
    bm = bmesh.from_edit_mesh(obj.data)

    bmesh.ops.convex_hull(bm, input=bm.verts[:], use_existing_faces=False)

    bmesh.from_edit_mesh(obj.data)
    bpy.ops.object.mode_set(mode='OBJECT')

convex_hull(bpy.context.active_object)

The API docs say

Any input elements that end up inside the hull (i.e. are not used by an output face) are added to the ‘interior_geom’ slot. "

So delete those elements.
geom = bmesh.ops.convex_hull(bm, input=bm.verts[:], use_existing_faces=False)
bmesh.ops.delete(bm, geom=geom['geom_interior'], context='VERTS')

Unrelated to this question, but bpy.ops.mesh.select_all(action='SELECT') is redundant.
EDIT
The above method produced a non-manifold mesh. So removing all faces and edges before running the convex_hull method seems to work fine.
import bpy
import bmesh
from math import radians
def convex_hull(obj):

    bpy.ops.object.mode_set(mode='EDIT')

    mesh = obj.data
    bm = bmesh.from_edit_mesh(obj.data)

    bmesh.ops.delete(bm, geom=bm.verts[:]+bm.edges[:]+bm.faces[:], context='EDGES_FACES')

    geom = bmesh.ops.convex_hull(bm, input=bm.verts[:], use_existing_faces=False)
    bmesh.ops.delete(bm, geom=geom['geom_interior'], context='VERTS')

    bmesh.from_edit_mesh(obj.data)

    bpy.ops.object.mode_set(mode='OBJECT')

convex_hull(bpy.context.active_object)

Thanks @tetii. This successfully deletes most of the interior geometry, however, it doesn't remove interior edges that are connected to multiple convex meshes. If you run the script with this change, you can see geometry on the interior near the top and bottom of a suzanne mesh when the script is applied.

I've tried changing the line to include unused geometry with no sucess
bmesh.ops.delete(bm, geom=geom["geom_unused"] +geom["geom_interior"],context='VERTS' )

I can redcude to all verts using the following to avoid this, but is it the most efficient approach?
bmesh.ops.delete(bm, geom=bm.edges, context='EDGES_FACES')

@Zak Nelson, your method with 'EDGES_FACES' should have left unnecessary vertices. However, my method with 'VERTS' resulted in a non-manifold mesh. Deleting all faces and edges before running convex_hull method seems to work well. I'll modify my answer later.


text:
Blender compositor invert results in incorrect values
I would like to invert the values in my image in the compositor node, but as you can see from the output shown in the image below, the inverted image appears blown out. You can clearly see this in the almost fully white background.
I want to use the compositor to adjust image textures for pbr materials such as roughness and normal which should be set to non color data in the shader editor as well as base color and emission color which use sRGB.

I wonder if it is the result of color space  however I haven't found a combination that makes sense or works.
You can see here my current settings for color management in Blender's render properties:

I believe the Invert node simply inverts the channels with 1 - channel. But as your input data is in sRGB, you need to remove the gamma curve before doing this linear operation and apply it afterwards again (note 0.455 in the image is actually 1/2.2 = 0.454545...):

Thank you! What is the significance of the value 2.2?

It's the common gamma value used in most image file formats to map between linear and sRGB color space. There are plenty of resources if you search for Gamma correction.

@ZakNelson could not edit my comment anymore. In short, the mapping is not linear but with an exponential function, and the exponent is called gamma.

Thank you. I've marked this as the accepted answer.

Should I keep my view transform in the color management settings as Standard, rather than filmic?

For me, this has nothing to do with the gamma correction in the question. I see the Color Management purely as a post processing for certain render styles, but others may know better.


text:
Cloth simulation Vertex group Stiffness/plasticity/flexibility
I want to be able to use my weight paint to make parts of my cloth simulation less flexible than other sections and I haven't been able to find this option anywhere.

in your Physics panel > Cloth > Shape > Pin Group, choose your group

Pin group removes any movement for those areas. I still want physics applied, just not the same cloth properties. Pinning will only maken it hang from the very group instead of it all dropping.

don't give a weight of 1 to the vertices, try lower values

Thank you. That seams to be giving the result I want.

If you want to make a part of your object stiffer, weight paint this part with a low value (otherwise it will hang), it will automatically create a vertex group, choose this vertex group as the Pin Group of your cloth (Cloth > Shape > Pin Group).


text:
Bpy: Add a modifier to every object in the scene that doesn't yet have one
I would like to add specific modifiers to every object that doesn't have one yet. Below is what I have so far. I think my main limitation right now is I don't know how to find the context that also works with identifying modifiers.
obj = bpy.context.object
    for modifier in obj.modifiers:
        if modifier.type == "BEVEL":
            mod = obj.modifiers.new("Bevel", 'BEVEL')
            mod.limit_method='WEIGHT'
            print('kay')
        if modifier.type == "WEIGHTED_NORMAL":
            mod = obj.modifiers.new('Weighted Normal', 'WEIGHTED_NORMAL')
            mod.keep_sharp=True

Here you're looping over EXISTING modifiers and checking if they are of the correct type.
You can make use of the barely used for ... else idiom to do what you're looking for.
import bpy

for obj in bpy.context.scene.collection.all_objects:
    if obj.type != "MESH":
        continue
    for mod in obj.modifiers:
        if mod.type == "BEVEL":  # Select the bevel modifier
            break
    else:
        mod = obj.modifiers.new("Bevel", 'BEVEL')
    mod.limit_method = 'WEIGHT'

    for mod in obj.modifiers:
        if mod.type == "WEIGHTED_NORMAL":  # Select the weighted normal modifier
            break
    else:
        mod = obj.modifiers.new('Weighted Normal', 'WEIGHTED_NORMAL')
    mod.keep_sharp = True

Further reading on for ... else
Another way to write it using or
import bpy

for obj in bpy.context.scene.collection.all_objects:
    if obj.type != "MESH":
        continue
    mod_bevel = next((m for m in obj.modifiers if m.type == "BEVEL"), None) or obj.modifiers.new("Bevel", 'BEVEL')
    mod_bevel.limit_method = 'WEIGHT'

    mod_weighted_normal = next((m for m in obj.modifiers if m.type == "WEIGHTED_NORMAL"), None) or obj.modifiers.new("Weighted Normal", 'WEIGHTED_NORMAL')
    mod_weighted_normal.keep_sharp = True

That did it. Thank you!


text:
Part of the Interface disappeared
while I was sculpting today a part of my interface disappeared while accidentally hitting a key combination I don't remember. The interface only changed in Sculpting mode and it only changed in this project, it's back to normal when I open a new project. Is there a way to fix this?

I think you pressed CTRL + SPACE. The shortcut maximizes the view of the window you are hovering over.
Note : If you emulate a 3-button mouse, the shortcut is ALT +  CTRL + SPACE.
Press this combination again to go back to normal.

Thanks, it worked! Even though it was Alt+CTRL+Space, probably because I have emulate 3 Button mouse active


text:
How to unwrap properly this bevelled mesh (see pic)
I've been trying to get a decent result with the unwrapping of a mesh representing a boardgame counter (top + bottom). I've bevelled it first, applied smooth surface and then unwrapped it in many different ways, but it seems to always get the edges wrong. As you can see in the reference picture, the camo texture should continue to the edge of the counter, instead, it stops showing a different part of the mesh. It shouldn't be that hard to do, but for some reason I always get the same result. Is there a way to have the top part of the mesh show exactly as it does in the reference pic?

I would make three or four separate UV islands: the top face, the bottom face and the edges would be a 'strip' (maybe two separate strips for better packing the islands).

It would be helpful if you packed the texture into your blend file and posted the blend file here.

Thanks all for your quick replies, but it looks like the problem was that I wasn't scaling before unwrapping the mesh. I scaled and after some adjustments to make everything fit it looked great.

The problem with your texture isn't the way you are unwrapping the UV's, the problem is the way the UV's are automatically positioned.  For example, in the picture below is approximately what the UV's of your cube look like (I know they aren't the exact same)

Now, if I select a face from two different sides on the cube, you will see that both islands of the UV are disconnected, and this is why your textures looks the way it does.

There's not an easy way to fix that part, that's just how a cube unwraps.  What you can do however, is put a mapping node, onto your cube's image texture, and switch the texture coordinate from UV, to generated, and then you will have to scale it to get the right dimensions.

That's the default UV map for a cube.  It's not the way to solve this problem, which will require manually adding seams


text:
Giving Shapekeys a random starting value?
I love the "random" input in the shader editor; it makes it so easy to randomize duplicated objects by changing the color and offsetting textures and all that. It would be crazy useful to be able to do a similar thing with shapekeys, so the geometry can vary as well.
I can control the value with a driver, and I tried the method in this fantastic video, but that changes the shapekey value on every frame (as happens with every "random" solution I've tried so far), which means in an animation it's a jittery mess (he suggests "muting" the drivers to fix this, but the scene still runs super slowly, since I think it's still running the randomizer for every value for every frame, even if you can't see it).
So my question is, how can I give that shapekey a random static value? I figure something like multiplying the object's ID by a wacky number or something, but I just can't figure it out.
I feel embarrassed posting this, because I feel like this is a fairly basic thing that's probably answered elsewhere, but I've been searching obsessively for a couple days and just keep finding the same few threads over and over, so hopefully someone here knows?? Thanks in advance!

Hi and welcome. If the linked post does not answer your question, just let us know. The add-on mentioned in the answer has been updated recently too and should work perfectly: https://blender.stackexchange.com/questions/40621/how-to-disable-enable-multiple-shapekeys-visibility/40624#40624. BTW: recommend take the [tour] to learn about how this site works, cheers.


text:
Get keyframes with offset for walking animation
I am making walking animation.
I always tweak Right foot IK animation values but I want to re-use it as Left foot IK animation. If I can do this I don't need to copy Right foot IK animation keyframes and paste it on Left foot IK controller.
My Right foot IK animation has 50 frames-long loop animation using XYZ euler rotation mode.
And I have a question. How do I write python script for drivers?
I think what I should do is like
Get right foot transformation value frame by frame and offset the keyframe value.If current Right foot IK has frame number 10 keyframe transformation value, I need to offset it and get  10+25 or 10-25 frame transformation value of Right foot IK and make Left foot IK have it.
Is it possible?

I managed to make the script by myself. it still need revising but works fine for the time being. I don't need to copy and  paste half part of animation anymore.


text:
is it possible to force "Zoom to Mouse Position" option to use previous mode's mouse position?
I do modeling  in edit mode and sculpt mode(or Object mode and Edit mode), but If I edit mesh in edit mode and start sculpting in sculpt mode, "Zoom to Mouse Position"  setting forget the mouse position which I set in  edit mode. Is there any way to make "Zoom to Mouse Position" to use previous mode's mouse position? Maybe python script can make it possible?


text:
Move object towards/away from camera in 2.8?
I can't figure out how to make an object move towards or away from the camera view in 2.8. Any help?

Do you mean.. Zoom in and out in camera ? Or actually move the object?

Do you mean as an editor transform (e.g. limit movement to camera axes)?

I want to move an object closer/farther to the camera's (in the viewport) location.

Did you ever get this?

like I want to press g twice and have the translation axis be the normal of the camera

Change the Transform Orientation to View

Now you just press G to grab along Z.


text:
Minimum amount of illumination in Cycles?
I'm rendering a satellite in orbit of the Earth for a client. The sun is head-on so there is nothing to light the back of the satellite. Since this doesn't look great and more of the satellite should be visible, I want to make it so that shadowed areas aren't as dark. I tried doing this by making the world lighting brighter, which works, but since the satellite is metallic, the shadowed areas of the satellite don't look shadowed at all when viewed at a shallow angle (the background is reflected). How can I make the satellite still look shaded properly but with the shadowed areas still somewhat illuminated?

Cycles, it's in the title.

Maby this helps: https://blender.stackexchange.com/questions/38851/cycles-how-do-i-exclude-the-environment-texture-from-reflections

Also bluring the background image maby helps making the reflexions less intrusive

The most complicated way would be to use several passes/ diffrent scene setups and use the envoirment background only as direct/ indirect diffuse pass but not as glossy

It's hard to tell without seeing your setup, but couldn't you just put either an emission plane, or a simple reflective plane (to bounce back some light from the sun) "off-screen".

Thanks. I think that I was under the impression that my shadows being hard to see was unrealistic but upon further analysis, this is physically accurate, so I will keep it.


text:
How do you export an STL using proper units?
I want to export an STL file using the units in my scene (millimeters), however, when importing the STL, the model is in fact MUCH smaller than that. The units in blender seem to only be a display feature, however I believe that 1 Blender Unit is equal to 1 mm, but working with only these units is annoying and restrictive. Is there a way to export an STL using the displayed unit in my scene, or are there any workarounds?

Unit system of Blender can be changed from default to Metric or Imerial in scene settings. 1 Blender default unit on export can be pretty much everything; in Blender it equals to 1 meter.

Unit Scale "0.001", Length "Millimeters" and Export STL Scale 1 works for me and Cura.

The STL exporter has the Scale setting. You can use it to scale blender unit to one, that your target software uses. It's easy to find out exporting the default cube (2 x 2 x 2 meters), and check its size in the target software. Then use the coefficient found. As for display units, when you select 'Metric' in the scene's Units section, it gives the Scale setting enabled, where you can tell blender that one blender unit equals say 10 meters instead of default 1.
Note that you have to keep the scene scale adequate for blender's physics to work right. It assumes that 1 blender unit equals 1 meter.

I have tried it in the past, never seemed to work. Will try again.


text:
Turning a UV layout into an image?
I want to be able to print out my UV layout, so as to be able to assemble the model out of paper (or wood, if I lasercut). Is there an easy way to turn the edges in the UV editor into outlines on the image, so I can see where to cut?

Yes, you can export your UV layout as an image.
Open up the UV editor and...


text:
Vertex Paint not painting the areas selected on Blender2.8
So I'm literally using blender 2.8 for the first time and I'm following a tutorial to make a low-poly island. I'm at where I want to paint the tip of my mountains white (while preserving the low-poly effect), what I'm doing is I selected the faces I want to paint in the Edit Mode using circle select, then I switched to Vertex Paint and picked the color using the color bar at the bottom next to "color". Then I clicked paint->set vertex colors, but it did nothing.
I'm not sure if I did something wrong or it's got something to do with blender 2.8, if anyone could point out my error or provide an alternative to my purpose it would be very much appreciated.

This has an answer here.
Is it possible to paint only on selected vertices in vertex paint?
Though I would like to add that if you are in any viewport shading mode other than Solid, the results won't show up in the 3D viewport when you are painting in vertex paint mode.
Also of note that after you get this working, you're very likely going to want to perform a render at some point. And you may run into more trouble when you get to that point, because vertex paint doesn't seem to want to render unless you go into the Shader Editor and hook up some nodes. If you later find that this is a problem, consider reviewing the following:
How can vertex paint be rendered?
How do I set a vertex color material in Blender 2.8?


text:
Only want part of an STL
I am using different STLs to make a special creature.  For example: I have a panther STL, but only want to use the head for my project, and then just the wings from another STL, etc.
Is there an easy way to separate the parts I need?  I have looked through some other Q&A and found some things that are close, but I have yet to find the best solution.
Thanks

Welcome to the site :) Let us know if the linked answers don't satisfactorily answer your question.

That link was helpful.  Thank you.


text:
How can I keep its face from breaking?
I made a fluffy toy and set armature using automatic weight. Then changed to pose mode and I moved head bone, its face was broke as image.
So how can I fix it? I already tried to fix it by setting of weight paint but it doesn't work.I tried to join the objects too, but this way broke the setting of hair particle.
Thank you for reading.

blender version:2.83
OS: Windows 10

Can you please explain how it broke, does it got separated or overlapping, adding the image it seems to be attached and only rotated a bit weirdly

After I read your comment, I reviewed setting of weight paint and tried to fix it...And surprisingly I could fix this by myself! Thank you for your comment.

Hi. Please add an answer showing how you fixed the problem so other people can benefit. Thanks.

This problem's cause was automatic weight. There was unnecessary weight on eyes and nose, so they were influenced by rotate of shoulder and arm. I could solve this by reviewing setting of weight paint and delete unnecessary weight. I know this is very elementary problem and embarrassed but I wish this question could help someone who has similar problem. Thank you.


text:
How can I fix inversion of light and shade of normal map?
I made a normal map of cloth by bake and set it to low-polygon object. Then I checked it on render view, the light and shade of cloth had  inverted between front and back.
But I can't find what probrem is and I can't fix it though tried to.
Could you give me some advise. Thank you.

could you please share the shirt (with the images packed into the file)? https://blend-exchange.giantcowfilms.com/

Start from changing in your texture node the color space from sRGB to "Non-Color", with the strenght set to 1.0, and see if this solves the problem.

Oh, as you say I could solve this problem with changing color space! Thank you very much.

Thank you both for your comments!


text:
Dyntopo doesn`t do anything even though it's activated
While sculpting a hand dyntopo stopped working after I unionized the last Finger to the hand. It worked for the first four, but after the last it didn't. It shows that it is activated, but it just doesn't add new geometry. I already checked for geometry inside the mesh after the union, but there isn't any. Anyone got an idea, why it is not working?

have you set your geometry addition size low enough for new geometry? is it doing anything? Picture?

You can try to make a new default scene and append your dyntopo mesh into it - could help, perhaps?

@dave44 Don't know how I can add an picture to a comment, but mydyntopo is set to relative detail, but it doesn't matter how close I am or how low my Detail size is,  it doesn't add topology.

@ManuJärvinen I don't exactly know how I do that, but I tried to copy all objects into a new project and there it works without any problem. So it seems to be a problem with the project and not with my mesh

Great that you got it solved! :) I made an official answer out of that one.

to add image just update your post by editing in future

You can try to make a new default scene and append your dyntopo object into it - could help, perhaps? Or just copy all the objects to a new project.

If anyone is still having this problem, the way I fixed it is to use the Snake Hook Brush. Make sure Dyntopo is enabled, and then just press wherever you need to make the mesh denser. There's no need to actually pull anything around – just tap and it subdivides it all. Hope this helps at least someone.

Here's a way of resetting the interface (including sculpt tools) while leaving the actual model alone. There are a lot of tools and options (A LOT) with sculpt mode, and sometimes it's easier to just reset everything to factory mode like when you created a new model, but without actually opening a new file.
As of Blender 2.92, go to the Edit→Prefrences menu. Make sure you're on the Interface tab. In the bottom left corner of the window, there is a hamburger icon. Click on it, and select "Load Factory Preferences".

This is an important last-resort move to know when your interface has gotten too out-of-hand to correct manually.
As a caveat, though, this also resets some system preferences, like switching your Cycles render device from CUDA or OptiX back to None (CPU only). This is an infrequent enough thing, and easy enough to fix, that having to change it back each time doesn't bother me so much.

Dyntopo doesn't work with the Draw (sharp) brush or any elastic deformation brushes (except if you're smoothing).
Try using the normal Draw brush, decreasing your detail size or changing to another brush.

I had this same problem. Try checking Refine Method. If it is set to Collapse Edges it can only make a mesh less detailed, you therefore have to swap it to Subdivide Edges or Subdivide Collapse. I believe Subdivide Collapse is the standard setting, but it got changed by accident.


text:
Problem with using Curve from mesh
I tried to make a tube by using the vertex replicated from object(not add bezier curve),but I add the bevel thickness, it seems flat not like I prefer to. How can I solve this problem?

Does the object have uniform scale ? Try CTRL + A > Apply scale


text:
How to only sew a specific part of a mesh?
I am trying to make an overcoat/trenchcoat type of mesh. At the bottom of the coat, there are two flaps that have to be drawn back to the sides. For reference, it is based on the French trenchcoats from during the Victorian era as shown . So look at the bottom of the coat, notice how those flaps are attached with buttons on the side. I tried looking if I could do something with vertex groups and weight paint, but to no avail.
Here is a clip I made of my issue. I am trying to use sewing in the cloth physics, but the physics are affecting my entire mesh, instead of just the bottom parts(the flaps more precisely). How would I go about this that only the bottom part is affected by the cloth physics and that the sew physics work only for the flaps?

so why didn't you succeed with vertex group and then use this group as Pinning so that only the bottom part moves? Also I'm not sure about the sewing thing, I guess it's only useful when your modeling your cloth, when you're glad with the sew you apply the Cloth modifier (then create a new one for the bottom flaps).

Well, The problem is I think that I just don't understand how it works. I've tried looking up some tutorials on cloth physics and weight paint and vertex groups. Most of them are still in 2.79 or earlier versions. I try to port and convert it, as it were, to 2.8, but I don' t think it seems to do what I want it to do.

you need to paint all the part of the mesh that you don't want to move, or select it and directly assign it to a group in the Vertex Group list, then in the Cloth panel > Pinning, choose this group so that Blender understands that it is supposed to stay still. The rest of the cloth will move. Have you already done that?

For some reason, what I did before with the vertex groups works now. When I did it yesterday, it did not work. I don't know what I did wrong last time...


text:
How do i model the sharp of a blade?

I'm making my first sword in blender for a video on yt but the guy doesn't teach how to make the blade edge


text:
Restoring 2.79 click functionality in Blender 2.8 particularly with respect to lasso select
I am really used to using the lasso selected in Blender 2.79, but for some reason I cannot seem to figure out how to get similar functionality out of Blender 2.8.
Note that I have the "Keymap" option set to "Blender 27X".
My particular issues are:

When I have the lasso select selected in the toolbar and ctrl+click, Blender refuses to select anything.
Under certain circumstances, Blender changes the lasso select mode back to box select mode. I have tried to debug what these circumstances are but cannot figure it out. It seems related either to switching modes (e.g. from Edit to Object) or maybe to switching tools (which I avoid, as I never want a tool selected other than 3D cursor).

Essentially what I'm trying to recreate is the Blender 2.79 controls of left-click for 3D cursor, ctrl+click for lasso select, and right-click for select. If there's just an option somewhere to do this that would be the best solution.
Otherwise what I've been doing is changing the select tool to the lasso select, and then trying to leave the tool selection on the 3D cursor tool. This however is not sufficient due to the issues listed above. In order for this to work for me I need to know how to prevent Blender from switching my tools without me clicking on them.
There are some promising looking options under the Keymap options but I'm afraid I cannot decipher what exactly they all mean, although I've looked at this documentation.
I've been searching for solutions to this for a few months now and have not found any. Perhaps my google-fu is not strong enough but I figure it would make sense to ask here at this point.
Thank you for any help you can give me.

In Blender 2.8x you can hold Shift to extend the selection or Ctrl to remove parts of the selection with the lasso select tool.

@RobertGützkow I am aware of those features; as I said, I use the lasso select a lot. :) My problem is more that, for example, if you open a new Blender 2.8 file, ctrl+click does not lasso select, while in Blender 2.7 it would. Thanks anyways.


text:
"Selection to Cursor" Why it's not working nomally
I made two UV Spheres like this

make Constraint-ChildOf

insert rotation keyframe of target

after few frame, I rotate target sphere and insert keyframe

And then, when I try to "Selection to Cursor"

The result is this....

as you can see. the sphere is not matched at cursor
What's wrong with it and How can I fix it?


text:
Intersection of two mesh profiles in geometry nodes
I'm struggeling to get a (clean) intersection of the following profiles. It has to be this kind of arc stripe intersected with a rectangle.

I tried these nodes

Even though the shape looks like it could also just an arc segment, this is not what I'm looking for. I would also be happy with a solution which can construct the shape.
I want to construct the following geometry in the end.

And finally I want to stack these. I'm also trying to get a clean mesh and I know stacking these and filling the curves and extruding the profiles in the end will also be very tidious, but these are things to come. It it important that the faces on the sides are missing because there I will add more geometries.

thank for you help

You could use maths, but the way the title is phrased, there's no general mathematical solution (there is for cutting out an arc as presented in the question body).
The generalized solution would be to use Boolean. Fill curves, extrude, then boolean, and then keep only the bottom (because the filled curve extrudes up)

You could continue extruding, flipping etc. until you get as many levels as you need…


text:
Make Part Of Material Transparent
I want to make the blue part transparent and the non-blue part not transparent, there are no vertices where the grey part is so I can't just make a new material.

What you can do is that you can edit a copy of the texture in an image making program like Paint.net.
First, make the area where the non-blue strands are black and the blue areas grey or white. If you want the blue area to be translucent (between opaque and transparent), choose grey. If you want it to be fully transparent, choose white. After you do that, save the image as a separate image file (I'll call it alpha.png).
Now go to Blender. Go to Cycles Render.
Then, go to the material's nodes in the Node Editor. Add an Image Texture node and load alpha.png in it. Connect its Color to a Transparent BSDF's Color. Then, add a Mix Shader node. In one Shader socket on the left side, put the Transparent BSDF. In the other, put the BSDF your actual texture (NOT alpha.png) is connected to. Finally, take the shader socket on the right side and connect to the Material Output.
Here's the explanation; connecting alpha.png to the Transparent BSDF creates something called an alpha. White means fully transparent, grey means between transparent and opaque (translucent) and black means opaque.

Use an image with an alpha channel


text:
images with transparency return to black when bunched
Each plane with grass has transparency on it so that if I just rendered one grass plane it would not be a problem but when i duplicate them then they return to black

In the Render tab > Light Paths > Max Bounces, you may need to increase the Transparency value.


text:
Explosion/fire not showing up after bake in viewport or rendered
I was following an explosion tutorial for 2.82 on youtube and he did a bake and after that, the explosion showed up, but when I do it the domain changes sizes but the explosion does not show up, I have tried clearing my cache folder and restarting my computer and blender but nothing happens still.

https://blender.stackexchange.com/questions/181499/bake-data-button-not-visible-in-fluid-options/181501#181501

I was having this issue even after baking the data. And It finally started rendering after I baked the noise as well.

Please don't use the answers section (and Set the cache type from replay to final ; ) )

Sorry, first time hear :}


text:
See image through object
I am trying to do something like this
https://twitter.com/i/status/1094431182891159553

All you have to do is add the following nodes:

Here are the things that are labelled above:

1) Connect an image texture node to your shader.
2) Upload the Galaxy Image (You can look for Galaxy Wallpapers for
  some good ones).
3) Set the Texture to Clip instead of Repeat.
4) Use the Location and Scale to properly wrap the texture around your
  mesh.
5) Set the Texture Coordinate Node to Camera

Here's the final result on a Suzanne Monkey with a bit of extra lighting and compositing: https://youtu.be/y_6SRElqMn8
Hope this helps :)

it works in eevee but not cycles

The example above was made in Cycles though.... Unless 2.8 has changed how cycles behaves cause the above was done in 2.79.


text:
Cycles Plane With Equal Shading On Both Sides
I made some grass, but with the lighting I am using one side is dark because there is no light shining on it, so I want it to have no shading, but the problem is I still want it to change colors with the hdri, just have equal shading on both sides.

You can start from combining Principled & Translucent shaders with Add or Mix shader.  For Mix use Backface socket of Geometry node. Optionally you can play with Normal edit modifier which is commonly used for plants

could you include a picture?

Here it is: https://imgur.com/a/yR3yZZI


text:
Wrap texture evenly around mesh
I am trying to wrap this brick texture evenly around this controller 3d model, I can get it evenly around some parts but the handles are causing me problems.

Imaging you are wrapping this object with paper with this print; How would you like the pattern to be cut? There is no magic button for this. You need to UV unwrap it carefully and make decisions about how you want the pattern to be distorted.

I dont want it to be wrapped a certain way, I just want it to have an even texture across the entire surface

"Even across the entire surface" is a very certain way. Not only that... it's impossible.

how can I get close? I want it to be like wallpaper not like spandex

So I figured it out, what I did was make an image of one brick in photoshop and then put it on as a generated normal map.


text:
Make Explosion Out Of Blocks
I am trying to make an explosion out of legos like you see in the lego movies, I have seen a bunch of tutorials for houdini but none for blender. I tried adding a remesh modifier to a smoke simulation but it did not work.

use a particle system in which the particles are legos

Thank you for the response, do you know how I would make a particle system where the legos are particles and also how would I make the legos line up with each other and make the colors change depending on how the smoke and fire are?

this may help https://www.youtube.com/watch?v=bpYkNTwK9Pg

That would totally be awesome if someone could answer this.  what would be really cool is if someone could figure out how to use multiple different types of bricks to build the explosion like in the lego movie, but that probably requires python.  addons anyone?

I asked this question, and I got a great answer!  The answer with the bounty is the one I think to be the most helpful. here' the link. https://blender.stackexchange.com/questions/154870/how-do-i-make-more-complex-lego-simulations-in-blender?noredirect=1#comment264586_154870


text:
Subsurface Scattering Causes Strange Dark Sections
I am working on a model and I am using subsurface scattering for the skin. It was working well until I got to the face. When I added subsurface scattering, it caused the section around the mouth and eyes to become dark and bluish. The only way I can find to fix it is by deleting the mesh for the mouth and teeth, but I need those meshes. I have tried adding subsurface scattering to the mouth mesh, and disconnecting it from the body mesh, but nothing has worked. Also, the effect does not show in material preview, only in rendered view. Thank you in advance!

Looks like your subsurface is set too high, the value is a 'scale' setting that determines how far into the mesh light can penetrate, .19 is about 7 inches :p

At that point the ray may never make it back to a light, and will be reported as lost (black pixel), since that is probabilistic based on ray direction, this causes an overall darkening in color

Thank you so much! What would be a good value for it?

Okay so I changed the subsurface value to 0.05, but the dark color is definitely still there especially around the eyes...it does not go away until subsurface is zero. Also, I can get the darkness around the mouth to disappear by deleting the mouth mesh from the body, but I need the mouth. Here is what it looks like with subsurface at 0.05: https://imgur.com/a/pR0k5wU

Try the settings here - https://blender.stackexchange.com/a/179561/110840

Unfortunately still having the same problem...

This might have something to do with the thickness of the mesh, missing faces on the inside, or clipping, and might be hard to solve without getting very specific detail.  Suggest you give it some thought and [edit] the post with more info if you find it worthwhile.  Cheers

Alright, so I have found that when I delete the mouth mesh the problem stops, and here is a screenshot: https://imgur.com/a/ZzlAszi Also, for anyone who could possibly investigate further here is the .blend file: https://mega.nz/file/ZzwE3SYT#ImBsfZaG_rAs0n6xmn8Jv9C9KZtgeQkGDeur6RaCURE


text:
How to add audio to Blender 2D animation?
All the tutorials I have seen for adding audio to a 2D animation in Blender involved using the video editor. Is there any way where you can just directly import audio to your animation?

What do you mean by directly? In Blender there is a Speaker object that can reproduce sounds during an animation

The tutorials I have seen showed the process of putting audio into your animation to be like this:

Import your animation into the video editor.
After you have done that, you can add audio to your animation.

I feel like importing your animation into the video editor is just an extra, unnecessary step. So, what I meant by directly is this: is there a way to import audio into your animation without having to import the animation into the video editor? Thanks!

You don't need to import the animation as a video in the VSE. You just add the audio on the frame you want it to start, and it'll come out with the animation (regardless of whether it's imported video, 3D, or 2D)

In the Video Sequencer (shift f8), in the dropdown menus, under "Add" -> "Sound". You can cut it and move it around, the same as the video strips.
The sound should play on the same frames that they would on imported video (even if there's no "video", per say)


text:
Does the term "polygon" just mean "face"?
Is polygon just another word for face in Blender? For example, a cube has 6 faces. Does this mean that you could also say that this cube is made up of 6 polygons?

Yes. Polygon (or sometimes 'poly' for short) refers to a face of a 3D shape.
For a more full answer:

'Tri' refers to a 3-sided polygon (triangle)
'Quad' refers to a 4-sided polygon (quadrilateral)
'ngon' refers to a polygon of more than 4 sides ('n' being used as a placeholder to mean 'penta', 'hexa' (-gon) etc. for brevity. They're all placed in the same bucket for 3D models because they all have the same practical problems.)

Polygon also just refers to any 2D shape in the world of maths/geometry too :)

A polygonal chain which is not closed is a geometrical shape as well, but not a polygon ;)

Well, yes and no. While a polygon is first of all a set of points connected by lines to form a closed shape, this does not necessarily have an interior (generally speaking for geometry), whereas in 3D software usually a polygon is used for a "filled" polygon with interior rather than a hole surrounded by edges.
And for Blender, while you can say polygon to this shape no matter if you're looking at it in Vertex Select, Edge Select or Face Select mode, the word face distinctly refers to a filled polygon. You can select a boundary only polygon (unfilled) in Vertex Select or Edge Select mode and it's geometrically still a polygon, but you cannot select it in Face Select mode.
Okay, that was a little bit too excessive maybe, in case for what you are asking the simple answer would be: Yes, you can say the cube is made up of 6 polygons.
Let's put it this way: a face is always a polygon, but a polygon not always a face.

Basically yes, for Blender (since this where we are right now), a polygon is shorthand for a filled closed shape, unlike in regular geometry, where a polygon is not always needed to be filled. We need this as an approximation of the curves in real object, which would require an infinite amount of data for the point otherwise.
However, since this is a software we are talking about, it depend on which setting you are drawing the cube in to define how many polygon does it have. In this question for example, the post-triangulated cube actually have 12 polygons instead of 6 (each square face turned into 2 triangles). On the other hand, this cone is made of n triangle polygon (where n is the number of vertices)


text:
How to animate an object rotating on its own axis?
I want to animate a planet spinning on a slight tilt, like the earth does. I want to use a generator (in the graph editor) to have consistent, procedural motion, but animating any single axis of rotation uses global coordinates. How can I achieve this effect?

if you animate the earth on the Z axis, then parent it to an empty, and tilt a bit this empty, is it not what you want?


text:
Disable atmospheric drag in smoke simulator?
I know this is a stretch, but using the smoke simulator, I'd like to simulate a gas moving through a vacuum (space) which means that the gas should not be slowed down over time and should retain its momentum. Is there any way to disable the effects of atmospheric drag on smoke so that it continues to move for long periods of time? Thanks


text:
Compositing : change color behind glass
I modeling a watch and want to use the compositor to change the lume color.
But, in the compositor, I can't access anything under the glass so I can't change to color on the hands.
The only way I can do it is using a transparent shader instead of a glass shader (but in that case, I loosing the refraction and i really want to keep it...)
Does anyone have a hint to do it ?

Related : https://blender.stackexchange.com/a/104367/29586

Thanks, I just looked at it and add a emission shader to the torus in the example.
Unfortunalty, it seems the "emit" channel behind the glass doesn't show up even in the "visible layer". So I can't use a mask to play with it :(

You don't actually use the 'emit' channel in that solution. Instead, it's a whole new render layer just rendering that emission and how it's contributing to the final image. You can then combine that 'mask' layer with the original render and use that to manipulate the result without having to re-render. Hope this makes sense.

Yes, it makes perfect sense.
I would have love to only change the emission color and keep the base color. But this solution is way better thant nothing !


text:
how do i create spiral vortex with texture or by modeling
hi i need help to creating spiral vortex something like this it would be great if you help me

What you could do is create a vertical edge, move it away from its origin, give it a third vertex next to the bottom. Give it a Screw modifier. Apply it. Give it a white material. Select the face loop that was created between bottom and second vertex and give it a second material (black). Give your object a Subdivision Surface modifier.

If you have a more complex texture pattern (example: Image Texture), you could just keep one segment, unwrap it, give it the texture, then duplicate on the Z axis.


text:
How to select faces along curve/path/edge?
Is there a way to select mesh polygons along a curve/path/edge?
A mesh is an exported profile of an area of the earth's surface (approximately 1 km by 1 km in size). There is a road running through this section in real life. A path/curve/edge is a road, which is easy to make directly in blender, since the mesh of an area of the earth's surface is exported with the texture of its topographic plan.
I would like to leave only those polygons in the plot mesh that go along the path/curve/edge in order to export it to DXF to continue working on it in another program.
Since there will be more than a dozen such meshes-areas, that’s why I would like to automate this process.
I would be grateful for any possible solutions/ideas, including those not related to Blender.

There's probably some facier way to do this with python or geometry nodes but, if you turn the curve into a mesh and merge it with the plane, you can use proportional editing set to Constant to move it up by X amount and everything at the set distance would go up. Selecting that displaced geometry afterwards with box select should be easy. Then just delete the rest and the curve and move it down again

A very interesting and quite suitable solution. I immediately thought about Python, just until I figure out what algorithm should be applied here. It is quite possible that Blender's internal API already has the required algorithm. In the meantime, I'll use your wonderful solution. Thank you very much.


text:
How to move a selection such that a chosen base vertex aligns with an end vertex?
I know that the SnapUtilities Move add-on had this functionality in previous versions of Blender, but it is not compatible with Blender 2.82. I need an add-on or workflow in Blender 2.82 that allows me to do this.

What exactly are you trying to do? Pictures and descriptions are very welcome. I do not know what a "base" vertex is, nor how it is different from an "end" vertex.

To be more precise, suppose I have selected a group of vertices. I wish to choose one of the selected vertices (the "base" or "reference" vertex) and translate it to another vertex in my model (the "end" vertex), while simultaneously translating all of the vertices in the selected group in the same direction.

Okay. You can do this by turning on the Vertex Snapping option in the standard way, and in the options section for it at the top of the screen, click the button called Active. This will make only the active vertex respect the snap settings. Just make sure that the vertex which you want to have this behavior was the final one in your group of vertices to be selected. Otherwise, it won't be the active one.

Thank you, works perfectly!