text:
How to display a fixed list of RGB values in a panel and when a color is clicked call an operator
For clarity, the previous question I asked was closed so I made this one, its now reopened and both are asking basically the same question.
I have a fixed list of RGB values which I want to display to the user inside a panel, when they click on a color I need to run an operator.
In a previous question I asked (which was poorly formulated by me) I got a reply from @pyCod3R which showed a palette item which visually looks like what I want but has a few limitations.

Image showing the template_node_socket and palette created by the code below

The list is a fixed length, in the palette there are +, - signs allowing the user to add/remove indices to the list which would need to be disabled for it to be a viable option in this case
When a color is clicked by the user I need to run an operator, which doesn't seem to be possible with a palette
Ideally the coloured squares would be larger than the small circles created by template_node_socket, the  palette squares are perfect in size

This code is adapted from the answer @pyCod3R gave in the previous question:
import bpy
import random

class ColorDemoPanel(bpy.types.Panel):
    """Creates a Panel in the 3d viewport"""
    bl_label = "Color List Display"
    bl_idname = "MATERIAL_PT_colorlist"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'

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

        #the template_node_socket way to display a color is very limited
        #the color is a small circle and cant be clicked so I have to add a separate button
        for i in range(5):
            row = layout.row(align = True)
            r = random.random()
            g = random.random()
            b = random.random()
            row.template_node_socket(color=(r, g, b, 1.0))
            #just a demo operator, not what I'd actually use
            row.operator("object.transform_apply", text = "Color")

        #the palette way is a lot cleaner visually but I need the list to be of fixed length
        #buttons allowing the user to add or remove indices from the list isnt possible to remove afaik
        #there doesnt seem to be a way to call a function when a color is clicked either, which I need
        ts = context.tool_settings
        palette = ts.image_paint.palette
        sel_r, sel_g, sel_b = palette.colors.active.color

        if ts.image_paint.palette:
            layout.template_palette(ts.image_paint, "palette", color=True)

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

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

if __name__ == "__main__":
    register()

    # Add a new pallete
    pal = bpy.data.palettes.get("CustomPalette")
    if pal is None:
        pal = bpy.data.palettes.new("CustomPalette")

        # Add a single color
        red = pal.colors.new()
        red.color = (1, 0, 0)

        # Add random colors to the palette
        from random import random
        for i in range(10):
            col = pal.colors.new()
            col.color = (random(), random(), random())

        # Make red the active/selected color
        pal.colors.active = red

    ts = bpy.context.tool_settings
    ts.image_paint.palette = pal

Is there some way to adapt a palette or template_node_socket to my needs or is there some other way to display clickable RGB squares that I've missed?

Does this answer your question? Display preset RGB values in a panel (and call function when clicked)

Ironically your answer does not solve the problem either. @MartyFouts

As has been mentioned elsewhere, template_palette is implemented in C as uiTemplatePalette and that function does not take any arguments, so it is not possible without writing new C code to use template_palette with editing disabled.
A second approach suggested in an answer to your previous question relies on custom icons. That approach could be made to work but it requires the extra overhead to externally create the icons, include them with an add-on, and so forth.
Here is the outline of a third approach which is similar to the custom icon approach but relies instead on images having previews that can be used as icons:

Create a dictionary of the color values you want to use.  Using a dictionary rather than just an array of RGBA values, allows you to name the colors and makes the code slightly more readable.

Walk the dictionary and create an image for each entry.  The image is just a block of pixels of the color identified in the dictionary.  The image's preview ID is then used as the icon of a button.  Remember the list of created images

This has the advantage that, as described in this answer, it is possible to generate images on the fly.  While this approach to generating images is slower than using image processing software, Blender icons are only 32 x 32 pixels in size.
Having done that it is possible to create an array of buttons, one per palette entry, representing each of the colors in the dictionary.  By giving the button a string property and associating each button with the name of a color and using the image id of that color as the button's icon, two things are accomplished:

The buttons each display a unique color.
In the execute function of the button it is possible to determine the color associated with the button.

This code is just a demonstration of the concept.  It doesn't delete the images when the classes are unregistered, and it's not packaged as a function that can be called from a class draw function.  It also doesn't lay the buttons out in a grid, although that would be a trivial change to make to the calling code.
To use the code, simply replace the three dictionary entries in the palette dictionary with one entry for each color, in the form of "color name": (red, green, blue, alpha) entries and run it.  As written, it displays this panel:

and if you push one of the buttons it prints the color name and RGB value.  Obviously you would replace the print with the code you want to execute.
import bpy

# This function is derived from code taken
# from https://blender.stackexchange.com/a/652/42221
def new_icon(name, red, green, blue, alpha):
    icon_size = 32
    icon_image = bpy.data.images.new(name, width = icon_size, height = icon_size)
    pixels = [ None ] * icon_size * icon_size
    for x in range(icon_size):
        for y in range(icon_size):
            pixels[(y * icon_size) + x] = [red, green, blue, alpha]
    # Flatten List
    pixels = [chan for px in pixels for chan in px]
    icon_image.pixels = pixels
    return icon_image

palette = {
    "Red": (1.0, 0.0, 0.0, 1.0),
    "Green": (0.0, 1.0, 0.0, 1.0),
    "Blue": (0.0, 0.0, 1.0, 1.0),
}

def make_icons(palette):
    icon_list = []
    for entry in palette:
        rgba = palette[entry]
        new_image = new_icon(entry, rgba[0], rgba[1], rgba[2], rgba[3])
        icon_list.append(new_image)
    return icon_list

icons = make_icons(palette)

class TLA_OT_Icon(bpy.types.Operator):
    """A button per color"""
    bl_idname = "tla.icon"
    bl_label = "Color"
    bl_description = "Pick color"
    bl_options = {'REGISTER', 'UNDO'}
    color: bpy.props.StringProperty(name="color")
    def execute(self, context):
        rgba= palette[self.color]
        self.report({'INFO'}, f"{self.color} {rgba} chosen")
        return {'FINISHED'}

# From https://blender.stackexchange.com/a/48508/42221
class TLA_PT_Icons(bpy.types.Panel):
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'UI'
    bl_category = "Palette"
    bl_label = "Palette"
    def draw(self, context):
        layout = self.layout
        for image in icons:
            layout.operator("tla.icon", text="", icon_value=image.preview.icon_id).color=image.name
        if not icons:
            layout.label(text="No Colors in Palette")

classes = [
    TLA_OT_Icon,
    TLA_PT_Icons,
]

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

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

if __name__ == "__main__":
    register()

sample info window output:
bpy.ops.tla.icon(color="Red")
Red (1.0, 0.0, 0.0, 1.0) chosen
bpy.ops.tla.icon(color="Blue")
Blue (0.0, 0.0, 1.0, 1.0) chosen
bpy.ops.tla.icon(color="Green")
Green (0.0, 1.0, 0.0, 1.0) chosen

Here is an example of how a small change of code and make the layout look more like a palette.  Change the layout from one button per row to a row of buttons:
        row = layout.row()
        for image in icons:
            row.operator("tla.icon", text="", icon_value=image.preview.icon_id).color=image.name

results in:

Changing that code a bit further, you can keep track of how many entries are in a row and generate a new row every N entries.

This answer is great, thanks for taking the time!
The third approach is the best for my purposes, only unfortunate part is that the images end up in the image browser but that seems unavoidable.

@CybranM Thank you.  I looked into hiding the images but couldn't find a way.  If I do, I'll update the answer.

The UI doesn't load the images until I open the image browser, is there a command to "refresh" the image browser or similar to force it to load them? Using Blender 3.0

I'm not sure I understand what you mean by 'load' here.  What are the symptoms you are seeing?

You can put a dot "." at the front of datablock names to hide them.

If you want somewhat similar without all the extra elements coming with template_palette() and execute something when clicking on each color, you can implement some sort of dynamic operator for all colors, and only display a custom icon that represents the operator on the panel (as I mentioned in my previous answer).
The icons for the colors can be generated on the fly by adding a new preview collection as you normally would do for custom icons anyway and by assigning a pixel array to each new icon added: https://docs.blender.org/api/current/bpy.types.ImagePreview.html

Example of displaying 3 unique colors based on Ui Previews Custom Icons template.
import bpy

colors = {
    "Red": (1.0, 0.0, 0.0, 1.0),
    "Green": (0.0, 1.0, 0.0, 1.0),
    "Blue": (0.0, 0.0, 1.0, 1.0),
}

class SimpleOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.simple_operator"
    bl_label = "Simple Object Operator"

    color: bpy.props.FloatVectorProperty(
             name = "Color Picker",
             subtype = "COLOR",
             size = 4)

    def execute(self, context):
        context.scene.active_color = self.color
        print(self.color[0], self.color[1], self.color[2], self.color[3])
        return {'FINISHED'}

class PreviewsExamplePanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Previews Example Panel"
    bl_idname = "OBJECT_PT_previews"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    def draw(self, context):
        layout = self.layout
        pcoll = preview_collections["main"]

        row = layout.row(align=True)
        for icon_name, color in colors.items():
            p = row.operator(
                SimpleOperator.bl_idname,
                icon_value=pcoll[icon_name].icon_id,
                text="", emboss=True)
            p.color = color

        r, g, b, a = context.scene.active_color
        layout.row().label(text=f"Active Color: {r:.2f}, {g:.2f}, {b:.2f}, {a:.2f}")

# We can store multiple preview collections here,
# however in this example we only store "main"
preview_collections = {}

def register():

    # Note that preview collections returned by bpy.utils.previews
    # are regular py objects - you can use them to store custom data.
    import bpy.utils.previews
    pcoll = bpy.utils.previews.new()

    for name, color in colors.items():
        size = 32, 32
        pixels = [*color] * size[0] * size[1]

        icon = pcoll.new(name)
        icon.icon_size = size
        icon.is_icon_custom = True
        icon.icon_pixels_float = pixels

    preview_collections["main"] = pcoll

    bpy.utils.register_class(SimpleOperator)
    bpy.utils.register_class(PreviewsExamplePanel)
    bpy.types.Scene.active_color = bpy.props.FloatVectorProperty(
         name = "Color Picker",
         subtype = "COLOR",
         default = (1.0,1.0,1.0,1.0),
         size = 4)

def unregister():
    for pcoll in preview_collections.values():
        bpy.utils.previews.remove(pcoll)
    preview_collections.clear()

    bpy.utils.unregister_class(SimpleOperator)
    bpy.utils.unregister_class(PreviewsExamplePanel)
    del bpy.Scene.active_color

if __name__ == "__main__":
    register()

... for clarity: the assumptions of the other answer regarding my previous answer are wrong.

A second approach suggested in an answer to your previous question relies on custom icons. That approach could be made to work but it requires the extra overhead to externally create the icons, include them with an add-on, and so forth.

We do not have to create the icons externally (as proven by this code). However, you can do this and it's a valid option too, see: How to implement custom icons for my script/addon? or the template this code is based of.
Since we use the regular approach for custom icons, the icons generated are not added as images to the blend file and do not become visible in the image editor as the code of the other answer does.

This was very useful, thank you so much


text:
Sculpt Mask Not Working`
I'm using Blender 2.93.3. Trying to create a mask while using the sculpting tools. No method of applying a mask produces a visible result, and masking is not taking place. I've tried all suggestions found here and elsewhere - view overlays have mask turned on, for example, and suggestions for using ctrl/alt/shift keys do nothing. Other sculpt tools like draw, inflate, and so on work fine. Dyntopo mode is on; masking still does not work after dyntopo has created new mesh. This is on a plain vanilla starter file with the cube; cannot place mask on cube, but I can perform other sculpting actions.

maybe your Strength is at 0?

0.5; also tried at 1, no joy.

maybe share a file? https://pasteall.org/blend/

source: Stack Exchange

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

sort: votes


text:
Shape keys and material
I'm following a tutorial on YouTube, but I got stuck in Shape Keys. I made 2 keys: open and closed to make eyes blink. I clicked closed and change the value up to max. Then I added material to change the color to green. I switched back to object mode and decrease the value to 0, but the eyes didn't change from green to white.  How do I get them to change?
This tutorial I'm learning right now is Blender 2.83 Easy Character Rigging

I may miss something but you can't change the material with shape keys, what you can probably do though is create a driver on the shape key in order to command a mix shader factor in your material

To visualize Moonboots' comment:

Either drive some value inside your shader (here factor of MixRGB) with the shape key's value, or use a custom property that drives both. Here I used the easy way of adding a driver by right-clicking source: "Copy as New Driver" and right-clicking destination: "Paste Driver".

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


text:
Subdivision surface modifier pulls mesh apart?
A mesh consists of two disconnected parts, which look connected to the eye. It is not ideal, but the geometry is generated through geometry nodes, which doesn't seem to offer an option to gracefully merge the parts? The problem here is that a subsurf modifier rounds the parts independently, which disconnects them to the eye. I guess this is the nature of the subsurf modifier. Is there any workaround, which keeps the parts together?

would you mind providing blend file?

Provided the .blend file.

Well, the two pipes are not connected, smoothing them works separately on both of them.

@GordonBrinkmann this is the answer.

No. This is mentioned in the question, what I'm asking for is a workaround.

@eezacque You don't get what we want to say. Subdivision Surface will only treat it as one piece when it is one piece. So you have to edit the mesh to make it one piece. Is there a reason why this basic mesh has to be done in Geometry Nodes? Anyway, it is no longer a GN mesh (there's no GN modifier on the object), so you can edit it manually.

I think we're on the same page, I just wonder whether there is a workaround. This basic mesh is just a MWE, reduced to its bare essence, as I don't want to waste your time with a tree generated through several tens of geometry nodes. This tree is constructed as trunk and several layers of branches, joined through a Join Geometry node, which creates a loose join, meaning that the result cannot be effectively subsurfed, as it seems...


text:
How to find pixels which are getting occluded in the next frame?
I have 3D model of a scene with several objects that are transformed from one keyframe to another one (translation, rotation, scaling). This scene will be rendered as animation with write_still=True so the final results are images per each frame. I am interested in finding pixels that are visible in one frame but are occluded in the next frame. A simple example could be something like this:
First frame ----------- > Second frame

In this example, the colorful plane is fully visible in the first frame but is getting behind the gray square in the second frame, so not only the bottom left corner of it is occluded now, but part of the background near the gray square is also occluded by the colorful square. In the next image, the occluded areas are highlighted white. I would like to have a binary mask that shows which pixels from the first frame will be occluded in the next frame. The final goal is to do this by Python interface, but any suggestion to solve this is very appreciated.

Please note that objects are 3D, they might rotate or scale too. Lighting will change and the camera motion is also involved. A more complete example is as follows:
First frame

Second frame

Occlusion map

The difference of two images (image1 - image2) is supported in the Compositor of Blender.  Images can be compared by the standard math operations less >, greater <, equal == et cetera.Then you can threshold  the result by various means including a color ramp (mapping color) .   Perhaps this is a starting point.  You may want to search the Blender API for image functions.

What is the larger context of you work?  Is the work post production, part of a pipeline, ...? Realtime?  If you are doing something very elaborate please state so if possible.

Thank you @atomicbezierslinger for this point, but actually, in a more realistic example, differencing images won't work. The camera will move around, lighting will change, etc. I need to kind of keep track of visible vertices to the camera or something!

Using the speed vectors, I am finding the motion vector for each pixel between frames, now I need to determine which pixels are not visible in the second frame.

Again the compositor may help.  To a large degree you can use Object ID ,a number say, for each object, lets say N1 and N2.  Then the pixel itself can be examined for those IDs, N1 and N2.  The object ID is a feature of Blender.  You may want to add your additional variations to the questions itself.

This question seems a little more of digital image processing question ....  without 3D information used.  Digital image Processing video series and documents could be searched separately outside of BSE. That search is perhaps not an easy task. There was a question above ,as a comment. What is your larger goal?

Will you have access to a 3D Model of the scene? Is your video source originating from a 3D scene?  Is the source image sequence or video only?

Yes, I have access to the 3D model of the scene. I am moving objects around, adding key frames and at the end rendering as images.

Did you manage to solve this problem yet?
I see that the FlyingThings3D dataset has managed to solve the occlusion problem with blender's older render engine. (Flow occlusions)
https://lmb.informatik.uni-freiburg.de/resources/datasets/SceneFlowDatasets.en.html Are you looking to solve the same issue?

Please see the panel ... object relations pass index. This information can be examined in the compositor.  This is generated in the object index render pass for Cycles. You must enable that pass.

There is also Cryptomatte.

Could you please explain more? I am aware of the Object Index Pass, but how can that be useful here? Imagine a sphere rotating in place, the back of it coming to view in the next frame while its front pixels are getting occluded. Object index will be the same for these pixels in both frames, but we know that all those pixels should be considered as occlusion.

You might consider examining the geometric normals of faces in addtion to object id.  You might also add the refinements written immediately above to your original question.  There is a language problem of speaking about faces versus pixels.  There is also an issue of how exact you are trying to be.  I might not be able produce any more suggestions. You might consider rendering with materials designed to be trackable via object id or material id.  I do not know the larger goals or your work, so I cannot make many suggestion with a rationale.  I am guessing.


text:
Subdivision modifier doesn't work on some edges
I just started blender and I have a basic problem often when I use subsurf modifier. Most times it works well but also occasionally some edges wouldn't be smooth. For example, I was doing a tutorial this time making a faucet in the bathroom. I made this model simply extruding a circle. Then I added the modifier. But one round of edge is sharp as before like in the picture. It may be a simple mistake or misunderstanding but as I just started learning, I can not really figure it out :( It also often happens when I add more shapes into models. I appreciate your help so much!

it could be that you duplicated that edge circle, maybe extruding. try removing doubles.

Yeah, there are several double vertices. You can check by Alt-leftclicking the questionable edge, and move the now selected edge loop down.
To repair, select all vertices in edit mode, and click Mesh > Clean up > Remove Doubles.

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


text:
Mesh breaking/deformed after sculpting?
I'm quite new to blender and I've got lots of help from here recently I appreciate a lot! The problem I'm facing now is that the corner part of my couch starts breaking or making a weird extruded shapes along the edge of the object after sculpting. When sculpting, everything looks okay but then whenever I save the file they become like this. I removed doubles and tried to recalculate or flip directions but still don't know what I missed. Or maybe it's something I have to start from the beginning again?

This file above is before I smooth the edges on sculpting mode. If I save the file after smoothing then it always changes to the file below with deformed edges.

This is the file with changed shape

Try maybe pressing Apply Base in the modifier options. While it's hard to tell what's really wrong there as it might depend on how you smoothened, still it shouldn't be changed itself after saving, maybe it's a bug.

It sorted it out perfectly! Thanks a lot. I don't know either what went wrong since I tried to sculpt over and over again but happened whenever I saved. But the solution you gave me works great for me and I'm sure it will help out other people with similar problems.

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


text:
Mesh face not rotating at the same rate as rest of the mesh
When ever I try to move a bone in pose mode, the face of the barrel of the gun doesn't move as fast as the rest of the mesh, resulting in the pictures below.

Any idea on how to fix this?

Another, earlier version of the setup:

This one is better.

maybe if you could show it in solid mode, it would be easier to understand...

@m.ardito Is the picture I added what you mean?

sorry, but I still can't understand which is "the face of the barrel of the gun" that "doesn't move as fast as the rest of the mesh"... if you prefer you can share the file on http://blend-exchange.giantcowfilms.com/ then edit your question adding the provided link text.

@m.ardito Added the file.

Thanks for the file, I feel now I can understand what you meant.
in weight paint mode you can see that (at least) some bone have incomplete weights to that arm: some part are blue while they should have been red.

this is causing a part of the arm not moving with that bone:

You just need to correct weights (all red) to make it move better with the bone:

That's actually the wrong bone, I'm afraid. It's the one above it.

Also, uploaded a better version of the file, an earlier one.

this is why you should better explain what you mean, sorry but even with the new file I can't understand. I can't try everything until you spot that I did the right thing... Maybe hide everything except what is needed, and add exact replication steps


text:
Script works well in python console but crashes when "Run Script" in text editor?
I have a python script. It works well when I run the code in python console but if I open the script file in text editor and click "Run Script", blender crashed.
Does anyone know what might causes the difference?
Here is the script:
import bpy
from bpy import data as D
from bpy import context as C
from mathutils import *
from math import *
import blensor
bpy.context.scene.objects.active=bpy.data.objects['Camera']
blensor.tof.scan_advanced( max_distance = 20.0)

Yan, pasting the script in your question might give some clues.

It could be a number of things, the easiest way to find out is to toggle system console found in the window menu if you are on Windows. This will open a second window which will be a text console. Any errors when running the script will be reported here so you can find the cause. If you can't solve the issue you will have to post the actual script here before anyone can help.

I am using the python script to execute blensor add on.
Here is the script:
import bpy
from bpy import data as D
from bpy import context as C
from mathutils import *
from math import *
import blensor
bpy.context.scene.objects.active=bpy.data.objects['Camera']
blensor.tof.scan_advanced( max_distance = 20.0)

Thank you! I have toggled the system console. When blender crashed, system console also disappeared. When I run the script in commond line by " blender myscene.blend --background --python myscript.py". The crash message it gives indicates some parameter is not set. For this parameter, it has a default value. And everything works well in python console. So it confuses me.

Here are the information when I run the script using blender in cmd.exe: |
Preparing Scene data
|Creating Shadowbuffers
| Raytree.. preparing
Raytree.. building
Raytree finished
Creating Environment maps
Fra:1 Mem:5.33M (0.00M, Peak 5.35M) | Caching Point Densities
Fra:1 Mem:5.33M (0.00M, Peak 5.35M) | Loading voxel datasets
Fra:1 Mem:5.33M (0.00M, Peak 5.35M) | SSS preprocessing
Fra:1 Mem:5.33M (0.00M, Peak 5.35M) | Volume preprocessing
Fra:1 Mem:5.33M (0.00M, Peak 5.35M) Sce: Scene Ve:42 Fa:40 La:1
The refractive index of the world is: 1.000000
Writing: C:\blender.crash.txt

@Yan, edit the original question to post the script.  It needs to be indented for it to be formatted as script.  This can be done in blender script window by selecting all and hitting the tab key before copying and pasting here.  Shift tab un-indents.

@leon-stafford not sure what that script is - those import lines contain some horrible frightening shivering things! Beyond that, since we do not know what does the blensor code, it's very hard to answer…

@mont29, thanks, I've not touched Python for a while and trimmed comments in the wrong places! Blensor project


text:
If I made a good armature, can I use it for another mesh as well?
I made an armature for a man, can I use that same armature for a female, clearing the weights and add another mesh in the place or do I need to make a new one?

The weights are stored on the mesh, and not the armature, so you don't even need to clear the weights.

Well aside from the anatomical differences, yes you can reuse a rig.

You can absolutely reuse armatures among meshes, and doing so allows you to bring over NLA actions and other animations associated with the armature. It's not trivial to do this, since both meshes must be weight painted to the needs of the armature and bones... but since you will probably accumulate a lot of animations over time, it is a good investment for important characters, or those that have a lot of actions.
I use common armatures for sea turtles, fish, mosasaurs, dinosaurs of a common body plan, etc, and the whole mixamo concept is based on the idea that yo will accumulate and use common armatures.

Additional information: how to copy a rig to another mesh
Mixamo: https://www.mixamo.com/#/ -- Thgis is not Blender specific, but a handy way to see how others have animated particular sequences and their files will work with Blender. You would be downloading an FBX, and importing into Blender via File | Import FBX.

There is only one obstacle when reusing an armature - model proportions. It is very likely that the mesh you want the armature to be reused with has different joint placements and bone lengths (like trying to fit male armature to female mesh).
Let's say the meshes are very very similar. In this case the best thing to do is to skin an envelope, so the character mesh is completely inside the envelope mesh. The envelope is weight painted to the armature and the character uses Mesh Deform modifier to be driven by the envelope. When you switch the characters inside the envelope, you just bind it to the envelope and you don't weight paint the character. This saves work, but also might degrade the deformations compared to character driven directly with armature - it all depends how good the envelope mesh is.
Now let's say the meshes are different. If the armature is simple with not so complicated constraints on bones, you might be fine with just adjusting the armature to the right proportions in armature edit mode. Some constraints that take into account bone length, bone positions and rotations might break and you will have to fix them (setup again or reset them).
The ultimate way to approach this is to have scripts that build the complicated armature with all the drivers and constraints from a simple metarig. You adjust the metarig to fit the character, then just generate the rest. For example Rigify works like this.


text:
Losing detail when retopologizing
After the retopo is done a lot of detial is lost and if I use subsurf or multires and increase it it over 2 times it has double the amount of faces than the high res mesh and still not all the detail is back...any idea?

Related post - https://blender.stackexchange.com/questions/38307/retopo-can-we-apply-shrink-wrap-to-multires-subdivisions  Related video - https://www.blendernation.com/2017/04/06/saving-lost-sculpted-details/

Use the shrinkwrap-modifier in combination with a subsurf- or multires-modifier.
Make sure that the shrinkwrap is stacked lower than the subsurf- or multires-modifier to gain detail.
When using the multires-modifier, you can apply the shrinkwrap-modifier and the gained detail will be 'absorbed' by the multires. You can then enter sculpt mode to add and or smooth the desired detail while keeping your relatively low poly retopologized mesh.


text:
Rigging effect on wrong object
I have this problem with one of my models that I am trying to fix. I tried a lot of options before coming to you all
I design a low poly 3d boots, and I want to parent them to an existing armature - using automatic weights. I am facing a side effect that occur when I try to move one of the boots (using my armature). Instead of deformed only the effected boot it also deformed the other boot.
Things I did:

Apply mirror
Separate the boots "by loose parts"
Ensure no subdivision nor duplicate vertices
Assign each of them to an existing armature
Assure that the weight painting is not effecting on the other boot
Remove duplicate
Clear parents
Clear vertex groups
Reassign each boots to the armature

Nothing helps. I have used this same method with other objects - like glove. Came out perfectly fine.
Hope to hear some new ideas
Thank you

Can you add your blend file to your question? (How to add a blend file)

maybe my answer here will help: https://blender.stackexchange.com/questions/237997/tongue-and-teeth-dont-follow-the-movement-when-i-change-the-pose-any-suggestin/238000#238000


text:
I can't bake the texture: "Baking map saved to internal image, save it externally or pack it"
Hello I just started to testing "baking". I created "BaseColor" texture and I joined everything on one model, pressed Ctrl–A Apply > Scale & Rotation and Smart UV.
After the editing I added UV and Env texture to every material and baked it but my Base Color texture is black.

Smart UV

UV and Env Texture.

Info after bake

base color texture in the end.

Blender File: https://we.tl/t-QVn7waFCie

https://blender.stackexchange.com/a/218408/2214 or here for multi-object bake https://blender.stackexchange.com/questions/91526/baking-multiple-materials-into-one-texture ... BTW it doesn't make a sense to use Environmental texture node :)

thank you so much @vklidu i closed the blender and opened and my problem has been solved and can you tell me what diff. that have env and Image tex?


text:
How to turn on antialiasing in rendering, using the Cycles render engine?
I have an option of anti aliasing for the 3D Viewport, but not for Cycles render output. I want antialiasing in my render too. The rendered image edge is aliased even when i am using high resolution.
This is my rendered image max zoom to see aliased edges. I use cycles to render.
I use anti aliasing node and denoising node.

This is link of my blend file:

This is third time I see you asking the same question and I still don't understand what you want to know, what is jagged or pixelated? Render will be pixelated because it is rasterized and not vector based like in viewport... if you want more sharp edges you need more pxpx image... what even is your render size? 19201080?

What I see here is some jpg artifacts.

That is expectable if it is jpg with compression, just saving it as png would solve that, but I am not sure if that is what he wants

i have tried saving in png and jpg both i mean aliased edges is my problem

you can view my file i have uploaded zoom to edges you will know my problem .I have the default resolution set in my file i even tried increasing resolution

Please do not repeatedly ask the same question across multiple posts. If you do not receive a satisfactory answer to your question, then please make an edit to your first question. See also here and the [tour] for more information on how to get more use from the site.

@KushagraKumarSingh The only way to smooth that is using the pixel Filter, this is inside the render setting >Film > Pixel Filter. in here you could switch from Black Man Harris to Gaussian and then play with the Width. Hope that helps

thx a lot it Helped a lot

I think I know what you're talking about.
When CPU rendering the Render Result window displays some weird aliasing.

This is only present in the viewport, an exported image doesn't have this.

no it is also after exporting but it only comes when i zoom in an exported image.Can you pls more zoom the edges and see the pixalated edges of render the pixalated edges is also an another problem.This does not happen while creating or editing the object.

what you are saying is also a problem

help pls with my problem

@KushagraKumarSingh, I think many of us are struggling to understand what your problem is. That is why we have asked you to upload a rendered image that is "bad." We are not ignoring your question to be mean nor to be disrespectful, but we cannot understand the problem you are having. The cube image you have attached to this question looks fine to me, except for some JPEG artifacts?

i just want to Know how to turn on anti aliasing for my render

cause i am getting wired alised edges even when i am making the resolution too high

just help me turning on anti aliasing

see i am getting this type of edges https://i.sstatic.net/TN68B.png

i think anti aliasing will fix this

@Ron Jensen help

Save the image and then view it.  Does it look the same?  That's what I tried to say in my answer.

@ Allen Simpson exported image also has this but less if you zoom more you will be able to see . download my blend file and see.

@Allen Simpson help me turning on anti aliasing


text:
Is it possible to change the parent of a bone mid animation?
I have a first person rig with a gun, but I need it to reload, my question is, can I have the magazine be attached to the gun, then when I need it to, attach to the left hand to be re-attached to the gun later?

Marty's answer is certainly a good way to go.  For another approach, perhaps this might help -
https://blender.stackexchange.com/questions/198580/animation-issue-in-sniper-gun-reload/198961#198961

Yes.  Instead of actually parenting the bone, you use two Child of Constraints and use their Influence values to choose which one is being used.
Here's an example with just three bones to show how it works:

Enter Pose mode, select the child bone, (in your case, the magazine) and add the two constraints.
Here's the constraint setup for the example:

In your case, one parent would be the left hand, and the other would be the gun.  It doesn't matter which order you pick them in.
The technique you use to swap parents is to set keyframes on the influence property of the two constraints.  When the influence is 1, the child is constrained to be parented by that bone.  So you want The first constraint to be 1 and the second constraint to be 0 if you want the child to follow Parent A, and the first 0 while the second is 1, if you want the child to follow Parent A.
You can set keyframes on the influence.  But rather than having to keyframe both constraints, you can use a driver:

hover over the Influence input of the first constraint, and click Right mouse
Select Copy as new driver from the popup

hover over the Influence input of the second constraint, and click Right mouse.
Select Paste Driver from the popup

hover over the Influence input of the second constraint, and click Right mouse.
select Edit Driver.  This will bring up a popup like this:

Change the type to Scripted Expression
Set the expression to 1.0 - influence

click Update dependencies

Now you can simply set the influence of the first constraint to 0 or 1 and the driver will set the second to 1 or 0.

Wow! Very descriptive, I'll give this a shot, not 100% sure if it will work in what I am doing since I'm modifying an exisiting animation in a game. I'll hopefully get back to you if this works soon.

Logged in just to say, EXTREMELY helpful Marty. When I get enough rep I gotta come back to upvote you. A criminally underrated post.


text:
Why does adding a second action sometimes result in two actions influencing each other?
I have been working with Blender for about a year almost exclusively to animate 3d models for games. I absolutely love it, save for the entire flow of action strip + NLA. The moment I think I understand fully what is going on and how to operate it, something tweaks out and wrecks my progress.
To put this in a more cogent question form: does anybody have any idea why, when, sometimes I load an action, and then go and load a different action, the two actions' influences will sometimes affect the each other and change the action output, as if it is adding a little something? And then it will transpire that sometimes an action can become sort of permanently distorted when I go back and try to load it after having first loaded other actions into the field?
I'll give an example. I have a character with several animations of him doing things. On a couple of those, he is doing things in the opposite direction than most of the other animations. So if I, for example, load the base action which is a T-pose sort of thing to set a clean slate (???  this seems to work like that sometimes), and then load an animation walking in the normal direction, fine. It works. Then I load another action which has the character looking opposite the typical direction. Fine, that works (actually it doesn't in all cases but let me continue). Finally, loading the exact same second animation walking in a normal direction has him WALKING THE COMPLETE WRONG DIRECTION after I loaded the third action. Mind you, the keyframe button is off and I am not keying anything. (This is all on top of a Rigify rig generated from Blender.)
Finally, in this particular case if I reopen Blender and reload the scene, the now-faulty animation is reverted back to its ok form.
What the hell is going on here? The animations in question are stashed animations, so I understand that the changes are being stored if they are made, but where am I even making changes? It just seems like the action field has a mind of its own, slipping in influences from here and there no matter how painstakingly careful I try to be to keep animations separate. I even have an animation which is permanently damaged from this influence slip and I don't know how to fix it besides just re-animating it. I've tried going in a keyframing IK/FK influences for each of the animations in question and that doesn't do anything to fix it.
And before someone asks, when I run into problems I am making sure that no NLA strips are keyed up on top of the current action which would throw it off. They are just pure stashed actions with nothing running on top of them. It has taken me a very long time to digest the roles of the action editor (or current action) vs. the NLA vs. stashed actions, and this problem of ... just animation influence popping out of the Blender ether and bombing my animations is still something I cannot grasp. Is there another aspect to the file structure that I am missing?
Somebody please help, my liver cannot take more punishment.

When you switch actions, anything not animated by the new action gets left with whatever value it had before the switch (eg. if the last action animated it, it will be whatever value the last action had on the current frame). So when you switch between actions that animate different things, you can get a buildup of pieces of different actions. Maybe that's what you're seeing? If you're animating pose bones you can clear all pose bone transforms to remove the influence from previous actions.

That actually explains a lot. Seems to do the trick, too. Jeez, thanks.


text:
I cannot get my glass window to render with tree background no matter what tutorial I try
My glass windows continued to render as a black solid instead of transparent as I can view it in material view and rendered view prior to rendering the whole scene.  I have tried numerous tutorials for glass.  I cannot render in Cycles as my pc cannot handle the render and almost closes/ freezes the program for an extended period of time.  I am in Eevee.

wanted to post more images but couldn't figure out how.

To add images, edit your answer, and select the position where you want the next image to go.  Type CTRL-G to bring up the menu for adding the image.  In EEVEE you need to change the glass material's blend mode to alpha blend or alpha hash.

@MartyFouts thank you for assistance with adding images.  I have alpha blend in my glass material.  These are some of the settings I have updated through tutorials, this is how they are set now.

can you share your blend file in your question? (How to add a blend file)

@MartyFouts Yes I added the blend file

@MartyFouts Oh my gosh thank you so much! Is there a simple way to make the background image more clear/ make a different part of it visible through the window? in particular the tree

This answer has a diagram of a world shader that you can adjust the location of.  Use the Mapping node's Z Rotation to rotate the position of the world image.  Don't change anything else in the mapping node or it will distort the world image.  You can make it brighter by changing the strength value in the background node.

The problem appears to be your world shader.  If you go to the Shader workspace and change the Shader type from Object to World  You will see that you have a world shader that looks like this:

The World shader should be a Background  shader:

When I make that change, your image renders with the background visible through the window.


text:
I am trying to do a Boolean cut here; but there are some weird shading issue going on. How to fix that?
Here, I am trying to make a Boolean cut, but their are some shading issues going on.

The boolean virtually changes your topology, but could you please share your file? https://pasteall.org/blend/

Hi, @moonboots I have uploaded the file on pasteall.org/blend. I am also providing the drive link here to download the blend file. https://drive.google.com/file/d/1PBOSC_kYNGgCqLlrVSWPkzvbg_O7I5Ag/view?usp=sharing

Please let me know the solution

I could fix it if I applied the boolean but I'm not familiar enough with complicated non-destructive objects, I hope someone will help


text:
how can I retrieve the shorcut-key for the hardOps mirror function (alt + X)?
for those that are using Hardops: the shortcut Alt–X is not working for me for the mirror function. Is there a way to reassign it to use it again?
There is no short key that is interfering with Alt–X; so I don't know why it's not working!

Edit Preferences; Go to Add-Ons and find HardOps.  Open up its preferences section to Operators.  The Mirror Gizmo preference is there.  Edit it to whatever you want it to be.

much appreciation <3

You're welcome.  Add-ons are uneven about whether they have shortcuts you can change, but HardOps is one of the better ones.


text:
Creating phyllotactic flower in blender 3.0
I am trying to create a phyllotactic flower (one whose leaves form a particular kind of pattern, usually spiral,) in blender as a part of my journey to learn geometry nodes. I was following a tutorial but I am not sure what exactly am I doing wrong.
This is my raw blend file.
Can anyone please explain to me where exactly am I going wrong?

For us non-botanists: What is a phyllotactic flower?

Could you explain here what is wrong? Or are we supposed to discover it by ourselves?

Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking.

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

If you are following a tutorial and something goes wrong, generally it means that you failed to follow it correctly. In general this is really fine and to be expected. This happens to everybody all the time. Struggling is normal when learning. The simplest solution to this kind of a problem is always to start over and attempt to follow it from the beginning as many times as it is required for you to get it right. This way you learn what it is attempting to teach and also to troubleshoot problems so this is not in any way wasting time as it may seem.

I have been trying to follow it exactly how the guy tells it in the video and I know there is something silly that is the root of this problem. And thus I thought perhaps I need a fresh perspective which in turn got me here.

I too had the same issue. I had to rewatch the tut and redo this over and over to find the fix which was really simple

For modelling the leaf, the author uses a circle and ROTATES it in the X-axis at 90º.
Then aligns the leaf to point upwards, which is another rotation. So, in the object properties,the Rotation X should be 180º.
But it seems like, after modelling the leaf, he has applied the rotation (Ctrl + A) and then rotated it again. So, if you check in the video, the object properties panel will show the rotation to be only 90º. On doing this, the issue got solved


text:
UI Slider as Offset for Array Modifier
I want to create an Addon for a shelf planning tool.
The slider should change the offset of the Array Modifier.
I already have the slider in my panel, but when I tell the offset to be the slider I always get the message: offset is too short? Even when the slider is 2 for example.
How can I change the code to make it work?
import bpy
from bpy.types import Panel, Operator

class RGL_PT_Panel(Panel):
     bl_space_type = "VIEW_3D"
     bl_region_type = "UI"
     bl_label = "Regalplannung"
     bl_category = "Regalplannung"

     def draw(self, context):

         layout = self.layout

         row = layout.row()
         col = row.column()
         col.operator("object.regalplannung", text = "Aufüllen")

         col.prop(context.object, 'Offset_X', text = "Abstand X",
         slider=True)
         col.prop(context.object, 'Offset_Y', text = "Abstand Y",
         slider=True)

class RGL_OT_regalplannung(Operator):
     """Vollständig gefüllt & Ausrichten"""
     bl_idname = "object.regalplannung"
     bl_label = "Regalplannung"
     bl_description = "Regalplannung in Blender"

     bpy.types.Object.Offset_X = bpy.props.FloatProperty(min = -5, max = 5)
     bpy.types.Object.Offset_Y = bpy.props.FloatProperty(min = -5, max = 5)

     def execute(self, context):

        selection = bpy.context.selected_objects

        for sel in selection:

            parent = sel.parent
            parent_0 = parent.dimensions [0]
            parent_1 = parent.dimensions [1]
            parent_2 = parent.dimensions [2]

            mod_array = sel.modifiers.new("Vollständig gefüllt", 'ARRAY')

            mod_array.fit_type = 'FIT_LENGTH'
            mod_array.relative_offset_displace[0] = 0

            if parent_0 < parent_1:
                mod_array.fit_length = parent.dimensions[0] - sel.dimensions[0]
                mod_array.relative_offset_displace[0] = bpy.types.Object.Offset_X

            else:

                mod_array.fit_length = parent.dimensions[1] - sel.dimensions[1]
                mod_array.relative_offset_displace[1] = bpy.types.Object.Offset_Y

        return {'FINISHED'}

bpy.utils.register_class(RGL_PT_Panel)
bpy.utils.register_class(RGL_OT_regalplannung)
```

it would be helpful, if you script is runnable...so please indent it right and  it should be runnable and reproduce your error. Thanks.

@Chris sry I forgot to indent it, but now it should be runnable

Runnable... are you sure? The mentioned error occurs with line mod_array.relative_offset_displace[0] = 0 where you set all values for Relative Offset to 0. Your script breaks off here.

Your problem is that you are trying to access bpy.types.Object.Offset_X as an object, but that's the type.  instead, you need to access sel.Offset_X.  You have the same problem with Offset_Y.
The modified code is at lines 51 and 56 in my version.
Here is a version of your script that works, provided I have the selected object parented to another object:
import bpy
from bpy.types import Panel, Operator

class RGL_PT_Panel(Panel):
     bl_space_type = "VIEW_3D"
     bl_region_type = "UI"
     bl_label = "Regalplannung"
     bl_category = "Regalplannung"

     def draw(self, context):

         layout = self.layout

         row = layout.row()
         col = row.column()
         col.operator("object.regalplannung", text = "Aufüllen")

         col.prop(context.object, 'Offset_X', text = "Abstand X",
         slider=True)
         col.prop(context.object, 'Offset_Y', text = "Abstand Y",
         slider=True)

class RGL_OT_regalplannung(Operator):
     """Vollständig gefüllt & Ausrichten"""
     bl_idname = "object.regalplannung"
     bl_label = "Regalplannung"
     bl_description = "Regalplannung in Blender"

     bpy.types.Object.Offset_X = bpy.props.FloatProperty(min = -5, max = 5)
     bpy.types.Object.Offset_Y = bpy.props.FloatProperty(min = -5, max = 5)

     def execute(self, context):

        selection = bpy.context.selected_objects

        for sel in selection:

            parent = sel.parent
            parent_0 = parent.dimensions [0]
            parent_1 = parent.dimensions [1]
            parent_2 = parent.dimensions [2]

            mod_array = sel.modifiers.new("Vollständig gefüllt", 'ARRAY')

            mod_array.fit_type = 'FIT_LENGTH'
            mod_array.relative_offset_displace[0] = 0

            if parent_0 < parent_1:
                mod_array.fit_length = parent.dimensions[0] - sel.dimensions[0]
                mod_array.relative_offset_displace[0] = sel.Offset_X

            else:

                mod_array.fit_length = parent.dimensions[1] - sel.dimensions[1]
                mod_array.relative_offset_displace[1] = sel.Offset_Y

        return {'FINISHED'}

bpy.utils.register_class(RGL_PT_Panel)
bpy.utils.register_class(RGL_OT_regalplannung)
```

Hey there, omg thank you. I've been searching for a solution for ages. Thank you

Is there any way that the slider changes the value in real time? Not just when i press the button the add the Array modifier?

Yes, but that would require a modal operator.  You might want to find a tutorial under 'blender python modal operator' search before you try it.


text:
Eye rig not following body rig properly
I am really struggling with this issue. I have two eyes as separate objects to a character and want to parent the eye control and target bones to the head bone so that they can move with the character. No matter which way I parent them, the rig starts behaving really strangely in pose mode and doesn't even switch back to default pose on right click. I have parented both eyes to the correct eye bone.
Any advice on this issue will be really appreciated!

link to blend file :

Screenshots and/or GIFs help us a lot helping you. You most likely won't get any good answers, if any at all, because there can be a million different reasons for your issues. An image can say a thousand words. Remember that ;)

Instead IK I would uso Track To because if you use IK and parent it to the head you will get that all the body is going to move


text:
Inserting a ❤ symbol into text
I'm trying to put a piece of text into Blender 2.76, most of it works and is OK, putting the ❤ symbol into the text editor pane works. When I try and put it into a text object, all I get is a square symbol (i.e. can't display it).  I've tried copy and pasting the char in (even the Insert Text pane entry field), tried changing the font and run out of ideas.
Is there a specific font I should use?  Or is there something else I'm missing?
Update:
Finally managed to get something I was after, here's a render of it so far...

If you're on Windows try selecting the font "MS Mincho" (it should be  C:\Windows\Fonts\MSMINCHO.TTF). Or MS Gothic (msgothic.ttc), this is how Libreoffice Writer gets it.
At least that font is used on my Microsoft Word (on Windows 7) when I paste your char into a blank document. I tried setting both the above on Blender, and it works:

Thank you, I'm running on Ubuntu, but managed to download this font and it gives me the same as your getting :)

see updated post, also MS gothic seems to work... maybe others.

It displayed as a heart in most fonts in LibreOffice, but it didn't seem to translate to Blender.  Just need to work out how to set this font programmatically when I create a new text object.

yes, LO always displays it, even with "arial" or "liberation serif"... the weird thing is that neither ms gothic or ms mincho have this heart in their character set... some obscure font wizardry, I suspect.

Managed to find fnt = bpy.data.fonts.load(...), so on to the next problem!  Thanks for your help.


text:
Sub-frames and the File Output Node
I am trying to get the File Output Node of the compositor to create a new file with a different name (appending a number would be best) if one already exists. Controlling the name with some extra input perhaps would also work.
I'm in this situation because the time is being controlled by a speed track on the VSE. The frame are actually sub-frames, but the File Output Node generating the output file name based on the integer frame number. The result is that there are less files than there should be, because multiple sub-frames end up overwriting themselves.
Any ideas?

Can you simply change the project scene properties Frame Remapping? To make sub frames instead of a speed strip? Then ramp in compositor with a driver on the image input frame start and offset values? See this example http://blenderartists.org/forum/showthread.php?292677-Interlaced-Videos&p=2380159&viewfull=1#post2380159

@3pointedit Seems possible, but it would require time remapping "to the slowest part", which would require rendering lots of useless frames, right?

Correct. And I'm not sure that time remap affects the node file output, you'll have to test that.

A workaround is to make the base path of the File Output node change according to the subframe, before every render, using a Python script. In this way, the output file names won't be overwritten. This script must be run once before rendering.
import bpy

def add_subframe_to_fo_path(scene):
    if scene.name == 'SceneName':
        scene.node_tree.nodes['File Output'].base_path = '//sth/' + str(scene.frame_current) + '-' + str(scene.frame_subframe)

bpy.app.handlers.render_pre.append(add_subframe_to_fo_path)


text:
creating equiangular HDRI of my own scene
I have created a room in an arch viz project.  It has no windows.  Currently I'm using a studio light HDRI setup for lighting.
I'm rendering out what I will call backplates and then separately rendering out some animations of forground characters and objects, and then compositing them together with the backplate.
Here is my problem.   One of the objects I am rendering separately is all chrome, so it is now reflecting only the studio lights of the current HDRI. But I need it to reflect my actual room.  So I would like to create a quick and dirty HDRI equiangular map of my actual room.
-The backplate renders is 1280 x 720px.
-I am using Cycles
Can anyone provide me a detailed workflow on how to properly create my HDRI map within Blender? Please also tell me what size it should be.

I actually have done this before. I'll post an answer.

Thanks for the explanation...  I checked out the other answer that was previously posted.


text:
Are OBJ files exported from Blender different?
I'm having some issues importing OBJ files from Blender into After Effects (for Trapcode). Is there any difference between the way that Blender and similar software generates OBJ files?

What kind of issues? Can you upload a file that your having problems with? Generally OBJ is standard and blender's exporter is fine from my experience, might be a specific issue.

Well, I have uploaded two images. The first one, is how it should look, but when you close and re-launch After Effects, you find the second image. It's very strange. It seems like the coordinate system flips or get bigger, I don't know. I used to use Cinema 4D before and I never had any issue with OBJ. I usually download OBJ from Turbosquid too. So, I think it has to do with Blender OBJ, maybe something with the export settings.

so it's OK when you first import it into AfterFX, but when you return to the project it's different?

Recent versions of AfterFX have Cinema4D (Lite) built in. It may be worth seeing if the same thing happens using its Obj importer.

A problem blender has in comparison with most other software is its axis differences. Blender uses +Z up, +Y forward, +X right, whereas most others are different. Maya, for example, uses +Z backward, +Y up, +X right; C4D uses +Z forward, +Y up, +X right... It's a mess.

In the export settings, you can set which axes are up and forward. By default, they follow the convention that allows them to import into Maya properly, ie -Z forward, +Y up.
After Effects may be different. I believe +Z is coming towards you and +Y is up. The point here is that you might need to experiment with the axis export settings to get the proper orientation of your object in AE.
Key point to remember is that from the front camera view, forward is going away from you, right is right, up is up. A quick and easy way to test these settings is to just use Suzanne as a test model. She's light and easily recognizable, much more so than a cube. Once you get her to export right, just use those settings for your other objects.

Hi, thank you for your answer. But I think the flip scenario is not the case, it seems like the way Blender generates and recognizes OBJ files is different. I have played around a little more with OBJ files and Blender, and I think something is wrong with the OBJ Import / Export tool. For example, I tried to import an OBJ file into Blender, and two faces disappeared. It didn't happen in Photoshop, Cinema 4D or Houdini. I'm not a developer, but I'm sure there is something weird with this add-on.

I've never had a problem with OBJs, even when I export/import a 1-GB scene, no matter the software I take it from. Maybe the normals were flipped on those two faces, I don't know. I always do cleanup to make sure everything's consistent, like normal recalculating and removing doubles.

Yes, you are right, the second problem has to do with the normals and if the 3D model is clean. The first problem I mentioned has to do with the Trapcode plugin and OBJ files from any software, not just Blender, so, it is something that Red Giant needs to solve.

Honestly, 3D software just needs to use Z up, Y forward, X right. Just simplify it for everybody and make it consistent. I'm waiting for someone to think outside the box and use Z down, X left.

does anyone know the setting then to use for 3ds MAx?


text:
Volume rendering an image stack in Blender Game Engine
I'm trying to create an interactive scientific visualization tool using the Blender Game Engine (BGE). One of the things I want to include is a volumetric rendering of an image stack. An image stack is a series of images, each of which describes a slice of a 3d structure along a certain axis (e.g. a slice of the whole XY plane at z=1, z=2, z=3, etc.), so when you put them together you can describe a whole 3d volume.
I've already figured out how to create a volume rendering of the image stack by following Brian Kent from NRAO's Datacube tutorial. It works in Blender Render. Here's an example, not a very exciting one, but what I've done here is made an image stack describing a fuzzy sphere inside of a cubic volume. I loaded in the image stack as a volume-rendering texture for a cube-type object, as described in the tutorial.

My problem is, when I try to use the game engine, it just looks like a solid cube with the default white/grey material. Any thoughts?
Edit:
X-27's comment might imply that this kind of approach simply doesn't work in BGE. If that's the case, I also welcome any thoughts on another way to render a Z-stack of images in a volumetric-like way, that works in BGE.
And in response to Radish of Knowledge's comment - I tried both multitexture and GLSL rendering, and it didn't help, thanks though.

If you are only using transparency however, just change your scene to "GLSL"


text:
Animating a snowboarder
So I am currently working on a snowboarder character and I would like him to do certain things.

I've been playing around all day with different constraints but I just can't get the desired result. What I would like it to do is when the spine moves along x axis, first the leg gets extended (totally straight), then as it pulls the board - the board starts to bend. Also I need him to be able to rotate the whole lower body, without an upper body, and be able to do the same board flexing thing. How can I do that?
Update
So I have been working with this armature, solved a few problems on the way, and new questions arose. The main one - is it possible in the "copy transform" constraint settings of the "board" bones limit "local space - local space" only to vertical axis, z in this case, and leave "world space" for x and y? So the board bones would be only flexible on the axis that a real board is flexible and I could easily apply rotations to the board? Or maybe I should look at this problem from different perspective and find some workarounds? Opinions appreciated. And thanks again to Italic_ for an awesome rig concept

You're able to limit most constraints to single axes if you need. For example, the copy rotation constraint has checkboxes for X Y and Z, as well as inverters for the transforms. You could realistically leave the single axis constrained and use some other constraint for the others. Just be aware of which axes are constrained so you don't conflict constraints (ie don't have two constraints on copy rotation X).

Just reread that you want a copy transforms constraint, which does not allow axis specification. Just use copy rotation/scale constraints in its place.

I took this as a challenge to build a rig, so you have my experiments. Essentially what I did was to cause the leg IK target to follow the end of the leg IK chain, then damped track the board to match the foot. It's not perfect, but that's because of technical reasons within the concepts of rigging, not a blender limitation or my own limitation.
I'm trusting that you know how to realistically animate a body. If you can, this rig will not be a big problem. The issue is that it's difficult to get the foot to stay planted on the board while also serving as the IK target (indirectly) because that will create a dependency cycle within the same armature, which the new depsgraph can't handle yet. If you animate the root properly, you can avoid this foot sliding quite naturally. In this example, you have only two controls to animate: the root and foot rotation (translation is determined by the IK chain).
I'm not sure how separate you want the lower and upper body because there are numerous ways of doing that. I simply put a hip bone and control under the root, which would be skinned to the hips of the character, and a spine also under the root. This way, the root controls the overall body, then hips and spine control their own respective body parts. If you need something more complex, like an IK spine, there are plenty of tutorials around that can describe those.

This is HUGE help, thanks a lot man! It will take me some time to comprehend and implement that for my character, but I will post some animations when I am done!

I have just noticed my reply wasnt saved. Huge thank you for the work youve put in. Will update on my progress

I think you'd be better off using a character animation technique over a constraints-based setup.  Why not use something like Rigify to quickly animate the character, and then use a very simple rig to bend the board.
I first learned Rigify with this tutorial: Quick Rigging with Rigify
As for bending the board, simply make an armature along the board with as many segments as you want.  Then, parent with automatic weight the board to the armature.  If you want, you can set up an IK Chain to make the bending a bit more realistic.
Use the Action Editor to make actions for the board and the character, then put them together with the NLA Editor.


text:
What numerical CRF values do the assorted output qualities correspond to in the ffmpeg video encoding options
Blender 2.79 added the ability to encode video using ffmpeg's CRF (constant rate factor) technique.
I assume this is controlled by the Output quality setting in the Encoding subpanel.  Unfortunately, all my previous workflow has been using numbers for CRF (like 20 or 25 or 30) with ffmpeg in a makefile.  It is not obvious which of the qualities in blender's UI maps to these values.
For each of the Output qualities, what is the corresponding CRF value?  (Although I bet the lossless and CBR options don't correspond to CRF operation)

These are defined in DNA_scene_types.h, in the eFFMpegCrf struct:
typedef enum eFFMpegCrf {
  FFM_CRF_NONE = -1,
  FFM_CRF_LOSSLESS = 0,
  FFM_CRF_PERC_LOSSLESS = 17,
  FFM_CRF_HIGH = 20,
  FFM_CRF_MEDIUM = 23,
  FFM_CRF_LOW = 26,
  FFM_CRF_VERYLOW = 29,
  FFM_CRF_LOWEST = 32,
} eFFMpegCrf;

We use a slightly wider than "subjectively sane range" according to the FFMpeg wiki.

A suggestion from a person on IRC led me to examine the encoded streams which conveniently contain a SEI NAL with the encoding options.  Based on encoding streams with varying output qualities it seems
CRF
32   lowest
29   very low
26   low
23   medium
20   high
17   perceptually lossless

and the lossless option is a different mode with qp=0 which activates the lossless mode of H.264 (which probably uses a PCM mode according to what little I have read).  I did not bother to study the CBR mode.


text:
Vertex problem: there are some dark shade in the view mode
I try to build a hole and extrude today. And I come across with this problem.
Does anyone know how to fix it?

Did you try Alt+N - Recalculate Outside? This can be normals facing problem, or it may be some topology issue as well

Yes Miko I tried. But still the same..

Is it possible that you have duplicate vertices?  (Try selecting all and then M, merge at center.)

@MartyFouts I tried.. still not working..

Solved!! Thank you guys..
I rebuild it and give ut more Bevel on the part that intersact.
Finally work


text:
Why is my CPU maxing out when I set to use GPU rendering?
I am using blender 3.4.1
Does the GPU bring no value in faster rendering? Is there anything that could be done to render faster?
I have updated the drivers to use the Nvidia Studio drivers. The graphics card also has 16G of local ram.

I have also tried using some of the benchmark animation files from the blender site, including both the fluid simulation and the lava simulation.
I included my simple file fir debugging as well if that helps at all. https://drive.google.com/file/d/1hmH67DdnK9JAfWEXEW4fkN8FgknCRLJL/view?usp=sharing
I have OptiX (I have also tried CUDA) NVIDA GeForce RTX 4080 selected in preference and render engine = cycles, Feature Set = supported and Device = GPU Compute. It is taking ridiculously longer than when the CPU was rendering, yet the CPU is getting maxed when trying to GPU render.

So I did run the benchmark and it does appear that the GPU is faster but when compared against the average for a 4080, my 2k, 2k, and 4k values are alot lower than the 9k average. Is there something else I could be doing incorrectly?

RTX Uses cuda cores and should be noticeably faster than CPU rendering alone. This may be a hardware issue on your end. I downloaded your scene and GPU rendering took around 35 seconds while CPU rendering took nearly a minute.

It's literally a brand new computer so it wouldn't make sense to me if it was a hardware issue, when you rendered the file, does that mean you had the exact same settings too? If you change anything can you list them

Note that task manager won't report usage for rt cores, and the cpu will always see utilization even when handing tasks to the gpu

That's fair I've also seen mentions of that, and that applying cuda as one of the GPU dropdowns might report more but regardless, as mentioned by callmepro, his render was at 35 seconds while mine got a few frames in after about five-ten minutes which can't be right at all

I should clarify that was render times for an individual frame. The only settings I changed was to switch on the usage of GPU and CPU in Blender Preferences > System.


text:
Can you recreate this Subsurface Scattering effect in Cycles?
I have applied a simple Subsurface Scattering and adjusted the Transmission value in the Principled BDSF. In Eevee this really pops. In Cycles it's quite dull. How can I recreate this effect in Cycles?
I have tried a handful of different node setups (Transparency, Transmission, Mixed etc.) and I can't quite get it. Any ideas how to achieve a similarly bright luminosity in Cycles.
Both renders are using the proprietary HDRI (forest.exr) that is used in the Material Preview window.
Thank you if you've got an idea how to approach this.
1)Top Image is in Eevee; there's a lot more luminosity in the Subsurface Scattering.
2) 2nd Image is in Cycles, comparatively quite dull, no Bright Pink coming through.
3) Bottom Image is the Principled Shader setting (Note: Transmission as well as the SSS). Both images use these same settings, just with different render engines.

Keep in mind that Cycles is based on physics where Eevee is not so if you are satisfied with a non-realistic result of Eevee, it will take some hoops and loops of tweaking to achieve the same result in Cycles. Also your lighting in the scene will greatly influence the Cycles result but you are not showing your light setup.

I haven't used any lights, only the default HDRI (forest.exr) as in the Material Preview. (See this post for the setup: https://blender.stackexchange.com/questions/158336/using-material-preview-hdri-in-renders-blender-2-81 )

I added a link to the .blend if that helps... but I think it's a pretty straight forwad setup, I know what you mean about tweaking to get the result, however I was wondering about novel approaches to SSS. I haven't been able to acheive the same luminosity with a number of different node set ups and light setups that I've tried, with the bright pink coming through in the Subsurf, Cycles just seems to dull everything down. Any bright ideas are warmly welcomed! Cheers.

bring down the value for transmision, or for Alpha, that will make it more transparent.

In the interest of completion I'll answer with the result I arrived at for rendering these leaves. I didn't arrive at precisely the same result but something quite close.
I have attached an image with the various tests and shader settings. I included the Displacement Texture Nodes I used for surface texture because it does have an effect on the final look.
The biggest changes were affected by altering the Transmission and Transmission Roughness values. And by using Random Walk instead of Christensen-Burley as the SSS Method.
This is what the Blender manual says about these SSS Methods:

Subsurface Method Rendering method to simulate subsurface scattering.
Christensen-Burley Is an approximation to physically-based volume
  scattering. Gives less blurry results than Cubic and Gaussian
  functions.
Random Walk Provides the most accurate results for thin and curved
  objects. This comes at the cost of increased render time or noise for
  more dense media like skin, but also better geometry detail
  preservation. Random Walk uses true volumetric scattering inside the
  mesh, which means that it works best for closed meshes. Overlapping
  faces and holes in the mesh can cause problems.

One commentor suggested using Alpha for Transparency, but to me this appears to affect a different kind of near total transparency that doesn't seem to have any relation to the physical nature of the simulated material but something more like an overall opacity of the object. It is my understanding that Alpha is primarily used to modify another node which plugs into it. (But I stand to be corrected here).
In this particular case, adding Sheen also had an influence that came closer to approximating the look of realtime Eevee rendering in Material Preview mode.
Something I have not been able to imitate, is the way that realtime rendering in Eevee seems to pick out some edges with a highlight. Even after rendering an output image in Eevee this effect was not reproduced. Perhaps this is a feature of blender to allow for objects to be more quickly visually isolated while editing them, rather than physical accuracy for a final render. Just a guess.
This technique of picking out edges with a highlight is an effect used by old painters, you can see if you look at dark old oil paintings.
You might be able achieve a similar highlight with carefully placed back light, but for the purposes of this experiment I was more interested in trying to pin down some of the specific aesthetic effects of each render engine, albeit on this one very particular example, so I stuck with same default HDRI for the render.
I hope someone may find this useful sometime.


text:
Best practice and method for transparency with leaves?

I'm modelling leaves as a solid mesh using Displacement for texture (no Image Texture files). Leaves need Subsurface scatter (SSS) and translucency. I can add Subsurface Scatter with the Principled Shader, but I'm confused about the best practice for a realistic translucence to the leaves. I see three possible approaches: Transmission value in the Principled Shader, or a Transparent node or a Translucent node plugged into material output.
What is the difference between these three tools (Transmission, Transparent, & Translucent shaders) and what is the best option for this application?
I understand that the Transparent shader allows light to pass through unhindered (like glass). And Translucent shader scatters light - not dissimilar to SSS - like it is passed through a body or mass. But, can this same effect not be achieved in the Principled shader with SSS and  Transmission? In short what does Transmission achieve that Translucent and Transparent shaders cannot?
Thank you.

Hi. You should not delete and re-ask a question. If a question was closed or you need to change the details, you should use the [edit] link below it.

Does this answer your question? What is the difference between Translucency and Transparency?

Hey everyone thank you for the quick replies and the informative link! It was super helpful to learn about the difference between Translucency and Transparency. But this link is 6 and a bit years old, and Blender has the Principled shader since that point (I think) which has Subsurface Scattering and Transmission built in. Can you achieve these effects without extra nodes? In short, what does Transmission value do that Transparency and Translucency do not?

Translucent BSDF is physically more acurate in this situation.

Connect it using Mix Shader with Principled BSDF
Use the Fac slider to control the influence
Use Cycles render engine for realistic translucence (Eevee doesn't support it)

If you want to use only Principled BSDF shader, use Transmission + Transmission Roughness. Notice the light scattering isn't as strong.

Subsurface Scattering doesn't directly affect translucency, but it's needed for proper realism. Just bear in mind it's a bit slower.

Hey, awesome! Thank You for the quick reply! I see that Transparency allows light to pass through unhindered whereas Translucency functions to scatter light when there's mass there - not dissimilar to SSS - and as you say more accurate in this situation because we are talking about a leaf and not a piece of glass. But what does Transmission do? Can this simple setup be achieved even more simply with just the principle shader?


text:
How to randomize holes in a mesh, like with a particle system?
I'm building a bush that has been ravaged by caterpillars. I am working with a set of leaves, see attached image, and some of them I have created holes in the mesh, you can see in the mesh which is selected in Edit mode.
I'm trying to figure out a workflow to generate the holes randomly - sizes, location, shape - in the mesh. Thereby limiting the base set of leaves. I'm seeking a workflow similar to how you would add raindrops on leaves using a particle system: create a droplet; Particle: Hair; Render As: Object etc...
Can you think of a clever method to achieve this?
It doesn't necessarily need to affect the mesh itself, but just the transparency (transmission) for render.
The answer to this question suggests a workflow using micro-displacements, that might be a good starting point ... not sure.  Maybe creating a texture with the holes, that can be UV mapped ... thinking out loud. Keep in mind the leaves already have a texture mapped onto them, and a solidify modifier with Subsurf Scattering in the material.
Grateful for any bright ideas you can share.

EDIT
An answer was offered to run a texture through the Alpha channel. It's close but not quite there yet. See the attached image for the setup.

The Base Leaf Texture is connected to Base Color - this has been unwrapped using 'U Project from view and placing the mesh on the image in UV editor.
This same image texture is used twice again with ColorRamps to influence Roughness input and Bump via Normal input.
As per the suggestion, I created a black and white texture file of leaf holes and this connects to the Alpha channel. (My understanding is that Alpha works with 1.0 = White = Opaque / 0.0 = Black = Transparent, hence the black and white image).

You can see this sort of works.
The issues:

This method is not random, the texture is the same on duplicates. (Might I perhaps use a larger file for the leaf holes and somehow manipulate it with an empty...?)
This method is indiscriminate on the leaf, I need to restrict the pattern of holes from affecting the stem  (Can this be done with texture paint - or weight paint - multiple textures onto an object? So the mesh can be unwrapped onto the Base Color image texture and the pattern of holes image texture for the Alpha channel be selectively painted? Can you explain how?) This still doesn't affect the randomness of the holes.
Finally there is an artifact in the cycles render, the 'holes' are dark transparent grey in accordance with the shape of the mesh rather than completely invisible. (See final attached image for the Cycles render).

Further clues are greatly appreciated. Sincere thanks for your efforts.

IMO the reason your holes aren't completely transparent must be because in your texture the holes aren't completely black but light grey. You can most likely solve this by adding a Color Ramp after the texture.

The reason they are not random on duplicates is because the seed value of random nodes are same for both leaves, change the noise node to 4d and then change the W value for each leaf.

@ViplavPrakash that's a good approach. I solved the randomize problem with the Texture Coordinate Node; using the data from an Object; a Plain Axes Empty in the Layout Workspace. But I tried your way also and it works, the problem is that all the duplicates use the same material, so I can't change the W value for each individually. Also this gets cumbersome when were' talking about more than a dozen or so objects, and I'll be using 100s of duplicates. But that is a good suggestions, I never understood how 4D operated in the Texture Nodes. Thank you.

What about using the Alpha channel on the texture? Create a random noise texture (or any pattern you want) and plug it in the Alpha channel. I think that the effect should be believable enough.
I would then add a simple bump map in addition to that, so the corners of the whole are a bit smoothed.
EDIT:
So obviously you need to play around a bit with the generated textures, but this is the way I'd approach it. Here is a sample:

This looks stupid because I didn't use a leaf texture or the proper model, but I think it would look quite good on yours, and it's completely procedural, so it will be randomly generated automatically and you can define and keyframe the size.
I've added a small gradient so the leaf gets browner closer to the wholes (you could blend this with a nice brown leaf texture), and a bump map, so the holes don't have a completely hard border.
This is the node setup:

Hope that helps.

Cheers for your speedy suggestion! This was a good start. I edited my question with my efforts following your idea, there are a few issues still as you can see. Getting the pattern to be random, and selectively unwrapping / painting multiple textures onto the mesh... Thanks again for your helpful suggestion.

@Aubrey I've edited my answer. If something isn't clear I can explain the individual parts.

LEGEND! That is an impressive and very helpful answer - for quite a specific question. Thank you for taking the time.
I will suggest one edit to your setup. In order to RANDOMIZE the texture: In the Texture Coordinate Node pull from the Object field (rather than UV) into Mapping, and set the Object to a Plain Axes Empty this will generate the pattern randomly across all duplicates.
Thanks Enyo. I wouldn't have got there without you. When I tried your initial suggestion, Noise Texture into Alpha, I wasn't getting any result. The problem: I didn't push the Scale High Enough.

You're welcome. Glad it worked for you!


text:
Problem with Curve Modifier in Animation Nodes
I instance a curve on the vertexes of a circle mesh. I create a plane with a curve modifier and instance it. I loop through the curve and plane instances, assigning each plane a curve to the modifiers["Curve"].object attribute.
Using the normals of my circle mesh, I scale the locations of the planes planes. The resulting motions of the planes are not identical, because they all have the same deformation axis set for the curve modifier (x).
Here is the blend file.
Is there a way to get get the planes to deform uniformly?

Can you please provide the blende file. Also, are we to assume that you mean that you'd like the planes to hold the shape of the path as it travels or simply travel along the path from the center?

Using Blender with AN is sometimes not the best idea due to the limitations that this impose. I recommend you use Animation Nodes for everything. Would you like to see a solution with pure AN?

If there is a way to have deformations similar to the curve modifier just with animation nodes I would like to pursue that. Yes the plane should hold the shape of the path as it travels along the path.

Start by evaluating some points on the spline, add and subtract a normal vector to get vertices on both sides, and the compose a mesh out of those vertices using the polygon indices of a grid:

Then you replicate that mesh along a circle as follows:


text:
Packing and Animating Rectangles in Animation Nodes
I would like to re-create the effect in the below gif with animation nodes. As I see it the process would break down into these parts:
1)Define boundaries - Define some flat area that the animation will occur in
2)Create Geometry - Define a method of placing planes within this defined area, where the width and height of the plane randomly chosen between a defined min and max value. Together this arrangement of planes forms a perfectly filled flat surface.
3)Animate - The rectangles scale down in different directions. Not sure how you would do this a simple scale transform, I'm imagining controlling the vertex locations of the individual planes. The duration/rate of this animation is somewhat random, like the example.
Potentially helpful threads:
Omar Ohmad's Sphere Packing Answer:
How to animate spirals on packed spheres using Animation Nodes?
https://stackoverflow.com/questions/1213394/what-algorithm-can-be-used-for-packing-rectangles-of-different-sizes-into-the-sm
https://www.codeproject.com/Articles/210979/Fast-optimizing-rectangle-packing-algorithm-for-bu#basic

I think you should take a step back and think about this problem from a different perspective. Instead of randomly choosing the width and height of the rectangles and then try to optimize their positions to be tightly packed, you can successively split the domain into smaller and smaller rectangles. This way, the rectangles are already positioned and tightly packed as you might expect.
Algorithm
Our general algorithm can be as follows:

Create a loop that takes an initial list of rectangles as input. The list could initially contain a single big rectangles which we could consider our boundary.
For each iteration in the loop, we choose a rectangle at random and split it at a random position to produce two smaller rectangles. We then remove that rectangles from the list and add the two produced rectangles.
We could add a condition that skips the rectangles that have an area less than some threshold value. This ensures rectangles don't get too small. We could also add a condition for the areas of the resulted rectangles, but we shall not do this in this instance.

We shall define each rectangles by two 2D vectors, a vector representing the location of the lower left corner, and another representing the location of the upper right corner. Let those two vectors be $(x_1, y_1)$ and $(x_2, y_2)$. We have two ways to split a rectangle into two smaller ones, horizontal splitting and vertical splitting. This diagram demonstrate how one can compute the two smaller rectangles from the original rectangle using vertical splitting:

First, a random float $\delta \in [y_1, y_2]$ is chosen as the $y$ location of the splitting. Then the two rectangles are defined as:

$(x_1, y_1)$, $(x_2, \delta)$.
$(x_1, \delta)$, $(x_2, y_2)$.

Similarly, horizontal splitting can be done by choosing a random $\delta \in [x_1, x_2]$ and forming the two rectangles based on it.
Implementation
We shall define each rectangle using a struct of four floats. Our initial rectangle list will be composed of a single struct representing a rectangle defined using an empty in the scene. The loop will output a list of structs, those structs can then easily be used to construct quad meshes which can be output and used. The high level node tree look like this:

With the Generate Rectangles loop defines as:

As for the Compute Rectangles loop, we first get the index of some random rectangles from the list. We use that index to get the rectangle and delete it from the list:

Then we compose the four rectangles (Two for each split type) based on the formula above. A random number is used to determine if the type is horizontal or or vertical by switching between rectangles. Finally, the two rectangles are combined with the rest of the rectangles and are reassigned if the area condition is met:

And by adding some value to the seed for seed control, we get:

Which gives the following result:

Blend file:

The animation should be easy, so I will let you do that on your own.


text:
How to create a script that will evenly distribute selected nodes?
I would like to create a script that would evenly distribute the locations of some selected nodes so that I can better organize my node trees. I'm seeking a script solution for this issue, instead of using Node Wrangler, because Node Wrangler functionality is not available in Animation Nodes.
I imagine script would function something like:

X = C.active_nodes
For nodes in X find locations of left_most_node_location and right_most_node_location
Set location of nodes to distance between left_most_node_location and right_most_node_location divided by the length of X

I'm not very good with Python, so I'm not really sure how I would write this for Blender.

Don't think you really need that. You can press: S + Y + 0 to align the nodes vertically. Also Node Wrangler comes with an Align Nodes button...

@brockmann yes I know you can scale to align them but I would like to distribute their locations evenly

Enable Node Wrangler (you'll need it anyway) and Align Nodes does what you want...

@brockmann I'm seeking a script solution to this problem because I want to use the script in Animation Nodes, which is not compatible with Node Wrangler

Aha... you should add that to your post @ANimator120.

I created this question to answer a similar question, this might help you


text:
How do I fit a UV texture into a frame and dissolve glitches?

Hello, I want to scale the door picture in my UV editor to my door surface in my 3d model, so I would like to know what would be a way to make it slimmer and positioning it to the center? I cant use loop cuts on the door surface because of already dissolved edges to fit the texture in a better "frame".
Also as you can see there is a huge glitch in the selected door. Is there a way to fix that?

if you want the door to be narrower, maybe subdivide this part and give another material to the other parts you'll create?

Perhaps UV > Project From View Bounds is what you need ?

In Edit mode Select only your door.
Go into Front Orthographic view.
Open the UV drop-down menu and choose the Project From View (Bounds) option.

The door image in the UV editor should now be mapped perfectly to your door mesh. If the door is too wide then select the door mesh and scale it in the X ( or Y ) axis.


text:
Texture splits in the middle
How can I make the texture line up better? It splits in the middle. I'm using applied geometry nodes.

You can find the texture here.

When you wrap a flat texture on an object, there will always be seams: the places where the edges of the texture meet each other.  When you have a non-tiling texture like the one you've chosen, the best you can do is hide the seams by placing them where they are hidden from the camera view, or at least obscured and less apparent.
In the case of your torus, I would suggest two seams, one around the inside of the torus and one in back that cuts the torus in half:

You add a seam by selecting the edges you want to be part of the seam and then typing Ctrl–E and selecting Mark Seam from the drop down menu:

In this case, since the two sets of edges I would use as seams are edge loops, you can quickly select one by hovering over one of its edges and holding Alt while left clicking.
Once you have the seams set, you need to rebuild the UV map:

Select all vertices
Type U
Select Unwrap from the menu

Unfortunately, this will not give you a good unwrapping -- it will place the torus in the corner of the UV map.  You'll need to rotate, move, and scale it, until it's centered and mostly fills the map:

There are tools you can use for this but that's outside the scope of the question.
Here's the result, using an ordinary Torus.  Notice that you can still see the seams but they're more obscure.  On your fat torus they'll be even more so.

Go into the node editor and see if your texture has this kind of projection. If so you can turn up the "Blend" value to blur the edges, or you can switch it from "Box" to "Sphere" and see if that fixes it. Otherwise it probably has something to do with UVs, but seeing as it's a procedural mesh I don't think that's it.

https://imgur.com/a/SVH9ADk this is what the nodes look like, switching them to box or sphere and changing the blend value did not fix it, unless I did something wrong.


text:
Setting vertex normals
I've been trying to set the selected vertex normals of my model to have a common average direction. After some research I came up with this
    import bpy
    import bmesh
    import gpu
    from gpu_extras.batch import batch_for_shader
    from mathutils import Matrix, Vector, Euler

    class ButtonAverageNormals(bpy.types.Operator):
            bl_idname = "button.average_normals"
            bl_label = "Average Normals"

            def execute(self, context):

                context = bpy.context
                ob = context.object
                me = ob.data

                me.use_auto_smooth = True

                averageNormals = Vector((0,0,0))
                selectedCount = 0
                newNormals = []
                for v in me.vertices:
                    if v.select:
                        averageNormals = averageNormals + v.normal
                        selectedCount = selectedCount + 1
                averageNormals = averageNormals / selectedCount

                for v in me.vertices:
                    if v.select:
                        newNormals.append(averageNormals)
                    else:
                        newNormals.append(v.normal)

                me.normals_split_custom_set_from_vertices(newNormals)
                me.update()
                print(averageNormals)
                return{'FINISHED'}

Everything works ok. I'm executing the operation with an UI button called "Calculate Normals", and the average normals are calculated and printed correctly, but they're never applied to the vertex. This: "me.normals_split_custom_set_from_vertices(newNormals)" doesn't seem to be working.

The mesh data is accessed in object mode and intended for compact storage, for more flexible mesh editing from python see bmesh. Insert             bpy.ops.object.mode_set(mode='OBJECT') in your operator and try again.
def execute(self, context):
    context = bpy.context

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

    ob = context.object
    me = ob.data
    ...

Thanks! This worked like a charm. I'm getting some unexpected results, but that's something I think I can handle.


text:
Flow object doesn't generate fluid
I'm trying to transform a cap into water, but every time I "bake", nothing happens.
Maybe my cap is too complex, but change the resolution division in the liquid domain doesn't work. I have many materials on it, can it be the problem?
I don't know what isn't working, I've tried it with a cube and it perfectly works, but my cap don't want to be liquid.
Thank you

Flow object (Cap) is too thin for such low-resolution Domain (32 is not enough).
In general - thickness should be like one Domain > Resolution Division
or from other side - Domain Resolution should be at least a one Division of Cap thickness.
What is the dimension of one Division you can see at Domain corner (small cube).
In this example Domain. Resolution Division is default 32 and Flow object with Solidify modifier 0.03. Since the volume is smaller then one division (cube in left-down corner) there is not calculated any fluid.

... same but Solidify 0.08.

In your case you probably don't want to make Cap thicker :) ... so you would have to increase Domain Resolution or make Domain smaller if possible, but keep in mind Resolution is calculated by dividing longest domain edge.

i've tried even to solidify my cap and put the domain resolution to 1000 and it still doesn't work..

It doesn't make a sense to use solidify on your model, it was example for you to experiment and see how system works. Anyway to speed it up share your file via https://blend-exchange.com/ given code copy paste into your question? BTW if you tried 1000 you have super power machine ;) lucky you ... So don't use solidify, scale domain only on size of cap with 1000 and try to bake few frames into cache or even make domain smaller just for a cap segment to see if fluid would be generated.