Split concave into separate convex meshes? I know Mesh > Cleanup > Split Concave Faces splits the mesh itself into convex shapes, but I want to split it into separate objects so I can import it into unity.
That's all I really want to know, how can I make it separate objects that I can select and export individually?

I ran into exactly the same question. I wrote a script that uses the "Split Concave Faces" feature to split the object into separate parts. It's not foolproof -- it only works well for reasonably flat, rectangular geometry.
The hardest parts of the process are:

Identifying which edges the object should be split by, since "Split Concave Faces" only adds edges that it deems necessary, but the object may already have edges that define the boundary of a convex region.
Intelligently matching up which faces of an object should be grouped together into a new closed object after splitting-up the parent object. For example, two faces that are parallel to one another might end up as separate planes after splitting by convex boundary edges -- so the script must find these and determine that they need to be matched up.

I have not found a feasible way to do either of the above if an object has holes or openings inside -- especially curved openings. It seems that the algorithm can never be sure which edges connect both sides of a convex shape for splitting, and which edges should be left alone because they're part of a closed shape. Meanwhile, once split, knowing the optimal combination of faces to re-combine to form closed shapes becomes intractible because there's no good way to know how many distinct faces/pieces need to be re-combined -- 2? 3?
Anyway, here's a link to the script:
https://gist.github.com/GuyPaddock/e2420a0c54f6892c2c2f01556d6a4e14
It operates on the selected object.
Since this is likely to be used for collision meshes for things like Unreal Engine 4, the script also renames the split pieces according to sequence numbering. Before running the script, give the object you are splitting a name
that ends with _01 (e.g. UCX_My_Mesh_01) so that all the pieces that split off from it are properly (e.g. UCX_My_Mesh_02, UCX_My_Mesh_031, etc.)
numbered.
In case my link disappears, here's the full script as of the date I am writing this:
##
# A script to split simple, architectural geometry into convex pieces.
#
# This script makes use of Blender's built-in "Split Concave Faces" clean-up
# algorithm to break-up the faces of an object into convex pieces. The script
# attempts to identify all the edges that represent convex boundaries, and then
# it splits objects up along those edges. Each resulting piece is then made into
# a closed object by converting it into a convex hull.
#
# Be sure to select the object you wish the split into convex pieces before
# running the script.
#
# NOTE: This script is expecting to work with flat, reasonably clean geometry.
# For example, it is expected to be used when generating collision on the
# ceiling and walls of an architectural visualization project, but is not
# expected to perform well with round or n-gon geometry. Using
# create_closed_objects=True and matchup_degenerates=True, in particular, does
# not work well with objects that have openings inside.
#
# If this script doesn't work for you, a plug-in like V-HACD may work better.
# This script was written to handle cases V-HACD did not handle well -- flat,
# reasonably rectangular arch. vis. geometry.
#
# @author Guy Elsmore-Paddock <guy.paddock@gmail.com>
#

import bmesh
import bpy
import operator
import re

from itertools import combinations, count
from math import atan2, pi, radians, degrees
from mathutils import Vector

def split_into_convex_pieces(ob, create_closed_objects=True,
                             matchup_degenerates=True):
    object_name = ob.name

    deselect_all_objects()
    make_all_faces_convex(ob)

    eliminated_piece_names = \
        split_on_convex_boundaries(
            ob,
            create_closed_objects,
            matchup_degenerates
        )

    rename_pieces(object_name, eliminated_piece_names)

    # Deselect everything, for the convenience of the user.
    deselect_all_objects()

def make_all_faces_convex(ob):
    bpy.context.view_layer.objects.active = ob
    bpy.ops.object.mode_set(mode='EDIT')

    # This is what actually defines the new geometry -- Blender creates the
    # convex shapes we need to split by.
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.mesh.vert_connect_concave()
    bpy.ops.mesh.select_all(action='DESELECT')

##
# Splits an object into smaller pieces by its convex, planar edges.
#
# In an ideal world, we could just split the object by all the edges that are
# attached to -- and are co-planar with -- the faces of the object, since those
# edges are most likely to represent the convex boundaries of the object. But,
# Blender does not provide an easy way to find such edges.
#
# Instead, we use several heuristics to simulate this type of selection:
#   1. First, we select all the sharp edges of the object, since sharp edges are
#      only co-planar with one of the faces they connect with and are therefore
#      unlikely to represent convex boundary edges.
#   2. Second, we select all edges that are similar in angle to the sharp edges,
#      to catch any edges that are almost steep enough to be sharp edges.
#   3. Third, we invert the selection, which should (hopefully) cause all the
#      convex boundary edges we want to be selected.
#   4. Fourth, we seek out any sharp edges that connect with the convex boundary
#      edges, since we will need to split on these edges as well so that our
#      "cuts" go all the way around the object (e.g. if the convex boundary
#      edges lay on the top and bottom faces of an object, we need to select
#      sharp edges to connect the top and bottom edges on the left and right
#      sides so that each split piece is a complete shape instead of just
#      disconnected, detached planes).
#   4. Next, we split the object by all selected edges, which should result in
#      creation of each convex piece we seek.
#
def split_on_convex_boundaries(ob, create_closed_objects=True,
                               matchup_degenerates=True):
    bpy.ops.object.mode_set(mode='EDIT')

    select_convex_boundary_edges(ob)

    # Now perform an vertex + edge split along each selected edge, which should
    # result in the object being broken-up along each planar edge and connected
    # sharp edges (e.g. on corners).
    bpy.ops.mesh.edge_split(type='VERT')

    # Now, just break each loose part off into a separate object.
    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.mesh.separate(type='LOOSE')

    if create_closed_objects:
        # And then make each piece fully enclosed.
        return create_closed_shapes_from_pieces(ob, matchup_degenerates)
    else:
        return []

##
# Selects all edges that denote the boundaries of convex pieces.
#
# This is a multi-step process driven by heuristics:
#   1. First, we select all the sharp edges of the object, since sharp edges are
#      only co-planar with one of the faces they connect with and are therefore
#      unlikely to represent convex boundary edges.
#   2. Second, we select all edges that are similar in length to the sharp
#      edges, to catch any edges that are almost steep enough to be sharp edges.
#   3. Third, we invert the selection, which should (hopefully) cause all the
#      convex boundary edges we want to be selected.
#
def select_convex_boundary_edges(ob, max_edge_length_proportion=0.1):
    bpy.ops.object.mode_set(mode='EDIT')

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

    # Enter "Edge" select mode
    bpy.context.tool_settings.mesh_select_mode = [False, True, False]

    # Find all sharp edges and edges of similar length
    bpy.ops.mesh.select_all(action='DESELECT')
    bpy.ops.mesh.edges_select_sharp()
    bpy.ops.mesh.select_similar(type='LENGTH', threshold=0.01)

    # Invert the selection to find the convex boundary edges.
    bpy.ops.mesh.select_all(action='INVERT')

    bm.faces.ensure_lookup_table()
    bm.edges.ensure_lookup_table()

    edges_to_select = []
    max_edge_length = max(ob.dimensions) * max_edge_length_proportion

    for selected_edge in [e for e in bm.edges if e.select]:
        edge_bridges =\
            find_shortest_edge_bridges(
                selected_edge,
                max_edge_length=max_edge_length
            )

        for path in edge_bridges.values():
            for edge in path:
                edges_to_select.append(edge)

    # Select the edges after we pick which edges we *want* to select, to ensure
    # that we only base our decisions on the initial convex boundary edges.
    for edge in edges_to_select:
        edge.select = True

##
# Locate the shortest path of edges to connect already-selected edges.
#
# This is used to find the additional edges that must be selected for a cut
# along a convex boundary to create a complete, closed object shape.
#
# The max edge length argument can be provided to avoid trying to find
# connections between convex boundaries that are very far apart in the same
# object.
#
def find_shortest_edge_bridges(starting_edge, max_edge_length=None):
    edge_bridges = find_bridge_edges(starting_edge, max_edge_length)
    sorted_edge_bridges = sorted(edge_bridges, key=lambda eb: eb[0])
    edge_solutions = {}

    for edge_bridge in sorted_edge_bridges:
        path_distance, final_edge, path = edge_bridge

        # Skip edges we've already found a min-length path to
        if final_edge not in edge_solutions.keys():
            edge_solutions[final_edge] = path

    print(f"Shortest edge bridges for starting edge '{str(starting_edge.index)}':")

    if len(edge_solutions) > 0:
        print(
            "  - " +
            "\n  - ".join(map(
                lambda i: str(
                    (i[0].index, str(list(map(lambda e: e.index, i[1]))))
                ),
                edge_solutions.items()
            )))
    print("")
    print("")

    return edge_solutions

##
# Performs a recursive, depth-first search from a selected edge to other edges.
#
# This returns all possible paths -- and distances of those paths -- to traverse
# the mesh from the starting, selected edge to another selected edge. To avoid
# a lengthy search, the max_depth parameter controls how many levels of edges
# are searched.
#
# The result is an array of tuples, where each tuple contains the total distance
# of the path, the already-selected edge that the path was able to reach, and
# the list of edges that would need to be selected in order to reach that
# destination edge.
#
def find_bridge_edges(edge, max_edge_length=None, max_depth=3, current_depth=0,
                      path_distance=0, edge_path=None, seen_verts=None):
    if edge_path is None:
        edge_path = []

    if seen_verts is None:
        seen_verts = []

    # Don't bother searching edges we've seen
    if edge in edge_path:
        return []

    if (current_depth > 0):
        first_edge = edge_path[0]
        edge_length = edge.calc_length()

        # Don't bother searching edges along the same normal as the first edge.
        # We want our cuts to be along convex boundaries that are perpendicular.
        if have_common_face(first_edge, edge):
            return []

        if edge.select:
            return [(path_distance, edge, edge_path)]

        # Disqualify edges that are too long.
        if max_edge_length is not None and edge_length > max_edge_length:
            print(
                f"Disqualifying edge {edge.index} because length [{edge_length}] > [{max_edge_length}"
            )

            return []

    if current_depth == max_depth:
        return []

    new_edge_path = edge_path + [edge]
    bridges = []

    for edge_vert in edge.verts:
        # Don't bother searching vertices we've already seen (no backtracking).
        if edge_vert in seen_verts:
            continue

        new_seen_verts = seen_verts + [edge_vert]

        for linked_edge in edge_vert.link_edges:
            # Don't bother searching selected edges connected to the starting
            # edge, since that gets us nowhere.
            if linked_edge.select and current_depth == 0:
                continue

            edge_length = linked_edge.calc_length()

            found_bridge_edges = find_bridge_edges(
                edge=linked_edge,
                max_edge_length=max_edge_length,
                max_depth=max_depth,
                current_depth=current_depth + 1,
                path_distance=path_distance + edge_length,
                edge_path=new_edge_path,
                seen_verts=new_seen_verts
            )

            bridges.extend(found_bridge_edges)

    return bridges

def create_closed_shapes_from_pieces(ob, matchup_degenerates=True,
                                     min_volume=0.1):
    print("Converting each piece into a closed object...")

    degenerate_piece_names = []

    for piece in name_duplicates_of(ob):
        if not make_piece_convex(piece):
            degenerate_piece_names.append(piece.name)

    degenerate_count = len(degenerate_piece_names)

    print("")
    print(f"Total degenerate (flat) pieces: {degenerate_count}")
    print("")

    eliminated_piece_names = []

    if matchup_degenerates:
        if degenerate_count > 10:
            # TODO: Hopefully, some day, find a good deterministic way to
            # automatically match up any number of degenerate pieces using a
            # heuristic that generates sane geometry.
            print(
                "There are too many degenerates for reliable auto-matching, so "
                "it will not be performed. You will need to manually combine "
                "degenerate pieces.")
            print("")
        else:
            eliminated_piece_names.extend(
                matchup_degenerate_pieces(degenerate_piece_names, min_volume)
            )

            eliminated_piece_names.extend(
                eliminate_tiny_pieces(degenerate_piece_names, min_volume)
            )

    return eliminated_piece_names

def matchup_degenerate_pieces(degenerate_piece_names, min_volume=0.1):
    pieces_eliminated = []
    degenerate_volumes = find_degenerate_combos(degenerate_piece_names)

    print("Searching for a way to match-up degenerates into volumes...")

    for piece1_name, piece1_volumes in degenerate_volumes.items():
        # Skip pieces already joined with degenerate pieces we've processed
        if piece1_name not in degenerate_piece_names:
            continue

        piece1 = bpy.data.objects[piece1_name]

        piece1_volumes_asc = dict(
            sorted(
                piece1_volumes.items(),
                key=operator.itemgetter(1)
            )
        )

        piece2 = None

        for piece2_name, combo_volume in piece1_volumes_asc.items():
            # Skip pieces that would make a volume that's too small, or that
            # have been joined with degenerate pieces we've processed
            if combo_volume < min_volume or piece2_name not in degenerate_piece_names:
                continue
            else:
                piece2 = bpy.data.objects[piece2_name]
                break

        if piece2 is not None:
            degenerate_piece_names.remove(piece2.name)
            pieces_eliminated.append(piece2.name)

            print(
                f"  - Combining parallel degenerate '{piece1.name}' with "
                f"'{piece2.name}' to form complete mesh '{piece1.name}'."
            )

            bpy.ops.object.mode_set(mode='OBJECT')
            bpy.ops.object.select_all(action='DESELECT')

            bpy.context.view_layer.objects.active = piece1

            piece1.select_set(True)
            piece2.select_set(True)

            bpy.ops.object.join()

            make_piece_convex(piece1)

    return pieces_eliminated

def find_degenerate_combos(degenerate_piece_names):
    volumes = {}

    for piece_combo in combinations(degenerate_piece_names, 2):
        piece1_name, piece2_name = piece_combo
        piece1 = bpy.data.objects[piece1_name]
        piece2 = bpy.data.objects[piece2_name]

        if not volumes.get(piece1_name):
            volumes[piece1_name] = {}

        piece1_mesh = piece1.data
        piece1_bm = bmesh.new()
        piece1_bm.from_mesh(piece1_mesh)

        piece2_mesh = piece2.data
        piece2_bm = bmesh.new()
        piece2_bm.from_mesh(piece2_mesh)

        piece1_bm.faces.ensure_lookup_table()
        piece2_bm.faces.ensure_lookup_table()

        if (len(piece1_bm.faces) == 0) or (len(piece2_bm.faces) == 0):
            continue

        piece1_face = piece1_bm.faces[0]
        piece2_face = piece2_bm.faces[0]

        combo_angle_radians = piece1_face.normal.angle(piece2_face.normal)
        combo_angle_degrees = int(round(degrees(combo_angle_radians)))

        # We only combine faces that are parallel to each other
        if combo_angle_degrees in [0, 180]:
            combo_volume = convex_volume(piece1, piece2)

            volumes[piece1.name][piece2.name] = combo_volume

    return volumes

def eliminate_tiny_pieces(degenerate_piece_names, min_volume=0.1):
    eliminated_piece_names = []

    tiny_piece_names = [
        n for n in degenerate_piece_names
        if n not in eliminated_piece_names
           and convex_volume(bpy.data.objects.get(n)) < min_volume
    ]

    print("")
    print(f"Total remaining tiny pieces: {len(tiny_piece_names)}")

    # Delete tiny pieces that are too small to be useful
    for tiny_piece_name in tiny_piece_names:
        print(f"  - Eliminating tiny piece '{tiny_piece_name}'...")

        tiny_piece = bpy.data.objects[tiny_piece_name]

        bpy.data.objects.remove(tiny_piece, do_unlink=True)
        eliminated_piece_names.append(tiny_piece_name)

    print("")

    return eliminated_piece_names

def make_piece_convex(ob, min_volume=0.1):
    print(
        f"  - Attempting to make '{ob.name}' into a closed, convex "
        f"shape."
    )

    volume_before = convex_volume(ob)

    make_convex_hull(ob)

    volume_after = convex_volume(ob)
    volume_delta = abs(volume_after - volume_before)

    # If the volume of the piece is very small when we tried making it convex,
    # then it's degenerate -- it's a plane or something flat that we need to
    # remove.
    is_degenerate = (volume_after < min_volume)

    print(f"    - Volume before: {volume_before}")
    print(f"    - Volume after: {volume_after}")
    print(f"    - Volume delta: {volume_delta}")
    print(f"    - Is degenerate: {is_degenerate}")

    return not is_degenerate

def make_convex_hull(ob):
    deselect_all_objects()

    bpy.context.view_layer.objects.active = ob
    ob.select_set(True)

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

    bpy.ops.mesh.select_all(action='SELECT')
    bpy.ops.mesh.convex_hull()

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

    # Clean-up unnecessary edges
    bmesh.ops.dissolve_limit(
        bm,
        angle_limit=radians(5),
        verts=bm.verts,
        edges=bm.edges,
    )

    bpy.ops.object.mode_set(mode='OBJECT')
    bpy.ops.object.select_all(action='DESELECT')

def have_common_normal(e1, e2):
    e1_normals = map(lambda f: f.normal, e1.link_faces)
    e2_normals = map(lambda f: f.normal, e2.link_faces)

    common_normals = [n for n in e1_normals if n in e2_normals]

    return len(common_normals) > 0

def have_common_face(e1, e2):
    common_faces = [f for f in e1.link_faces if f in e2.link_faces]

    return len(common_faces) > 0

def convex_volume(*obs):
    meshes = []
    verts = []

    for ob in obs:
        mesh = ob.data
        bm = bmesh.new()

        bm.from_mesh(mesh)

        bm.verts.ensure_lookup_table()
        bm.edges.ensure_lookup_table()
        bm.faces.ensure_lookup_table()

        # Prevent early garbage collection.
        meshes.append(bm)

        geom = list(bm.verts) + list(bm.edges) + list(bm.faces)

        for g in geom:
            if hasattr(g, "verts"):
                verts.extend(v.co for v in g.verts)
            else:
                verts.append(g.co)

    return build_volume_from_verts(verts)

def build_volume_from_verts(verts):
    # Based on code from:
    # https://blender.stackexchange.com/questions/107357/how-to-find-if-geometry-linked-to-an-edge-is-coplanar
    origin = sum(verts, Vector((0, 0, 0))) / len(verts)
    bm = bmesh.new()

    for v in verts:
        bm.verts.new(v - origin)

    bmesh.ops.convex_hull(bm, input=bm.verts)

    return bm.calc_volume()

def deselect_all_objects():
    try:
        bpy.ops.object.mode_set(mode='OBJECT')
        bpy.ops.object.select_all(action='DESELECT')
    except:
        pass

def rename_pieces(object_name, name_skiplist=None):
    if name_skiplist is None:
        name_skiplist = []

    for duplicate_name, old_index_str, new_index in dupe_name_sequence(object_name, name_skiplist):
        piece = bpy.data.objects.get(duplicate_name)

        if not piece:
            break

        old_name = piece.name
        new_name = re.sub(fr"(?:01)?\.{old_index_str}$", f"{new_index:02d}", piece.name)

        if old_name != new_name:
            print(f"Renaming piece '{old_name}' to '{new_name}'.")
            piece.name = new_name

def name_duplicates_of(ob):
    duplicates = []

    for duplicate_name, _, _ in dupe_name_sequence(ob.name):
        piece = bpy.data.objects.get(duplicate_name)

        if not piece:
            break
        else:
            duplicates.append(piece)

    return duplicates

def dupe_name_sequence(base_name, skiplist=None):
    if skiplist is None:
        skiplist = []

    yield base_name, "", 1

    new_index = 1

    for old_name_index in count(start=1):
        old_index_str = f"{old_name_index:03d}"
        duplicate_name = f"{base_name}.{old_index_str}"

        if duplicate_name in skiplist:
            continue
        else:
            new_index = new_index + 1

            yield duplicate_name, old_index_str, new_index

split_into_convex_pieces(bpy.context.view_layer.objects.active)
print("Done!")

I added screenshots to the gist:
https://gist.github.com/GuyPaddock/e2420a0c54f6892c2c2f01556d6a4e14#gistcomment-3631462


Object in texture and material view appear black When i change from solid to texture and material view my object appears black, im in blender render engine with GLSL shading and Hemi added,

Here is my solid view,

when i change from solid to texture my object appears black,

the same happens to solid to material

and the same for texture painting mode.

Any ideas what might cause the problem?

You have a black image in the UV/Image editor that the object is linked to. For the material view, it is because you have that texture applied in the textures tab of the properties window.

"Solutions" (There isn't actually anything wrong)

In texture paint mode, you can paint onto that texture and change its color.

You can disable that texture to keep it from showing up in the material preview.

You can put a different texture on it. For changing texture mode's display, go to the UV/Image editor and with the object in edit mode (so you can see the UVs), select a different image.


How can I reuse a class between a few addons I have the following situation. I have a class (let's call it GeometryCalculator) with many functions which I would like to reuse between a few addons. How can I do it in a way that the GeometryCalculator is a part of each addon. If a user has 5 addons installed and then he uninstalls any of them the rest of addons can still use this common class. Should all addons have a copy of the GeometryCalculator class in their folder? Any ideas how to do it are welcome. Are there any guidelines how this should be tackled? Thanks in advance.

Inside your scripts folder you have addons and maybe addons_contrib and a modules folder.

The modules folder can added if it's not there and used to store files that you want to access from various add-ons. In this case I have a file which stores functions, but it could store classes (anything a .py file is used for).

Imagine the modules folder has a folder inside called 'some_name',

and some_name contains a python file called functions,

so the path is scripts/modules/some_name/functions.py . To import that module in an addon you write

from some_name import functions

Potentially this makes installing your add-on a little bit more involved for the average novice user, unless you write code that places the files in the modules folder automatically


Correctly combining a two layer material in cycles I am trying to create a material that has two physical layers. A thin top layer covering the second main body layer of the object, I have drawn a quick sketch of what I mean:

Light interacting with the material can

0) be reflected off its surface
1) be scattered by the top layer
2) be scattered by the lower layer
3) be scattered by both layers
4) be transmitted right through both layers.

My question is, how to combine these two layers. Say I have the properties of each layer set up in an individual shader, will a mix node give the correct results or do I need to combine them in a different manner?

This link might be helpful. It has a cycles material that has thin film interference. Here is a Wikipedia article on what thin-film interference is.

Excerpt:

  Thin-film interference is a natural phenomenon in which light waves
  reflected by the upper and lower boundaries of a thin film interfere
  with one another, either enhancing or reducing the reflected light.
  When the thickness of the film is an odd multiple of one
  quarter-wavelength of the light on it, the reflected waves from both
  surfaces interfere to cancel each other. Since the wave cannot be
  reflected, it is completely transmitted instead. When the thickness is
  a multiple of a half-wavelength of the light, the two reflected waves
  reinforce each other, increasing the reflection and reducing the
  transmission.

Here is the blender file download link. I think it can be applied to what you want. It puts a bit of "thickness" on your object. If you want it to be more dramatic/visible, let me know and I'll try to brainstorm another solution.


How to make changes to my vertex groups with python I need to mirror my weight paint from one side to the other. The mirror modifier isn't working for me because I have existing weight paint and groups for both sides. Unfortunately it's not feasible for me to manually copy and mirror each group like what has been done in a way suggested by another answer.

But it did inspire me to put myself into the position of not yet having the other side of groups yet. I tested this theory out by deleting my 'b__L' groups then using this script:

import bpy
obj = bpy.context.active_object

vg = obj.vertex_groups[:]

for g in vg:
    if not g.name.endswith('.L'):
        obj.vertex_groups.new(g.name+'.R')
        g.name = g.name+'.L'
    else:
        obj.vertex_groups.new(g.name.replace('.L', '.R'))

I added the modifier and this worked! So is there a way for the script above to be modified to:

DELETE all starts with 'b__L' groups
Ignore anything that doesn't start with 'b__R'
Add suffix '.R' to groups starting with 'b__R'

THEN

Duplicate the remaining 'b__R' groups (ignore others)
Replace title text of duplicates ('b__R' to 'b__L')
Change the suffix of duplicates, '.R' to '.L.'

THEN something to simply remove the suffixes finally for import to game.

I'm aware this means I will have to remember to always delete the left hand side of my model to use mirror w this. I have no experience with Python and I’ve tried making some changes myself and it’s just returning me errors. Appreciate any help.

Ultimately what was missing here was another look at the core issue. Only toggling a suffix on and off was not the answer. My groups had names that differed by one character to their counterpart and regardless of having the correct .L/.R suffix, meant they could not link with the mirror modifier. I did not need to delete the vertex groups relevant to the mesh side I had deleted as previously thought.

That being said, this is the code you're after if you need to achieve something similar.

In my case, remove the prefix that caused the group names to no longer be linked to their counterparts [4:]. Add the correct suffixes. Revert both of these changes when the script is run again for import back to game.

import bpy
active_object = bpy.context.active_object

vertex_groups = active_object.vertex_groups[:]

for vertex_group in vertex_groups:
    if vertex_group.name.endswith('.L'):
        vertex_group.name = 'b__L' + vertex_group.name.replace('.L', '')
        continue
    if vertex_group.name.endswith('.R'):
        vertex_group.name = 'b__R' + vertex_group.name.replace('.R', '')
        continue
    if (vertex_group.name.startswith('b__L') | vertex_group.name.startswith('b__R')):
        suffix = '.L' if vertex_group.name.startswith('b__L') else '.R'
        vertex_group.name = vertex_group.name[4:] + suffix

Thanks to my lovely sister for this script. Hope it can help someone else out there!


How do I export a video from Blender? I edited a video using Blender today and now I cannot export it. The video is fairly short I just need to make some cuts and add a couple of clips together. Do you guys know how I can export the video?

assuming you have the video all cut together in the video sequence editor pannel, open a properties panel and go the the render section (first button with a picture of a camera) there will be all your render setting whch you may personalize. For rendering 3D you would want to first export as PNG files and then post render bring the PNG sequence into the Video sequence editor render it into a final video file, but it sounds like you are trying to do a final video render in which case you go to the output section and choose FFMPEG video, Then under encoding > container you generally want to go with either Quicktime (.mov) or mpeg-4 (.mp4) and for the codec use H.264


Seams aren't separating in the UV viewport Hi so I created some seams along two identical meshes in the exact same spots. The seams are separating into clean islands like they're supposed to in one mesh but in the other it is not splitting them apart and I can't seam to figure out why. Any guidance?

First image is the desired separation, second is what I am getting.

I figured out the problem. I'm mirroring my mesh and apparently there was a face in between them that was interfering with the unwrapping. Deleted that, unwrapped it, and all is well now.


parrent armature bone to 3 vertecies of a different mesh How to parent armature bone in pose mode to 3 vertices of a mesh
Because parenting a single atmature bone through object mode works fine,
but trying to accomplish the same result witch constraints in pose mode seams to be broken.
weather by child of or copy transform :/

To strictly answer the question: Easiest thing is to parent an empty to the mesh vertices, then copy transforms from that empty.  (And probably limit scale, because vertex triangle parenting leaves you with some pretty gigantic skew problems that you probably don't want...)
Alternative, without any empty, is to copy location from a vertex group marked vertex, damped track another vertex group marked vertex, and then locked track a third vertex group marked vertex.  (Copy transform or rotation from vertices is never a good idea.)
However, most of the time people ask this question or one like it, they're trying to do something impossible.  They're trying to acquire this position and then use it to further deform the same mesh that they're "parented" to.  You can't do that-- it's a dependency loop.  The mesh depends on the bone which depends on the mesh which depends on....  The end goal of people asking this may be achievable, but this particular technique is not a means of achieving it (and the technique that works is likely to be complicated, possibly involving dummy copies of the mesh.)


Is it possible to export animation cache data from Maya and apply it to a look dev mesh in Blender? I'm currently setting up a pipeline at my company where our animators are animating our characters in Maya, and we want to use the powerful Toon Shader for Eevee in Blender to texture the look dev models of our characters. So ideally, the animation for a character would be cached out of Maya, and that cache data would then be applied to a look dev version of that same character in Blender. Then final renders would be done with Eevee and sent to compositing.

I'm use to keeping this whole process within Maya, usually using a geocache to transfer animation from a character's animation scene to their final look dev render scene. But going from Maya to Blender has been difficult.

It doesn't look like there are any native cache data sets that can be exported from an animated mesh in Maya to an identical mesh in Blender. Alembic seems to bring in the character's geo with the animation, but the scale is off and I have no way of applying the toon shaders to this model. And it looks like there's an 'add modifier' option for my look dev character, but it only takes 'MDD' or 'PC2' point caches. I can't get either of these cache data codes out of Maya, but I'm not sure if there are plugins that could help with that?

We would really love to integrate Blender into our pipeline, so any advice would be greatly appreciated from the community!

Also if it helps, our current setup is getting a 3D model of our character from artists that made said model in blender, then bringing the FBX into Maya to rig and animate. That same model from the artist in blender is what is being used for the look dev file and getting the shaders/lighting applied.

MEL example
Convert a maya cache into pc2 format. The maya cache is named pSphereShape1.xml and located in c:/test/  directory.
cacheFile -pc2 0 -pcf "c:/test/mypc2.pc2" -f "pSphereShape1" -dir "C:/test/";

Furher reading:
https://download.autodesk.com/us/maya/2010help/Commands/cacheFile.html
"/" slash direction is important! Also you need to use "keep vert order" function when you import your .obj file in Blender. Otherwise you mesh will crash blender (but it will still have the animation). Then turn on the modifier:


How complete is Blender? I am really a new guy to blender.My question is how much complete I am with Blender software alone (of course after getting necessary skills).I understand it depends upon what art I want to produce. However, on an average, if completeness is measured 100 %,what would be the contribution of blender in it? (based on your expeience) Also, I look forward for any suggestion to have must have companion with Blender if there are any (like Photoshop, illustrator etc.)

Purpose: Academic illustration (not movie/animation).

Blender is comprehensive enough to me. On my PC, I have over 25 FREE open alternatives and AFFORDABLES, none of your overpriced.

Avoid Adobe, if you wish to avoid auto-renewal subscription trap.

If you want softwares to use alongside Blender, see the list below.

MyPaint — free lightweight painting software. Great realistic pencils & gritty charcoals there. You will love MyPaint. Great for planning artworks.

Krita — for digital painting. Has vector and raster formats. Free alternative to Photoshop.

GIMP — free alternative to Photoshop.

Note: you can use universal format ORA for working back and forth in all three softwares above. ORA keeps all your layers intact.

Inkscape — wonderful free alternative to Adobe Illustrator.

Affinity Designer — affordable alternative to Adobe Illustrator. Has AI format, very useful for opening Illrustrator files or for converting SVG to AI and vice reverse.

Artrage — affordable software for digital painting. This has highly realistic oil brushes with textured bristle marks on paint. Makes realistic dirt, smudges, smears, etc.

Rebelle — affordable and unrivalled Software for highly reaslistic watercolour paints that bleed and drip.

Storyboarder — free open source software for storyboarding.

Moreover, you can actually upload Photoshop brushes into Krita, Gimp, and Artrage. You can obstain your PS brushes at DeviantArt and Brusheezy.

Add - I recently created this directory containing thumbnails of scrapbooks, some on open source softwares, if they are of any interest to you.
https://docs.google.com/presentation/d/1TyUpu4zylhDkEAKpepI9P6HkvtmonJG7zEBLsHgWCjI/


network render on blender 2.8 I am starting to get into blender on my laptop (3500U quad core 6GB of RAM) and was doing fine at some basic 3d modelling but then I tried to do an animation and the room started shaking with fan noise and my laptop started sweating and the estimated time was in the days category for only a 90 frame scene. but then I thought, I have literally loads of raspberry pi`s(7) and an old laptop, and thought about doing a network render farm. so I excitedly went onto YouTube and saw loads of tutorials but they where all for blender 2.79 and not blender 2.8. I was wondering if blender 2.8 supported network render or if blender killed it after blender 2.79.
thanks in advance, Tom

You maybe looking for a render plugin called Crowdrender  https://www.crowd-render.com/
snippet...
Making 3d rendering faster
Render Farms use lots of computers to accelerate rendering 3d animation or still images. You can use our software to build a render farm from your own hardware and reduce your render times. If you've never built a render farm before, read our article on what you can expect in terms of performance and cost.
Building a render farm is simple
All you need is two (or more) computers connected to the same wifi or ethernet network and you can be rendering faster, that's it. We designed our software to install in one click and not require technical know how to use or have complicated setups.
Supports Free and Open Source 3d tools
Our software supports rendering in Blender using the cycles engine, EEVEE rendering is also possible. Our add-on for is tightly integrated with Blender's latest 2.8x versions, allowing you to render and post process the results easily.


How to add 'desert dust' to object? This is the effect I want to achieve using the node editor:

This is what I've come up with so far:

Node editor setup:

I'm using Cycles render. Any help would be greatly appreciated! :)

Briefly, unpack how these things look and get the nodes to represent your intention.  You want the dust to accumulate on certain surfaces based on the forces being applied.
That said, seeing the dust in your example, I don't think this is easily achieveable with nodes and you might be better served painting a map or two by hand. The reason is that some of the mechanics in play are hard to express with nodes. For example "I want dust to accumulate on upward facing surfaces, but only on the back of the vehicle where it isn't blown off" is- by itself- at least 2 nodes. Then you have rough surfaces and smooth surfaces that violate that rule, some places where it sticks underneath, and so on.
I'd suggest studying the reference photos and painting a mask or two to help control where the dust appears in general.  Then, from there, use your noise maps and procedural generation to take it to the next level of detail.


transparent glass material refract the light I am trying to create a transparent glass for my windows. But somehow, I found out the glass is creating a refraction. My furniture is now refracted.
This how its look with windows and glass :
https://imgur.com/a/5hjb2y0
and this how its look without windows :
https://imgur.com/a/SYdDGtX
this is my glass formula :
https://imgur.com/a/LHdTjPt
Any idea what's wrong?
Thanks in advance.

Glass refracts light, this is what it usually does so there's nothing wrong about it. I don't know why you setup your glass like that, although a lot of people do it.
Most of the time I simply use a Glass BSDF with an IOR of 1.45 or a Principled BSDF with Transmission set to 1.
This should work if you use it correctly: do your windows have a thickness or are they just flat planes? Real windows have a thickness, if you have flat planes the refraction works as if your furniture was embedded inside a glass cube.
The setup you have there is mostly used by people because of balck artifacts they experience when using simple glass. To avoid this, go to the Render Properties > Light Paths > Max Bounces and set a high value for Transparent like 64 or more.
On your windows this shouldn't matter, but sometimes with more complex glass objects there are still dark parts that are unwanted. In this case you have to increase the max bounces for Glossy. To have an effect, the Total bounces have to increased to this value as well (this is not necessary for the Transparency bounces).
The last problem is, which might be another reason for your setup, that the glass still absorbs a lot of light and your room looks quite dark from the outside. Then of course you have to mix in a Transparency BSDF node to make the glass transparent or invisible for certain rays. Although in reality it is like that - sun and sky are really really bright light sources, so standing outside and taking a picture without over-exposure results in dark windows. Or if you want to see what's inside, the outside gets very very bright.
I'm sorry, that was quite a long answer to say: the strange refraction might come from simple planes as windows. But I can't tell from your screenshots.


How to get the current step number in volume render I need to get the current step number while rendering a volume object

the step used for sampling the volume :

something like in light path node " transparent depth , ray depth "

In short, no. This isn't currently exposed to the user.

The Transparent Depth value is a count of each transparent object, not distance traveled within it.

There is a Ray Depth output, but it's unclear what that does.

There is a Ray Length output, but it doesn't increase inside a volume. It's measured after the sample is taken.


In the latest 2.79 daily build, is it possible to convert the Bevel node's RGB normal maps to BW edge highlighters? On the left is the normal map generated by the Bevel node. On the right is an unbeveled cube with the Bevel node in action. I wish to convert this to a BW map where The edges/gradients are highlighted and the rest isn't. Does anyone know if this can be achieved with more nodes?

Final result and node setup:

After many tryouts with complicated setups it seems that this effect could be easily achieved by using Vector Math > Cross Product from Bevel > Normal output and Texture Coordinates > Normals.

After this the most efficient way is to use Color Ramp to change softness/sharpness of the edges.


How to use material index from Object Info node? Material Index:

This socket just outputs index pass set by user, just like simple Value node.

At first I thought it can play a role with material override, to see passes of real materials. Unfortunately, it doesn't work that way, as it also overrides all passes.

So, what is usecase for it?

Maybe a slightly obscure one.. I've used the Material Index for discriminating between materials hit by a forward-cast ray in OSL.

Examples here and here... it's one of the few attributes actually returned by a shader-cast ray, at the moment..


Changing rotation_mode from `YXZ` to `XYZ` without changing orientation? I am writing an importer in Blender that appends a object and then moves and rotates that object by some stored values I have created in Unity and saved to a Json file.

I found that in order to achieve the desired rotation I must first set my object to rotation_mode='YXZ' then I can create a new Vector with the order (X,Z,-Y) and my object will be rotated correctly:

degToRad = math.pi / 180

myobj.rotation_mode = 'YXZ'
jRot = json['rotation']
myobj.rotation_euler = Vector((jRot['x']*degToRad, jRot['z']*degToRad, -jRot['y']*degToRad ))

#Do something here to convert rotation back to XYZ...

myobj.rotation_mode = 'XYZ' #this causes the object to rotate unexpectedly

But when I attempt to revert the rotation_mode back to XYZ the object then rotates to some other orientation and I don't know how to prevent.

I am not sure if I am correctly changing handedness and up/forward with my above example but it seems to work ok.

I am curious if it is possible to change the rotation_mode from YXZ to XYZ without the orientation of my object changing?

Or is it possible to somehow apply a "converted" rotation so I can just keep the rotation_mode as XYZ?

Thanks for help!

You can use matrices, or quaternions. Unlike euler rotations, matrices or quaternions are comprised values which are order-independent.

There is no need to apply the "wrong" YXZ rotation to the object. You can store it in an mathutils.Euler object, the convert it to a mathutils.Matrix object and finally convert it back using a different rotation order.

import bpy
import mathutils

ob = bpy.context.active_object

x, y, z = 1, 2, 3

rot_YXZ = mathutils.Euler((x, y, z), 'YXZ')
rot_mat = rot_YXZ.to_matrix()
rot_XYZ = rot_mat.to_euler('XYZ')

ob.rotation_mode = 'XYZ'
ob.rotation_euler = rot_XYZ

The mathutils.Matrix.to_euler method takes the desired rotation order as the first argument.


Need help moving a set of cubes from one end to the other on x-axis with python scripting I am currently using blender 2.8 and I am trying to make a scripted animation where  I move a set of cubes from one end to the other on the x-axis with delays in between animations. This isn't really a real animation because I am not using the timeline. I am trying to create a real-time demo of a personal project.
If you look below I want to make the collection of cubes to travel to the right in delayed steps.
My current script is like this:

import time

collection = bpy.data.collections["layer_1_filters"].objects # I grouped the 5x5 cube grid to the collection called "layer_1_filters"

for steps in range(23): #steps to the right 23 times

    for cube in collection: # loop each cube

        cube.location[0] = cube.location[0] + 3 # move all the cubes to the right by 3 on the x-axis

    time.sleep(0.3) # pause 0.3 seconds before start moving right again.
                    #THIS HANGS and BREAKS BLENDER!

If I use time.sleep to delay the actions blender hangs then crashes, if I don't use some sort of delay the cubes would just immediately teleport to the end. How can I slove this?

Modal Timer operator

For the most part don't use time.sleep() in blender, as you have seen it doesn't work as expected.

Modify the template text editor > templates > python > operator modal timer

This line

self._timer = wm.event_timer_add(0.3, window=context.window)

creates a timer that fires a 'TIMER' event every 0.3 seconds.

Additionally I've added a count class property to only move the object that many times.

For example sake, only moves the context.object edit to suit

import bpy

class ModalTimerOperator(bpy.types.Operator):
    """Operator which runs its self from a timer"""
    bl_idname = "wm.modal_timer_operator"
    bl_label = "Modal Timer Operator"

    _timer = None
    count = 0

    def modal(self, context, event):
        if event.type in {'RIGHTMOUSE', 'ESC'}:
            self.cancel(context)
            return {'CANCELLED'}

        if event.type == 'TIMER' and self.count < 24:
            context.object.location.x += 3
            self.count += 1

        return {'PASS_THROUGH'}

    def execute(self, context):
        self.count = 0
        context.object.location.x = 0
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.3, window=context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        wm.event_timer_remove(self._timer)

Related:

Time delay when selecting objects in a python script!

How to run a python script at regular intervals?

Application Timers in 2.8

2.8 brings in a new timer class.

See my answer to Blender Python: Running multiple timers

  Move an object every second

import bpy
import functools

def move_obj(ob):
    ob.location.x += 0.1
    return 1

bpy.app.timers.register(functools.partial(move_obj, bpy.context.object), first_interval=1)


Help with proportional editing I am working on a tutorial in Blender where I am trying to model a frosted doughnut, but when I try using proportional editing on a single vertex, I move the whole mesh down. What do I do?

How big is your "proportional editing" brush. I find the Brush can get so big you can't see it in the viewport and it is affecting more than you want. Hold down "S" to "S"cale and scroll your mouse wheel to adjust the brush size


How Can I create wings with auto rig pro I've read the Auto rig pro documentation and I saw you can make wing rig with it from the limb options, but I tried I couldn't see any wing options there. Is there something I'm supposed to activate before then?

The problem was that my Auto Rig Pro was just outdated


Objects rendering well in Shading but not in Layout I'm newish to blender and have been trying some stuff for fun.
When in the Shading tab my two objects look like this

But when in Layout tab it looks like this

Is this because there is a lack of reflective surfaces in the layout workspace.
Here is file just in case
https://drive.google.com/drive/folders/1UDwYHPuKChcps8QVuM5N79nVDnfqTfBe?usp=sharing
Sorry for google drive link. Hope you guys can help, thanks

Lookdev (first image in the question) uses an environment lightning. This is not the case for rendered (second image) are you are supposed to choose the environment lightning yourself.

See the button with circles on them, on top right of the 3D view:

If you want to have the same lightning in 'rendered' viewport shading, you can use the same texture that can be found in your installation path: \Blender Foundation\Blender\2.80\datafiles\studiolights\world.

And set the world surface like this, where forest.exr is from the folder above:

Though, the texture will be visible in the background and this is not the case in look dev shading mode.

If you don't want it, there is two (at least?) possibilities:

Either set the film to "transparent":

and the background will be transparent...

Or enhance the world node setting, using another color of your choice when the light ray goes directly to the camera:


How can I make an object use it's animation action at a specific frame in Blender Python script? I have a python script that runs through Blender and I use it to procedurally animate two figures. I gave the models animation actions which work in Blender, but in the python script how do I tell the objects to add their action to the animation at specific frames?
scene = bpy.context.scene
scene.frame_set(10) #go to frame 10

#assign animation action to object
bpy.data.objects[0].animation_data.action = bpy.data.actions[0]

#play that animation Action on frame 10
help meeeee!

#render the video
bpy.ops.render.render(animation=True, write_still=True)

After help from Sighthound here is the final part of the script that now works, commented to explain why the other stuff needed to be added
#define starting frame
frame = bpy.data.scenes[0].frame_start = 1

#loop through arrays that hold information for which frame to play the action strips on
for data in Datas:
    frame = data['FRAME']

    #set current frame in blender to the frame called for in data array
    bpy.context.scene.frame_set(frame)

    #loop through keys that are nested in data array
    for key in data['KEYS']:

        #if data calls for action_01 to play on this frame...
        if(key == "action_01"):
            #add a new track
            track = bpy.context.active_object.animation_data.nla_tracks.new()

            #name the upcoming new strip with frame appended to keep it unique
            newStripName = 'action_01_' + str(frame)

            #add new strip to the new track with the correct action
            newStrip = track.strips.new(newStripName, frame, bpy.data.actions['action_01'])

            #must set the new strips extrapolation property to none so that all the strips will play in the animation instead of just the top one
            bpy.context.object.animation_data.nla_tracks[track.name].strips[newStrip.name].extrapolation = 'NOTHING'

I think Strips in the NLA are more suitable for your purpose than Actions.
Actions are containers for FCurves/keyframes.
Strips on the other hand are containers for Actions. Strips can be moved comfortably to the desired position on the timeline.
In the Action editor "Push down" you action as a new strip to the NLA editor. In the Nla editor you can drag the newly added strip anywhere on the timeline.
From here on you could toggle and move your strips on the timeline with Python.
Here's a quick sketch:
for track in bpy.context.active_object.animation_data.nla_tracks:
    for strip in track.strips:
        if strip.action == bpy.data.actions[0]:
            start_frame = 10
            strip.frame_start = start_frame
            strip.frame_end = (
                strip.action_frame_end - strip.action_frame_start + start_frame
            )

To add an action as a strip to the Nla, use:
start_frame = 10
strip = track.strips.new(bpy.data.actions[0].name, start_frame, bpy.data.actions[0])

Relevant API Docs:
https://docs.blender.org/api/current/bpy.types.NlaTrack.html?highlight=nlatrack#bpy.types.NlaTrack
https://docs.blender.org/api/current/bpy.types.NlaStrips.html#bpy.types.NlaStrips
https://docs.blender.org/api/current/bpy.types.NlaStrip.html#bpy.types.NlaStrip


How to Export the UV Map of a Cycled Hair Mesh? I'm currently working on a Sims 4 Custom Content Hair Mesh, and Here's what it looks like;

Anyway, I'm not trying to create a rendered image, I'm trying to create a UV Map so I can recolor the hair and Import the said colored texture into Sims 4 Studio...
I need help, for I am not that skilled in Blender, and I learned all of the mesh making process from a tutorial... If anyone at all can help me, that would be REALLY appreciated... And sadly, if I ask more questions, I'm sorry in advance... And BTW, I'm using Blender 2.70, for it is the only one that will work with S4S...
Please help me...
Thank you very much!

-SK289

u must select desired object (with a finished UV), then creat material and create image texture node in it, then in UV/Image editor creat image with resolution what you need and indicate this image in texture node, then select texture node (so that it is highlighted with a yellow frame) and in the render tab choose Bake -> BakeType: UV -> Press Bake Button


Set initial position and rotation of a bone (python) I'm making a script for import models from a game.
This game has inital position and rotation for each bone. If I load the model without rotating bones, it looks like this:

and if I load rotations it should be like this

Unfortunately, when I load the rotations, they change the model completely

The model should be in something like 'A' pose, like this:

This is the script:

    bpy.ops.object.mode_set(mode='EDIT')
    for h in range(boneCount):
        name      = f[h * 3 + 1][:-1]
        parent    = int(f[h * 3 + 2])
        coords    = f[h * 3 + 3][:-1].split(" ")

        bone      = skl.data.edit_bones.new(name)
        bone.head = mathutils.Vector([float(coords[0]), float(coords[1]), float(coords[2])])
        bone.tail = mathutils.Vector([float(coords[0]), float(coords[1])+0.01, float(coords[2])])

    bpy.ops.object.mode_set(mode='POSE')
    for h in range(boneCount):
        name      = f[h * 3 + 1][:-1]
        parent    = int(f[h * 3 + 2])
        coords    = f[h * 3 + 3][:-1].split(" ")

        rot       = mathutils.Quaternion([float(coords[6]), float(coords[3]), float(coords[4]), float(coords[5])])
        bone      = skl.data.edit_bones.get(name)
        bpy.context.object.pose.bones[h].rotation_quaternion = rot

    bpy.ops.object.mode_set(mode='EDIT')
    for h in range(boneCount):
        name      = f[h * 3 + 1][:-1]
        parent    = int(f[h * 3 + 2])
        coords    = f[h * 3 + 3][:-1].split(" ")
        bone      = skl.data.edit_bones.get(name)
        if parent != -1:
           bone.parent = skl.data.edit_bones[parent]

Rotations are quaternions.
Any ideas on how I can implement it?
Thanks

Thanks to batFINGER I've solved the issue.

bpy.ops.object.mode_set(mode='EDIT')
for h in range(boneCount):
    name        = f[h * 3 + 1][:-1]
    parent      = int(f[h * 3 + 2])
    coords      = f[h * 3 + 3][:-1].split(" ")
    # Converting quaternions values to matrix 4x4
    quat        = mathutils.Quaternion([float(coords[6]), float(coords[3]), float(coords[4]), float(coords[5])]).to_matrix().to_4x4()
    # Converting location values to matrix 4x4
    pos         = mathutils.Matrix.Translation([float(coords[0]), float(coords[1]), float(coords[2])])
    bone        = skl.data.edit_bones.new(name)
    bone.head   = mathutils.Vector([float(coords[0]), float(coords[1]), float(coords[2])])
    # To establish a length of bone
    bone.tail   = mathutils.Vector([float(coords[0]), float(coords[1])+0.001, float(coords[2])])
    # To apply the rotations
    bone.matrix = pos @ quat

With this script I'm able to load the original bones rotations in matrix. After bone declaration, must set the bone.head in order to place the bone. bone.tail is useful for boen size, else the bone will be larger. Now, in order to set the desired rotations without altering the object structure, you must set bone.matrix. Is better to use mathutils for creating correct matrix.
This is how it looks like
As you can see, bones are well rotated looking at the axes.


Scaling X Y Z precision? What is the precision of numbers in Blender? I am using Python scripting to adjust textures on a model, and need to define my own scaling algorithm. What precision?

If I put 0.0000000005 in the UI it ends up to 0.0, see animated GIF below.

32-bit Floating point representation offers approximately 7.2 decimal digits of precision (7.2 = 7 + 1/5), https://en.wikipedia.org/wiki/Floating_point

Blender limits that to 7 digits. Absolutely safe is to have your number's fraction and integral parts not exceeding 7 digits in total.

If your numbers exceed these limits, the rounding error may be seen, for example, if you set scale X for the default cube to 123456789, it will turn to 123456792.

There is no good way to observe floating point values in the UI, maybe you can print them with Python, as that will avoid Blender's UI conversions.

You can experiment with floating point rounding effects using my online C++ test http://cpp.sh/9pv2l


How to list all collections and their objects? I have a scene with 2 collections of 4 objects each. I am trying to get all collection names and their objects' names. Unfortunately, info panel nor python hints have not been helpful to find the command.
How do I get a list of all collections' names? How do I get a list of all objects' names in a given collection?

You can access all collections through bpy.data.collections. The objects within the collection (and child collections) are given by bpy.data.collections.all_objects. This is documented in the BlendData types and the documentation of the collection type.
A little example script for printing the content of the collections:
import bpy

for collection in bpy.data.collections:
   print(collection.name)
   for obj in collection.all_objects:
      print("obj: ", obj.name)


uniformly repeated image on objects with different dimensions I am looking to apply a tile image to various walls in a room.   I have the following result where the tiles seem to be distorted based on the object dimensions, so that (for example) six inch tiles do not appear as such on all surfaces.
Can I not reuse the same Material slot on all objects?
(note that while the captured image shows the planes to be contiguous, there are not contiguous -- the tile should always start at says the lower left corner)

Your problem isn't the material, it's the UV texture coordinates.
You may be better off with a different coordinate system, such as using Object coordinates and then changing the image mapping from Flat to Cube. You may have to further use a Vector Mapping node to scale the coordinates to make the tiles the right size overall. I recommend also creating an empty to use as the Object coordinates reference: If the material links to an object such as an empty (a single object to reference no matter what instanced the material), they will probably stay the same size relative to eachother. Just don't move the empty relative to those objects or the textures will move. If the objects will be moving in different directions, it's a no-go.
UVs may seem tedious, but are a hands-on concrete way to manage textures since they are attached directly to the mesh. To fix the UV: Scale the UV by the ratio of the surface over the image dimensions (i.e. if the image is square and the surface is a 1X2 rectangle, make the UV a 1X2 rectangle over the image). This may require extending the UV past the image bounds, or doing yet more math so that the tiles not only have the same aspect but also the same size.
Hope this helps :)


Suddenly, when grabbing I can only move objects in increments I don't know how it happened

I could only grab an object and move it in increments, as if I was holding "control"

Only grab/move/translate is affected, the other transformations like rotate and scale are normal.

If I hold control while grabbing, it'll inverse it and allow me to grab normally and smoothly.

Only the blender file I was in is affected, if I open other .blend files the problem won't be there.

Does anyone know how this happened and how to undo it?

You must have enabled the Snap tool by mistake. To fix it, just click on the magnet at the top of the viewport, or press ⇧ Shift + ↹ Tab


Making sure the faces are flat (for paper model) I am willing to use Blender for creating paper models. I am experimenting with this extension by Adam Dominec.

I am struggling to find way how to make sure that all the faces of my model are really flat. If all the faces of a model are triangular then whatever positions the vertices are moved to, all the faces are flat. However, it is easily possible to create a model that has quadrilateral faces that has one or more faces that are not flat. Here's a cube with one vertex moved one unit along X axis:

This clearly has one face non-flat. If I create a paper model from this (also, if I do UV unwrap), this non-flat face is one piece there. If I'd create a paper model, that face would be bent:

I'd like to create models with complex shape faces, not just triangles. Form complex models, say, animal head, that would be hard time to manually keep all the vertices aligned so that all faces are flat. Is there some way how to make sure my model has all faces flat, and fix, if they are not?

Thanks to comments from users @lemon and @m.ardito I can answer this myself now.

The distorted face fixing can be done in two steps:

Identify the distorted faces by activating the "mesh analysis" in the properties menu (N key), select type: distortion.
Flatten the distorted faces by selecting them (Edit mode, face select mode) and then going to Mesh menu > Clean up > Make planar faces.


How to prevent model from changing locations when going into dynamic topology mode? My character model rotates 90 degrees forward when I check dynamic topology. When exiting, the mesh goes back to it's original point with the exception of any vertices effected by sculpting, which remain 90 degrees forward.

After loading model.

After checking dynamic topology

After sculpting

When I load the .blend file, everything in the scene is selected.

Click on the model name 'Game_engine' in the outliner,
so it selects all the pieces of the model, and it's pose.

Click the skeleton icon in properties

click Rest Position

Alt-R to reset rotation.

Hope that helps, if not, you might try Autodesk's tool
to convert it to a more recent .fbx file.
http://usa.autodesk.com/adsk/servlet/pc/item?siteID=123112&id=22694909

As a side-note:
The scene seems to have 2 lamps and 2 cameras with the exact same position.
You might delete the extra .001 for each of those, if they aren't needed.


Why rendering black areas in cycles? Thanks for reading this.
When rendering I get black areas using Cycles. It happens with path tracing and also branch tracing. I tried to deactivate all different light sources but problem still persists. I have checked the geometry and that seems OK too.
Blender version 2.92
I have included the blend file in the following link.
https://drive.google.com/file/d/10B9H-IZI_4YW23S_orMQxuBohhXw6plb/view?usp=sharing
Thank you very much for helping out.
Best regards.

Your Normal and displacements are connected in the wrong way, you need a Normal map node and a displacement Node, also your normal image needs to have a Non color on the color space.


How can I infinitely loop a png sequnce in blender? Imagine I have a transparent png sequence of a bird flying that takes 1 second each loop.

How can I import the png sequence into blender, and loop it infinitely in a way that I can then drag the bird around the stage, so that combined with the loop animation it will appear to be flying in the background as a transparent flat png image?

I want to combine 2d and 3d art.

Name the images so that they have sequential numbers at the end of the name of the file.

Enable the images as planes addon.

In the add menu select add images as planes. Select the image sequence you want to import.

Click on the cogwheel icon on the right of the import menu to expand the options and select "Animate Image Sequence", set the material to Shadeless, Check Alpha and set it to Premultiplied. Enable Auto Refresh.

A plane with the image mapped to it will appear.

To make the image sequence loop endlessly enable Cyclic on the material.


How to make Image as Planes default to Diffuse shader instead of principled BSDF to in 2.8x In 2.79 adding an image as a plane had a simple Diffuse and Transparent shader node setup that reproduced the original image exactly however 2.83 has a different setup with an alpha input into the Principled BSDF shader that results in a hazy version of the image that would require additional modifications to replicate the original. In 2.79 replacing the Diffuse shader with Principled causes the same problem so using a straight Diffuse/Transparent node setup produces the better results without the need for extra adjustments.

Personally I edit images externally prior to adding to the scene rather than editing it within the scene. Is there a way to modify the default node setup to the way it was is 2.79 or add my own default?

On the window that opens when you add "import images as planes", there is a gear icon on the top right. Click on it and you will quite a few options open for you.  The shortcut, as you might have guessed already, is N

By default, the material is set to use the the BSD principled shader, but you can change it to Shadeless or Emit.

It is there that you can choose to use Alpha channel.

If you have a series of pictures you an choose to load all of them with a certain offset.

Lastly you can set the size and orientation.

For images that are already imported just change the principled shader for whatever it shader you like, and blend happily ever after.

EDIT:

Comparing the files from the previous version (2.79) of the addon it is quite easy to modify it to use a Diffuse shader.

Find the io_import_imates_as_planes.py file located in the /scripts/addons folder, open it in a text editor and replace all mention of Principled with Diffuse, make sure you match Upper and Lowercase correctly.

Then on lines 1013 and 1014 replace

     if self.shader == 'PRINCIPLED':
        core_shader = node_tree.nodes.new('ShaderNodeBsdfPrincipled')

with

   if self.shader == 'DIFFUSE':
        core_shader = node_tree.nodes.new('ShaderNodeBsdfDiffuse')

on line 1024

replace

    if self.use_transparency:
        if self.shader == 'PRINCIPLED':
            node_tree.links.new(core_shader.inputs[18], tex_image.outputs[1])
        else:
            bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')

            mix_shader = node_tree.nodes.new('ShaderNodeMixShader')
            node_tree.links.new(mix_shader.inputs[0], tex_image.outputs[1])
            node_tree.links.new(mix_shader.inputs[1], bsdf_transparent.outputs[0])
            node_tree.links.new(mix_shader.inputs[2], core_shader.outputs[0])
            core_shader = mix_shader

with

    if self.use_transparency:

        bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')
        bsdf_transparent = node_tree.nodes.new('ShaderNodeBsdfTransparent')

        mix_shader = node_tree.nodes.new('ShaderNodeMixShader')
        node_tree.links.new(mix_shader.inputs[0], tex_image.outputs[1])
        node_tree.links.new(mix_shader.inputs[1], bsdf_transparent.outputs[0])
        node_tree.links.new(mix_shader.inputs[2], core_shader.outputs[0])
        core_shader = mix_shader

Be aware of the indentation change, as you are getting rid of a conditional if and else statements.

Save the file and enable the addon again.

Here's a version of the modified file


animating on local axis This could be a duplicate question, if so I do apologize for wasting your time. I did some research, but couldn't find the answer for my question. That's why I posted it here.

I've modeled an Archimedes screw for my undergraduate project. Now i want to incline the setup at an angle of about 30 degrees and add a rotation for this crew. but when I animate the rotation after re positioning, it does not rotate the way I want. It rotates around the global axis, but i want it to rotate around like a screw. what should i do for this ?

I want my setup to look like this, but when i progrramme the keyframes it does not rotate according to it's new position ( i want it to rotate like a screw)

The simpler method to achieve the result is to animate the screw in vertical position, set the screw to be child of an empty and then tilt the empty 30 degrees (in this way you can even animate the tilt angle).


Stretchable pipe (for export to Unity) I'm trying to create a pipe that will bend and stretch, which I can then export to Unity. Bending I can do, but I have no idea how or if I could stretch. Is it possible? Thanks :)

What I'm aiming for is, in my Unity game, to be able to anchor one of the pipe to the ground, and then, as I drag the other end of the pipe away, it keeps stretching (increasing it's length).

So - Imaging holding a length of string with one end in each hand. In the dull reality we live in, the string wouldn't stretch, but in lovely virtual world, I'd like the string to extend in length as far as you pull it.

I think I have a handle on doing this in Unity, so if it's not simple for a Blender newb, I'll stick with what I know :)

I'm not entirely sure what you want, but you can make a "stretchable pipe" in Blender by using Hooks:

Add a cylinder with a fill type of Nothing
Add hook to one end by pressing CtrlH> Hook to new object:

This will add an empty with a Hook modifier that you can control the hooked vertices with.
Add a hook to the other end.

Now you can manipulate the newly created empties to stretch the "pipe".


When apply the mirror modifier when rigging a character I'm trying to make a character, rigged it, and now i'm adding shape-keys.

question: When is generally the appropriate time to apply the mirror modifier when making a character?

Thanks!

You'd better apply before rigging or shapekeying:

Rigging: It's always simpler to apply the Mirror modifier in my opinion, as you'll avoid bad surprises later on, even though you should be able to keep it in theory. If you keep it, as reminded here by Nathan, don't forget to put the Mirror modifier above the Armature modifier and enable its Vertex Groups option.
Shapekeys: You won't be able to apply the Mirror if you've created some shapekeys, so you'll have to recreate your shapekeys.


Is there a way to autorun a script? I was wondering if I could autorun my script as soon as I opened the blender file?

You could run the script from the command prompt or a batch file

blender blenderFile.blend --python myscript.py


Help with blender stains on texture I'm fairly new to blender and i am working on a project for a friend, and i finished almost everything, and now i am stuck at this. I can't make the stains go away, to make the inside of the shoe evenly colored.

Edit:
here is the file:

Your mesh is correct except several materials are assigned to it and one is displayed in Solid mode:

If I turn it orange:


What is the parameter order of a quaternion constructor? I cannot find the source code of mathutils, since it can be imported from python I assume it is a python source.

Essentially I want to find out whether a quaternion is created with W,X,Y,Z fields or X,Y,Z,W.

You can figure it out easily in the py console:

q = Quaternion((1,2,3,4))
print(q.w, q.x, q.y, q.z)
# -> 1.0 2.0 3.0 4.0, so it's WXYZ

The mathutils module is not python source btw., the Quaternion class is written in C and located here:

  BlenderSVN\blender\source\blender\python\mathutils\mathutils_Quaternion.c


Add rotation to a key frame I'm supporting blender 2.80, And I want to move to blender 2.81 - 2.83.
I encountered an issue while trying moving to blender 2.81
In my script for blender 2.80 I ran these command lines.
scn = bpy.context.scene
wd = scn.world
envnt = bpy.data.worlds[wd.name].node_tree
map_node = envnt.nodes['Mapping']
map_node.rotation.x = <x value of rotation>
map_node.rotation.y = <y value of rotation>
map_node.rotation.z = <z value of rotation>
map_node.keyframe_insert(data_path="rotation", frame=<frame number>)

But for blender 2.81 I needed to do some changes.
scn = bpy.context.scene
wd = scn.world
envnt = bpy.data.worlds[wd.name].node_tree
map_node = envnt.nodes['Mapping']
map_node.inputs['Rotation'].default_value.x = <x value of rotation>
map_node.inputs['Rotation'].default_value.y = <y value of rotation>
map_node.inputs['Rotation'].default_value.z = <z value of rotation>
map_node.keyframe_insert(data_path="rotation", frame=<frame number>) --> problem

Here I didn't manage to add a rotation to the key frame.
In the end I need to save a scene file that include the rotation to each key frame.
What is the right command here?

scn = bpy.context.scene
wd = scn.world
envnt = bpy.data.worlds[wd.name].node_tree
map_node = envnt.nodes['Mapping']
map_node.inputs['Rotation'].default_value.x = <x value of rotation>
map_node.inputs['Rotation'].default_value.y = <y value of rotation>
map_node.inputs['Rotation'].default_value.z = <z value of rotation>
map_node.inputs['Rotation'].keyframe_insert("default_value", frame=<frame number>)


Why those hexagons appears in sculpting mode Why those hexagons appears in sculpting mode?

I ran I to the exact same issue when following BlenderGuru's beginners' tutorial. I was confused and reloaded an old save. It turns out Andrew unhides his vertices at one point and forgets to show it. Try Alt + H before applying the modifiers and it should work

If you've already applied the modifiers go to sculpting and  press'Grab' (yellow one) and press shift while clicking the holes until they are all gone.

If that doesn't work then select the vertices with the hexagon holes and then click f (to create a face there) however this is really inefficient and makes your donut look bad


How to animate assembly of DNA bases? How to animate these DNA bases that are being added one by one .
How to assemble them?
Do we have to do this with keyframes only, or we have any faster method?

Youtube Video [Timestamp: 1:25]
TIME = 1:33 TO 2:00

Here is a way to do it, a bit tedious because you have a lot of duplications and NLA strips to move but it works.
Basically the method is to create 3 linked-duplicated bars, create an action for each one that makes it stick to the vertical bars, push these actions into the NLA, link-duplicate these 3 different bars and, in the NLA, move the strips so that it delays the animation for each one.

Create the path, create one vertical bar, give it a Follow Path constraint with the path as Target, click on Animate Path.
Link-duplicate the bar (AltD), in the Follow Path constraint change its Offset so that it's a bit in front of the first one. Repeat until you have a lot of bars.

Create a second bar, put it somewhere above the path, where it can't be seen by your camera at the beginning of its animation, animate it so that at one key moment it sticks to the vertical bar. Then create a last keyframe so that it keeps sticking to the vertical bar until the end of the animation, for this last part make sure that the animation is linear (in the Dope Sheet select the keyframes and press T > Linear)

In the Dope Sheet, press Push Down in order to push the animation into the NLA.
Link-duplicate this second bar, in the NLA, move the second bar's strip so that it sticks perfectly to another vertical bar:

Link-duplicate the bar, create a second animation in the Dope Sheet that makes it stick to the second vertical bar, push the action in the NLA:

Then same thing, link-duplicate this bar, in the NLA move the strip so that it makes it sticks to another vertical bar, and so on:


A difficulty using rigidbodies So basically i'm trying to do a ring attached to small chains...
However when i press Alt+A to animate, the "ring" detaches from the two bottom "chain"
Mass of "ring" = 30kg
Mass of each chain link = 4kg...
Scale are x= 2.376m
          y= 1.422m
      and z= 28.431
I learned the chain thingy from Blender Guru and he said something about the object being big...i'm not sure
Also the top 2 chains(left and right) have Active Rigidbodies but arent Dynamic, the rest is dynamic (even the ring)  Someone help pls...

here is my file:

thanks for the file, it was easy: it's the unapplied scale for all chain rings (even the bigger one). They all have some scale like 1.846...

applying each (with CTRLA then "scale"), it becomes 1.0 and it behaves well...


Python : Change cursor icon in my add on, every execution of my operator, I change my icon cursor. (see code)
I have to repeat these two lines of code in all operators or there is a solution to change icon when an operator is running?

def execute(self,context):
    bpy.context.window.cursor_set("WAIT")
    ....
    My code
    .....

    bpy.context.window.cursor_set("DEFAULT")
    return {'FINISHED'}

Using a decorator in an Operator class. Notice the repeating code is defined once in the decorator and any* function which you want to wrap that code around can be decorated with the @mouse_change

import bpy
import time

# declare the decorator
def mouse_change(func):
    def add_mouse_change(*args):
        bpy.context.window.cursor_set("WAIT")
        func(*args)
        bpy.context.window.cursor_set("DEFAULT")
    return add_mouse_change

class SimpleCBOperator(bpy.types.Operator):
    bl_idname = "node.some_callback_identifier"
    bl_label = "Short Name"

    fn_name = bpy.props.StringProperty(default='')

    @mouse_change
    def dispatch(self, context, type_op):

        if type_op == 'some_named_function':
            time.sleep( 5 )
            print(type_op)

        elif type_op == 'some_named_other_function':
            time.sleep( 5 )
            print(type_op)

    def execute(self, context):
        self.dispatch(context, self.fn_name)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.node.some_callback_identifier(fn_name='some_named_function')

*The way I wrote the decorator function won't let you decorate the execute function.

you would have less code, and arguably more understandable code, by dropping the decorator entirely and going with a dispatch-callback pattern..

class SimpleCBOperator(bpy.types.Operator):
    bl_idname = "node.some_callback_identifier"
    bl_label = "Short Name"

    fn_name = bpy.props.StringProperty(default='')

    def dispatch(self, context, type_op):
        cursor_set = bpy.context.window.cursor_set
        cursor_set("WAIT")

        if type_op == 'some_named_function':
            pass

        elif type_op == 'some_named_other_function':
            pass

        cursor_set("DEFAULT")

    def execute(self, context):
        self.dispatch(context, self.fn_name)
        return {'FINISHED'}

The drawback of using a single operator 'callback' with an internal dispatch, is that the tooltip wouldn't be unique per fn_name. These are at least a few options to look into.


How to fix this seam? I'm fairly new to Blender, this time it's giving me a strange seam running at weird angles to the mesh and I don't know where I went wrong or how to solve it
I also tried UV unwrapping it along all the relevant seems and that did not change anything, so I removed my original Unwrap and still it happens, even when the Texture Coordinate set to Object
Blend File:
https://pasteall.org/blend/0e0b55e3ca254b3d9c82037255315484

Gray sockets are for scalar (single e.g. 0.73 or 512.256) values, and blue sockets are for 3D vector values such as <0.0, 0.707, 0.707> or <5.1, 8.2, 3.3> (one for each axis).
Since Blender supports vector displacement, the Displacement socket is now a vector socket. When you link a scalar to a vector socket, the three vector components all receive the same value. For example, 0.618 would become <0.618, 0.618, 0.618> and -1 <-1, -1, -1>. This conversion from a scalar to a vector can only result in two directions along one axis, but normals can face in any direction. For example, a sphere's normals face away from the center in every direction.
The Displacement node can convert a scalar to a vector that can be used for displacement/bump by making use of the object's existing normals. It should give you the results that you're looking for.
Press ShftA, Vector (V), Displacement (D) to add one.


Laying curved bricks in a circle I want to recreate the brick layout in the well image below. Specifically, I want my bricks to perfectly mate end-to-end (in the image below, the bricks appear to be uniform size, each 1/8th the circumference of the well). I have attempted this in my blend file by creating the curved bricks using an array and curve modifier, and then repeating the pieces using an array modifier and rotating about an empty. My pieces are not uniformly separated and overlap in one spot (see the .blend file or the images below). Is there a way to achieve what i'm after using modifiers and Blender functions without perfectly measuring out the size of my pieces manually?

Reference image

A single one of my pieces

My pieces laid out in a circle, red circling the overlap of two pieces

Edit

I tried using BlendExchange to upload the file but the page kept giving an upload error. I have resorted to uploading to Google Drive instead.

I think you're complicating the operation, the 2 most basic ways to do it is with a Simple Deform modifier or with a Curve modifier.

With a Simple Deform modifier (easiest in my opinion):

Create your brick.
Give it an Array modifier with the count of brick you want, enable Merge and First Last.
Give it a Simple Deform modifier, choose the Bend mode, and an angle of 360°.
Your well will automatically be 8 bricks / 360°.
If you don't want the bricks to stick to each others, increase the Array Relative Offset value a bit and reduce the Simple Deform Angle (to adjust the first and last bricks).

With a Curve modifier:

Create your brick.
Create a curve. Put its origin somewhere on its circumference, put the brick at the same position as this point.
Give your brick an Array modifier with the count of brick you want, enable Merge and First Last.
Give it a Curve modifier. You will need to adjust the curve size to make the first and last brick stick to each other. When you scale, use shift to make it more precise.
If you don't want the bricks to stick to each others, increase the Array Relative Offset value a bit and scale the curve.


How can I change colors of grease pencil strokes drawn in 'vertex color' paint mode? If I have drawn grease pencil line strokes in 'material' paint mode, I can easily change colors of them by using base color button(marked with a white arrow in above picture).
But after I had drawn some line strokes in 'vertex color' paint mode by a way of trial, I realized that I don't know how to change colors of them.
Help me.

Change from Draw mode to Vertex Paint mode (top-left of the screen) and you'll be able to change the strokes colour.
But you won't be able to just change the colour of all strokes at once, like when using a material then editing it. You'll have to manually re-paint over each stroke with the new colour.


Is Blender right for me? - A photographer creating 3d renderings I am looking to replace photography with Photo realistic 3d Renderings.

In almost the same way and reason Ikea did. (http://www.pixatecreative.com/ikea-3d-rendering/).
They use 3DStudio Max and V-Ray to create their 3D renders. Would Blender be the cost effective equivalent? Scenes are not important, a simple product shot that would normally be taken in my photography studio. I want results to be equivalent to the image below.

I have time to learn and am quick at picking up new software, but DStudio Max and V-Ray are more problematic - in my head. I would like to learn the basics before I tell the boss I am overhauling all our images and replacing them with these, and this is where cost makes it easier to pitch and blender is a fair bit cheaper.

At Blender Conference 2015 Piotr Zgodziński gave a talk about this very topic: From photographer to 3d artist, a personal journey - Piotr Zgodziński. worth the 30 minutes.

I will try to answer the question where it can be done so objectively, but a simple yes / no is unrealistic. If you are going to get into 3d modelling and rendering, then it's a matter of learning a few different skills which are often specialized in industry. Whether you have time to learn the important subtleties of each will decide if it's a cost effective venture, because it will be judged by the end result.

It will take approximately the same amount of time regardless of what software package you finally decide to use. At the minimum you'll want a combination of these skills:

Modelling
Texturing / Materials
Lighting / Rendering

You probably intend to specialize on non animated objects and scenes (a chair with lights is a scene) and that means there's a lot that you don't need to learn to get stuff done. There's also a lot you can re-use between scenes that you only need to set up once (like a good virtual lighting stage, or materials) and then tweak depending on the project.

All these things can be outsourced and it's worth considering.

Modelling

Blender has superb modeling tools, definitely adequate for creating models for product rendering like furniture, fixtures, anything you might find in a home improvement store catalog. At its heart Blender is an Artistic package, not a CAD tool with ultra high precision needed for Civil engineering (and you won't need that for rendering anyway).

Texturing / Materials

Texturing: The core of this is UV unwrapping, which conceptually works the same over all 3d software, it's not traditionally an automated process. Making a UV map of your object is what lets you define (using seams) which surfaces are distinct from others.
Materials: The core here is the Node system, a modular approach to defining materials and how surfaces respond to light. It's similar for all node based software; you get a collection of nodes with a few parameters and you combine them into larger complex organizations. Just like + - / * % can be combined to describe just about any mathematical concept.

Lighting / Rendering

As a photographer you have an advantage here regarding the so called physically based render engines. Blender's own Cycles render engine is an option, but it's not the only one. We compiled a list of external renderers to choose from. You mentioned Chaos Group's V-Ray renderer, it's on that list too.

At a certain level of proficiency people (consumers) can't really tell if a product is rendered at all, or even if they can then only few people would have an easy time betting on which render engine was used.

Some packages have comprehensive specialized training, Blender is no exception: Search and you will find Free or Paid training.

See our resources page for links intended to help learn Blender.


How to change the direction in which a menu is displayed? I don't know if this is possible... but I want to change the direction  in which a menu is diplayed

I search in API and I don't find anything... some ideas??

Looking at your picture, I think you rather mean that you want to change on which side of the 'menu starter' widget the menu is displayed (left vs right)? A menu “direction” would rather refer to order in which its items are displayed (top to bottom or vice-versa)

In any case, side or direction, you cannot control this from py script, this is handled by internal UI code (based on several factors like type of menu, position, available area on top/bottom/left/right, etc.).


How do I use refraction to make underwater shadows look better? I'm using Cycles.

I've been messing around, trying to have fun with Minecraft Blocks in Blender. I also made water, using just a square - one face of a cube. I tried mixing transparent with diffuse BSDF, everything looks really cool, but I would like to have some refraction cause the shadows look unnatural.

I'll attach a photo so you know what I mean.

I don't know what to do. When I use Glass BSDF it looks like it's almost black.

Cheers.

Give the plane a single Refraction BSDF shader with blue color and IOR > 1.
Under Properties > Object > Ray Visibility uncheck shadow so the water does not produce shadow (that's why its almost black)


Is there any difference in mesh generated by Bool Tool addon vs default Boolean modifier? Let's imaging that I have two meshes and I want union/diff/intersect them. Probably the default way to do that is to apply a Boolean modifier. The other way is to use the Bool Tool addon. Will these two approaches always generate the same output mesh (if I apply modifiers)?

I don't think it makes any difference, BoolTool is just an addon that makes booleans easier to use, for example it makes the boolean object transparent without the need to go into its display options. Apart from that it creates a classic Boolean modifier.


How can I find out what kind of relationship between a parent bone and the child, using python? How do I know the type of parent that has a bone, connected or offset? using Python in blender 2.8

Edit mode, relations panel

As is displayed in the relations panel of a bone in edit mode, can look at the properties in the python console.
Simple armatrure, active and in edit mode. List each edit bones EditBone.parent and EditBone.use_connect properties.
>>> C.object
bpy.data.objects['Armature']

>>> bpy.ops.object.mode_set(mode='EDIT')
{'FINISHED'}

>>> for b in C.object.data.edit_bones:
...     b.name, b.parent, b.use_connect
...
('Bone.002', None, False)
('Bone', bpy.data.armatures['Armature']...EditBone, False)
('Bone.001', bpy.data.armatures['Armature']...EditBone, True)

Pose / Object Mode
or similarly in Object or pose mode by looking at the armature objects  pose bones collection.
>>> for pb in C.object.pose.bones:
...     pb.name, getattr(pb.parent, "name", None), pb.bone.use_connect
...
('Bone', 'Bone.002', False)
('Bone.002', None, False)
('Bone.001', 'Bone', True)

>>>


Batch Selected to active Baking I have to bake several objects, in combined type. Each (lowpoly) object take baking information from a selection of another (highpoly) object(s). Here is my bake panel config:

My problem is that i can only bake one object, wait for the texture to be baked, save it, then redo the task for the next object (with a new selection). So i can't set a list of render task to calculate by night 'cause it's not automate.

So :

is there a plugin (free or not) which can do that ? (I buyed the baketool plugin which is very great, but don't support selected to active option [edit] finally, it can, see answer below [/edit])
can this task be send to network render ? (network renderer addon, render.st, etc)
i don't know python at all but i have already write little script in another programming language : do you think it will be a pain to script a task like this ?

BakeTool addon can handle it !

There is a mode that i haven't try yet, which is the Atlas mode (default is individual).
The support of baketool answer me :

  There’s a “Target” option in the Atlas Mode. It works as the “Selected
  to active”. On this mode all the objects in the Object List are used
  as sources and the target is the “actived” one to be baked. See that
  in this case the target need a valid non overlapped UV.

I definitively love this addon, anyone who use blender and make realtime 3d should have it :)


Can't identify where this lip is in hiding in this model This is somewhat related to my previous question here, however this question is related to the partial invisibility of one of the sides when exported and loaded into ThreeJS.

In there it looks like this:

Notice the pink lip at the top of this side. In Blender I've extended the red side to the top of the bag so it should cover whatever this pink lip is - the problem is I don't know where it's coming from.

Based on the "Edit Mode" view there are only two sides here, both are the same height and width & both are facing the same direction (outside). I've also recalculated the normals after I flipped the directions but I still see this pink lip. Why?

Here's the Blender view with the two sides hidden:

Any advice on this would be good.

P.S. It has also been suggested that this can be caused by not using a THREE.DoubleSide but I am using that as the material so this shouldn't be the issue:

EDIT
Link to the uploaded bag:

Probably not (yet) an answer, but at least I can show something that seems weird in your model:

You have some different faces for interior and exterior sides of your bag, but their normals are all directed outwards, instead of being as usual, ie: I expected the exterior face normal pointing outside, and the interior face normal pointing inside the bag.

It seems there are many face normals set like this, it seems a bit weird imho.

I will try to learn Threejs basic concepts to experiment (never used before, but interesting) but I would try before making this mesh look better in Blender before...

edit: imho, this mesh has many problems (many of them clearly found by the 3d print addon mesh checker, or the mesh analysis tool, btw) which can confuse an external engine: face distortion (non planar) face overlaps, and others...


Blender 2.8 - Objects Are In Different Position -- Rendered EEVEE View To Cycles View I have a plane for an object that has texture material for a street. When viewing render in EEVEE viewport the plane shows different position and when I switch to cycles my other objects as well as the plane are also in wrong positions.

I'm not sure if this is a Beta 2.8 bug or if it's something I've done to cause it? The way it appears in EEVEE viewport is also the way it appears in solid or lookdev modes. How to fix? Hope someone can help. Thank you!

I have no modifiers on the plane or other objects. Blender version is: 2.80 (sub 39)

Found the solution! It was the displacement node that was causing it. I used the ctrl+shift+t using node wrangler to add the Principled Textured Setup automatically to the plane.

I don't know if this is a bug or not with cycles in Blender 2.8 Beta, but after disconnecting the displacement node it works perfectly now.

Hope this helps someone else if they have the same problem.


What does the Term Ragdoll mean? I wonder what the term Ragdoll in BRIK - Blender Ragdoll Implementation Kit means.

Wikipedia defines: "The Ragdoll is a cat breed with blue eyes and a distinct colorpoint coat."

Apart from the article you linked to, rag doll physics refers to the ability of a character in a video game or simulation to be able to react to falling over or being hit in a more dynamic way.

Rather than having to create specific animations for falling you could let the character fall and determine how it moves based on how it's limbs collide with each other or the ground and how they drag each other (as long as a correct hierarchical skeleton is present) when a force is applied.

These are calculated on-the-fly in the game engine when the game is run rather than having been predefined beforehand (though they could have been limited to only have a certain amount of effect or be set to mix with a key framed animation).

The addon appears to help with the setting up of the collision boxes and game logic for the limbs that are necessary for accurate collisions.

The term rag doll is used because as the character or object falls it may have the appearance of a doll as it loses stiffness and collapses.


Blender 2.8 GUI lag when rendering (F12 & viewport render preview) So I have a laptop with 2 GPUs: an Intel HD 520 and a Geforce 940MX.

In the case of 2.79, if I had set Blender to run on the nVidia GPU in the NV control panel, there was a horrible GUI lag when there was rendering in progress using Cycles. All GUI elements took 2-3 seconds to react to mouse hover and mouse clicks. This is completely normal, of course, because the GPU that is used to render the GUI is also being used to render the image in Cycles. And of course with CPU rendering, this GUI lag didn't happen.

If I had set 2.79 to use the Integrated Intel HD GPU, there was no GUI lag because only Cycles render engine used the nVidia GPU and the rest of Blender used the Intel HD GPU.

Now, in 2.80 I am having the same issue, but this time, configuring in the NV control panel to run Blender on the Intel GPU doesn't help. The GUI still lags like hell, and it's almost unusable because I can't make fast changes, tinker with materials etc. while it's rendering.
(In 2.80 CPU rendering still works fine as expected.)

Same thing with GPU and CPU+GPU rendering (GPU Compute).
I have Geforce 436.30 drivers (most recent).
940MX is set to 'Maximum Performance' in NV Control Panel, other settings are default.
Windows 10 v1903.
Blender 2.80 most recent stable version.

Was there a change in how the GUI gets rendered in 2.8 or something? If anyone can help, I would really appreciate.

As a workaround, I am now using Blender 2.80 on a Kubuntu 18.04.3 system. The interface, while not perfect, works much smoother than on Windows (while rendering viewport view).

Since the nVidia driver doesn't get loaded on Kubuntu if the Intel GPU is selected (sudo prime-select intel), I am forced to use the nVidia GPU as primary, and so Blender uses it for both rendering of interface and rendering in Cycles. But this is still so much smoother than on Windows 10. The GUI elements react quickly to mouse interactions.