Fail to join faces with python I would like to join two faces which are in the same mesh by using bmesh.utils.face_join(faces, remove=True), and the details from blender 2.78c  API documentation show:

Firstly, I had a square plane whose vertices are((-1, -1, 0), (1, -1, 0), (1, 1, 0), (-1, 1, 0))

Secondly, I used the following codes to add a triangle plane whose vertices are ((0, 0, 0), (2, 2, 0), (2, -2, 0)) to the mesh containing the square plane.

And then joined the square plane and the triangle plane together.

import bpy
import bmesh
from mathutils import Vector

# Setting scene and camera
scene = bpy.context.scene

# All objects in Scene
objects_in_scene = scene.objects
# get the square plane
for obj in objects_in_scene:
    if (hasattr(obj.data, "vertices")):
        squareObj = obj
        break

# vertices of the triangle plane
verts2 = [(0, 0, 0), (2, 2, 0), (2, -2, 0)]
# add vertices
squareObj.data.vertices.add(3)
squareObj.data.vertices[-3].co = verts2[0]
squareObj.data.vertices[-2].co = verts2[1]
squareObj.data.vertices[-1].co = verts2[2]

# change mode to editmode
bpy.ops.object.mode_set(mode='EDIT')
bm = bmesh.from_edit_mesh(squareObj.data)

# add the triangle face
bm.verts.ensure_lookup_table()
set_of_verts = set(bm.verts[i] for i in range(4,7))
bm.faces.new(set_of_verts)

# update the bmesh
bmesh.update_edit_mesh(squareObj.data)

# join the two faces and print the new face
print(bmesh.utils.face_join(bm.faces, remove=True))

However, I got the error message bellow:

  TypeError: face_join() takes no keyword arguments

I modified the codes in the end line and use print(bmesh.utils.face_join(bm.faces)) instead.

The script could run but I got feedback, "None", which meant failure according to blender API documentation.

In fact, I am trying to merge two faces into one face with python like this.

I found this operation in blender 2.78c API documentation and tried it.

Please tell me if you have any suggestion about why can't use bmesh.utils.face_join(faces) and bmesh.utils.face_join(faces, remove=True), or how to merge two faces into one face with python.

Thank you in advanced.

okay so here is the information I can give you:

bmesh.utils.face_join(faces, remove=True) only works (in my tests) if the faces you provide are actually connected by an edge. If there is any other face involved that is not connected, the function will fail. This is the problem you are experiencing

therefore you need to programmatically select linked faces. (see 3.)

The indexes for the vertices are not guaranteed to be the same indexes. So range(4, 7) in your code in bmesh does not necessarily give you the same vertices you added earlier to the mesh.

I suggest, you add the face the same way you add the vertices, to the mesh datablock. Or, better, you should add the vertices to the bmesh like this:

v1 = bm.verts.new((2.0, 2.0, 2.0))
v2 = bm.verts.new((-2.0, 2.0, 2.0))
v3 = bm.verts.new((-2.0, -2.0, 2.0))

new_face = bm.faces.new((v1, v2, v3))

Edit: your new face might actually not share an edge with the existing faces. you should check that probably

Now that you have your face properly set up, you can try to feed linked faces into the bmesh.utils.face_join(linked_faces)

this is a function i wrote to get linked faces:

def get_linked_faces(f):

    if f.tag:
        return []

    f_linked = [f]
    f.tag = True
    # Select edges that link two faces
    edges = [e for e in f.edges if len(e.link_faces) == 2]
    for e in edges:
        faces = [elem for elem in e.link_faces if not elem.tag]

        if not len(faces) == 0:
            for elem in faces:
                f_linked.extend(get_linked_faces(elem))

    return f_linked

you will get an array of linked face groups:

f_link_map = []
for face in bm.faces:
    if not face.tag:
        linked_faces = get_linked_faces(face)
        f_link_map.append(linked_faces)

in the end of your operations it's also good practise to add

bm.free()

i hope that helps you. it took me quite a while to find out what the problem is in your case. also sorry, python formatting is quite an annoyance.


Texture Baking creates Stripes When I try to bake this texture, I am getting stripes on the image.
The object is just a plane with one side extruded then scaled on the z axis.

Link to the .blend file:

Looks like the texture coordinates are very small, please check the UV space on your object. If it doesn´t have one, then you can also try switching from GPU to CPU render to bake.


Can't Mirror Bone Roll When X-axis Mirror is turned on, bones snap to other side & overlap I have the left half of an armature, all properly named with prefixes. With both 3D cursor and Pivot pint in center, I mirror my armature using ctrl-m, x. I flip the names correctly. Then I invert my selection, to select the original half of the armature, and then turn on x-axis mirror. Here is a screenshot of my mirrored, and name-flipped armature:

Here, I press ctrl-r to rotate bone roll. In many youtube tutorials, this forces the mirrored side to match the original side's bone roll exactly. Unfortunately for me, all it does is snap my mirrored side over to my original side. I do not have snapping turned on, it is off. What can I do to precisely mirror both side's positions and bone rolls? Below is a screenshot of what happens when I press ctrl-r:

I cannot be the only one who's had this problem?

For anyone who's also had this problem: you need to apply scale and rotation to your armature in object mode. Once you apply these, then go into edit mode and mirror your armature. X-axis mirror should then perfectly match the bone rolls if you press ctrl-r and press enter without moving the mouse.


Is it possible to change viewport draw mode when navigating? I'd like to write a script to automate viewport draw mode switching when navigating the viewport.  Could this be done with, say, a modal operator? I haven't written any modal operators before, so before I go all Don Quixote on this thing, I'd like to know if this is even possible.

So, can view3d.rotate(), view3d.move(), etc., be intercepted in such a way as to change the viewport to bounding box draw mode automatically whenever the viewport is being navigated?

Also, I've looked at the documentation on modal operators and I couldn't really understand it.  Maybe someone could help me understand the functions and how they work together?

Switch shading mode while navigating the 3D View

import bpy

class VIEW3D_OT_View_box_orbit(bpy.types.Operator):
    """Switch shading mode while navigating the 3D View"""
    bl_idname = "view3d.navigate_shade_switch"
    bl_label = "Navigating Toggled Shading"

    nav_mode = bpy.props.EnumProperty(name = "Navigation", items=[
        ("rotate", "Rotate", "Rotate the view"),
        ("move", "Move", "Move the view"),
        ("zoom", "Zoom", "Zoom in/out in the view"),
        ("dolly", "Dolly", "Dolly in/out in the view"),
        ("fly", "Fly", "Interactively fly around the scene"),
    ])
    shade_mode = bpy.props.EnumProperty(name = "Shading", items=[
        ("BOUNDBOX", "Bounding Box", "Display the object's local bounding boxes only", "BBOX", 1),
        ("WIREFRAME", "Wireframe", "Display the object as wire edges", "WIRE", 2),
        ("SOLID", "Solid", "Display the object solid, lit with default OpenGL lights", "SOLID", 3),
        ("TEXTURED", "Textured", "Display the object solid, with a texture", "POTATO", 4),
        ("MATERIAL", "Material", "Display objects solid, with GLSL material", "MATERIAL", 5),
        ("RENDERED", "Rendered", "Display render preview", "SMOOTH", 6),
    ])

    def modal(self, context, event):
        if not hasattr(self, "navigating"):
            self.navigating = True
            getattr(bpy.ops.view3d, self.nav_mode)("INVOKE_DEFAULT")
            return {"RUNNING_MODAL"}
        elif event.type == "TIMER":
            return {"RUNNING_MODAL"}
        context.space_data.viewport_shade = self.shading
        return {"FINISHED"}

    def invoke(self, context, event):
        v3d = context.space_data
        if v3d.type == "VIEW_3D":
            self.shading = v3d.viewport_shade
            try:
                v3d.viewport_shade = self.shade_mode
            except TypeError:
                pass # Shading mode not supported.
            context.window_manager.modal_handler_add(self)
            return {"RUNNING_MODAL"}
        return {"CANCELLED"}

bpy.utils.register_class(VIEW3D_OT_View_box_orbit)


Highlight an item in a UIList I have a UIList in which I list materials to which I have attached an additional EnumProperty.

My goal is to highlight items in this UIList based on this EnumProperty by changing their background color. Is this possible?

I guess something like

if item.my_enum == "target_value":
    #I guess here i have to use something instead of layout.prop()?

in the draw_item() function is necessary?

You can't change the colors of items in the UI-List, arbitrarily.

You can however have an "active" property, which is an index that defines the active item in the UI list (as is used for vertex groups, uv layers... etc).

See the UI List template in the text editor.


Python 2.8 - eliminating shadow by adding emission shader to background plane/image In Blender 2.8, I have an image/plane ("sky") serving as a background that shows an unwanted shadow from an object in the foreground.  Manually, I can eliminate the unwanted shadow on the background 'Sky' by changing the "Diffuse BSDF" shader to "Emission."

I would like to do this in Python, but my code doesn't produce the desired result.  Instead, the entire background image goes either gray or purple depending on which lines are executing.  I have noted where the code starts to create unwanted results.

Any suggestions would be much appreciated.  Thanks in advance!

bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Sky'].select_set(True)
obj=bpy.data.objects['Sky']
skymaterial = bpy.data.materials.new('SkyMat')
obj.active_material = skymaterial  #UNWANTED RESULTS START HERE
skymaterial.use_nodes = True
nodes = skymaterial.node_tree.nodes
nodes.clear()
node_emission = nodes.new(type='ShaderNodeEmission')

I suggest that you learn how to do this manually first.

To create any material you will need a material output and link the emissive shader to that.
Use the Shader Editor to review your result.

import bpy

bpy.ops.object.select_all(action='DESELECT')
bpy.data.objects['Sky'].select_set(True)

obj = bpy.data.objects['Sky']

skymaterial = bpy.data.materials.new('SkyMat')
obj.active_material = skymaterial  #UNWANTED RESULTS START HERE
skymaterial.use_nodes = True
nodes = skymaterial.node_tree.nodes
nodes.clear()

# Create needed Nodes
nodeOut = nodes.new(type='ShaderNodeOutputMaterial')
nodeEmission = nodes.new(type='ShaderNodeEmission')
nodeTexture = nodes.new(type='ShaderNodeTexImage')

# Link them together
links = skymaterial.node_tree.links
linkOut = links.new(nodeEmission.outputs[0], nodeOut.inputs[0])
linkTexture = links.new(nodeTexture.outputs[0], nodeEmission.inputs[0])

# Configure Texture node
img = bpy.data.images.load('//test.png')
img.name = 'Test'
nodeTexture.image = img


How to build Blender with edited blender_icons? SVG

If I do changes on SVG file located in ~/blender-build/blender/release/datafiles folder, save it and run commands

cd ~/blender-build/blender
make icons

it ends with

FileNotFoundError: [Errno 2] No such file or directory: 'blender': 'blender'
make: *** [icons] Error 1

Wiki has a note which I don't understand: "... both inkscape and blender must be in the system PATH for this command to execute properly."
Official Blender build and Inkscape are located in /Applications folder, but only Blender arised as error.

What is that system PATH?
How can I recognise if PATHs are set right?
(how they should looks like?)

Blender uses uncompress bitmaps for the icons, which are generated from the svg with a python script which depends on inkscape and blender. See this for details.

The basic workflow should be something like:

Edit svg
Run the python script in

blender/release/datafiles/blender_icons_update.py

If you are on linux, you can also run make icons instead.
Compile


Custom mouse pointer slows the game down I have implemented a custom mouse pointer in a separate scene. It mostly works fine as a mouse pointer, however when it is used as a overlay scene for my main game world, the logic shoots up to around 180-300ms when it hovers over the objects in the scene, however, goes down to a normal 1-4ms when it is pointed at the sky.
Any ideas of how i can decrease this logic use so the frame-rate doesn't suffer?

Here is the logic setup and the simple python script (i'm still very new to python):

Some things I found:

You should be more carefully with the usage of [True Level Triggering]

Just by deactivating [True Level Triggering] at Sensor "Always" of object Camera.001 the logic time improved from 5 ms to 0.05 ms.

Analysing the Game scene

Your scene has quite a lot of objects. I ran my analyser to get some information from it's setup:

Keyboard Listeners (Sensors):

----------------------------------------------------------
purpose <keys> by scene.gameObject (purpose = sensor name)
----------------------------------------------------------
a                           <a>             by World.Arrow.007
d                           <d>             by World.Arrow.007
a                           <a>             by World.Arrow.003
d                           <d>             by World.Arrow.003
a                           <a>             by World.Arrow.002
d                           <d>             by World.Arrow.002
w                           <w>             by World.Movement
shift                       <LEFTSHIFTKEY>  by World.Movement
a                           <a>             by World.Movement
d                           <d>             by World.Movement
s                           <s>             by World.Movement
space                       < >             by World.Movement
w.001                       <w>             by World.Movement
shift.001                   <LEFTSHIFTKEY>  by World.Movement
a.001                       <a>             by World.Movement
d.001                       <d>             by World.Movement
s.001                       <s>             by World.Movement
w.002                       <w>             by World.Movement
shift.002                   <LEFTSHIFTKEY>  by World.Movement
a.002                       <a>             by World.Movement
d.002                       <d>             by World.Movement
s.002                       <s>             by World.Movement
Keyboard                    <F2KEY>         by World.Movement
Keyboard.001                <F2KEY>         by World.Movement
Keyboard.002                <w>             by World.Movement
Keyboard.003                <s>             by World.Movement
Keyboard.004                <a>             by World.Movement
Keyboard.005                <d>             by World.Movement
Ctrl                        <LEFTCTRLKEY>   by World.Camera.009
Ctrl                        <LEFTCTRLKEY>   by World.Camera
Ctrl                        <LEFTCTRLKEY>   by World.Camera.008
w                           <w>             by World.metarig.002
shift                       <LEFTSHIFTKEY>  by World.metarig.002
s                           <s>             by World.metarig.002
not w.001                   <w>             by World.metarig.002
shift.002                   <LEFTSHIFTKEY>  by World.metarig.002
w.001                       <w>             by World.metarig.002
not shift                   <LEFTSHIFTKEY>  by World.metarig.002
w.002                       <w>             by World.metarig.002
not w                       <w>             by World.metarig.002
not s                       <s>             by World.metarig.002
Space                       < >             by World.metarig.002
Space.002                   < >             by World.metarig.002
Space.003                   < >             by World.metarig.002
Space.004                   < >             by World.metarig.002
not a                       <a>             by World.metarig.002
a                           <a>             by World.metarig.002
a.001                       <a>             by World.metarig.002
d                           <d>             by World.metarig.002
not d                       <d>             by World.metarig.002
d.001                       <d>             by World.metarig.002
a                           <a>             by World.Q battery
d                           <d>             by World.Q battery
a                           <a>             by World.Arrow
d                           <d>             by World.Arrow
a                           <a>             by World.Q Egg
d                           <d>             by World.Q Egg
a                           <a>             by World.Q seeds
d                           <d>             by World.Q seeds
a                           <a>             by World.Q.001
d                           <d>             by World.Q.001
a                           <a>             by World.Q.002
d                           <d>             by World.Q.002
Print Active game objects   <a>             by World.Analyzer__
Print Inactive game objects <i>             by World.Analyzer__
Print active Controllers    <c>             by World.Analyzer__
Print Python controllers    <p>             by World.Analyzer__
Print Message listeners     <m>             by World.Analyzer__
Print Keyboard listeners    <k>             by World.Analyzer__
Help                        <h>             by World.Analyzer__
Print Message Senders       <s>             by World.Analyzer__

warning: scene Cursor.001 already exists, not added!
warning: scene Cursor.001 already exists, not added!
warning: scene Seasons.001 does not exist, not removed!
warning: scene Seasons.001 does not exist, not removed!
warning: scene Seasons.001 does not exist, not removed!
Message Listeners (Sensors):
----------------------------
scene.gameObject: subject
----------------------------
World.Cube.057:           Net
World.Net.003:            Net
World.Net.002:            Net
World.Net.001:            Net
World.Key.005:            Igloo egg
World.Key.004:            Igloo egg
World.Key.003:            Igloo egg
World.Key.002:            Igloo egg
World.Gate.003:           Open door
World.Cube.043:           Key
World.Cube.042:           Key
World.Gate.002:           Open door
World.Gate.001:           Open door
World.Cube.041:           Key
World.Cube.040:           Key
World.Cube.038:           Igloo egg
World.Plane.039:          Fried egg
World.Cylinder.011:       Cook
World.Empty.007:          Egg
World.Empty.007:          Pan
World.Empty.006:          Wood pick
World.Empty.006:          Flint
World.Cylinder.010:       Fire time
World.Cube.027:           Bird seeds
World.Bird.001:           Bird seeds
World.Plane.038:          Seeds got
World.Plane.037:          Bird seeds
World.Egg.003:            Egg
World.Egg.002:            Egg
World.Egg.001:            Egg
World.Point.010:          Fire
World.Plane.021:          Igloo egg
World.Arrow.007:          Battery
World.Arrow.007:          Log cut
World.Arrow.007:          Stop
World.Arrow.007:          Resume
World.Arrow.006:          Axe
World.Arrow.006:          Log cut
World.Arrow.005:          Axe
World.Arrow.005:          Log cut
World.Arrow.004:          Axe
World.Arrow.004:          Log cut
World.Plane.011:          Power
World.Melon SLICE.003:    Cut melon
World.Melon SLICE.002:    Cut melon
World.Melon SLICE.001:    Cut melon
World.Sound:              Axe
World.Sound:              Battery
World.Sound:              Power
World.Sound:              Wood pick
World.Sound:              Log cut
World.Sound:              Cut melon
World.Sound:              Seeds
World.Arrow.003:          Battery got
World.Arrow.003:          Power
World.Arrow.003:          Stop
World.Arrow.003:          Resume
World.Cylinder:           Battery got
World.Arrow.002:          Log cut
World.Arrow.002:          Axe got
World.Cube:               Axe got
World.T pad.001:          Power
World.Movement:           Summer
World.Movement:           Tel W
World.Movement:           Winter
World.Movement:           Tel S
World.Movement:           Spring
World.Movement:           Tel Sp
World.Movement:           Autumn
World.Movement:           Tel A
World.Movement:           Stop
World.Movement:           Resume
World.Empty:              Stop
World.Empty:              Resume
World.Camera.009:         Summer
World.Camera.009:         Winter
World.Camera.009:         Spring
World.Camera.009:         Autumn
World.Camera.009:         Power
World.Camera.009:         Farm
World.Camera.009:         No farm
World.Camera:             Summer
World.Camera:             Winter
World.Camera:             Spring
World.Camera:             Autumn
World.Camera:             Power
World.Camera:             Tel W
World.Camera:             Tel Sp
World.Camera:             Tel A
World.Camera.008:         Summer
World.Camera.008:         Winter
World.Camera.008:         Spring
World.Camera.008:         Autumn
World.Camera.008:         Power
World.Camera.008:         Tel W
World.Camera.008:         Tel Sp
World.Camera.008:         Tel A
World.metarig.002:        Stop
World.metarig.002:        Resume
World.Gate:               Open door
World.Q battery:          Power
World.Q battery:          Stop
World.Q battery:          Resume
World.Arrow:              Axe
World.Arrow:              Stop
World.Arrow:              Resume
World.Arrow.001:          Axe
World.Arrow.001:          Log cut
World.Wood:               Log cut
World.Melon SLICE:        Cut melon
World.Butterfly 2:        Butterfly
World.Icosphere.048:      Net
World.T pad.005:          Power
World.Q Egg:              Igloo egg
World.Q Egg:              Stop
World.Q Egg:              Resume
World.Spider:             Spider
World.Empty.001:          Fire
World.Egg:                Egg
World.Bird:               Bird seeds
World.Q seeds:            Bird seeds
World.Q seeds:            Stop
World.Q seeds:            Resume
World.Seeds.001:          Bird seeds
World.Key:                Igloo egg
World.Q.001:              Fire
World.Q.001:              Stop
World.Q.001:              Resume
World.Q.002:              Fried Egg
World.Q.002:              Fire
World.Q.002:              Stop
World.Q.002:              Resume
World.Net:                Net
Toolbar.001.Text.032:     Butterfly
Toolbar.001.Text.031:     Caterpillar
Toolbar.001.Text.030:     Spider
Toolbar.001.Text.015:     Net
Toolbar.001.Axe.001:      Axe
Toolbar.001.Battery.001:  Battery
Toolbar.001.Battery.001:  Power
Toolbar.001.Cylinder.005: Wood pick
Toolbar.001.Cylinder.005: Fire
Toolbar.001.Seeds:        Seeds
Toolbar.001.Seeds:        Bird seeds
Toolbar.001.Egg.004:      Egg
Toolbar.001.Egg.004:      Fried egg
Toolbar.001.Egg.004:      Fire
Toolbar.001.Pan.001:      Pan
Toolbar.001.Pan.001:      Flint
Toolbar.001.Pan.001:      Fried egg
Toolbar.001.Pan.001:      Fire
Toolbar.001.Flint:        Flint
Toolbar.001.Flint:        Fire
Toolbar.001.Fried egg:    Fried egg
Toolbar.001.Fried egg:    Igloo egg
Toolbar.001.Key.001:      Key
Toolbar.001.Key.001:      Open door
Toolbar.001.Net.004:      Net
Toolbar.001.Spider.001:   Spider
Toolbar.001.Butterfly:    Butterfly
Toolbar.001.Cylinder.013: Caterpillar
Title.Plane.002:          Power
Menu game.Empty.002:      Game control
Menu game.Empty.002:      Resume
Menu game.Plane.057:      Resume
Menu game.Text.022:       Resume
Menu game.Plane.053:      Resume
Menu game.Text.029:       Control show
Menu game.Text.029:       Control hide
Menu game.Text.028:       Control show
Menu game.Text.028:       Control hide
Quests.Plane.060:         Quest show
Quests.Plane.060:         Quest hide
Quests.Plane.065:         Power
Quests.Plane.065:         Tel A
Quests.Plane.065:         Tel Sp
Quests.Plane.065:         Tel W
Quests.Plane.064:         Battery
Quests.Plane.064:         Tel A
Quests.Plane.064:         Tel Sp
Quests.Plane.064:         Tel W
Quests.Plane.063:         Log cut
Quests.Plane.063:         Tel A
Quests.Plane.063:         Tel Sp
Quests.Plane.063:         Tel W
Quests.Plane.062:         Near log
Quests.Plane.062:         Tel A
Quests.Plane.062:         Tel Sp
Quests.Plane.062:         Tel W
Quests.Plane.061:         Axe
Quests.Plane.061:         Tel A
Quests.Plane.061:         Tel Sp
Quests.Plane.061:         Tel W
Quests.Text.040:          Tel A
Quests.Text.040:          Tel Sp
Quests.Text.040:          Tel W
Quests.Text.040:          Power
Quests.Text.039:          Tel A
Quests.Text.039:          Tel Sp
Quests.Text.039:          Tel W
Quests.Text.039:          Battery
Quests.Text.037:          Tel A
Quests.Text.037:          Tel Sp
Quests.Text.037:          Tel W
Quests.Text.037:          Log cut
Quests.Text.036:          Tel A
Quests.Text.036:          Tel Sp
Quests.Text.036:          Tel W
Quests.Text.036:          Near log
Quests.Text.035:          Tel A
Quests.Text.035:          Tel Sp
Quests.Text.035:          Tel W
Quests.Text.035:          Axe
Quests.Text.034:          Tel A
Quests.Text.034:          Tel Sp
Quests.Text.034:          Tel W
Quests.Empty.000:         Quest
Toolbar.001.Text.032:     Butterfly
Toolbar.001.Text.031:     Caterpillar
Toolbar.001.Text.030:     Spider
Toolbar.001.Text.015:     Net
Toolbar.001.Axe.001:      Axe
Toolbar.001.Battery.001:  Battery
Toolbar.001.Battery.001:  Power
Toolbar.001.Cylinder.005: Wood pick
Toolbar.001.Cylinder.005: Fire
Toolbar.001.Seeds:        Seeds
Toolbar.001.Seeds:        Bird seeds
Toolbar.001.Egg.004:      Egg
Toolbar.001.Egg.004:      Fried egg
Toolbar.001.Egg.004:      Fire
Toolbar.001.Pan.001:      Pan
Toolbar.001.Pan.001:      Flint
Toolbar.001.Pan.001:      Fried egg
Toolbar.001.Pan.001:      Fire
Toolbar.001.Flint:        Flint
Toolbar.001.Flint:        Fire
Toolbar.001.Fried egg:    Fried egg
Toolbar.001.Fried egg:    Igloo egg
Toolbar.001.Key.001:      Key
Toolbar.001.Key.001:      Open door
Toolbar.001.Net.004:      Net
Toolbar.001.Spider.001:   Spider
Toolbar.001.Butterfly:    Butterfly
Toolbar.001.Cylinder.013: Caterpillar
Title.Plane.002:          Power
Tip Farm.Text.001:        Show farm
Tip Farm.Text.001:        Hide farm
Tip Farm.Text.001:        Show farm
Tip Farm.Text.001:        Hide farm
Toolbar.001.Text.032:     Butterfly
Toolbar.001.Text.031:     Caterpillar
Toolbar.001.Text.030:     Spider
Toolbar.001.Text.015:     Net
Toolbar.001.Axe.001:      Axe
Toolbar.001.Battery.001:  Battery
Toolbar.001.Battery.001:  Power
Toolbar.001.Cylinder.005: Wood pick
Toolbar.001.Cylinder.005: Fire
Toolbar.001.Seeds:        Seeds
Toolbar.001.Seeds:        Bird seeds
Toolbar.001.Egg.004:      Egg
Toolbar.001.Egg.004:      Fried egg
Toolbar.001.Egg.004:      Fire
Toolbar.001.Pan.001:      Pan
Toolbar.001.Pan.001:      Flint
Toolbar.001.Pan.001:      Fried egg
Toolbar.001.Pan.001:      Fire
Toolbar.001.Flint:        Flint
Toolbar.001.Flint:        Fire
Toolbar.001.Fried egg:    Fried egg
Toolbar.001.Fried egg:    Igloo egg
Toolbar.001.Key.001:      Key
Toolbar.001.Key.001:      Open door
Toolbar.001.Net.004:      Net
Toolbar.001.Spider.001:   Spider
Toolbar.001.Butterfly:    Butterfly
Toolbar.001.Cylinder.013: Caterpillar
Title.Plane.002:          Power

active and frequently triggered Python controllers in this frame
----------------------------------------------------------------
scene.gameObject(controller) by sensors
----------------------------------------------------------------
scene Cursor.001:       Mouse.001|Python         by [over, Mouse, Mouse.001]

This output might help you later. Unfortunately I have no function that prints all mouse sensors to console. When you have many mouse over sensors it will constantly eat performance. But let me check how many you have...

It does not look like you have too much. But it is hard to say.

Cursor Script

You suspected that your cursor script is the bottleneck. I can't confirm that. When I disable the cursor controller (and enable the system mouse cursor) the processing time does not improve.

Mouse Over Sensor

I have a different idea. This requires that I explain to you how the mouse over sensor is working.

The mouse over sensor (and the mouse over any sensor too) is basically a ray sensor. It measures the line under the system mouse cursor from pretty near the camera to pretty far away from the camera. This "ray" is a measurement of the line trying to find any face it crosses.

This is a pretty heavy operation which gets worse with the number of objects and faces that exist in the scene. To be more specific what matters are the physics faces (ghost and no collision objects will be ignored and not considered = no processing time required).

The nature of a sensor is that it will measure at each single frame. All sensor types do that. This means when a single measure eats time it will eat that time at each single frame until the sensor dies ( because the owning object died).

As more sensors you have as more processing time is required. As all mouse over sensors are measuring along the same line (the line under the cursor) you might think that only one measure is calculated within a single frame. Unfortunately this is not the case. Each mouse over sensor measures again. That is the reason why the number of such sensors should be as low as possible.

So there are two thing to consider:

the number of mouse over sensors
the number of "detectable" faces (including face that can block the measurement)

Reduce the number of detectable faces

I switched on Game\Show Physics Visualization. It showed my there are quite a lot of very detailed objects on the screen. They are not visible, but present as physics objects. These objects might cause the bottleneck. I suggest when you do not need them (they look like menu entries), then move them outside of the camera's view. This way the mouse over sensor does not need to consider them.

Reduce the number of sensors

To reduce the number of mouse over sensors you can use a single mouse over any sensor connected to a Python controller. The Python controller can read the object under the cursor (it should be one per scene) and tell interested objects which one it is. This reduces the number of mouse over sensor to one per scene.

Please be aware this is only worth when you have more than ~10 mouse over sensors.

I hope this helps a bit. Due to the large size of your scenes I can't dig deeper right now.


Blender shows this error 'Loading 'C:\file.blend': Missing DNA block; I tried to open my file in blender after restarting my pc and it showed this error.please help

More often than not if the Missing DNA Block message appears the affected *.blend file will be utterly unusable, nothing can be done to retrieve the user generated content it otherwise contained. In these instances it may still be possible to reestablish the project checking whether Blender created a *.blend1 backup file in the project folder ...

Read on at https://www.katsbits.com/codex/missing-dna-block/


stitching uv islands creates sharp edges in new version so, recentrly this weird thing appeared in blender, whenever I stitching uv islands there is a sharp edge to appear marking boundary of an island that i stitched, but sometimes even random edges

This appears to be because blender is keeping the old unwrap edge markings, but knows the UV is now different than what was created from the unwrap markings, so it is now highlighting them. This is not going to show up in the final render.
Edit: sorry, they are actually sharp marks and are not UV marks. But regardless, you can select those edges and then “clear sharp“ in… I don’t remember which menu. It’s either mesh or edge. (Why is this small?)


Get pose bones which were animated in a strip I created an animation with some of my pose bones and created a strip in the nla editor.
How can I access the strip and find out which pose bones were needed for this animation via python?

I took a look in the animation data of the armature object

C.active_object.animation_data.nla_tracks[0].strips[0]

but I couldn't find anything useful.

The container for fcurves are actions. So you need to find the corresponding action for the strip.

I.e.

track = C.active_object.animation_data.tracks[0]
#get the action from the first strip
action = track.strips[0].action

for fcu in action.fcurves:
    print(fcu.data_path, fcu.array_index)


Problem in texturing a cube I add a texture to a cube. The texture is an image. I set Coordinates to Generated and Projection to Cube. The rendering is perfect: the texture is replicated on all 6 faces of the cube.
But if I use the Texture or Material Display Modes in the 3D View the texture is applied only on 2 faces of the cube.
Why ?

The attached image show the problem with Material Display Mode

Blender's viewport has limited support for generated and object coordinates.

GLSL preview materials only support a subset of Blender node material textures and features as stated in this bug report and this one too

You can fake it or workaround it using node materials, as shown in this video


Blender Python: Running multiple timers I have a bit of a weird problem that I simply cannot seem to get around. I want to run 2 timers, each set to a different interval.

The problem that I'm having is that both classes receive each others 'TIMER' event! I think that this is really weird, as one would expect the timer event to be constrained within the class it's created in.

After hours of DuckDuckGoing, I found this forum post: https://blenderartists.org/t/how-to-distinguish-timers-when-running-multiple-modal-operators/601432/7

But it didn't help much, basically stating that it's impossible, + it's from 4 years ago, maybe something has changed.

Am I looking at this the wrong way? Maybe I don't really understand Blender's paradigm here, anything that can help me get on the right track would be really appreciated, thanks!

I created a demo blender file showing my problem: https://keybase.pub/peterwilli/StackExchange_Files/TimerProblem.blend

Just open with Blender and look at the console (open blender from the console in Linux) and run timer1.py and timer2.py, what you see is that both timers run each 1 second, but if you run both, both of them run practically twice as fast, taking each other's event.

Application Timers

Blender 2.8 has a new API to run functions in specific time intervals.

Run a Function every x Seconds

import bpy

def every_2_seconds():
    print("Hello World")
    return 2.0

bpy.app.timers.register(every_2_seconds)

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)

Similar but passing object time axis and disp

import bpy
import functools

def move_obj(ob, axis, dist, sec):
    print(ob, axis, dist)
    ob.location["xyz".index(axis)] += dist
    return sec

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

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

bpy.app.timers.register(functools.partial(move_obj, bpy.context.object, "z", -0.1, 2), first_interval=1)

On a few quick tests it appears that the context, if passed to the timer like above is restricted, has no "object" attribute for example.


How to make an animation so that it is smooth and plays at one speed? I tried different settings, but I haven't received the desired result.
Either the animation is smooth but first it slow then speeds up and then slows down at the end (Bezier) or animation rude but it has one speed (Linear).
Example:

Is there a way to make the animation smooth and have it play with one speed without acceleration & deceleration?

The image above is the simplest way to visualize what i mean, but the image in this link shows the kind of objects i'm animating, and it behaves quite abrupt when Linear, but Bezier gives pronounced easing in-out:

One possible solution to the question (before it was updated with a use-case):

You could build curves into the corners of a trajectory path, like:

Tighter corners will result in more jumpy (sudden, unrealistic) movement.

Here I start out with a Mesh Object, then use Ctrl+Shift+B to fillet the corners, then in Edit Mode use Alt+C and convert the mesh to a Curve Object.

Then Add a Follow Path constraint, and press Animate Path, then press Play to see what that looks like.

Sometimes It can be more convenient to see the path it will be on, rather than key-framing it.


Emboss a logo in a complex mesh I need to emboss logo and a mesh which needs to be detailed but it comes out not very nice looking when I try to emboss logo with boolean. Any suggestions?

Most of the time when your boolean its due to questionable topology. I am guessing you are using the boolean modifier at the moment but there is actually a better option. Select the logo then the mesh you want to emboss it in, then use the shortcut Ctrl - (minus), it'll make the logo transparent and can cut into the model much more cleanly. Once you are satisfied go to your 'modifier' tab on your mesh and apply the b_tool modifier. Good luck.


How to use the textured material from a multi-mesh object onto a single mesh obj? The above bush is made of many initially individual images on planes, one per plane (leafs). Then joined into one mesh. This mesh uses 2 materials.
 But now I need to replace all these planes with one mesh (which I already made with the Re-mesh modifier, and lots of cleaning).
 At first I thought I could bake all those planes into one texture to then just apply it to the other single mesh. But after baking I can see it is only using one of the many planes, hence the result is one big leaf in my baked image
 Any ideas?

Feel free to inspect the blend

Thanks guys,

DPC

Quick mapping (sloppy) of your image on single sphere mesh on the left to simulate your starting point. Middle image is placement of the two participants of the bake. Then baked onto another final mesh on the right side.  The 3 images are different stages of the baking process.
The created texture has black background which becomes transparent via color ramp and transparent shader.  I nested the hemisphere askew to increase readability.  All the hemisphere shapes below are a single mesh.  Your are seeing objects below with transparency so you may need more time to get the orientation of the object.  I may correct this.

Created texture with black on left.  Mapped texture with black.  Objects baked in alignment.  Below.

Two alternatives.

Consider Baking in Cycles Render or Blender Render.  You will use a new texture to record the color reflection of one source mesh to the other target mesh.
Your finished original bushy mesh can be illuminated or set to emission material.  We assume your shapes are roughly hemispheres. Hemisphere is sphere cut in half.  The target mesh is hemisphere with reflective surface.  Original mesh in placed over the reflective target.  Bake target mesh.  See video references for detailed instruction on baking in cycles render or blender render.

Consider creating a regular rectangular tile of leaves texture, which is expected to be modest work. Leaves in this texture can all be same size. New mesh is cylinder.  UV Map cylinder to leaves texture.  Leaves appear all same size as in the soup can model.  Use proportional editing to reshape cylinder in to hemisphere.  In this scenario your original bushy collection of meshes is discarded completely... rather I mean ... placed gently in the experience bin.

Abbreviated Picture Notes
Blender Cycles Texture Baking Setup

In the following the red object is your texture object with emission material.

Red emission object is next to green reflective object follows

Bake Result is the New texture follows

Texture placed back on green inner object and rendered follows

Original Red object has been set to No Render.


It there a possible way that I could scale all the objects individually? I'm working on a complicated building which my goal is to keep the multiple objects in their respective groups and scale all objects at once. Instead of using Ctrl+J function to group everything into 1 object and scale it.

Appreciate some advice. Thanks.

Try simply selecting all your objects and scale the whole selection.
It doesen't work if the pivot point is set to "individual origin".
All the others options will scale your objects maintaining shapes and proportions


Loop Cut won't go around object I have a cube that has been divided and reshaped. Some faces have been deleted and recreated along the way, but there is a currently a face on all sides and I have all quads.
I can't figure out why it won't let me perform a loop cut here.

I have already checked and there are no duplicate vertices. There are exactly 12 in this section that is visible when I used the rubberband tool and "Merge by Distance" no longer removes any.
The red line in the picture is where I used "Mark Seam"
with my understanding of the way it works, I would have thought I should be able to make a loop cut here.
Any ideas?

Ok. I figured it out. I didn't actually recreate the object properly. I had closed the edge using the 'F' key so the Face wasn't actually subdivided, so one side has 6 vertices and one side has 4.
I deleted the edge and used the knife tool to recreate the line in the middle and it all works properly now.


How to create realistic plastic effect in packaging How to render realistic plastic packaging with wrinkles same with the image attached

For the following cloth simulation, the ground plane is set to be a collision object and the box has the 'leather' cloth preset applied.

There is a Sub-Division modifier in the stack below the Cloth Sim modifier, you can place the Sub-D higher up the stack for more detail however this greatly increases the time needed for the calculations to run.

Once the simulation is run, you should have a series of frames to choose from.  Select the one you prefer and Apply the modifier so that the mesh becomes frozen in that shape.


Adjust Overal Brightness in Cycles Is there a better way to adjust overall brightness other than using the "exposure" slider? The "exposure" slider in the Color Management area is considerably grittier than making the lights physically brighter for anything other than post-render micro adjustments.

Right now I just have a node group with a single "Value" node shared across all my light sources & world strength, as shown.

Finally figured this out. Basically, you should use the 'exposure' slider in the color management tab to make overall brightness adjustments while keeping the light 'ratio' the same. Seems obvious, but by default Cycles uses strong clamping which botches this up. If you disable clamping, you can render once then adjust lightness through the exposure slider with identical results to re-rendering with brighter light sources.


Relative and Absolute shape keys on the same mesh is there a way to use both relative and absolute keys together on the same mesh ?

i want to use absolute keys to deform muscle in a way, and relative to animate face shapes. both on the same model.

Yeah. Simply animate "Relative" checkbox when needed. Works in Blender but currently I have problems exporting this to Unity. I hope it's possible.


Can't zoom into my mesh anymore Problem: My viewport is stationary. and I can't zoom in anymore.
I'm not rotating around my mesh, but around the view, so to speak.
What can I do to remedy?
Much thanks!

If you are "lost in space" you can press the Home button to view all objects in your scene, or select an object in the outliner and press Numpad "." to view active object. Also check the clip values in the "N" properties panel: in my example all objects closer than 1 cm or far more than 1 km will be greyed out, and you can change thoose values.


"Apply Scalings" parameter missing in export_scene.fbx? I'm trying to write a simple exporter script to do an FBX export with all the settings I want already selected, for convenience. Reviewing the API on export_scene.fbx, I don't see a parameter matching the "Transform -> Apply Scalings" option in the regular export UI (as in the image below). Is this something that's absent from the documentation, or is there no way currently to assign this from script? Thanks!

I'm not sure because I'm pretty new to blender scripting but it appears to me that dropdown in question is not selecting parameters for the fbx export function, it's just applying a transformation to the objects that it's exporting using the regular mechanism for applying a transformation. That is: it's scaling by a factor, applying the transformation, running the fbx export, then scaling by the inverse factor to undo the first scaling, then applying the transformation again. So in my script, I'm basically doing the same thing.
What I'm doing that seems to be working for me is scaling by some constant factor (100 in my case):
obj.scale = (100, 100, 100)

Then applying the scaling:
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False)

Then exporting with the global_scale set to the inverse of my scaling factor:
bpy.ops.export_scene.fbx(
    filepath=fname + ".fbx",
    use_selection=True,
    axis_forward='-Z',
    axis_up='Y',
    global_scale=0.01,
    apply_unit_scale=True)

and finally setting and applying the opposite scaling factor after running the export:
obj.scale = (0.01, 0.01, 0.01)
bpy.ops.object.transform_apply(location=False, rotation=False, scale=True, properties=False)

this may be a very whacky and roundabout way of doing it, but it seems to be working for me and sets my object back to how it was before I ran my script.


Can I use VSE result in Movie Clip Editor? I'm editing a video in VSE. Some cutting here, a new sound track there.
I would now like to use the result of my edit in VSE in Movie Clip Editor to do motion tracking.

Is that possible wihtout exporting it as a new video (and importing it again) first?

You can only use unedited clips in the motion tracker for now.


Is there a way to make baking sound to F-curves more accurate? At the moment I've got a script that generates a bunch of bars, and bakes a narrow range of frequencies to each bar's Z scale. It ends up being a pretty simple spectrogram that I composite onto the bottom of the video.

The only problem is that there's a lot of "bleeding" across frequencies. It looks like the same kind of thing you see on a spectrogram if you set the window to something really small.

If I have an audio file with a 440Hz tone, you can bake frequencies as low as 100Hz or has high as 1100Hz and still be able to see a little of the 440Hz tone influencing it, and there's a lot of really significant interference down until around 200Hz and up to 700-800Hz. Is there any way to make blender more accurate when baking sound to F-Curves?

It's not an answer, but I've worked around it by processing the audio data in Sonic Visualizer, saving the spectrogram as a PNG, then importing the data into blender through a script I wrote. It basically splits the image into several long strips, each representing a bar, and treats each pixel in the X direction as a new frame. It sets the height of the bar based on the brightness of the brightest pixel in the current chunk, with some stuff to smooth out the motion, and then keyframes it. After I've cleaned it up a bit, I'll edit this to include it.


Empty Image renders in front of transparent object I am trying to model with a reference image in Blender 2.80. I want to see both the reference image and my mesh in a transparent overlay so nothing blocks anything else. I assigned a material to my mesh and set its "Viewport Display" with an alpha of just less than one, so it should remain mostly transparent. However, the images that I pulled in render completely in front of it as soon as this transparency is added. Is it possible to make my mesh render transparently in front of an object?

the images rendering in front of the transparent mesh:

The alpha channel for the mesh's material:

I was trying to make the mesh transparent, but it seems the easier way is to make the images transparent. In the image's object data panel, click the "Use Alpha" checkbox, and adjust the transparency value. To get the desired effect, this needs to be set on the image and you need to set an alpha on the mesh's material's "viewport display" like I showed in the question.


Cannot delete phantom edge in my model I'm very new to Blender and I have these phantom vertices/edges in my mesh. The vertices are visible in Object Mode and but not in Edit Mode, so I cannot manage to select and delete them like I would a normal point. It also does not seem to affect the structure when I'm viewing it with a texture. Could someone explain how it got to be like this and how to get fix it?

Thank you!

I believe that the vertex is hidden. To hide something, you select it and key H. This can easily be done by accidentally hitting H on your way to G (grab/translate). Hiding is useful for working on one part of your mesh while not having to work around or Wireframe through other parts. To un-hide, for lack of a better phrase, key Alt + H.

Once you've un-hidden, key X and select Verticies or perhaps Edges in your case.


Blender Keymap presets - how do they work exactly? I'm having trouble understanding the keymap presets system. I create a new keymap preset, then with that preset selected I go and edit some keys. Then I go back to the default Blender keymap but... the one I edited in my preset is also written to the Blender one? If I restore the keymap in the Blender preset then the changes I make in my preset are also restored.
A similar question has been asked previously to which a comment was made linking to a blender developer site that states that this is in fact by design. My question is then how are you supposed to use the preset system if every change you make is applied to all keymaps?
Am using 2.83 but have tested this behaviour is the same going all the way back to 2.79

I'm not sure I fully understand your question Arvin, but I believe there are two approaches for you:

Edit the entire blender default keymaps to your liking, and export the entire keymap and save it as a file via Edit >> Preferences >> Keymap >> Export

OR

If you intend to be able to quickly toggle on and off different modular sets of keymaps, then as @susu suggested, you may want to set up python scripts for each module of keymap modifications, which you can then toggle on or off individually from the Addons pane

Here is an example of a script with two custom keymaps, being used as an addon to modify a custom operator, which is then available for keymap editing via the Edit >> Preferences >> Keymap pane


How to duplicate and move a selected edge in normal direction? I want to duplicate a selected edge and translate it to another location, based on the normal direction.

(source: shshop.da.to)

This is my current code:

import bpy
import mathutils
import math

obj = bpy.context.object
me = obj.data
eg = me.edges[2]

nor1x = me.vertices[eg.key[0]].normal.x
nor1y = me.vertices[eg.key[0]].normal.y
nor1z = me.vertices[eg.key[0]].normal.z

nor2x = me.vertices[eg.key[1]].normal.x
nor2y = me.vertices[eg.key[1]].normal.y
nor2z = me.vertices[eg.key[1]].normal.z

x = nor1x + nor2x
y = nor1y + nor2y
z = nor1z + nor2z

norSum = mathutils.Vector((x,y,z))

There are several normal directions, not sure what you actually desire. In your figure, it looks as if you want to translate to the average vertex normal direction, but only in 2D.

Here's a 3D example using the bmesh module:

import bpy
import bmesh

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

active_edge = None
for elem in reversed(bm.select_history):
    if isinstance(elem, bmesh.types.BMEdge):
        active_edge = elem
        break
else:
    raise Exception("No active edge!")

v1, v2 = active_edge.verts
#co1 = v1.co + v1.normal
#co2 = v2.co + v2.normal
n = (v1.normal + v2.normal) * 0.5
co1 = v1.co + n
co2 = v2.co + n

ret = bmesh.ops.duplicate(bm, geom=[active_edge])
new_verts = [elem for elem in ret['geom'] if isinstance(elem, bmesh.types.BMVert)]

# Order???
new_verts[0].co = co1
new_verts[1].co = co2

bmesh.update_edit_mesh(me)


Reflection in sphere becomes more distorted as subsurf increases? I was baking normals from hi poly to low poly meshes. With this specific example of a hi poly icosphere the reflections are distorted, whereas the low poly sphere is less so.

so i was just wondering;

why does this happen?
how may it be fixed?

note - A subsurf modifier was used on the hi poly sphere. Applying the modifier makes no visible difference.
I don't think this will be much of a problem in most cases but i was just curious as to why this happens, since in my head it would make sense that a higher poly mesh would be smoother than the low poly mesh. However in my experiment the opposite is true.
Thank You

Even if the Ico sphere has a nice distribution of triangles it isn't the best topology for normals. Worse is that it subdivides very bad since it is all triangles. The results gets worse since the frequency of the subdivision pinches increases.

The UV sphere gives better result but you get pinching deformations at the poles since they are triangles.

To get the best possible result for subdivision use a subdivided cube and add a Cast Modifier (cast type "Sphere") to get it to be a sphere. This creates an all quad topology with only 8 3-edge poles.

To further improve the normals you can add an Edit Normals Modifier set to Radial and enable Auto Smooth in the Mesh properties. Now the normals will go straight out from the centre of the Sphere.


Can Python Operator Presets be shared between Operators? I am currently working on an Add-on that makes use of the Preset system. As outlined here, Presets in an Operator can easily be defined using the bl_options = {'PRESET'} set. Those presets are then stored in BlenderPrefsLocation\scripts\presets\operator, named after the operator they refer to. Fine.

What I'd like to do is: Operator A has created a preset called file.A. From operator B, I'd like to re-use said preset. The property structure matches, so technically it would be possible.

At the moment, my only way of achieving this is to duplicate the folder file.A, and name it file.B, but I'd need to repeat this every time a preset is created.

Leveraging the preset system

A while back when doing some addon maintenance, changed the preset code for the add curve extra objects addon for 2.7x.  In particular add curve spirals.

Can leverage off the existing preset code to emulate the 'PRESET' option.  This way can choose what goes in the preset, what folder to save in, the menu and the operator to execute the preset.

Code snippets from /2.79/scripts/addons/add_curve_extra_objects/add_curve_spirals.py

Firstly there is an add preset base base class to inherit

from bl_operators.presets import AddPresetBase

The operator that creates the presets, notice can set the subdir here, defines in the script,  and what properties to save in the preset.  It is also associated with a menu.

class CURVE_EXTRAS_OT_spirals_presets(AddPresetBase, Operator):
    bl_idname = "curve_extras.spiral_presets"
    bl_label = "Spirals"
    bl_description = "Spirals Presets"
    preset_menu = "OBJECT_MT_spiral_curve_presets"
    preset_subdir = "curve_extras/curve.spirals"

    preset_defines = [
            "op = bpy.context.active_operator",
            ]
    preset_values = [
            "op.spiral_type",
            "op.curve_type",
            "op.spiral_direction",
            "op.turns",
            "op.steps",
            "op.radius",
            "op.dif_z",
            "op.dif_radius",
            "op.B_force",
            "op.inner_radius",
            "op.dif_inner_radius",
            "op.cycles",
            "op.curves_number",
            "op.touch",
            ]

its associated menu class. The bpy.types.Menu class has a 'draw_preset(..)` class method that draws the menu from the files in the presets folder. The default preset execute operator, which runs the code within the preset file setting the props is assigned as the operator of each menu item.

class OBJECT_MT_spiral_curve_presets(Menu):
    '''Presets for curve.spiral'''
    bl_label = "Spiral Curve Presets"
    bl_idname = "OBJECT_MT_spiral_curve_presets"
    preset_subdir = "curve_extras/curve.spirals"
    preset_operator = "script.execute_preset"

    draw = bpy.types.Menu.draw_preset

In the draw method of the operator that the presets are for

def draw(self, context):
    layout = self.layout
    col = layout.column_flow(align=True)

    col.label("Presets:")

    row = col.row(align=True)
    row.menu("OBJECT_MT_spiral_curve_presets",
             text=bpy.types.OBJECT_MT_spiral_curve_presets.bl_label)
    row.operator("curve_extras.spiral_presets", text="", icon='ZOOMIN')
    op = row.operator("curve_extras.spiral_presets", text="", icon='ZOOMOUT')
    op.remove_active = True

With this set up  presets are being saved to or loaded  from the defined folder. This way if your operators A and B have similar (same) structure can draw their presets from the same folder.

Also Look for code in addon prefs in __init__.py to convert from the old preset locations to new presets.


Dope Sheet Key Automation/Effects/Preset I have all this elements that are going down on the animation I would like to automate the all the keys one after another so that they follow a standard of creating the elements one after the another:

There´s any kind wihout using some addon?

I've written this script to shift all the keyframes at once.

Select the objects
Open the script in the Text Edit
Set the amount of frames, eg: step(10)
Run script (Alt + P)

import bpy

def shift(step):
    interval = 0.0
    for object in bpy.context.selected_objects:
        interval += step
        if object.animation_data !=  None:
            fcurves = object.animation_data.action.fcurves
            for curve in fcurves:
                keyframepoints = curve.keyframe_points
                for point in keyframepoints:
                    point.co.x += interval
                    point.handle_left.x += interval
                    point.handle_right.x += interval

shift(10)

The script will loop through the fcurves of the selected objects and will increment the x value of each point.
Caveat:

the script doesn't allow to set the order of the objects.
the script will shift ALL the keyframes


How to make a smooth oval window Here is a simple model that I'm working on:

I want to make the selected ring of edges smooth, to get rid of the discrete angles and get an oval shape. Something like this:

I have tried applying subdiv modifier but that changes its shape to a multi-point star. Also it smooths outer edge of the cube too, which I do not want. I have also tried Ctrl + R, but that does work on the selected face, only on the outer faces. Lastly I have tried Alt + Shift + S, which only changes the size of this face but doesn't do the smoothing that I want.

You need a combination of Subsurf Modifier, Smooth shading and Edge Crease

Start wit a plane.

Subdivide it.

Select some vertices to create the outline of the window.

Press Alt+Shift+S (to activate the "To Sphere" tool)

Move the mouse a bit to create a rough oval.

Add the middle vertices to the selection and extrude the shape of the window.

Press ⎈ Ctrl+2 to add a subsurf modifier with two subdivisions.

In edit mode set the object to smooth shading.

To make the outside edges sharp, enter edit mode, select the vertices on the edge of the object and mark a crease (Shift+E) with a value of 1, so that the edges are sharp.


Ambient occlusion problem using EEVEE I'm trying EEVEE for compositing but I don't know how to avoid (if possible) those ambient occlusion "pops" . It occurs when an object is in front of other and the ao shadows appear suddenly when revealed to the camera.

The reason for this happening is that unlike cycles, ambient occlusion generated by evvee are not physically accurate. Eevee tries to mimic ambient occlusion and only generates ambient occlusion for objects in front of the camera.
As you said, ambient occlusion pops occurs when an object which was hidden by something comes in front of the camera. It is coz as soon as the object is visible to camera, eevee generates ambient occlusion causing the poping effect.
My advice would be to use cycles which generates physically accurate Ao maps


CTRL + A Menu Apply Transformation : where to find in Python document I noticed that very often when I search for a command or something in the Blender Python API I do not find what I am looking for. I am not sure if I simply make a mistake or if what I am looking for is not available.

For example:

CTRL + A calls the Apply Transformation menu

I am after the command "bpy.ops.object.transform_apply()" but I would like to make a button that opens that menu.

And what calls that menu is not what I am able to find.

Can anyone give me a tip where such information is in a document?

For this one ( or other shortcuts ) :

go to User File -> preferences -> Input
search for a key combination  "Ctrl  A"
expand the shortcut for "call menu" under "Object mode"
you can see the command is "wm.call_menu" and the name attribute is "VIEW3D_MT_object_apply"

since the shortcut point to an operator which should be under "bpy.ops", we use this line to call the same menu  :

bpy.ops.wm.call_menu(name="VIEW3D_MT_object_apply")


How do I make objects transparent in edit mode in 2.8 I want to be able to make objects transparent to see my reference image better. I can't seem to find anything though.

You could Toggle X-Ray, located in the 3D Viewport Header. Or click the little downward pointing ">" icon to open the Viewport Shading panel and check the box next to X-ray. Or press Alt + Z.

As stated by moonboots, in the Viewport Shading panel you can also change the amount of transparency.
(moonboots comment was quite adequate but i though they made a mistake, while actualy i had my keybindings messed up: apologies)


meshes in blender vs. in unity I'm trying to understand how the meshes are working in blender vs. unity.

My goal is to take an object with many meshes, and after applying the textures and the materials in blender, merge the meshes into one mesh using "join". Now, there's only one mesh for the object and I export a .fbx file.

In Unity however, after importing the .fbx file, the object has multiple meshes regardless the fact that in blender it had only one mesh.

Can anyone explain to me why unity avoid the mesh changes made in blender?

Make sure you have "Selected objects" enabled when exporting the FBX file, otherwise all objects including hidden objects and objects on another layers get exported in the same file. Besides that the only explanation for multiple meshes per 1 exported mesh is exceeding Unity's 64,000 vertices per mesh limit that causes your mesh to import as multiple segments.


How to render world position pass A world position pass is a pass used for composting other elements into the scene after the initial render. In a world position pass the R, G, B values correspond to the X, Y, Z axis (or X, Z, Y). A world position pass could look something like this. (Image form another 3d app)

Is there a way to render out corresponding world space coordinates of each pixel?

Yes, this is possible using the following node setup (click for larger image):

As you can see, the coordinates are the same as the channels (click for larger image):

In the screenshot above the RGB values are slightly different from the coordinates displayed in the Properties panel because those coordinates are measured at the object origin and the RGB channels represent the coordinates at the objects surface.

Also note that the colors will be different than in your screenshot because blender uses Z (blue) up and it appears that the screenshot is of a Y (green) up space. Aside from rotating your actual geometry, you can remap the colors in the node setup (click for larger image):

Now the colors will match your screenshot:

Blendfile


Missing polygon when baking in Cycle render I'm trying to bake my character for unity but only some polygons' materials were baked. The body isn't showing up :(

I am using cycle render and assigned different materials to different polygons.

Please see attached screenshot for clarification. Thank you, really appreciate any help!

Agatha

Got it. my body's normal was inverted. Didn't realise that was the problem until I baked the texture on a transparent image - showing the polygons as black.


How to create a voronoi texture with different color in every tile and black lines in between? The image below shows a simple cube with the following node setup:

is there a way to input different colors instead of just the color blue?
The idea is to have an output of something like this:

To make all the tiles different color you could just take the color output of the voronoi texture and play with that. It's already quite close to what you want. If you want the black lines you need to add more nodes to mix it with.

Update
Here are two different results. This one has uniform lines and the last one has little distortion added so it closer to the original picture.


How to make object bend like a hair strand (particle system) - 2.77a? First I set up the particle system to work with bending grass and hair dynamics, then I change the hair to an object. The object is a tree I have generated. The wind blows the tree as a whole, but I need the branches and trunk to bend.

I will demonstrate only on the trunk, the branches are the same idea.
At first add the cloth simulation and turn on the pinning, then assign the bottom vertices of the trunk to a groop and in the cloth simulation panel under the pinning set to the groop u just made, then use this picture values as a basis to make it suit u own purpose


Blender will not fully open Whenever I try to start up Blender the CMD comes up as usual but then stops on that and says nothing?

I've tried leaving it for a while to see if it was just going slowly because I had  just updated to 2.77 and needed a little load, but no. I've tried installing it on steam still the same problem, even tried to install all sorts of different dll's someone please help, I love Blender and want to get back to it!!

I had the same problem recently. It's probably something else, but, please, try to run blender via CMD (windows+R : CMD). If it's the same issue as me, you could have this error :

  EXCEPTION_ACCESS_VIOLATION

If it's that error : you just have to reinstall blender 2.76b. (It worked for me on my old computer with a windows 10). Somebody here had the same issue and report the bug (I think)

If it's not, you could copy/paste the error here.


Track object position during an animation using python script I'm trying to write a simple script that displays the position of a falling cube on a custom panel. I want it to update the panel throughout the animation.  Here is the code so far:

import bpy

class MocapPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Display Data"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

    frame = bpy.context.scene.frame_current
    print(frame)
    bpy.context.scene.frame_set(frame)

    obj = context.object

    body = bpy.data.objects[obj.name]
    row = layout.row()
    row.label(text="MocapData", icon='WORLD_DATA')
    pos = body.location.z

    row = layout.row()
    row.label(text="Active object is: " + obj.name)
    row = layout.row()
    row.prop(obj, "name")
    row = layout.row()
    row.label(text="object position is " + str(pos))
    print(pos)

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

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

if __name__ == "__main__":
    register()

all it does is display the start position at the moment. Can I get it to update with every frame?

Object.matrix_world.to_translation() gives you a global (visual) location of the object.  The frame change handler makes the panel "hot" and update on every frame change.

import bpy

class MocapPanel(bpy.types.Panel):
    """Creates a Panel in the Object properties window"""
    bl_label = "Display Data"
    bl_idname = "OBJECT_PT_hello"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

    @classmethod
    def poll(cls, context):
        return context.object is not None

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

        obj = context.object
        pos = obj.matrix_world.to_translation()

        row = layout.row()
        row.label(text="Active object is: " + obj.name)
        row = layout.row()
        row.label(text="object position z is %.2f" % pos.z)

def prop_redraw(scene):
    for area in bpy.context.screen.areas:
        if area.type == 'PROPERTIES':
            if area.spaces.active.context == 'OBJECT':
                area.tag_redraw()

def register():
    #clear handlers for testing
    bpy.app.handlers.frame_change_pre.clear()
    # add a handler to make the area "live" without mouse over
    bpy.app.handlers.frame_change_pre.append(prop_redraw)

    bpy.utils.register_class(MocapPanel)

if __name__ == "__main__":
    register()


Principled Volume not showing up in Cycles Render My Blender scene looks like this:

On the left, you can see my cloud-like volume setup. The center screen is in Material Preview mode and shows my clouds (the volumes) just right. As you can see in the Dimensions panel, the selected Cloud Box is actually pretty large (30x30x30m), but the clipping of my camera is already set to 1000m.
The problem is, that in my renders, the volumes seem just invisible. Whatever I'm doing, even if I change the cloud color to black, it doesn't ever show up in the Cycles render.
Is there a setting I'm missing?

Update 1:
After following suggestions, I removed most of the nodes. For testing purpopses, I even disconnected the noise texture:

This looks quite foggy in the preview now:

And indeed, in the render output, I can see something, but not what I've seen in the preview. The rear-half of the plane looks kindo of blue-ish. And when I disable the rendering of my "Cloud Domain" objects, the blue-ish look disappears. So it seeems to be there. Cycles just seems to treat those volumes substentially different compared to Eevee.

The weird background is a Sky Texture node with the 2.9 new Nishita mode. I set it to be that dirty, because I wanted to see a better contrast to the clouds while I'm testing. It's the only light source by the way.
I'd still guess that it has something to do with my Render settings or the how the ligthing is configured, but I don't know what exactly this could be.
Some more images:

Looking at your material nodes, you are mixing a Surface Shader (Transparent BSDF) in with the volumetric - this may be the cause of your problems as the preview may behave differently to the actual render (especially with versions that support Eevee since the material preview will use Eevee to render while the actual render is using Cycles).
Generally you do not need to mix in 'transparency' with volumetric shaders - simply control the Density instead; ie, zero density is 100% transparent.
Try connecting the Principled Volume directly into the Volume socket of the Material Output and use the Noise Texture to vary the Density of the volume rather than to vary a mix shader.


How to make a smooth object look less 'lumpy' I'm editing an object. Here's how it looks when editing:

and here's how it looks when rendered, with a subdivision surface modifier:

That outer surface just doesn't look as smooth as I'd like. You can sort of see where edges of the model are - some parts of it are slightly less curved than others, which gives it a slightly lumpy appearance. I'd like it to be a completely smooth, parabola-like surface instead.
I realise that what I mean might not be clear from the image above, so here's an exaggerated picture of how the shape currently looks to me, compared to what I'm trying to achieve:

I don't think the issue has to do with the coarseness of the final mesh, or with the shading, but rather, it's to do with how my very coarse model is being interpolated by the subdivision modifier, and the lack of control I'm able to exert over that process.
I can fix the shape by adding loop cuts and then fine-tuning their positions, but that takes a lot of manual fiddling, and it's rather time consuming because in this case the lumpiness can't really be seen without doing a full render. Because of this, I'm wondering if there's something I can do that will take my existing model and render it in a more smoothed-out way.
I am a beginner and may well be unaware of an obvious way to do this.
I tried changing the crease value of the edges that make up the curve to -1, but that didn't appreciably change the shape, and also introduced some Mach banding, for some reason. (I removed the image of this failed attempt, because I realised it was in danger of confusing the issue, since that image contains a different kind of non-smoothness than the one I'm asking about. Please don't edit that image back in again. If anyone wants to see it, it's in the edit history.)

Here's a self-answer, based on information from the comments. There is a very nice trick to this, which is to model using Bézier curves instead of just relying on the subdivision surface modifier.
The basic procedure is to do shift-A -> Curve -> Bezier. Then in properties there's a curve panel where you can turn it into 2D, which makes editing easier. Then you can add a 'screw' modifier, followed by subdivision surface and, in my case, solidify.
Here's how the object looks modelled with curves:

The weird lumpiness has gone, and in addition, editing is much quicker and more painless, and it's easier to be accurate.
It looks like this when editing. I only have to change a couple of control points to change the slope of the curve - the geometry is generated automatically.


Where is Smoke in 2.83.10? I am trying to create something that requires the Physics > Smoke and it's not shown on my physics panel. The version I'm using is 2.83.10 and I have included a screen shot of my physics panel and on from a YouTube tutorial screen shot using the same version [ a tutorial physics tab .
In the Blender documentation online it shows the panel has a Smoke setting for creating a Smoke Domain. Did it move to another location? Or is it in an Add-On in the preferences?

The smoke and fluid simulations changed with the introduction of mantaflow
The settings are in Fluid.

To create the smoke emitter, or Flow.
Set the Type to Flow
And the Flow Type to Smoke.

For the Domain
Set the Type to Domain
And the Domain Type to Gas

For a simpler way to set flow and domain simultaneously, just select the object, press F3 and type quick smoke.


How do i get rid of these black shadows? I'm trying to render an animation about this children's crib. Essentially I'm creating a "How to install" guide as the printed one is dated and difficult to understand.

Using Blender 2.78 in cycles, I can render my object just fine. As I'll want to show where certain screws go and how the parts slot together, I want to use transparencies.

First I combined the diffuse shader with a transparent shader through a mix shader. At 50% and at 100% transparent I get these results.

So essentially if I tried to make the whole object transparent, I get these "shadows" remaining on the render.
So I decided to focus on one panel. I went 100% transparent for the Grey color and it works fine. When I try to do the same with the chrome color, the color or hue disappears but again i'm left with a kind of shadow from where the objects where.
I've removed doubles, made sure nothing is overlapping but I'm still stuck. Think it has something to do with shadows or the way I'm using the shaders. Anyways I fairly stuck and would appreciate any help. Thanks, Adam.

It won't let me post another pic yet as I'm new to the forum but my settings are as follows:
Transparency Max:4 Min:1, Bounces Max:4 Min:1, Diffuse:4, Glossy:4, Transmission:4, Volume:0,
Shadows: Checked, Reflective Caustics: Checked, Refractive Caustics: Not checked, Filter Glossy:1.0,

By increasing the Transparency Max from 4 to 24 (with some trial and error), I was able to successfully eliminate the all of the shadows from my animation. I originally tried increasing the Bounces Max to 48 with no success, so I dropped it back to 4, then increased the Transparency Max amount and everything worked.

Thanks to everyone for their help and suggestions.


Spot light looks fine in the viewport, but when I render the result is different In my viewport, I see my spot light shows fine.

But when I hit render, the spot light doesn't work.

Never mind, I forgot to delete some area lights ♂


How to pause/continue a FluidSim without Stopping the Simulation? Basically, I'm doing a fluid simulation that needs to stop at one frame and continue 50 frames later. I'm doing this by keyframing the "Enable" toggle on the Inflow object ON and OFF.

However, every time I make it stop, the Domain shows up in view as a cube(which is what the Domain is) and then goes back to being a fluid 50 frames later when I enable it, getting rid of the fluid that was generated previously. Isn't there a way, for the existing fluid that has been simulated to stay on the scene, until it reaches the frame the enables it to generate more fluid again?

This is hilariously late, but you can hover the mouse over the render button in the outliner (looks like a camera) and keyframe this to be off whenever the the unwanted domain box appears. Hope this could help someone with the same problem at least.


Why do objects following a path have a random drastic rotation? For this blend file I have a curve with many vertices that form a consistent smooth path. I'm animating a walking spider along the curve, it follows the curve perfectly position-wise, and "follow curve" is also checked to enable rotation. I also pressed "alt+g" to make sure it's position is at its default and everything is set how it should be.

But, for seemingly no reason whatsoever, between literally just one frame and another, there are these extremely intense changes in rotation that make the spider rotated completed off its axis for the rest of the path animation as it moves. When I played with the curve in edit mode, I have no idea why this happens, but tiny slight changes in a vertex location have this extremely devastating effect on the spider's rotation to the point where it just flips completely around it's axis completely. How do I prevent this sort of thing from happening? It's a completely smooth curve, all of the arrows have a smooth transition in their orientation from one another, I see no reason for this. A similar thing occasionally happens when I'm rigging bones.

check your tilt rotation (in your curve) in vertices that you find weird rotation of your object

in curve edit mode:
Alt + t
to clean

Ctrl + t
to "play" with your tilt rotation

you can even do this with all vertices selected or part of them


How can I bake textures on uneven goemetry without tearing and stretching There is a bug posted at the following page which shows that baking using raytracing (Selected to Active) is showing artifacts in some situations that ruin the bake.

https://developer.blender.org/T43696

By looking at the bolts, it can be seen that they are being sheared vertically along the middle.  It seems that elongated polygons are not being handled well on the code side of things.

Until this issue can be fixed with a proper code solution, a quick walk-through using an artist's workflow would be useful until things are repaired.

This issue can be solved by adding evenly spaced loops along the long axis of the model and then later deleting them after the normal map is baked.

The problem here is that altering a models geometry after the Tangent map is baked can invalidate a Tangent Space map.

There is a way around this:

(i) We can bake to an Object Space map first

(ii) Now the extra loops can be removed

(iii) Finally, a second bake pass that uses the Object Space map as Input for the Material normals can then be used to transfer the Object Space map info to a Tangent Space map and the resulting map will be valid for the low poly model that has had its control loops removed after the bake has taken place.

You can safely treat this second bake pass as a color transfer more than anything else.  Blender internal makes this quick and straight-forward. With practice, it shouldn't take more than 30 seconds even if you are being patient and going slow. Back to this in a minute.

To start with, add the control loops to one of the boards and then by using linked-duplicates, move and rotate the other boards into place; now most of the setup can be done on only one of the components and the changes will be reflected on all of them.

Here the loops are added in by using Ctrl+r and then pressing the NumPad(+) key about 30 times to increase the number of segments.

Now the pieces can be joined into one Object so the UV's can be layed out(mostly)properly as shown next.  Try to use all the available space so that the texture resolution is not wasted.  Also, try to leave a fair amount of space between the UV Islands and the borders so the textures do not bleed across the seams.  Mipmapping can exaggerate this issue so it's best to not skip this last detail.

Now bake to an Object space map and the results should be error free so long as the 'Selected To Active' settings are correct with regards to Bias/Distance/Cage controls that are available when Using Selected To Active for baking from a High-Poly Model to a Low-Poly model.

There are two good reasons to start with Object Space maps in a situation like this.  First, the models' geometry can be further reduced after the bake has taken place without invalidating the Normal Map because Object Space Maps are not susceptible to that problem.

Second, Object Space maps can be blurred without issue in a 2D Editor such as GIMP.

Blurring Tangent Space maps will almost certainly cause you problems.

The following animation shows how to quickly remove all the extra control loops prior to converting the Object Space map to Tangent Space.

To start with, Select the end faces and then use Ctrl+i to invert the Selection.  Now Use Ctrl+Numpad(-) to contract the Selection.

Switch to Edge Selection Mode and hold down the Shift and Alt keys and start mouse-clicking the long edges one at a time.  The combination of keys and clicks will remove the long edges from being selected.

When only the extra loops are still selected, use x+g to delete all the loops. Now there should only be the basic framework of the pieces just as before.

Next add a Blender Render(Blender Internal) Material and a texture to the material which should be set as an Object Space normal map using the settings shown in the following image.  The bake settings are also shown at the top right.

Now when you press bake, you should end up with a Tangent map that does not require the use of Selected to Active and its encoding should match up with the Low-Poly model.

Now for the Materials texture, replace the Object Space map with the Tangent space map and set the Image Sampling to 'Tangent' instead of 'Object' and you should have the following results.

Here is the Tangent map being used to light the model with GLSL.

Next the same normal map is being used in Cycles.  A Glossy shader is being used to exaggerate the normal map's detail in order to look for errors.  Glossy is basically a worse-case scenario for normal maps.  If looks good for shiny, it should always look good.(maybe not if it's really small and far away; then shiny will cause twinkles when the normal map detail is smaller that the computer screens pixels. :) <-You can fix that by blurring the map by a few pixels in GIMP, Krita, Photoshop, etc.


Mirror modifier creates duplicate vertices when modeling I have a mirror modifier on a few loose meshes I've joined into a single mesh (original image).  When I try to move one part of the mesh (the leg), it seems to duplicate the vertices I'm trying to move and leave the original object behind.
Why is the mirror modifier not working correctly?
Image before moving leg:

Image after moving leg with modifier:

Check the box of the 'bisect' Y axis in the mirror modifier.
The mirror modifier duplicates your whole mesh and mirrors it as a whole, so that's why there are duplicate vertices. To make it mirror only one side and get rid of the other, you must check the 'bisect' axis as well (bisecting literaly means cutting in half).
If the side it got rid of was not the one you wished to get rid, also check the 'flip' box in the same axis.


Compositing: How the resize the scene to fit the matte? I've a scene and an image matte built from an image with a green rectangle depicting a hole. I'd like to have the camera view resized to fit the hole.

The image with the hole may change, the hole may be sized and located differently (no input about that, only the green color of the pixels).

I have used a Transform node at the location indicated with ?. I have to adjust the offsets and the scale factor visually to position the camera view exactly in the hole. I'm looking for something automatic if this exists, or the most effective solution in any case.

I'm a true beginner.

Assumptions:

This final result is an image, not an animation.
The green rectangle and the camera have the same W/H ratio.
The image appears in the foreground, normal to the camera view axis, in the composited result. No perspective is involved.

You can use a Plane Track Deform: in doing so, you'll be able to apply the scene both on a rectangle or a deformed plane.

Open the "matte image" in the Movie Clip Editor on "Tracling" mode
Add 4 markers near the corners

Select all the markers and add a Plane Track

Drag the corners to fit the "hole" you want to fill with your scene
Open the Node Editor and the Plane Track Deform (add > distort > plane track deform)


How Can I change the Alpha parameter in this Material nodes I am doing animation using MakeHuman and blender in the Cycle Render mode. As mentioned this image, I try to fix materials for the skin of the person. I just need to know How can change the parameter value of alpha. Any help?

use the math node to modify the alpha output of the image :


Grease Pencil stroke thickness not behaving in render like in viewport I have a weird behaviour with GP stroke thickness. I managed to get a consistent line thickness on a scaling up house I made — thanks to some keyframes on the GP object (Thickness scale and its layers' individual Stroke Thickness).

Very happy with the animated viewport look.

Problem is when I render a video, the scaling thickness is ignored. The weirdest is that it seems to render with the thickness from the frame I'm on in the viewport.

Meaning that depending on where I am on the timeline, I'll get different renders.

Any idea what could be the problem ?

viewport preview : https://gyazo.com/46e87ad00c4e2b5ed75789b07fbfec80

rendered animation : https://gyazo.com/81fd1ce37efbd954618a1ee369c3e95c

Blend file : https://gofile.io/?c=SFQO49

Using 2.82 daily build

Thanks again from the help of the Blender Discord server users, I've been told that the "Adjustments > Stroke Thickness" does not render.

I managed to get the look I want using the "Strokes > Thickness Scale" setting only.

edit : This bug is now solved with the latest 2.82 build.


OpenVDB file and Blender Cycles i imported a open vdv file and render it but I looks blocky and has weird lines in the end render  I didn't change any settings from the volume, what can I do to make it, well not look like garbage

In many cases you should have at least some basic grids included to render a decent result. (Here I'm using a vdb I have on my system as an example, you should be able to follow along just fine)

Firstly, check what grids you have available here:

Second check the step size setting in the render section of the volume object. As it appears to currently be too coarse, try to lower it some. Perhaps it will help.
See the documention on the Volume Object

Using the grids we have available, you can now build a nice material like this(based on your comments, this particular vdb has more grids available, so could have a more complex material if desired):

click to enlarge

In this example, the render looks like this:


How to stop the timer when the ESC key is pressed I'm testing the following add-ons.

This is an add-on that will print 'test' every 0.1 second.

import bpy

bl_info = {
    "name": "TestPanel",
    "author": "taichi",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "3DView",
    "description": "test",
    "warning": "",
    "support": "COMMUNITY",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Print"
}

class test_PT_Panel(bpy.types.Panel):
    blidname = "test_PT_Panel"
    bl_label = "test Panel"
    bl_category = "test"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

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

        row = layout.row()
        row.operator('wm.modal_test_operator',text ='TestButton')

class test_OT_Operator(bpy.types.Operator):
    bl_idname = "wm.modal_test_operator"
    bl_label = "Modal test Operator"
    _timer = None
    returnValue = 0.1

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

    def execute(self, context):

        def printFunction():
            print("test")
            return self.returnValue

        wm = context.window_manager
        bpy.app.timers.register(printFunction)
        wm.modal_handler_add(self)

        return {'RUNNING_MODAL'}

    def cancel(self, context):
        wm = context.window_manager
        self.returnValue = None

classes = (test_PT_Panel,test_OT_Operator)
register,unregister = bpy.utils.register_classes_factory(classes)

if __name__ == "__main__":
    register()

When I press Esc key in the above add-on, I get the following error.

line 46, in printFunction
    return self.returnValue

 line 653, in __getattribute__
    properties = StructRNA.path_resolve(self, "properties")
ReferenceError: StructRNA of type test_OT_Operator has been removed

I know how to implement Cancel using Timer of ModalOperator, but I don't know how to implement Cancel using normal timer.

I would like to know how to do this without errors.

You will have to unregister your timer function in the cancel method.

To do so I had to bring printFunction out of the operator class, because otherwise it needs self argument, and I haven't found how to bring it with the function to the timer register operator. So now the idea is to set returnValue not as class's instance's variable (using self.returnValue), but as class's variable (using bpy.types.YOUR_OPERATOR_CLASS instead of self) - in execute, cancel, printFunction and any other method or function.

import bpy

bl_info = {
    "name": "TestPanel",
    "author": "taichi",
    "version": (1, 0),
    "blender": (2, 80, 0),
    "location": "3DView",
    "description": "test",
    "warning": "",
    "support": "COMMUNITY",
    "wiki_url": "",
    "tracker_url": "",
    "category": "Print"
}

class TEST_PT_Panel(bpy.types.Panel):
    blidname = "TEST_PT_Panel"
    bl_label = "Test Panel"
    bl_category = "test"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

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

        row = layout.row()
        row.operator('wm.modal_test_operator',text ='TestButton')

def printFunction():
    print("test")
    return bpy.types.WM_OT_modal_test_operator.returnValue

class Test_OT_Operator(bpy.types.Operator):
    bl_idname = "wm.modal_test_operator"
    bl_label = "Modal test Operator"
    _timer = None
    returnValue = 0.1

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

    def execute(self, context):
        bpy.types.WM_OT_modal_test_operator.returnValue = 0.1
        wm = context.window_manager
        bpy.app.timers.register(printFunction)
        wm.modal_handler_add(self)

        return {'RUNNING_MODAL'}

    def cancel(self, context):
        bpy.app.timers.unregister(printFunction)
        bpy.types.WM_OT_modal_test_operator.returnValue = 0

classes = (TEST_PT_Panel,Test_OT_Operator)
register,unregister = bpy.utils.register_classes_factory(classes)

if __name__ == "__main__":
    register()

Note that once the variable is changed as class variable it keeps its last meaning even after operator is over. You can for example reset it as class variable in cancel method. You can also add for example set_time: FloatProperty(name="Set Time", default=0.1) to your Operator class and in the execute method set bpy.types.WM_OT_modal_test_operator.returnValue = self.set_time - so you could change it at the begining of every launch of your operator, like this: bpy.ops.wm.modal_test_operator(set_time=0.5) and also to use this property in ui panel.

UPDATE:
Found much easier solution with less changes to your code. Set your printFunction to self._timer variable and register and unregister self._timer

import bpy

class TEST_PT_Panel(bpy.types.Panel):
    blidname = "TEST_PT_Panel"
    bl_label = "Test Panel"
    bl_category = "test"
    bl_space_type = "VIEW_3D"
    bl_region_type = "UI"

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

        row = layout.row()
        row.operator('wm.modal_test_operator',text ='TestButton')

class Test_OT_Operator(bpy.types.Operator):
    bl_idname = "wm.modal_test_operator"
    bl_label = "Modal test Operator"
    _timer = None
    returnValue = 0.1

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

    def execute(self, context):
        def printFunction():
            print("test")
            return self.returnValue
        self._timer = printFunction
        wm = context.window_manager
        bpy.app.timers.register(self._timer)
        wm.modal_handler_add(self)

        return {'RUNNING_MODAL'}

    def cancel(self, context):
        bpy.app.timers.unregister(self._timer)
        self.returnValue = 0

classes = (TEST_PT_Panel,Test_OT_Operator)
register,unregister = bpy.utils.register_classes_factory(classes)

if __name__ == "__main__":
    register()


I can't generate pitchipoy armature This is my 1st time using pitchipoy armature and i can't generate it. This is the error messages :

The automatic rig generating scripts are only designed to work with the provided meta rigs. While there is some ability to alter the rigs, they tend to be very specific about bone names and parenting relationships.

You will need to replace the bone/s that you deleted and probably get the parenting configured to match the original rig. This could mean it is easier to add a new meta rig and start again.

Even if you don't want to use all of the bones provided, you can leave them there and not weight paint them to any part of your mesh. Then you can place the bones on a separate bone layer that you can leave hidden so that they aren't in your way when you are animating.


How to Tweak Dragon Scales Scaling from a Particle Emitter I'm working on a dragon and want to use a particle emitter to put scales on it (emitting one scale from each vertex, big thanks to Mr. Blaquart for that suggestion!).  Does anyone know of a technique to scale up or down the individual emitted scales based on where they are on the dragon's body?  For example, I need smaller scales near the end of the tail but larger scales near the chest.

Ideally, I'd like to be able to do something like set some per-vertex data that scales the emitted object from that vertex (which I could then adjust via proportional edits to get a smooth transition between sizes of scales).  I've played around with applying the particle system so that each scale is its own object and then manually scaling batches of them with proportional edit in object mode, but that method won't work as well once I have non-scale dragon parts in the scene.

Anyway, here's a screenshot with a small bit of the dragon (that I've been using for tests) to show what I'm doing (and where I'm running into problems; as the tail gets narrower, the scales clip through each other and lose visual definition).  On the right is the full particle system, and on the left is that same bit in edit mode so that you can see the vertices:

I really appreciate any help or clever ideas you folks can provide!

Define a vertex group on your particle emitter, the tail, and use weight paint to make the part with larger scales stronger (red) and smaller scales weaker (blue). In your particle settings under "Vertex Groups" there is a field called "Length". Add the vertex group you just created to that. Now, the scales should be larger where the weight is high and shorter where the weight is low.

Hope that helps and answers your question.


why does the texture gets stretched on my rectangle shaped object? I have UV Unwrapped my rectangle looking object.
Even though the UV looks fine to me, the texture gets stretched.

I tried using heavier subdivide to make each face more like a square, I tried different seam patterns but I couldn't find the solution.

I noticed that when I Scale an object, the texture gets stretched, so I created a new squared and extruded it from one side to make a rectangle instead of scaling it to the side, but still same thing happened, texture got streched.

I also tried googling this question, but couldn't find a tutorial talks about unwrapping a rectangle, this might be because it's so easy so no one creates a tutorial about this.
but anyways I finally made the decision to ask myself in here.

How can I fix this?

Below you can find a screenshot of my object, seams and the UV.

Best regards,
Amirreza

The stretching is happening because your model's polygons are rectangular, but the UVs are square. Apply Scale to the object before UV unwrapping.

To apply scale, select your object in Object mode, then go to Object > Apply > Scale (or CTRL + A > Scale)