Blender 2.8 Viewport Render Image is dark and different to actual viewport When I render the viewport from "View > Viewport Render Image" it appears different and far darker.

Images are darkened in wireframe and solid mode but not in material preview or rendered preview (cycles / evee).

HOWEVER, if any other render passes beside "Combined" is chosen then it then starts to appear darkened if viewport rendered.

Viewport shot here is darkened

Viewport shot in combined mode is completely fine, however, there is no color in the X & Y grid, likely darkened like the rest.

Unsure if this is related to the same problem, but the little preview window in the materials panel has also been darkened.

to clarify, this problem is only happening in this specific blender file. A new blend file does not exhibit any of these problems. Restarting the computer and or blend file does not fix anything, and I am unsure as to when this started happening.

I had a similar issue. Navigate to Properties editor ‣ Render ‣ Color Management - If you have changed the settings in there it will affect the render, but not the viewport view. Using the sub-option curves You can set the rendered picture to appear similar to the viewport. It helped in my case.Hope it helps you too.


Enabling import/export .FBX addon I have User Preferences --> Addons --> Import-Export: Autodesk FBX Format checked, but .FBX does not show up in  File --> Import.
Is there something else I need to do to enable this?

Thank you.

Did you click "Save User Preferences"?  If so, it should be under File --> Import --> FBX (.fbx)


index out of range for UIList causes panel crash I am writing an addon that displays the mesh modifiers in a listbox, with the settings below the box.

The issue I have is with the active index for the listbox - I'm using a custom property because there is no internal 'active' property for modifiers. The problem I have is that when the last modifier is removed, the index reaches true zero (index size zero), and I get a panel crash plus a console message:

IndexError: bpy_prop_collection[index]:index 0 out of range, size 0

If I then re-add a modifier, the problem resolves and the panel(listbox) reappears.

How can I structure this so the listbox doesn't crash when the index reaches size 0?
Here's the backbone of the script:

import bpy

bpy.types.Object.modifier_active_index = bpy.props.IntProperty()

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

    global num
    global atype
    global aname
    global amod

    num = bpy.context.object.modifier_active_index

    ob = context.object
    obname = context.object.name
    amod = bpy.data.objects[obname].modifiers[num]
    amods = bpy.data.objects[obname].modifiers
    atype = bpy.data.objects[obname].modifiers[num].type
    aname = bpy.data.objects[obname].modifiers[num].name

    rows = 2

    row = layout.row()

    row.template_list("UI_UL_list", "", ob, "modifiers", ob, "modifier_active_index", rows=rows)

Edit:

class OBJECT_OT_modifier_move(bpy.types.Operator): #move active modifier down in stack
bl_idname = "object.modifier_action"
bl_label = "Modifier Action"

action = bpy.props.EnumProperty(
    items=(
        ('UP', "Up", ""),
        ('DOWN', "Down", ""),
        ('REMOVE', "Remove", ""),
        ('ADD', "Add","")
    )
)

def invoke(self, context, event):

    ob = context.object
    idx = ob.modifier_active_index

    if self.action == 'ADD':
          if bpy.ops.object.modifier_add(type = '') == {'FINISHED'}: #how do I call the menu with modifier.type enums
              ob.modifier_active_index = len(ob.modifiers) - 1
    try:
        mod = ob.modifiers[idx]
    except IndexError:
        pass
    else:
        if self.action == 'DOWN' and idx < len(ob.modifiers) - 1:
            if bpy.ops.object.modifier_move_down(modifier=mod.name) == {'FINISHED'}:
                ob.modifier_active_index += 1
        elif self.action == 'UP' and idx >= 1:
            if bpy.ops.object.modifier_move_up(modifier=mod.name) == {'FINISHED'}:
                ob.modifier_active_index -= 1
        elif self.action == 'REMOVE':
            bpy.ops.object.modifier_remove(modifier=mod.name)
            if idx >= 1:
                ob.modifier_active_index -= 1

    return {"FINISHED"}

You simply need to handle the case of an invalid index or an empty list of modifiers.

You could for example test if len(ob.modifiers): ... if there are any, but I would rather catch all bad indices using try ... except IndexError:

import bpy

class OBJECT_PT_modifiers(bpy.types.Panel):
    bl_idname = "OBJECT_PT_modifiers"
    bl_label = "Modifiers"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

        rows = 2
        ob = context.object
        idx = ob.modifier_active_index

        try:
            mod = ob.modifiers[idx]
            layout.label("%s (%s)" % (mod.name, mod.type), icon="MODIFIER")
        except IndexError:
            layout.label("no modifier selected")

        row = layout.row()
        row.template_list("UI_UL_list", "modifiers", ob, "modifiers", ob, "modifier_active_index", rows=rows)

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Object.modifier_active_index = bpy.props.IntProperty()

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Object.modifier_active_index

if __name__ == "__main__":
    register()

Note that an index of -1 is not considered bad, because it refers to the last item in a list in Python.

You shouldn't use global anywhere, it is certainly not needed. modifier_active_index is globally available for all objects, and you don't need globals inside the draw function to refer to the modifier.

Also note that if you use UI_UL_list, the second argument should be some unique string to prevent collisions with other UI_UL_list that may exist in the panel.

Edit: How to handle (re-)move actions while always showing the panel (even with no modifier)

import bpy

mod_icon_map = {m.identifier: m.icon for m in bpy.types.OBJECT_OT_modifier_add.bl_rna.properties['type'].enum_items}

class OBJECT_OT_modifier_move(bpy.types.Operator): #move active modifier down in stack
    bl_idname = "object.modifier_action"
    bl_label = "Modifier Action"

    action = bpy.props.EnumProperty(
        items=(
            ('UP', "Up", ""),
            ('DOWN', "Down", ""),
            ('REMOVE', "Remove", ""),
        )
    )

    def invoke(self, context, event):

        ob = context.object
        idx = ob.modifier_active_index
        try:
            mod = ob.modifiers[idx]
        except IndexError:
            pass
        else:
            if self.action == 'DOWN' and idx < len(ob.modifiers) - 1:
                if bpy.ops.object.modifier_move_down(modifier=mod.name) == {'FINISHED'}:
                    ob.modifier_active_index += 1
            elif self.action == 'UP' and idx >= 1:
                if bpy.ops.object.modifier_move_up(modifier=mod.name) == {'FINISHED'}:
                    ob.modifier_active_index -= 1
            elif self.action == 'REMOVE':
                bpy.ops.object.modifier_remove(modifier=mod.name)
                if idx >= 1:
                    ob.modifier_active_index -= 1

        return {"FINISHED"}

class MODIFIER_UL_listtype(bpy.types.UIList): #custom UIList type for modifiers

    def draw_item(self, context, layout, data, item, active_data, active_propname, index):

        modifier = item

        if self.layout_type in {'DEFAULT', 'COMPACT'}:

            layout.prop(modifier, "name", text="", emboss=False, icon=mod_icon_map[modifier.type])

            icon = 'RESTRICT_RENDER_OFF' if item.show_render else 'RESTRICT_RENDER_ON'
            layout.prop(item, "show_render", text="", icon=icon, emboss=False)

            icon = 'RESTRICT_VIEW_OFF' if item.show_viewport else 'RESTRICT_VIEW_ON'
            layout.prop(item, "show_viewport", text="", icon=icon, emboss=False)

            icon = 'EDITMODE_HLT' if item.show_in_editmode else 'OBJECT_DATAMODE'
            layout.prop(item, "show_in_editmode", text="", icon=icon, emboss=False)

        elif self.layout_type in {'GRID'}:
            layout.alignment = 'CENTER'
            layout.label("", icon=mod_icon_map[modifier.type])

class OBJECT_PT_Modifiers(bpy.types.Panel): #panel draw class
    """Creates a Panel in the Object properties window"""
    bl_label = "Modifiers"
    bl_idname = "OBJECT_PT_Modifiers"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "object"

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

        ob = bpy.context.object
        rows = 2

        row = layout.row()
        row.template_list("MODIFIER_UL_listtype", "", ob, "modifiers", ob, "modifier_active_index", rows=rows)
        col = row.column(align=True)
        col.operator("object.modifier_add", icon='ZOOMIN', text="")
        col.operator("object.modifier_action", icon='ZOOMOUT', text="").action = 'REMOVE'
        col.separator()
        col.operator("object.modifier_action", icon='TRIA_UP', text="").action = 'UP'
        col.operator("object.modifier_action", icon='TRIA_DOWN', text="").action = 'DOWN'

def register():
    bpy.utils.register_module(__name__)
    bpy.types.Object.modifier_active_index = bpy.props.IntProperty()

def unregister():
    bpy.utils.unregister_module(__name__)
    del bpy.types.Object.modifier_active_index

if __name__ == "__main__":
    register()

Remarks:

Creating a lookup dict is way better for icons
Move up, move down and remove actions can be handled in a single operator
Don't do ob.modifiers[ob.modifier_active_index] anywhere without range change or try/except construct
Check the result of modifier_move_up() and modifier_move_down(), as it may fail (MultiRes can't be below a non-deforming modifier)
All classes can be (un-)registered at once with (un-)register_module()
Use consistent indentation (4 spaces for every level)


How can we store EXIF-type metadata in renders? I used Blender this afternoon to turn a panorama into an extremely wide-angled photograph. This got me wondering: would it make any sense to store EXIF data in images generated by Cycles so you get the FOV, ISO, Arpeture, and so on? Especially since HDR formats are like the digital equivalent to taking a picture, I can see it being useful for making accurate composites, faking camera shake, and other things. Do Radiance HDR or OpenEXR keep track of that sort of metadata? I tried looking around and couldn't find anything. How do professionals keep track of that meta data in their renders or does nobody care?

I don't know of any option to add this data from within Blender, but I would think an extension would be the best solution (there are already options for timestamps and other such simple info IIRC).

For now, a possible solution would be to use a 3rd party application such as GIMP to add this information to the file.


Moving or zooming in Blender 2.8 on Mac So I am doing a thumbnail for my team, and when I load my project, I can zoom and move around for about 20 seconds before it's not working, I can now do anything, but zoom in or out and movie my camera so I can't see the back, and it's really annoying. It's like my screen freeze, but I can look around. It does that to all of my project. I am on Macbook Air on Blender 2.8.

I found out it is when I am at like 2m from my 3D skin it starts to slow down and stop. Does any one know how to fix it?

This probably happens because your viewport is set to perspective view.
Therefore, the camera slows down when near it's limit.

Switch to orthographic mode, and all will work again.

View > Perspective/Orthographic
Shortcut: Numpad 5


How to perform element-wise multiplication with mathutils.Vector? In Blender's I can add/subtract mathutils.Vector without any problems.

vec3 = vec1 - vec2  # OK return a vector

But! It's paint to multiply/divide vector. For example if i multiply vectors i'll get a float.

vec3 = vec1 * vec2  # ERROR return a float

Is there a method to multiply/divide vectors correctly? like vec1.mult(vec2) which exists in other game engines.

I am amazed mathutils.Vector class does not support vector scaling by another vector!

This can be for example useful when you get scale vector from matrix decomposition and you want to scale other vectors accordingly.

This is with a generator expression for better performance:

vec3 = Vector(x * y for x, y in zip(vec1, vec2))


AttributeError when adding keyframes in draw function I am trying to add add keyframes to an object from values in a csv file using python. It successfully reads the file and puts it into a list. However, it just gives me this error when adding the keyframes.

AttributeError: Writing to ID classes in this context is not allowed: Camera, Object datablock, error setting Object.<UNKNOWN>

This is the code that i have so far:

def draw(self, context):
    results = []
    layout = self.layout

    obj = context.object

    with open('record.txt', newline='') as inputfile:
        for row in csv.reader(inputfile):
            results.append(row)
    line = 0
    for x in results:
        line += 1
        if line > 2:
            currentFrame = str(x)
            xRot, yRot, zRot,_,_ = currentFrame.split(';')
            xRot = xRot.replace("['", "")
            print(xRot + " " + yRot + " " + zRot)
            obj.rotation_euler[0] += float(xRot)
            obj.keyframe_insert(data_path="rotation_euler", frame= float(line), index=0)
            obj.rotation_euler[1] += float(yRot)
            obj.keyframe_insert(data_path="rotation_euler", frame= float(line), index=1)
            obj.rotation_euler[2] += float(zRot)
            obj.keyframe_insert(data_path="rotation_euler", frame= float(line), index=2)

I would appreciate suggestions in how to solve this issue.

The draw function is for UI only (defining layout and visibility of properties, sliders etc). It's called multiple times per second, sometimes 20 or more times, as you move your mouse around

You can't change bpy.data (including keyframes) from inside draw, it is blocked by design. You probably don't want to repeatedly execute that code anyway. A standard approach is to Run it from Text Editor with or without an enclosing function.

If this represents the first and second line of the the dataset, and the next lines are all formatted like line 2.

dataset.txt

GYROSCOPE X (°/s);GYROSCOPE Y (°/s);GYROSCOPE Z (°/s);Time since start in ms ;YYYY-MO-DD HH-MI-SS_SSS
9.08;-1.04;-9.51;20;2015-07-03 14:17:34:206

code

import csv
import bpy

def some_function(fp):

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

    results = []
    with open(fp, newline='') as inputfile:
        row_gen = csv.reader(inputfile)
        next(row_gen) # skip first line.

        for row in row_gen:
            results.append(row[0].split(';'))

    # start making frames at frame 1
    for idx, frame_data in enumerate(results, 1):
        xRot, yRot, zRot = frame_data[:3]
        print(xRot, yRot, zRot)
        obj.rotation_euler[0] += float(xRot)
        obj.rotation_euler[1] += float(yRot)
        obj.rotation_euler[2] += float(zRot)
        obj.keyframe_insert(data_path="rotation_euler", frame=idx, index=-1)

some_function(fp='/home/zeffii/Desktop/zen/dataset.txt')

The -1 at the end indicates that the keyframe is to be added after the other existing keyframes.

For info about paths; whether to use back or forward slashes, see:

  https://blender.stackexchange.com/tags/path/info

Adding this for completeness, because it differs across Operating Systems.


Creating actions based on local location/rotation/scale of an object This may be a noob question, but I couldn't find the answer around.
I am trying to create a set of actions that I would like to apply to different object. The issue I have is that if the action includes the 'location' keyframe then the animation brings the object back to where the action was created. Here there's an example:
The yellow cube has a 2 keyframe animation, it simply moves down of 1 unit from its current location.

If I apply the same Action to the blue cube and I click play, the blue cube gets the same location of the yellow cube, instead of simply going down by 1 unit from it current location.
How can make it work in a way that I can apply an action to any object and that will work based on the location/rotation/scale of the object?
I hope the question is clear, thanks for reading!

just animate the delta transform instead of the location, then you can link the animation data to the other cube. This works.

if you need a step by step explanation for this, just let me know.


Documentation on Cycles BVH traversal and intersection algorithm Newbie to blender/cycles here.
Wondering if there are any documents/papers which explain the algorithm used in Cycles for BVH traversal and intersection?
Making sense of the code will be much easier if I can read about the algorithm/math first.
Any pointers will be appreciated.

Thanks much,
Gaurav.

The wiki page for Cycles' BVH links to three publications that it implements. Below you can find the links to the papers* as well as the abstracts.

(*) The links are different from the ones in the wiki, because one of them returns a 404 and another one is very slow.

Stich, Martin, Heiko Friedrich, and Andreas Dietrich. "Spatial splits
   in bounding volume hierarchies." Proceedings of the Conference on
   High Performance Graphics 2009. ACM, 2009.

  Bounding volume hierarchies (BVH) have become a widely used
  alternative to kD-trees as the acceleration structure of choice in
  modern ray tracing systems. However, BVHs adapt poorly to nonuniformly
  tessellated scenes, which leads to increased ray shooting costs. This
  paper presents a novel and practical BVH construction algorithm, which
  addresses the issue by utilizing spatial splitting similar to
  kD-trees. In contrast to previous preprocessing approaches, our method
  uses the surface area heuristic to control primitive splitting during
  tree construction. We show that our algorithm produces significantly
  more efficient hierarchies than other techniques. In addition, user
  parameters that directly influence splitting are eliminated, making
  the algorithm easily controllable.

Wald, Ingo, Solomon Boulos, and Peter Shirley. "Ray tracing deformable scenes using dynamic bounding volume hierarchies." ACM Transactions on Graphics (TOG) 26.1 (2007): 6.

  The most significant deficiency of most of today’s interactive ray
  tracers is that they are restricted to static walkthroughs. This
  restriction is due to the static nature of the acceleration structures
  used. While the best reported frame-rates for static geometric models
  have been achieved using carefully constructed kd-trees, this paper
  shows that bounding volume hierarchies (BVHs) can be used to
  efficiently ray trace large static models. More importantly, the BVH
  can be used to ray trace deformable models (sets of triangles whose
  positions change over time) with little loss of performance. A variety
  of efficiency techniques are used to achieve this performance, but
  three algorithmic changes to the typical BVH algorithm are mainly
  responsible. First, the BVH is built using a variant of the “surface
  area heuristic” conventionally used to build kd-trees. Second, the
  topology of the BVH is not changed over time so that only the bounding
  volumes need be re-fit from frame to frame. Third, and most
  importantly, packets of rays are traced together through the BVH using
  a novel integrated packet-frustum traversal scheme. This traversal
  scheme elegantly combines the advantages of both packet traversal and
  frustum traversal, and allows for rapid hierarchy descent for packets
  that hit bounding volumes, as well as rapid exits for packets that
  miss. A BVH-based ray tracing system using these techniques is shown
  to achieve performance for deformable models comparable to that
  previously available only for static models.

Dammertz, Holger, Johannes Hanika, and Alexander Keller. "Shallow bounding volume hierarchies for fast SIMD ray tracing of incoherent rays." Computer Graphics Forum. Vol. 27. No. 4. Oxford, UK: Blackwell Publishing Ltd, 2008.

  Photorealistic image synthesis is a computationally demanding task
  that relies on ray tracing for the evaluation of integrals. Rendering
  time is dominated by tracing long paths that are very incoherent by
  construction. We therefore investigate the use of SIMD instructions to
  accelerate incoherent rays. SIMD is used in the hierarchy
  construction, the tree traversal and the leaf intersection. This is
  achieved by increasing the arity of acceleration structures, which
  also reduces memory requirements. We show that the resulting
  hierarchies can be built quickly and are smaller than acceleration
  structures known so far while at the same time outperforming them for
  incoherent rays. Our new acceleration structure speeds up ray tracing
  by a factor of 1.6 to 2.0 compared to a highly optimized bounding
  interval hierarchy implementation, and 1.3 to 1.6 compared to an
  efficient kd-tree. At the same time, the memory requirements are
  reduced by 10–50%. Additionally we show how a caching mechanism in
  conjunction with this memory efficient hierarchy can be used to speed
  up shadow rays in a global illumination algorithm without increasing
  the memory footprint. This optimization decreased the number of
  traversal steps up to 50%.


Object Rotation with polar angles python I would like to know how to rotate an object around its center point,that the angle from the z axis is theta and the XY plane rotates in angle phi via python scripting.

To avoid any misunderstanding let me reiterate with this illustration.

Click to enlarge.

$\theta$ will control the orientation on the red axis.
$\phi$ will control the orientation on the blue axis.
If $\theta$ is a multiple of $\pi$, $\phi$ won't change the final orientation.

We can construct a quaternion from the $\theta$ and $\phi$ rotation and chain them. The mathutils.Quaternion class provides a rotate(other) function for this purpose.

import bpy
import math
import mathutils

θ = math.pi / 3
ϕ = math.pi / 2

q = mathutils.Quaternion((0, -1, 0), θ)
qϕ = mathutils.Quaternion((0, 0, 1), ϕ)

q.rotate(qϕ)

bpy.context.object.rotation_mode = 'QUATERNION'
bpy.context.object.rotation_quaternion = q

While this works, it doesn't really produce polar coordinates. Certain polar coordinates should be the same, and they currently aren't.

Calculation the spherical position

You can directly calculate the x, y and z values.

$x = \sin{\theta} \cos{\phi}$
$y = \sin{\theta} \sin{\phi}$
$z = \cos{\theta}$

Then you can generate a quaternion pointing to that position with the to_track_quat function.

position = mathutils.Vector((math.sin(θ) * math.cos(ϕ),
                             math.sin(θ) * math.sin(ϕ),
                             math.cos(θ)                ))

q = position.to_track_quat('-Z', 'X')

This will give you good control over which axis is oriented where.


Rendering on command-line with GPU? I am trying to submit a render job via slurm on our cluster with blender 2.8, that is, completely command-line based with no way to start the GUI on the computing nodes.

I have assigned 38 CPU to the task (so that the resources are assigned on a single machine) and plenty of RAM. Unfortunately, Blender uses only about 5 CPUs and the whole thing is disappointingly slow, with 5s/frame. (We are not only rendering the scene but are especially saving the motion vectors and depth map, which seems to take it's time).
On a local machine with 2 Geforce 1080 Ti, I got it running with 1.5s/frame.

We also have nodes with 20 CPUs and 2 Geforce 2080 Ti each. How do I configure CUDA on such a job?

The following script allows you to enable all GPUs and optionally all CPUs as well.

import bpy

def enable_gpus(device_type, use_cpus=False):
    preferences = bpy.context.preferences
    cycles_preferences = preferences.addons["cycles"].preferences
    cuda_devices, opencl_devices = cycles_preferences.get_devices()

    if device_type == "CUDA":
        devices = cuda_devices
    elif device_type == "OPENCL":
        devices = opencl_devices
    else:
        raise RuntimeError("Unsupported device type")

    activated_gpus = []

    for device in devices:
        if device.type == "CPU":
            device.use = use_cpus
        else:
            device.use = True
            activated_gpus.append(device.name)

    cycles_preferences.compute_device_type = device_type
    bpy.context.scene.cycles.device = "GPU"

    return activated_gpus

enable_gpus("CUDA")

The script can be called from the command line by starting Blender with the -Por --python flag followed by the path and name of the script.


Power of 2 style grid and grid scale subdivision hotkeys How would I set up a grid similar to unreal engine 4 power of 2 grid/UDK/GTK Radiant/Hammer, etc in the 2D and 3D views. I also want to be able to decrease and increase the grid subdivisions with hotkeys. For example, in unreal engine 4, "[" or "]" would increase and decrease the subdivisions.

I need the grid to be the same for everything and I can't seem to find anything. I've been looking for an answer to this for a very long time and I hope someone can help me.

You can set up your hotkey with wm:context_scale_float and set the scale to 2.0 and 0.5 respectively, for 2.8 the Context Attribute is now space_data.overlay.grid_scale.


What is the best way to make these wire wraps around a mesh? i'm trying to re-create this type of effect on a body mesh i have modeled
basically lots of metal curves wrapped around the mesh, most of them starting from the chest area (the center, core in the image)
the legs are more complex but i'm not doing that, just want the upper body to be shown.
is there a workflow i could use? i'm not too experienced in blender, i was thinking of curves or maybe particle system like hair, but i'm lost...

btw, it's just the model i want for now, if it's possible to animate it growing out it would also be cool, but i have a way of animating an already modeled mesh

I don't know if there's a "procedural" way to do it, but you could do it manually this way:

Once your body is ready, create a second mesh (plane) over the body.
Activate the Snap / Face mode, with all its options enabled.
Begin to extrude your plane to make your straps. As the Snap is enabled, the vertices will stick to the body underneath.
When you'll have finished you can add a Solidify modifier to give thickness, a Bevel modifier to make the angles round, then a Subdivision Surface modifier to smooth (+ press the Smooth Shading button on the Tools panel > Tools > Edit > Shading.
Add some edge loops to your straps to give them more angular angles.


Default Weight-Paint Sample I'm trying to fine tune custom controls for myself but I'm having issues with selecting bones while painting weights.

In default Blender settings, when in the weight-paint mode, you can use  CtrlSelect Mouse to select the joints quickly and continue painting. I have been trying to find the command in the Key configuration list for months now and I can't find the right command.

I've seen posts where people say it worked properly in Maya settings, but I've tried to get this working in both Windows and Linux Mint and Ubuntu with Blender 2.73 up to 2.78c

There is no command I can find that even suggests selecting bones or joints in blenders default controls. Can anyone help me out on this?

You can select the bone using a right click (as selection is working like that in most Blender's function).

It is sometimes easier to select them using the properties panel.

For instance, when you are in selection masking modes, right click allows to select the model faces or vertices and not the bones:


How to get material_index from individual faces in a Blender 2.8 Script Did you know, you can assign different materials (eg:colors) to different faces in a polygon?
Before Blender 2.8 you could get a list of the materials used for each Face with:
for aFace in anObject.data.polygons : print ("material: ", face.material_index)

However, in Blender 2.8, I guess 'material_index' is no longer a property of polygons. I'll show you:
>>> anObject.data.polygons.material_index
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
AttributeError: 'bpy_prop_collection' object has no attribute 'material_index'

How can I walk through polygons or faces and get the material_index for each?
Trying to write a file exporter for faces and their colors.

I used faces, I'm pretty sure that's what you were going after . It requires you are in edit mode to work and a mesh is currently selected.
import bpy
import bmesh

ob = bpy.context.object
assert ob is not None and ob.type == 'MESH', "active object invalid, select a mesh"
materials = ob.data.materials.items()
mesh = bmesh.from_edit_mesh(ob.data)
indexes = [[face.index, face.material_index] for face in mesh.faces]
material_indexes = []
for index in indexes:
    tuple = (index[0], materials[index[1]])
    print(tuple)
    material_indexes.append(tuple)

Result:
(0, ('mat2', bpy.data.materials['mat2']))
(1, ('Material', bpy.data.materials['Material']))
(2, ('Material', bpy.data.materials['Material']))
(3, ('Material', bpy.data.materials['Material']))
(4, ('Material', bpy.data.materials['Material']))
(5, ('Material', bpy.data.materials['Material']))

if you need just the material_index, you can take it back a step:
print(indexes)


How to rotate textures? Or how to set texture coordinates? I'm currently trying to texture a road with textures from CC0Textures. I've got an asphalt texture and a road lines texture both Principled BDSF with their own colour, roughness and normal maps. The only problem is, is that the road lines come out facing the wrong way.

My node setup looks like this.

You can use "Mapping" node: with this node you can edit scale, location and rotation of your texture. Just add it to the node tree of your shader and connect the "Vector" output to the "Vector" socket of your image nodes (try only mask first, and if it doesn't work try with both mask and color/rgh/nrm maps). "Mapping" node needs the "Texture coordinate" node (Shift+A > Input > Texture coordinate).

But I would suggest to properly UV unwrap your plane, so the direction is set in the UV editor once:


How can I make a tower of stacked boxes stable in the game engine? I have a tower of flat boxes, but the simulation is not stable. I have tried with split impulse turned off and on.

I have tried:

setting the collision shape to box, convex hull, and mesh
increasing the number of steps per second and iterations per step (though this does improve the stability, it still eventually collapses without outside influence)
enabling deactivation
start deactivated (but as soon as an object touches the tower, it gets very "bouncy")

I have even tried to gradually increase gravity, hoping that the boxes would eventually gently settle all opposing forces (gravity and contact constraints). This blend file shows that gravity is squishing the boxes a bit.

This technique, combined with enabling deactivation seems to work alright, until an object activates the boxes (on contact). Does anyone know of a less hacky way to prevent a tower of boxes from bobbing up and down like this?

Is there a way to make this kind of tower stable without resorting to these kinds of tricks?

Put collision shape to box and increase  linear and angular damping up to your needs. Remember higher the damping, higher the viscous effect will be (honey like). I suggest to start with 0.3 for both and then try to tune them up until they are stable.


Silk Option Missing from Cloth in Psychics Tab I am trying to make a bed in Blender as part of a personal project but the Silk option is missing under the cloth in the Psychics tab. I have made the surface below have a collision put on it, but I just can't find it! Any help?

Cloth presets are just a script placed within the folder where blender is installed

/blender/blender version/scripts/presets/cloth/

create a new text document with the following:

import bpy

bpy.context.cloth.settings.quality = 5

bpy.context.cloth.settings.mass = 0.150

bpy.context.cloth.settings.structural_stiffness = 5

bpy.context.cloth.settings.bending_stiffness = 0.05

bpy.context.cloth.settings.spring_damping = 0

bpy.context.cloth.settings.air_damping = 1

and save the file as silk.py

Or just use those values on blender and save a new preset using the plus (+) sign on the presets.


Blender explosion animation not rendering I am trying to create an explosion in Blender. However, when I try to render the explosion, this white box gets bigger in my particle domain but I can see the explosion in the viewport. What am I missing?

Found out that I just needed to put on a material for my domain. Now there is no box. But when rendering there is no explosion either. 1 frame just renders for like 10 minutes and there is no explosion. Guess I'll have to try to make my explosion from scratch.


Subtracting Geometry? I have two models - we'll say a sphere and hollow cylinder - that I'm working with.  Effectively, I want to 'subtract' the hollow-cylinder shape from the sphere.  I know from certain orientations (the top of the sphere) this is fairly easily done, just a matter of deleting and creating new faces.  However, from other orientations the edges/geometry doesn't line up so easily.  Is there an automatic (or at least, not terribly difficult/manual) way to 'subtract' one mesh from another?

You can use a Boolean modifier.

For example, adding a boolean modifier to a sphere with the operation set to Difference, the parts of the sphere which intersect the object specified in the modifier will be subtracted.

As a bonus, a quick way to select an object for a modifier (or anywhere a similar selection interface is used) is by pressing E while hovering over the object selection drop down and clicking on the desired object in the 3D view.


One Particle System is working, the other comes out the underside of the Emitter object? I’m making a flower. I have the petals weight-painted around the bulb which are working just fine. I made a second vertex group but the smaller central petals are coming out of the bottom of the mesh. Is it not a Normals problem? How could that be?

Ok, I figured it out—I needed to go to my source object, rotate it 180 degrees along the Z axis, and apply (Ctrl+A) the Rotation.


Good strategies for camera matching I've been blocking out the shapes of a rather visually complex interior. I used fSpy to match the camera to the perspective.

I've got some of the shapes blocked out, but finding the correct scale, orientation, and location of each part has proven to be extremely time consuming. Thus far, I have been just messing with the elements and moving then around and doing tiny little adjustments until it finally clicks in place.

For you folks that have more experience with this, is there a better way?

Are there any strategies to make this process more streamlined and easier?

Thanks in advance

What you are doing should be pretty easy, you should be using the fspy blender plugin BLAM.  Blenderguru did a video using a similar plugin to model a hallway:  https://www.youtube.com/watch?v=nb6rSMAooDs&t=160s

Hopefully you just need to tweak your workflow a bit.


Trying to Bake Texture But it's Black So first I'd like to say I'm still a complete wreck at Blender, I'm self taught, which a lot of people are; but I might be making a stupid mistake, though for the life of me I can't figure out what it is.

For whatever reason, I cannot get my texture to bake properly, it's black after every baking attempt. It is rendering correctly, the nodes are set up right in that regard I'm assuming. I'm not sure if I have something checked that I'm over looking, though I went through my settings multiple times. I have a light source.

If anyone could maybe take a look at what I have going on and tell me what's wrong, I'd much appreciate it.

simple. your viewing in texture, not material at least i think so... im reinstalling blender on my laptop to check r now


Blender 2.79 on Mac Os 10.12 import csv data using Python Most advice on importing csv files seems to assume users are on Windows, not Mac and many hours of effort has not helped this noobie to figure out the Mac setup and paths to import csv files to Blender text window. So I'm thinking just create a big string as below outside Blender and paste into Blender Python text window and then program a way to convert this string to a list(lines of data) of lists(variables). Does this make sense? Simple enough but somewhat defeatist!

CSV FILE 5 LINES
number,y,x,z,m
1,0,0.44,8.19,11.21
2,-11.68,8.13,8.31,7.22
3,-1.54,1.42,5.93,2.16
4,-7.1,3.13,6.25,1.42
5,5.17,3.13,8,1.39

(REAL DAT WILL BE 1000+ LINES)

MANUALLY CONVERT TO A LONG STRING
quakeTxt="1,0,0.44,8.19,11.212,-11.68,8.13,8.31,7.223,-1.54,1.42,5.93,2.164,-7.1,3.13,6.25,1.425,5.17,3.13,8,1.39"

PASTE INTO BLENDER

Because the script below doesn't work

import os
import bpy

blendPath = /Users/dickmeehan/Desktop
fileName = "xyzevents.csv" # name of the csv which is on Desktop

txt = open(blendPath + fileName, "r") # open the file to read
quakeTxt = txt.read() # read the entire file into a string
txt.close() # close the file
print(quakeTxt)

Use the os.path module

I'm not on a mac.  The code you posted wont work on any os, unless you have a "/Users/dickmeehan/Desktopxyzevents.csv" csv file in your user folder.

import os

dirpath = "/Users/dickmeehan/Desktop"
filename = "xyzevents.csv"

filepath = os.path.join(dirpath, filename)
txt = open(filepath, "r")
quaketxt = txt.read()

txt.close()
print(quaketxt)

Note: If the blend file is saved then the folder it is in is

blenfolder = os.path.dirname(bpy.data.filepath)

Use the filebrowser

To avoid having to hardcode in paths altogether, open Text Editor > Templates > Operator File Import and edit any occurences of ".txt" to ".csv". (approx line 28)

# ImportHelper mixin class uses this
filename_ext = ".csv"

filter_glob = StringProperty(
        default="*.csv",
        options={'HIDDEN'},
        maxlen=255,  # Max internal buffer length, longer would be clamped.
        )

run the script, select the file... and bingo prints the selected csv file to system console.  Edit the read_some_data(..) method to suit.

Use the Text Editor

open the csv file in a text block (or paste into new  and rename)

for line in bpy.data.texts["xyzevents.csv"].lines:
    print(line.body)

Lastly

There is no need to convert to some unwieldy string.

csvtext = '''
number,y,x,z,m
1,0,0.44,8.19,11.21
2,-11.68,8.13,8.31,7.22
3,-1.54,1.42,5.93,2.16
4,-7.1,3.13,6.25,1.42
5,5.17,3.13,8,1.39
'''

print(csvtext)


Removal of Program to reinstall not gone entirely I have 2.79 and a heap of addons that do not work when they should be, Hard Ops, etc.  Also, my Alt Click on edge loops stopped working so I figured I should reinstall Blender.  All the new versions say Install 2.8 but I can't seem to install it, also, I have tried to remove 2.79 to do a new clean install, I watch Windows remove the program, then I go and remove the folders, reinstall Blender, and it is the same version I tried to remove, complete with Addons, and all.

How do I completely remove everything to do a clean install since I am clearly not doing that very well, and

How do I "Install" 2.8 when I only get an exe to start the program.  There doesn't seem to be any sort of "install" to place Hard Ops, Box Cutter, etc. in a directory for 2.8.

My apologies if these are repeated questions, I could not find anything related to them, and thank you for your assistance.

To remove blender completely go to Control Panel -> Remove a program -> remove blender, then go to C:\Users\Your-Username\AppData\Roaming\ and remove the folder called Blender Foundation (This is where blender saves it's stuff), then reinstall blender.

about Blender 2.8, here is the link to download it: https://builder.blender.org/download/

just download the .zip folder, unzip it, then run the Blender.exe file (You don't need/have to "Install" it), Thats it :)


Giving lettes an individual node First of all. Im a total noob at blender. I only have a few days of training.

I am working on a logo for an animation. Im trying to bake the scene, but my text is too long for only one bake map (or texture or what ever) So I have seperated each letter so they can be baked one at a time. But they all still share the same node ?

How do I give them one each ?

First go to Material Tab, then click the + button next to your material, now press the 'Brows Material to be Linked' button and finally press the 2 button next to the material name. Now you have to go to edit mode and click the Assign button at the bottom of the materials list while the letter you want to give the particular material is selected.
By adjusting the new material you will now change the previous
Just see the Gif.


Imported object distorts on scale I have a distortion problem when I scale an object. I have applied all transformations, ie rotations are all 0, scales are all 1. Whether I use XYZ Euler or Quarternian rotation, I cannot scale to either local or global axes without distortion occurring. The object was pasted from another drawing (ie using 2 copies of Blender, & copy & paste.) There are no constraints. It seems like all the vertices have incorrect axis data, a diagonal offset or something . . .
Anybody know how to fix?
Link to file - https://www.dropbox.com/s/2i35cj8fvyr81o8/Distorted.blend?dl=0

    Thanks for your answer - I zeroed the deltas also, what I really needed to do was align the object's longest dimension with the global y axis, ie pointy end looking straight forward. It seems that only a custom orientation to view will do this. Seems like there might be a hotkey or something specifically for this.

Your object is behaving that way because it has some custom "delta transforms":

and scaling along an axis in object mode behaves like this:

If you scale it in edit mode it seems correct, though.

After resetting delta location/rotation to zero, and resetting location (ALTkbd>G):

it scales as expected:


texture is not going on the outside of my rock object only the inside I'm using blender 2.77 fracture version.

The texture does not show in final render and when I'm in object mode. when I'm in edit mode it shows
This is in object mode after UV unwrap

This is inside the cube

I have been checking your blend and it looks like the normals of the fractured object just point inwards instead of outwards (Recalculate Normal -> then it should work again, and of course re-execute Fracture)

I also took the liberty to tweak your blend a bit. As the rock texture was not packed, i just put the bottle texture onto the fractured object as well, just for demonstration. For example I used triggers and constraints, and reduced the displacement a bit, because the displacement "happens" after the physics and the more displacement you have, the more unnatural the shards will behave.

Edit: to have an "inside" actually, you need a solidify modifier on top and a Fracture Modifier below it, and need to refracture. The "inside" of the solidified object counts as "outside" too and will have the same material as the "real" outside of the cube. Additionally you could set an "inner material" on the Fracture Modifier and refracture. This will be applied to the inner shard faces.


How to draw rectangle in a plane? I have created a plane, then have created grease pencil and configured it to constraint drawings to that plane. Unfortunately, I can't contraint draw behavior to the plane too:

I.e. while I am drawing a rectangle, it looks rectangular only from that side view I was looking to the scene

Can I simulate 2D vector drawing more natural?

This is a great question, and had to think about it, but I think I have a simple solution:

Go to Draw Mode
With the box tool draw a rectangle at any location and orientation you want in the 3D Viewport.
Hit Enter to confirm the box location, orientation, size
Optional: change your view so you can understand this technique is not dependent on world view
Enter Edit Mode
With the Selection Tool active set the Selection Mode to Select Only Points or Select all Stroke Point

Select the whole rectangle you just created

Now switch the Cursor tool

With the Cursor tool selected go to the tools Settings and and set the Transformation Orientaion to Local

From the 3D Viewport Menu chose Grease Pencil > Snap > Cursor To Selected (you can also use the shortcut key: Shift + S  )

Go back to Draw Mode
Draw with any tool on the rectangle and then move your view to see that the strokes are in the same drawing plane.

You can see the drawing plane by turning on the 3D Canvas in the Viewport Overlay (In the Edit Grease Pencil section, put a checkmark next to Canvas to turn it on)


How can I make a material only apply to a side of a plane? How could a one-sided material be achieved with the Cycles renderer?

I would like to create a plane that is completely transparent from one side, and a mirror from the other side.

It would be cool if Cycles/Blender simple supported backface culling like the game engine. But I guess it doesn't?

How could something like that done with nodes?

In cycles it's a simple matter of using the Backfacing output of the Geometry node:

The Backfacing output gives us white (a value of 1.0) on the side that's facing away, and black (0.0) on the side that the normal is pointing

(This is what you see if connecting the Backfacing output to an emission shader as a sort of viewer node)

So connecting this to the Fac of a Mix shader with Glossy (the mirror) and Transparent shaders will give the effect you're looking for.

You can do this in Blender Internal renderer exactly the same way only with slightly different nodes.

As for backface culling in the viewport, there's a check-box for that in the Display Panel of the Properties Shelf in the 3D view:

Which would of course make faces on the other side of the normal direction transparent by definition:


cycles transparency results in color loss when background is black? to make exactly clear what i want:

i want to use a scripted animation that uses live motion capture data for projection mapping.
it shall look like some sort of energy beams or electricity going out or into the body of the actor.
for that i rendered a set of png's that use alpha which i added as an image strip to make an animated texture with animall.

so far so good, everything is working.. with one exception.

wanting to do stuff live, i obviously don't want continuous rendering resulting in a mess of noise, so i thought - let's do it in material viewport shading in cycles

i added a node setup for transparency, which works fine in rendered mode.
but to ensure that i can use tranparency in material viewport shading, i switched to internal, adjusted transparency settings and switched back to cycles.
my problem: this results in transparent mesh, but the color of my texture is gone.
why is this and how can i prevent it?

blend file:

i took a second look at the background plane and i noticed that the loss of color appears when the plane's material color is set to black. when it's white, the texture appears blue, although it's hard to see. my goal is to achieve transparent mesh with a texture fading to alpha in viewport material mode, that keeps the blue color no matter what background plane there is. having to use a white background makes transparency obsolete in my case.

why is this happening?
is there a workaround? (like really fast live rendering without noise that doesn't look too bad?)

Short answer

It won't work. Your technique has a fundamental problem that I'll explain below, but even if your technique was correct, some limitations of Blender's viewport will make impossible to produce the correct result.

Long Answer

Why the method you used wont work:

You say you used pre-rendered PNGs as source, and that's the problem.

PNGs use unassociated (often called "straight" alpha), which is inappropriate for compositing light effects.
The explanation is rather simple: A lighting effect, such as fire, electricity arcs, laser beams, etc.) is a purely emissive phenomenom, so itt's basically an addition (the light source adds luminosity but doesn't occlude any of the background).

When you use an unassociated alpha image (like your PNGs) every pixel with alpha > 0 will occlude the light coming from the background.
The phenomenom you're trying to reproduce shouldn't occlude any light from the background, so its alpha has to be 0.

But in unassociated alpha images, there is no RGB information where alpha is equal to zero, as that information is discarded by the alpha over operation for unassociated.
What you need is an associated image (often called "premultiplied), that lets you have RGB where alpha is equal to zero for this kind of effects, that need pixels that are luminous but don't occlude the background at all.

For that reason, PNG won't cut it.

The proper way to composite luminous effects:

If you use instead EXR images you'll be able to produce lighting effects that can be mixed with the alpha over operation as if they were a pure addition.
Just render your lighting effects on black, use a "set alpha" node to assign a 0 value (black) to the alpha channel and save as EXR, and you'll have some nice lighting effects ready to be composited.

Why it won't work anyway:

Blender's viewport, and to some extent cycles have some limitations regarding alpha manipulation.
The materials view does some funny things flipping between associated and unassociated alpha, which results in RGB with alpha zero being lost before it gets to your screen
So, even if you try to produce the right shader with cycles (which could work in the compositor), the material view will kill it.
Your best bet is cycles with a good GPU that can keep up the pace needed for realtime preview.

Since the phenomenom is purely emissive, you need an emit shader which is extremely fast to render, and the good news is that you need a few samples to get it rendered. Noise shouldn't be a problem (just use 8 for start resolution and one sample for preview, it will be fast and noise free).

The bad news is that cycles has some problems producing a proper output from a shader constructed with an alpha-driven mix where pixels have to be luminous, so you can connect the nodes in cycles to produce a luminous premultiplied image, but it won't render correctly.

But wait, there's hope! :-)

Not everything is lost: If your ligthing effects are purely emissive and you don't need any occlusion (which means, all your alpha will be zero), you can create the effect with cycles.

First you have to create an emission shader using the ligthing effects rendered on black background as texture, then you need to ADD that shader to a transparent shader using the add shader node.
The output will work in the cycles render view and it will be fast.

It won't work in the materials view, though. It will render white.


Motion Tracking. What do the graphs represent and how are they useful? After tracking things on a video clip or image sequence, I get a graph with green, red and sometimes blue lines.

What do those lines represent, and how are they useful to get more accurate tracking or a better camera solution?

The red and green lines on the graph show you the speed of the trackers at a given frame. Green is vertical movement, Red is horizontal. The red and green curves will always start at zero in the first frame of the scene, and will move away from zero as the tracking points change position on the following frames. Objects closer to camera will move faster than those far away, so the speed in trackers in the foreground will be greater and objects far away will tend to stay closer to zero.
The curves are useful to see if particular trackers are moving differently than the average. A line that spikes way out of the norm might mean a tracking error, like a tracker slipping out of place, or maybe it means that an object is moving differently than the rest, and shouldn't be part of the overall camera solution. You can manually edit the curve by selecting a point in the curve and dragging it or deleting, that will affect the corresponding tracker on that particular frame.
In this example most of the trackers follow the same pattern. The green line that strays from the norm is a tracker that is wandering off. By manually moving the trackers or retracking with different parameters you could get the curve to match with the rest, but in most cases is better to re-track or find a different section of the scene that can yield more accurate tracking.

Once you have done your tracking and hit the camera solve motion button, a bunch of blue lines will appear, They represent the reprojection error for each tracker.

"The reprojection error is a geometric error corresponding to the image distance between a projected point and a measured one" (wikipedia).
Blender wiki says:
"Reprojection error means the average distance between reconstructed 3D position of tracks projected back to footage and original position of tracks. Basically, reprojection error below 0.3 means accurate reprojection, 0.3-3.0 means quite nice solving which still can be used. Values above 3 means some tracks should be tracked more accurately, or that values for focal length or distortion coefficients were set incorrectly."
The blue curves cannot be selected or edited directly on the graph window, but if you select a tracker on the tracking window the corresponding graphic will turn a darker blue, so you can see at what frame the reprojection is failing.
Finding the trackers with the highest reprojection errors is easier on the dopesheet for tracking data. It has a way to sort by Average error and you can see the numbers right next to the trackers name.

Finally, the lonely blue line that comes out when you click on the film strip is the average per frame error.
This curve is available only after pressing camera solve and is not editable.
This is the one line that you want to be as flat as possible and as closer to zero as you can. The high points will show you where in your shot you are having inaccurate tracking.

For general tips on motion tracking please read this post: How can I get better results when doing camera motion tracking?


Blender does not start Installed Blender on a machine with Core i7 CPU, 16GBs of RAM and an NVIDIA GeForce 650. I managed to run Blender twice. On the third time nothing was shown and Blender didn't load properly, even though the active icon is in the tray and the program is in the running application list of task manager. Why is this happening?

Do you usually work on Two screens? (Two monitors or a monitor and a laptop).
I have found that if i use blender on the second monitor and then unplug it blender will not automatically come over onto the primary screen.

you might need to plug in your second monitor,(if you have one) and see if it is there.

Hope this works for you!


How to make a glass material having a dotted design and lines? I am new to blender so I don't know much procedural materials. Recently, I started to create a model of my own house in blender and I don't know how to make a glass material look like my window's material. I tried to add roughness to glass but it still having a nice and smooth surface. Rather I want a dotted glass material and with some designing lines. I am sharing an image too.   Please refer picture and help me.

How about that:

And that's the bump map for it (made in inkscape in less than 5 minutes)


Im making many objects one model, while still looking like many different Objects, How would I do that? Basically I have 3 different objects that are not touching, but I want to make them into a model like that, how would I do that?

Join them together.

Select the first initial object by right clicking on it then subsequently selecting the rest (by right clicking on them) while holding the shift key. Once each object that you want in the same object is selected, press CTRL+J.

(This is all assuming you have left the key shortcuts their default values.)


Rigid body following path I'm trying to make a rigid body sphere follow a path while it rests on another rigid body, which I'm tilting in different directions in order to balance the sphere, but I'm not having much success after several failed attempts. It ends up staying in the same place, like the image below, unless I manually keyframe the path but then it instead ignores the physics.

If I remove the path constraint and just treat it as a rigid body, it does react to the tilting plane below but quickly ends up rolling off the plane due to the physics, even if I only rotate the plane along one axis. I also want to be able to loop this which is another reason I want to try and solve this by applying a path constraint.
Is it possible to solve this in some way without having to manually keyframe everything? Any help would mean a lot to me.
Here is a link to the blend file if it helps: https://pasteall.org/blend/0f5d12df4024418d935c5e435661f760

just clear that "animated" checkbox in your sphere and it works.

result:


blender edge crease Invalid He doesn't work when I use subdivisions

This is the uploaded file
https://drive.google.com/open?id=1rKluT2TomDGfA4u_UMgL3OPLji65zgjx


Offsetting "hair" particles from their emitting mesh I have been following along @BlenderGuru's "Blender Beginner Tutorial Series".

At this moment of the last video, Andrew suggests duplicating the doughnut "Sprinkles" particles system from the "icing" to the plate below.

I did so and ended with the following setup:

So: the sparkles sometimes entering the icing feels realistic (both are partly melted sugar). But I do not want them to intersect with the plate.

How would you keep some random look to them while ensuring they are at a strict distance from (and parallel to) the plate mesh (half their radius typically)?

Here are the most significant particle system settings:

I shared my .blend file here: https://files.fm/u/ncqy88rn

I have made a research for similar questions on Blender Stack Exchange, but most seem to ask the opposite question (how to ensure hairs are properly rooted in their emitting mesh).

Answer taken from here. It's a bit of a clunky solution.

Say you have used an object as hair particle on a mesh.

To offset its position from the mesh you have to first switch from using an Object as hair particle to using a Path.

Once in the Path settings change the Start value. The larger the number the more it will be offset from the mesh. Once you have an acceptable value switch back to using an Object as hair particle.


Rigid body animation problems (coin pusher animation) Im trying to make a coin pusher animation with rigid bodies in Blender.
I have a few problems.

The 5 coins on the 'pusher' itself dont fall down. They stay on the same level. They dont join and interact with the other coins.

Some coins just fly away randomly.

I have tried different shape collision objects. Increased the steps per second and solver iternations in the Rigid body world. Made sure al my normals are pointing in the right directions.
Hope anyone can help me!
Thanks x

I've only done 4 coins here.  See if these physics settings work for you.
You can see those in the Blend file below.
Make sure to check those for the slide and pusher also.

You'll notice that all coins have much the same settings, except Coin 1. (leftmost)   Varying those on individual coins will obviously affect their behavior and can be used to break up their similarity if felt necessary.
e.g. Coin 1's "Rotation Damping" is wound down to zero at frame 1 and stays that way to help it flip over when it falls. Once it has rolled over, the value is rapidly increased (keyframed) to 1.00 to settle it down.
There's not a lot more to tell you, except perhaps the significance of the coins' "Shape" being set to 'Cylinder' instead of mesh.  This improved coin-like behavior.
The  "Collision Margin" was set to 0.002 but with it shaded out, I don't think it matters.


blender not responding while pinning the image in facebuilder addon When I use blender it works properly but when I use the face builder add on and try to view and pin the image, the blender stops responding .Please help me.I repaired the blender software,ran blender as administrator ,but still it is not responding while doing the task

It looks like you have a video card that does not support the necessary OpenGL shaders. You must reinstall the video drivers. But you can’t do anything with some graphics cards such as those made by Intel.


Curving path using curved profile I'm trying to re-create an object using different curves and different paths
Example object should look something like this:

My thought was creating each half separately and joining them together, since the curves and profiles on each side are different.
I created my path along with the profile I want.

But it doesn't look anything like the left half of the object I'm trying to get

Should I be using a different technique?
I've attached the blend file.

The curve will make Y "up":

Make sure the wanted top part of the bevel object is oriented to Y with no rotation in object mode.
In your original file, the curve as no width because the bevel object has no size in Y. So all its vertices are along the curve.


Object viewing from far distances I've created mountains for a scene in the game I'm creating...
The problem is, when I go into camera, you can only see a little bit of the mountains when they're generally quite huge. Anything in general, and it's not mist so I don't know what's the problem and is this fixable.

Any suggestions...
Thank you :)

Did you try changing the clipping value of the camera.?


OpenVDB does not show in render? I was trying to render out a sequence with OpenVDBs imported from Houdini and all of a sudden Cycles stopped rendering out the actual volume but only the reflections caused by it along with my model in the scene. I can see the VDBs and everything else in the scene without issues in the viewport even in rendered view. The issue persists with Eeevee as well.
I tried moving everything to a new project and it works for a little while but it disappears randomly in the render never to be seen again. I even reinstalled blender but that didn't help as well. If anyone can offer me some advice I would appreciate it as openVDB is just so amazing!
Here's what the render and viewport look like for the same frame:

My project file: https://we.tl/t-JHqUIjXRkV

Turning the transparency off fixed everything.
Make sure to have density if you want transparent renders.


Choose Snapping Point? I have a building block that has a cube for the ceiling, walls, and floor. It also has a blast door that overlaps the walls to fit into the next building block.
The problem is that when I align the building blocks together, I want to align the edges of the walls together, using snapping.  When I try to do so, however, it snaps using the edge of the projecting blast door to the edge of the opposite wall, instead of wall-to-wall. I'm snapping from corner to corner. I made an example image:

It would be nice if I could still use snapping, like temporarily choose a specific vertex to use as a snap. What is the best way to do this?

This is the workflow I've found for doing this repetitively in Object mode.
The setup:

Pivot set to '3D Cursor'
Snap-magnet: 'Off'
Snap set to 'Vertex' and 'Center'. Because of the 'Pivot' setting, 'Center'  refers to the location of the 3D Cursor at the start of the move.
(The active tool is 'Tweak'.. it always is, for me)

The moves, for each snap:

Shift-Right  drag the cursor. Once you're in charge of the cursor, you can release the Shift.
Still Right-dragging, hold Ctrl to snap the cursor to the desired 'From' vertex. You have now established the snap 'From' point.
Now Left-drag the 'From' object to the 'To' object, with Ctrl, hovering over the target 'To' vertex. The 'From' point will snap to it.


Align selected face parallel to a specific axis Does anybody know
how i can align a face to a specific axis?
Like the guy in this video does it.

Video (link starts at 2:30 rotating happens at 2:35)
All he says is "I rotate it so, that it is parallel to the y-axis."
Already tried google & co for an answer but hadn't any success.

Thanks in advance :)

Holding Ctrl while rotating snaps in 5° steps.

RYCtrlMouse-Movement

Enabling Snap during transformation has the same effect

Another way would be to scale the vertices of a face, with all vertices of the face selected:

SZ0Enter

Related:

Is there an easy way to align two objects on a specific axis?
Snap_to_Mesh


Is it possible to drive the contents of an existing text object with a text file? Recently I have been trying to use Blender to make some screen animation templates. I am running into one major roadblock though in the form of getting large amounts of data into a pre-existing text object. It seems that the standard Ctrl+V method of pasting does not work for text objects, and I can't migrate the text from a file to my pre-existing text objects.

I know how to convert a text file to a text object, but is there any way to make a text object display what is contained in a text file, manually or dynamically?

you will need 2 text data blocks.

a script
the text

some_text_body.txt

Commodi. Do laboriosam. Veniam aliqua modi, aperiam quo so velit. Duis
elit but consequat yet aspernatur. Anim quam incidunt and do. Irure.
Laboris modi and nequeporro aute. Ipsam laboris but minima, and amet
veniam.

Quo eu. Vel. Beatae sed magna yet perspiciatis. Aliquam nesciunt,
quam, and iste, minim, quaerat. Aute natus, or explicabo and odit
eaque but aliquam. Autem. Et dolores eos, laudantium, so ab,
molestiae.

script.py

import bpy
text_object = bpy.data.objects['Text']
text_object.data.body = bpy.data.texts['some_text_body.txt'].as_string()

to get this:

Some gotchas (Texts with sparse line breaks, how to reflow / wrap ? )

With the some_text_body.txt example above I manually added newlines by hitting enter where I wanted the text to drop to the next line. Hitting Enter puts an invisible character called newline (\n). Prior to that the text was one line per paragraph. The hidden newline character is often only present at the end of a paragraph or as a single character on a line to denote a line of only white-space.

The difference looks like this:

Same text different reflows:

Unfortunately the reflow / text wrapping isn't done automatically for any of the proposed methods. see:

You can set the width of text box to automatically reflow to the next line. This is found in the Font object data panel.

And that's probably fine for most stuff, but it doesn't appear to do hyphenation on words. In that case you'd look at the Python utility module called textwrap to help reformat text with a given line length measured in characters.

import textwrap
import bpy

text_object = bpy.data.objects['Text']
text_str = bpy.data.texts['some_text_body.txt'].as_string()
new_body = "\n".join(textwrap.wrap(text_str, width=80))
text_object.data.body = new_body

But sadly this doesn't deal with the drop line in the middle..see:

then you use something like this:

import textwrap
import bpy

text_object = bpy.data.objects['Text']
text_str = bpy.data.texts['some_text_body.txt'].as_string()
text_array = text_str.splitlines()

final_list = []
for paragraph in text_array:
    final_list.append("\n".join(textwrap.wrap(paragraph, width=80)))
    final_list.append('\n')
text_object.data.body = ''.join(final_list)


Weird mesh deformation for hollow object I have a question, when I made a skull for a bird and made it hollow, it warps when I try to animate the thing, look-
Is there a way to animate it so the whole thing rotates when I move it in pose mode? I tried painting the whole skull with maximum weight painting and yet it still deforms, is there no way to fix this? Thankyou in advance for any help.

As Monolith said, it means than some other bones have influence on this part of the mesh.

The easiest way to fix it is to select this part of the mesh in Edit mode, then go in the Properties panel > Data > Vertex Groups, and in the menu on the right of the vertex groups list, click on Remove From All Groups so that the vertices you've selected won't be part of any group anymore, and won't be controlled by any bone.

Now keep the vertices selected, in the vertex groups list select the group these vertices are supposed to be part of (i.e. group that has the name of the head bone) and click on the Assign Button.

Or to assign you can also switch your armature to Pose mode, select the object, switch to Weight Paint mode, select the head bone (it should be blueish), then paint with the brush (Mix option).


Is there a way to render a pass that will color planes depending on a direction they facing? I have this cube like head. Is there a way to quickly render a "mask" pass that will color all planes facing in the same direction to a same color?

For example, all planes facing forward - red. All planes facing top - green, etc.

I thought normal pass will do it, but it seems R B G channles of normal pass render only 1 side of a mesh, while other side remains black (in this particular image this measn G channel will be almost black, only exception is sphere eyes,   because all white or 1 pixels will be on the other side of the head).

Normals are normalized vectors and their values can be negative. You can just shift them from (-1,1) to (0,1) for them to be visible as colors:

You can also do math or use something like mixed color ramps to separate specific angles:


How to scale/repeat texture on object? (blender internal) How do I make the texture on my object smaller? (I'm pretty new to blender, any help would be appreciated)

I want that texture repeated, (e.g to make the whole thing look like lizard skin)

In the properties panel, textures tab, go to the mapping section and modify the size of the texture.

For fast editing of the 3 values simultaneously, left click on the x fileld, drag to z field without releasing, then - still without releasing - drag left to decrease and right to increase the value.

A bigger value means smaller texture.


How to bake a Bent Map (Object Space Normal) correctly with Cycles? I am trying to bake a bent normal map with Blender Cycles but i get weird results by default. I mean it works but it's not the same colors as other map bakers like XNormal or Substance Painter, the texture looks like this:

You have to fix the axis of the baking option in the swizzle line because Blender uses different axis in the 3D viewport than other software. So you must use +X +Z -Y.

Also don't forget to reset the orientation by doing an "Apply" with the shortcut Ctrl + a then Apply Rotation.


Deforming objects along the surface of other objects Hello I have made a chain model and I want to put some objects on it but objects must deform and cover up chain. it should be like this example

Thank you for your helps.

So one of the cool things about a torus-- which is what a chain link is-- is that it unwraps really nicely.  You seam it twice and it makes a perfect square.  And any tiling texture on that square will tile on the torus.
So what I might try here is to take that knowledge and create some displacement maps for my toruses.  You could build each link's stuff as a flat scene, then render to a height map, and apply that height map as displacement to your torus.  (UV mapping the individual elements would be a different matter though.)
Another option here is to use the Textools addon, which can create flattened versions of meshes.  It rips along UV seams and then creates a flattened shapekey.  From the flattened shapekey, you can surface deform other meshes, then unflatten.


Convert displacement to polygons iam dealing with this problem. I try to change from Maya to Blender and one thing is making me nuts. The displacement. I use it a lot to create geometry. So far I could not handle that in blender.
Is there any advice to do this properly?

There are three pictures, in the first one i try displacement texture but it does not affect the geometry at all and I dont now how to convert it.
Second one is how its done in Maya and how i do this.
Third one is done via modificator which happend to be bad.

As you're using the cube's UV, in the modifier you need to choose Texture Coordinates > UV. Also, reduce the modifier's Strength, and put one Subsurf above and one under the Displacement with subdivisions of 2, this will make it smooth nicely.


How do I limit the rotation of the camera in an FPS I have mouselook for my game but the player can look all the way up and down.  I want the camera to be limited in rotation like a normal fps.  Please help!

The mouse move script allows cutomization. In order to restrict up/down rotation you could add the properties as shown in the image.


no video in video sequence window I've been playing around with blender today, and now suddenly, I'm no lenger able to get a preview window of the sequence editor.

It just shows a black screen.

I have a videotrack so there should(?) be some output.

edit: Suddenly realized there is no audio either.

On the right to the preview window, you have set a proxy size to 50%. But if you don't build a proxy file, the preview can't show you a video.

So either set the Preview render to No proxy, full render, or with you video strip selected, scroll down the strip properties until you reach Proxy/Timecode and make your desired settings. Finally, to build the proxy files, have your strip selected and go to Strip -> Rebuild Proxy and Timecode indices and you're good to go.


Simple movie clip sharpening using Compositing - How to do this? I'm a novice in using Blender and am looking for an easy way to sharpen movie clips.  I believe I have to use Compositing, but am not being able to find some simple step-by-step methods to achieve this simple goal.  I looked at various tutorials on Youtube, but they are for more advanced users and use images (not movies) as examples.  How does one do this?  I have never done Compositing before.
I could not even load a single movie clip in my compositing window in the 'render layers' node that I had created in my movie project, which I believe is the first step.  If I could use just one filter successfully using the 'add filter...filter...sharpen', and apply it to my movie project, I would consider that to be a success.
I'm probably overlooking a simple step that most users are familiar with already.
I am using the latest 2.90.1 version installed on my Windows 10 laptop. I was able to create and render a short movie by joining several short movie clips shot on my DSLR camera using Blender.  Although, I am pretty sure my camera technique and equipment used was good, the final rendered movie in 24 fps, at 1920x1080 resolution is not sharp.  The built in camera picture profile I used was 'flat' with no sharpening.  I know I nailed the exposure and focus, used a tripod, a professional quality lens, etc...
Thank you

Add an Input > Image node (or Input Movie Clip node) and set the video file there.
Add a Filter > Filter node and set it to sharpen mode.
Plug the output image to the composite input and render.


How can I restrict the rendering of a parented object without removing the parent-child relationship? For Example: I have a cube and a sphere in my scene. The cube and the sphere have a parent-child relationship, such that the cube is a child of the sphere; as illustrated:

The Outliner only shows the properties of the sphere. How can I restrict the cube from the render without removing the parent-child relationship?

The Outliner is designed to be able to display a 'heirarchy' of information, that is, data that belongs to other data, including parent/child relationships.

To expand the Outliner heirarchy press the '+' (which changes to a '-' when clicked) next to the parent object:

You now have access to the selection, render and viewport visibility properties of the child object.

You can also press Numpad + or Numpad - to expand or collapse levels of the Outliner (while the cursor is in the Outliner) for multiple objects.

See the Outliner page in the Blender Manual for more information:

https://docs.blender.org/manual/en/dev/editors/outliner.html


"To Sphere" option not working I'm taking an online Blender course and the instructor is using the "To Sphere" option to make the holes for a bowling ball made from an icosphere. So for the picture here I insetted the edges, subdivided by 3, then tried "To Sphere" but nothing happened. Does anyone know how to fix this?

I would do it like this:

of course you have to drag the "to sphere" command action to get the desired amount (1 = maximum effect)


Only reflection from one side of glass material I'm doing an architectural visualization and I'm using a glass material for the balconies and a fence, but I get strange effects that doesn't look good. It seems that the glass from the windows on the facade that are behind the balconies and the glass fence get some strange distortion!? Is this really correct behavior? Compare the two images.

Anyway it doesn't look nice and I wonder if it possible to prevent this? I only want reflection from the front of the balconies and the glass fence like the sky.

It looks to me as if your balcony glass has no thickness or the normals are bad. Try either adding thickness (eg, Solidify modifier) or recalculate normals. For a physical glass pane the glass would pass through two surfaces - the front face and the.back face - and would refract opposite ways. With only one surface or with bad normals the refraction is being applied one way only - it's as if everything viewed through the balcony glass is within a solid volume of glass. I don't think that's a reflection your seeing but a refraction of the building through the glass.

Here's an image to demonstrate :

The right-most example is for 'correct' refraction - where the light is bent towards the 'normal' on entry to the glass and away from the 'normal' on leaving the other side. If the Normal of the back surface is pointing the wrong way (the middle example) then the 'exiting' ray is again bent towards the normal (directing the rays towards your building in your case). A similar situation occurs on the left-most example - where there isn't a back face since the "glass" is only a plane. In that case the light is bent towards the normal but is never bent back - as if the ray remains within the glass.


Unable to bake fluid after changing cache folder So I've been studying Blender's fluid simulation and I realized that after I set the folder's path to somewhere else other than Window's temp folder (C:\Users\User\AppData\Local\Temp) the bake progress bar stays at 0% for some seconds and then disappears. No errors or anything (the log shows no errors either) . I tried this out on my Linux machine back at home and it worked fine (the Windows machine is at work).

I had the same problem. I had a special character (german ü) in the path of the blend-file, after removing that, everything worked fine.


Texturing multiple books I have a bookshelf with 66 books in it. I want to texture most of the books differently so that it is more photorealistic. I cannot seem to find book sleeve textures very easily and texture painting seems impossible. What can I do?

Here, you can try something like this:

The main ingredient in getting different color books is the RANDOM output of an OBJECT INFO node. For this to work, the books must all be separate objects, so do what you already did - array the books, apply the array and separate by loose parts. Once this is done, you can apply the same material to all books (I used 2 - one for the cover and another for the pages), and the random output will generate a random color for each book. I didn't like the default colors it gave me so I mixed it with a bunch of others. That's what most of the nodes in the color section are. Play with them yourself to get different looks.

Another option is to run the black and white output of the random through a ColorRamp node. You can use a mix shader to change the degree of variation, and a "constant" ColorRamp setting to choose your own color scheme. However, I liked the selection given by the color mix to be more varied, especially when mixed with additional colors. (You can see at the end of the chain, one of the last steps to is to multiply by red. If you turn the mix factor up to 1, the red dominates all of the books and reminds me of the "books of knowledge" Britannica series of encyclopedias - my personal favorite) Use your own preference, however.

For the bands around the books, I used 2 different Wave Textures and lightened the mix to get 2 nice bands at the top and bottom.  (You can achieve this with only one wave texture if needed, I just used 2 because I was playing with different combinations). I sharpened their cut-offs with 2 ColorRamps - one for the color (yellowish for gold), and the other to be used as the basis for a mask, as well as the roughness factors, and (inverted) for the metallic (bands).

I used a noise texture, scaled up, to make the "bumps" on the covers. The mix node where I combine the noise with a light grey color has the effect of dampening the values of the noise so it loos more realistic. I mixed this combination with the (B&W) bands I already made to create a height-map of sorts, showing the bumps and making the bands appear to "stick out" from the books.

Finally, I used some ambient occlusion information combined with another noise texture to add "depth and wear" to the books. I turned on screen space reflections and ambient occlusion in the render properties panel, and lastly, added an HDRI for some better "reflections". The final result looks like this:

If you have UV unwrapped your books, you can also use a base "cover image" texture and randomize the colors by mixing them the same way as well, if you want. I'll post the .blend file, so anyone who wants can play around.
File is here -
Hope this helps


Where has the "Show in Viewport" option in the 2.8 branch of Animation-Nodes gone? I may be missing something, but the "Show in the Viewport" option that was available under "Advanced Node Setting" for an input data, is no longer there.

Is there a way to get the data input interact at the viewport level?

This option has been replaced by a more advanced node called the Viweport Input node. Every Viweport Input node creates an input box in the AN panel, the name of the input box is defined by the label of the Viweport Input node that defines it. The boxes can be minimized and you can change the order of inputs as you wish from the N menu. For instance, we have here two Viweport Input nodes defining two input boxes:


I make an action editor animation using keyframes, I save and quit, then when I open it back up, my animations are gone I am making an animation using Action Editor and key frames, I then go to save and quit, when I go back in, most of my animations are gone and only a few remain.

Any action that is not assigned to an object is automatically deleted by the garbage collector after a certain amount of time.
To prevent any of your unused actions from disappearing, use the Fake User feature (shield icon) to permanently keep the certain action in your blend-file's data memory.


Linked object issue with 2.8RC I am having an issue with linked objects in 2.8
I have mentioned it on the developer forums but have gotten no response so I thought I would bring it here.
https://devtalk.blender.org/t/error-when-opening-classroom-blend-with-2-8rc/8377

This started a few weeks ago using the betas and not continues with the RC

In the screenshot I am trying to load the classroom.blend from the examples page on blender.org.
https://www.blender.org/download/demo-files/

Any help would be appreciated.  I don't know if this is a bug or how I should be handling duplicated objects.

I got word from Blender that this is a design decision and no longer supported in blender any longer.

Closed issue.


How can I translate an object along its local axis using a script? I have a cube.

The cube's Z rotation is 45 degrees.

If I press G X X, I can move the object along its local X axis.

How can I do this with a Python script?

I found the answer here.

  import bpy
  from mathutils import Vector, Matrix

  ...

  trans_local = Vector((0.0, 32.0, 0.0))
  trans_world = obj.matrix_world.to_3x3() * trans_local
  obj.matrix_world.translation += trans_world


Set x-ray of two objects inside another object I have a mesh 'Suzanne' parented to an armature 'Armature'. Both are located inside another mesh 'Cube'. I want both 'Suzanne' and it's armature 'Armature' to be visible in the 3D view through 'Cube'. I tried setting the x-ray of 'Suzanne' and it's armature 'Armature' to True in Python, but then 'Suzanne'only appears through 'Cube'. I wonder how I can make both 'Suzanne' and it's armature 'Armature' appear through 'Cube'.

The .blend file can be found here in this Link

No. X-ray can't work that as as far as I know. Once you put both the armature and the monkey in x-ray, its like they are on the same "layer". The only way I can think of close to this is to invert the normals of the cube, but I don't think that meets what you're trying to do.


How to "revert" object along some axis? I can just scale the object passing its pivot, but then the scale value gets negative along that axis is that I don`t totally need. Are there any other ways to obtain it?

You can use the mirror transform to 'revert' your object.
And if you don't like negative scale, just apply the scale.

Mirror object: Object > Mirror
Apply Scale: Object > Apply > Scale

How to mirror an object and apply scale.

Note:
Applying negative scale can flip your normals orientation.
Check your normals after that, so they're not inverted.


Is it possible to use different compositor settings for different layers? I'm trying to render a second layer and every time I change something in the compositor, it makes the same changes for all layers.  Is it possible to have certain settings in the compositor for one layer and different ones for another layer?

Essentially, I am trying to get one object to have a certain colour and effect with the compositor, and the background object to have different settings in the compositor.

In this picture I have the node setup for scene 2, which is the same setup as scene 1.  If I change anything in scene 1, the exact same nodes will show in scene 2.  I want different nodes in the compositor for different scenes.

Thanks

Ok I figured it out.  I didn't select the right scenes in the Render Layers node.


How to move a mesh without disturbing origin point Whenever I try to move a mesh in any direction, the origin point also moves along with it, I am working on a project which is based on particle emanations, so I have to make the origin point glued to its original location.

Can any one help me out for this?

Simplest way is switching to Edit Mode and moving the mesh instead of moving the object in Object Mode, thus the origin stays in place:

Select the object
Toggle to Edit Mode Tab
Hit A to make sure all vertices/edges/faces are selected
Move the mesh via Grab/Move G or simply use the 3d Manipulators

In order to get precise control about moving the mesh, also see:

Is there a shortcut or hotkey that I could use to access the Transform panel of the properties shelf in the 3D viewport?
How do I rotate and scale edges in Edit Mode?
Constrain to any 2 axes during transform?


Script behaves differently when executed inside blender console vs python interpreter I am using blender as a python module and want to use this trick to get rendering results without saving on the disk:
https://ammous88.wordpress.com/2015/01/16/blender-access-render-results-pixels-directly-from-python-2/

The exact code described in the link works when I execute it in the python console of the blender program. However, it does not work, if I simply run it with python or by calling blender -b -P script.py. In those cases, bpy.data.images['Viewer Node'].pixels contains 256*256 zeros instead of the rendered cube.

I would appreciate very much any tips concerning what the origin of this difference in behavior is, and how to eliminate it.
My guess would be, that some configuration of blender is different when starting the program compared to importing bpy in python, but I have no clue where to search for.

running blender -b -P script.py will start blender in background mode, notice the -b option.
For that reason all Viewer nodes will be deactivated and set to default size 256*256.

Try removing the -b option.


How do you add an edge around a hole? I was hoping someone a little more experienced with Blender could help me out here.
I'm working on making a low poly helmet when I encountered an issue, I would like to add an edge where I have drawn the red lines but have no clue how to do so.
I would like to preferably place it parallel to the existing hole.

start with

F to fill

I to inset

O to outset

X to delete faces


Constrain particles to one axis? I can't figure out how to generate particles on a plane geometry and constrain the random movement of the particles only in the x axis. Any suggestions? Couldn't find anything on youtube or google. Thanks.

By default a particle emitter has some velocity relative to the normal of the emitter and is affected by gravity.  You can turn the normal velocity to 0 and turn off gravity, and then use the Object Aligned velocity to do what you want.


Quality loss when rendering in H.264 or even AVI RAW I rendered a video in H.264 (with what was recommended in the accepted answer here in fact: Video Quality Loss after Rendering in VSE) but the rendered video was always blurrier and less contrasted than the original sequence. So I tried to not compress anything with having AVI RAW as the output format, but even that does not seem to preserve the video quality...

Attached is a picture comparing the two: the left one is the original sequence, the right one is the rendered video (H.264 or AVI RAW look the same).

I tried to play with options such as anti-aliasing, lossless output, the bitrate or even the GOP size but the result is more or less always the same and there is an obvious quality loss.

What could this be due to? I must mention that I'm on Ubuntu 14.04 with Blender 2.77, maybe this has something to do with codecs on my operating system? Or is this quality loss unavoidable, which would be very surprising to me..?

Many thanks,

Assuming you didn't miss anything obvious (wrong resolution) I would recommend to render it out with a really high bitrate (24300k) and then use handbrake to compress it in a useful manner. The default bitrate of 6k is just way to low.

Also there may be a blur node hiding in your setup. Looking closely at the ladder on top of the mast it seems like everything is spread out by one pixel.(left original, right encoded)


What is an efficient way to rig a character made of 2 meshes? I've already tried rigging this character a few times with little success. A little background if the picture isn't completely clear: I have 2 meshes, one is the painted model, and the other is the outline around the character (a mesh with the normals reversed and a shadeless black material). I want both meshes to be rigged identically (or near identically) so the outlines isn't warped too much as the character moves. It sounds simple, but my previous attempts have been to no avail. Should I join the separate objects together and then rig them as one hardly cohesive unit? Or just wing it and rig each one individually with the same armature?

I'm sorry if my question seems like something I should figure out on my own. I'm just wondering if there is a solution outside of my experience level. Also, since outline a character the way I have done is becoming more popular, this question could definitely help you, or others in the future.

If you need for information on my character let me know. I would be willing to share the blend file, but I will exclude the painted textures. Thank you in advance for your time.

[

After you have created the rig have you tried parenting the same portion of the mesh on both objects to the same bones? This should correct any issues you are having with rigging. You could join then meshes together as well but it makes little difference on the end result.


How can I move keyframes of rig control properties in the timeline Cannot select/unselect/move keyframes (in the timeline) of rig control properties of the free blender Rain rig. For example the FK/IK toggle switch, stretch toggle etc. The keyframes remain selected always as yellow rhombuses. Even deleting the keyframes (by Alt+I hovering over a particular property) won't affect these. How can I? Using versions 2.8 and 2.83. Please refer the image.

You have hidden bones. Switch to Pose mode, go in the Properties panel > Object Data, unhide every layer, also unhide with AltH, and select all. Now you can move the keyframes.

For the Protected Layers check the explanation here.


Directional audio based on direction the camera is facing Is is possible to have two audio tracks playing but only being able to hear one based on just the rotation of the camera?

Drive the volume of the speaker.

There are three vectors of interest.

The direction the camera is facing (-Z local axis) in global coordinates.
The direction the speaker is facing (-Z local axis) in global coordinates.
The line between the camera and speaker.

In test script below, the angle between the camera vector -Z axis direction and the line between the camera and speaker are converted to global coordinates and normalized.  The dot product is used to drive the volume of the speaker.

Notice this doesn't look at whether the speaker is facing the camera, as this can also be achieved by setting the cone attributes of the speaker.

For convenience running the script will add drivers to Speaker.volume.  (Note will cause problems if speaker objects are sharing speaker data) for each speaker object in scene.

Will be verbose to the system console as there are print statements. Could look at the angle between vectors, or drive the mute property.

import bpy
from mathutils import Vector

context = bpy.context
scene = context.scene

def speaker_vol(spk, name):
    cam = scene.camera
    cmw = cam.matrix_world

    cam_vec = (cmw * Vector((0, 0, -1)) - cmw.translation).normalized()
    spk_obj = scene.objects.get(name)
    if not spk_obj:
        return 0
    smw = spk_obj.matrix_world
    spk_vec = (smw.translation - cmw.translation).normalized()
    print(spk.name)
    print(cam_vec)
    print(spk_vec)
    print(spk_vec.angle(cam_vec)) # angle in radians
    print(spk_vec.dot(cam_vec))
    return max(0, spk_vec.dot(cam_vec))

# register this driver
bpy.app.driver_namespace["speaker_vol"] = speaker_vol
# set up the drivers
speakers = [spk for spk in scene.objects if spk.type == 'SPEAKER']
for spk in speakers:
    fcurve = spk.data.driver_add("volume")
    driver = fcurve.driver
    driver.use_self = True
    driver.expression = 'speaker_vol(self, "%s")' % spk.name


DPIs in blender - How are they set up As far as I've worked with blender and GIMP(which are the ones I mostly worked with). I've only been concerned about resolutions of the images in dimensions such as 1080 X 1920. But, in some employment sites I have found that images need to be in high resolution and the standard is 300dpi. Even in blender I have never seen this option anywhere in setting up the export. I was aware that DPIs means quality of the images(didn't know it was resolution).How can we ensure that our exports are of a certain DPIs of resolution?

Edit: As Duane points out in the comment below, DPI is often incorrectly used and PPI is more appropriate. It is very likely, however, that DPI and PPI are being used interchangeably in the context of OP's question.

DPI PPI means "Dots Pixels Per Inch." It is an expression of resolution over length and is most commonly used in printing. It is used to tell other software how far to spread out the pixels for printing.

For this to be meaningful in Blender, you'll need to know how large the final reproduction of the graphic will be on a page (or poster, or whatever you're making). The math is pretty straightforward:

Render X Resolution = Print Width * DPI PPI

Render Y Resolution = Print Height * DPI PPI

For example, if you were rendering for a 4 x 3 print, the render resolution would be 4*300 x 3*300 ==> 1200 x 900.

Be aware that the rendered file will carry a default DPI PPI definition of 72 or 96, but that only tells the Inkscape or Illustrator how large to make the picture on the page at import. Once you have your render, you can change the file's DPI PPI definition in GIMP or Photoshop without changing the actual pixel count. (Be aware that other softwares may be using DPI and PPI interchangeably.)


Makehuman 1.0.2 Blender tools issues in Blender 2.72b Makehuman Blender tools from Makehuman v1.0.2 aren't showing after "install from file" in user preferences in stable version of Blender 2.72b.
Python console highlights green that the mhBlender tools have been placed in the correct folders for Blender to find them, but they don't show up in user prefs.

Another user had the same problems on the Makehuman.org forum, and a workaround was offered that worked for this guy, but it doesn't for me.

No problems with Makehuman working, only getting the Blender tools into Blender's user preferences. Same issue with Windows 7.

Problem solved!
The Makehuman sub-folders 'makeclothes', 'makewalk', 'maketarget' must be removed from the folder named Blender Tools before placing them inside Users/user name/Library/Application support/Blender/2.72/scripts/addons.
Any folder inside Blender's Addon folder must have a file named init.py; if it doesn't, Python will ignore the folder.

See this question for details of how Python uses init.py