How to correct surface normal for translated object **Edit - I'm willing to pay a $15USD bounty via Paypal for the accepted answer to this question.

I have a script which generates random points on the surface of a sphere and then places cone objects at each point.

Using the emitter.closest_point_on_mesh call I can get the surface normal from the sphere at a spot very close to the generated point and then apply that normal to the rotation of the cone object, thereby pointing the cone out from the surface of the sphere at an angle that very closely approximates the normal from the sphere surface.

However this only works when the sphere is at the world origin point. When I move the sphere, it no longer works. The cones no longer point away from the sphere surface at the normal direction.

I've tried different techniques involved multiplying the sphere's matrix_world value by the normal, but I can't seem to find the right combo to make it work.

Any help would be GREATLY appreciated!

import bpy
from mathutils.bvhtree import BVHTree
import mathutils
import math
import bpy_extras
from bpy_extras import mesh_utils
import timeit
from random import random
from math import radians
from mathutils import Vector
import bmesh

scn = bpy.context.scene
objs = bpy.data.objects

def DeletePreviousParticles():

    for o in bpy.data.objects:
        if o.name.startswith("particle"):
            objs.remove(o, True)
    #select sphere to update window
    sphere = bpy.data.objects['Sphere']
    bpy.context.scene.objects.active = sphere

def PlaceParticle(emitter,src_obj, point):

    dupCount = 0
    maxObjectDimension = 2

    new_obj = src_obj.copy()
    new_obj.data = src_obj.data.copy()
    scn.objects.link(new_obj)
    new_obj.animation_data_clear()

    new_obj.location[0]=point[0]
    new_obj.location[1]=point[1]
    new_obj.location[2]=point[2]

    new_obj.name = "particle_" + str(dupCount)
    dupCount+=1

    #calculate normal from surface of emitter
    partLoc = new_obj.location
    surfaceNormal = emitter.closest_point_on_mesh( partLoc )[1]
    print('surfaceNormal' + str(surfaceNormal))

    #the following line does not work when emitter object is not at world origin point
    new_obj.rotation_euler = surfaceNormal.to_track_quat('Z', 'Y').to_euler()

def Main():

    emitter = bpy.data.objects['Sphere']
    src_obj = bpy.data.objects['sourceParticle']

    print("starting------------------------------------------------------------")

    DeletePreviousParticles()

    me = emitter.data
    me.calc_tessface() # recalculate tessfaces
    tessfaces_select = me.tessfaces #[f for f in me.tessfaces if f.select]
    pointList = bpy_extras.mesh_utils.face_random_points(1, tessfaces_select)

    totalPoints = 20
    pointCounter = 0

    for p in pointList:

            if(pointCounter<totalPoints):

                mat1 = emitter.matrix_world
                adjPoints = mat1 * p

                PlaceParticle(emitter, src_obj, adjPoints)

                pointCounter +=1
            else:
                break

    print("done")

Main()

Here's the source file:

@rjg - Thanks again for your help! I've made a 15 Euro donation to the Blender Foundation as requested.

There are two problems in the script, the location and the rotation of the cone objects aren't correct.

The location is incorrect because the script currently sets it to the position of the randomly chosen point, not the location of the closest point on the surface. These coordinates can be retrieved through the return values of closest_point_on_mesh():

(result, location, normal, index) = emitter.closest_point_on_mesh(point)

The global coordinates are therefore:

emitter.matrix_world * location

If the goal is to align an arbitrarily chosen axis of an object with the normal, then the problem that needs to be solved is to find a rotation matrix. This matrix has to rotate the vector of the local axis to match the normal vector exactly, assuming that the vector is normalized.

One way of determining the rotation matrix is through the Rodrigues' rotation formula. It requires an angle and an axis of rotation. The angle $\theta$ between two vectors can be determined through the dot product, which is defined as:

$$a \cdot b =  \|a\| \|b\| \cos(\theta)$$

It follows

$$\theta = \arccos\left(\frac{a \cdot b}{\|a\| \|b\|}\right) $$

Any rotation angle in range $[0, \pi)$ radians or $[0°, 180°)$ can be used unambiguously. If $a$ and $b$ are unit vectors, then their magnitude is one and the division isn't necessary.

In order to rotate the vector, an axis for the rotation is required. Two vectors that a linearly independent define a plane and the cross product $a \times b$ is the normal to that plane, which is perpendicular to the two vectors.

Blender already implements the Rodrigues' formula in mathutils.Matrix.Rotation(angle, size, axis). Assuming we have a normalized vector $a$ that we want to align to vector $b$, the rotation matrix can be determined by the following code:

cross_prod = a.cross(b) # Axis used for rotation
dot_prod = np.arccos(a.dot(b)) # Angle in radians (ambiguous if >= pi)
rotation_matrix = mathutils.Matrix.Rotation(dot_prod, 4, cross_prod)

This could actually be optimized and not use arccos altogether as explained by Kevin Moran.

You can chose an arbitrary vector for $a$ as long as it isn't linearly dependent to $b$. For your specific application it makes sense that $a$ is either one of the global axis or one of the local axis of the cone object in the global coordinate system. For the latter you will have to decompose the world matrix of the cone object in order to determine it's rotation matrix and multiply with the desired axis.

# Determine the vector that will be aligned with the surface normal
if axis == 'X':
    axis_vector = mathutils.Vector((1.0, 0.0, 0.0))
elif axis == 'Y':
    axis_vector = mathutils.Vector((0.0, 1.0, 0.0))
else:
    axis_vector = mathutils.Vector((0.0, 0.0, 1.0))

# Apply the existing rotation of the object when the local axis is used
if use_local_axis:
    (old_location, old_rotation, old_scale) = new_obj.matrix_world.decompose()
    axis_vector = old_rotation * axis_vector

The adjustment of both rotation and location can be combined by creating a new world matrix for the target object.

new_obj.matrix_world = (mathutils.Matrix.Translation(emitter.matrix_world * location) * mathutils.Matrix.Rotation(angle, 4, rotation_axis) * mathutils.Matrix.Scale(1.0, 4))

Below you can find an implementation of the described solution as an add-on for Blender 2.79.

bl_info = {
    "name": "Create and Align Objects with Surface Normal",
    "author": "Robert Guetzkow",
    "version": (1, 0),
    "blender": (2, 79, 0),
    "location": "3D View > Tools > Create and Align",
    "description": "Create objects that are aligned with the surface normal of another object",
    "warning": "",
    "wiki_url": "",
    "category": "3D View"}

import bpy
import bpy_extras
import mathutils
import numpy as np
from bpy_extras import mesh_utils

class CreateAlignSettings(bpy.types.PropertyGroup):
    emitter = bpy.props.PointerProperty(type=bpy.types.Object,
                                        name="Emitter",
                                        description="The emitters surface is used to create"
                                                    " and align objects on it, according to its surface normal")

    dupli_object = bpy.props.PointerProperty(type=bpy.types.Object,
                                             name="Dupli Object",
                                             description="The object duplicated along the emitters surface")

    axis = bpy.props.EnumProperty(name="Axis",
                                  description="The axis of the duplicated object that will be aligned with the surface "
                                              "normal",
                                  items=[('X', 'X', 'X-axis', 0),
                                         ('Y', 'Y', 'Y-axis', 1),
                                         ('Z', 'Z', 'Z-axis', 2)],
                                  default='Z')

    use_local_axis = bpy.props.BoolProperty(name="Local Axis",
                                            description="Use the possibly rotated local coordinate system of the "
                                                        "duplicated object, to determine the axis orientation in "
                                                        "global space. If disable the global axis is used and the "
                                                        "object's rotation is ignored.")

    number_duplicates = bpy.props.IntProperty(name="Number of Duplicates",
                                              default=0)

class CreateAlign:
    @staticmethod
    def create(emitter, dupli_object, axis, use_local_axis, number_duplicates):
        # Remove previously created duplicate objects
        CreateAlign.remove_dupli_objects(emitter, dupli_object)

        emitter.data.calc_tessface()
        surface_points = bpy_extras.mesh_utils.face_random_points(1, emitter.data.tessfaces)

        for idx, point in enumerate(surface_points):
            if idx == number_duplicates:
                break

            CreateAlign.duplicate_and_align(emitter, dupli_object, axis, use_local_axis, point)

    @staticmethod
    def duplicate_and_align(emitter, dupli_object, axis, use_local_axis, point):
        new_obj = dupli_object.copy()
        new_obj.data = dupli_object.data.copy()
        bpy.context.scene.objects.link(new_obj)
        new_obj.animation_data_clear()
        new_obj.parent = emitter

        (result, location, normal, index) = emitter.closest_point_on_mesh(point)

        # Determine the vector that will be aligned with the surface normal
        if axis == 'X':
            axis_vector = mathutils.Vector((1.0, 0.0, 0.0))
        elif axis == 'Y':
            axis_vector = mathutils.Vector((0.0, 1.0, 0.0))
        else:
            axis_vector = mathutils.Vector((0.0, 0.0, 1.0))

        # Apply the existing rotation of the object when the local axis is used
        if use_local_axis:
            (old_location, old_rotation, old_scale) = new_obj.matrix_world.decompose()
            axis_vector = old_rotation * axis_vector

        normalized_axis_vector = axis_vector.normalized()
        rotation_axis = normalized_axis_vector.cross(normal)
        angle = np.arccos(normalized_axis_vector.dot(normal))

        # Create a new world matrix with the position of the closests surface point
        # and the rotation to align with the surface normal
        new_obj.matrix_world = (mathutils.Matrix.Translation(emitter.matrix_world * location) *
                                mathutils.Matrix.Rotation(angle, 4, rotation_axis) *
                                mathutils.Matrix.Scale(1.0, 4))

    @staticmethod
    def remove_dupli_objects(emitter, dupli_object):
        children = emitter.children

        for child in children:
            if child.name.startswith(dupli_object.name):
                bpy.data.objects.remove(child, True)

class CREATE_ALIGN_OT_create_and_align(bpy.types.Operator):
    bl_idname = "create_align.create_and_align"
    bl_label = "Create"
    bl_description = "Create duplicated objects that are aligned with the surface normal of the emitter"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        settings = context.scene.create_align_settings
        CreateAlign.create(settings.emitter,
                           settings.dupli_object,
                           settings.axis,
                           settings.use_local_axis,
                           settings.number_duplicates)
        return {'FINISHED'}

class CREATE_ALIGN_OT_remove(bpy.types.Operator):
    bl_idname = "create_align.remove"
    bl_label = "Remove"
    bl_description = "Remove duplicated objects"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        settings = context.scene.create_align_settings
        CreateAlign.remove_dupli_objects(settings.emitter, settings.dupli_object)
        return {'FINISHED'}

class CREATE_ALIGN_PT_surface_normal(bpy.types.Panel):
    bl_label = "Create and Align with Surface Normal"
    bl_category = "Create and Align"
    bl_space_type = "VIEW_3D"
    bl_region_type = "TOOLS"

    def draw(self, context):
        layout = self.layout
        layout.prop(context.scene.create_align_settings, "emitter")
        layout.prop(context.scene.create_align_settings, "dupli_object")
        layout.prop(context.scene.create_align_settings, "axis")
        layout.prop(context.scene.create_align_settings, "use_local_axis")
        layout.prop(context.scene.create_align_settings, "number_duplicates")
        layout.separator()
        layout.operator(CREATE_ALIGN_OT_create_and_align.bl_idname)
        layout.operator(CREATE_ALIGN_OT_remove.bl_idname)

classes = (CreateAlignSettings,
           CREATE_ALIGN_OT_create_and_align,
           CREATE_ALIGN_OT_remove,
           CREATE_ALIGN_PT_surface_normal)

def register():
    for cls in classes:
        bpy.utils.register_class(cls)
    bpy.types.Scene.create_align_settings = bpy.props.PointerProperty(type=CreateAlignSettings)

def unregister():
    for cls in classes:
        bpy.utils.unregister_class(cls)
    del bpy.types.Scene.create_align_settings

if __name__ == "__main__":
    register()

Porting to Blender 2.80:
Note that I haven't ported this to 2.80, because calc_tessface and related functions have been removed and I didn't know whether you had special requirements for the point selection. You would need to use a different approach to determine random face points.

Other necessary changes include:

Matrix multiplication is @ instead of *.
Annotation would be used instead of assignment for the properties.
The tool sidebar doesn't exist anymore, therefore the panel should have bl_region_type = "UI"

Instead of sending me the offered money, please consider donating it to either one of these organisations:

Médecins Sans Frontières / Doctors Without Borders
Blender Foundation


Workflow for animating object inside of object? (Organic shapes...) I'm a noob looking for best way to animate scenario below... Wrap around heart which beats.  The Wrap also inflates and deflates while heart beats.
I tried shapekeys, and although wrap is parented to heart, the keys only affect the heart...
Any suggestions?

Thanks!  Shrinkwrap looks like it might help.. I tried jacking offset to see if
it's viable as animation key, and got these results in render... any idea what's causing the artifacting?  Face normals are all pointing outwards... (I didn't check vertex or edge norms...)

Use an armature with two bones, one for the heart and one for the wrap. Make the heart bone the parent of the wrap bone. Now when you scale the heart bone, the wrap will also scale.

You don't need to use weight painting, a simple parent object to bone will work. Parent the heart to the heart bone and the wrap to the wrap bone.

Now animate the scale of the bones -

You could also use shapekeys to give more detail during the pulsing.

Example here


How can I access view3d.select_circle radius value? I thought this would have been stored in context.tool_settings or scene.tool_settings but it doesn't seem to be. I can access the default keymap value like this:

km.keymap_items['view3d.select_circle'].properties.radius

But this doesn't update after decreasing or increasing the radius any time durring or after you use the tool. Should also mention I'm not interested in accessing the Toolbar version of Circle Select radius property. I'm interested in accessing the radius property of the operator itself (view3d.select_circle). You can demonstrate to yourself how these properties differ by pressing the C hotkey vs accessing Circle Select via the Toolbar and changing the radius value on both.

Presumably the value is being stored somewhere because both the Toolbar version and direct operator radius values are stored separately. Also bpy.types.VIEW3D_OT_select_circle doesn't seem accessible, so I'm assuming I'm out of luck but thought I would double check.

Operator Properties Last

The window manager has some useful methods re looking up operators and their properties.  Of particular use is WindowManager.operator_properties_last(...)

If we feed in the operator, in this case "view3d.select_circle"

>>> sc = C.window_manager.operator_properties_last("view3d.select_circle")
>>> sc.radius
273

it will return the last used properties of the operator.

If the operator has not been used (or does not exist)  sc will be None

This is not read only. Changing the value will set it for the next run of the operator

>>> sc.radius = 40

Defaults

Possibly worth mentioning too, to get the default value use

>>> rna = bpy.ops.view3d.select_circle.get_rna_type()
>>> rna.properties['radius'].default
25

as it does seem that although the class name is as expected

>>> bpy.ops.view3d.select_circle.idname()
'VIEW3D_OT_select_circle'

after a change in API (around 2.79 IIRC) not all classes are accessible via bpy.types

>>> getattr(bpy.types, 'VIEW3D_OT_select_circle', None) is None
True


Texturing each object separately VS all in the same texture file I am making a blender model of a Living room. Inside of this Living room, I have several objects that can be used not only in that Living room, but in other kind of rooms. For example, I have:

LivingRoom.blend ==> Basic walls structure, floor, ceiling.
Television.blend ==> A complex model of a TV.
Statue.blend ==> In this blend file, I sculpted a Statue.
Couch.blend ==> The design of a couch
And so on... (Lamp.blend, Fan.blend, Painting.blend, Extinguisher.blend, ... you get the point!)

The main file, as you guessed, is LivingRoom.blend, inside of which I will be appending all the others. As I said before, I did it this way because those other objects will be reused in other parts of the house (like in the Kitchen or in the Basement, for example).

I need to Unwrap AND create a Diffuse Map + Normal Map + Specular Map for each object.

But I am presented with an elementary question: should I UV Unwrap + Texture all files in separate Texture files? These objects are to be used in a Game Engine like Unity. So I have two options:

Creating an Albedo.jpg, Normal.jpg and Specular.jpg for all objects. Downside of this method? I would end up with 3 maps for each objects, and the number of textures would increase quickly (in this case, I would have 3*8=24 texture JPG files).
UV Unwrapping + Texturing all files ONCE they are inside of the same .blend file. Drawback of this method? I would end up with an extremely messy UV Map and giant Texture files. Furthermore, I think I would lose quality/control over each element separately later on (although with Texture Painting I think this last problem is under control).

I want to clarify this question is a possible duplicate of another question of mine, where I didn't get any quality/useful answer. PLUS, this other question includes texturing also.

Thank you!

For re-usability sake I would advise texturing and unwrapping each object separately and independently.

That would make it easier to recycle assets for future projects without bringing useless information attached.

You could then reuse only say the Fan and Statue asset in another project easily without bringing the Normal and Specular data of say the Extinguisher and TV and every other object with it, needlessly being loaded into memory and possibly ruining performance of your scene.

It will also make it a lot easier to edit each object separately without having to worry about overlapping the UV space reserved of any other asset, and recalculating UV, or Normals or baking data without having to bake all of them.

If you are absolutely sure this is the final version of your assets, you won't be editing or improving them more in the future, or you plan on always using all or most of the assets at once in all projects then it might be worth the hassle.

If performance or available memory is really a strong concern (say mobile platforms, low end devices, etc.) it may also be worth the trouble of joining them all.

I am not in the game making industry, and this may of course be a bit of a subjective matter, so opinions may vary.

EDIT: An additional concern may be object variations, or like if you want to modify only one single object.

Say you have a red extinguisher, but now you want a yellow one, or worse want to used both in your scene simultaneously. Now you have to edit the texture with all objects lying around; and if you want to keep both colors you now have two huge duplicated textures, which will have to be loaded entirely into memory just for a small part of one of them.


Is there any relation between Movie Clip Editor and Video Sequence Editor? I have a video, consisting of several shots with cuts between them. I would like to make some 3D reconstruction within it. Particulatly, I would like to place some excess 3D modelled objects into the scene.

In Movie Clip Editor I can load some clip from external file and make some reconstruction against it. But this reconstruction should not extend the shots margins. How to denote shot margins here?

In Video Sequence Editor I can cut strips, but these cuts are seem to be unrelated with what happening in Movie Clip Editor.

Is there any relation between them, or they are completely separate? Can I load some strip into Movie Clip Editor, or perform clip editing on strips from Video Sequence Editor?

In the Movie Clip Editor you can define the duration of the clip by setting start and frame offset and using the Footage settings tab.

The events on the Video sequence editor are not connected with the Movie Clip Editor in any way. The VSE has its own viewer, unrelated to the MCE . You can only load Strips and edit on the VSE. The 3D scene can be loaded into the VSE as a strip, but the events on the VSE are not available in the 3D environment. There is an addon to send VSE strips to the compositor and back (link to blenderartist's thread), but it's not a fully implemented solution yet.


UV's not the same in substance painter I have a game-ready revolver i want to bake normals with, I prefer substance painter for baking normals. So here are my UV's (low poly only) in blender:

Then after exporting my revolver as a .obj file, and importing into SP, here is what i get:

Also, when I left click and hold parts of my object disapear. Here it is before left clicking:

Here it is after left clicking:

I UV-unwrapped every part of my revolver, yet 90% of my UV's are missing. Why is that?

Alright, it turned out since i had two materials it was seperating them by "texture sets" which made part of my UV's disapear. So instead i deleted both my materials, added a new one, and baked.


Why are these Grease Pencil objects moving together when I animate them? Using Blender 2.83, either in the 2D or in the general layout, how can I select individual objects having different layers and different materials? I want to animate objects individually.
I am a newbie to blender and new to animation.

The issue is that both of your objects are one single Grease Pencil object. If you look in the Outliner in your video (to the right), you will see that you have something highlighted in the list called Stroke. And both of these objects are part of it. Hence, why you can't move them independent of one another. If you want independent objects in 2D, you need to create a unique grease pencil object for each of them. This can be done in Object Mode, from the Add menu (Shift + a).


Creating cycles background light (world lighting) from Python I'm rendering a scene from the Python interface, and I can't get the python API commands to work from a script.

In the Blender UI I would go to world->Surface->Use Nodes
and then adjust the surface color and strength to get the desired light.

From python I run the following commands

bpy.data.scenes['Scene'].render.engine = 'CYCLES'
bpy.data.worlds['World'].use_nodes = True
bpy.data.worlds['World'].node_tree.nodes['Background'].inputs[0].default_value[:3] = (1,1,1)
bpy.data.worlds['World'].node_tree.nodes['Background'].inputs[1].default_value = 2.0

If I run these from the Blender Python console they change the values as expected.
But when running the commands from a script via

blender -b my_scene.blend -P my_script.py

These commands have no effect. Other commands (moving objects around etc) work from the same script.

This does work on my machine though, I've tested it. Note here i've used aliasing to make the lines less long.

my_script.py

import bpy
import time
import os

bpy.data.scenes['Scene'].render.engine = 'CYCLES'
world = bpy.data.worlds['World']
world.use_nodes = True

# changing these values does affect the render.
bg = world.node_tree.nodes['Background']
bg.inputs[0].default_value[:3] = (0.5, .1, 0.6)
bg.inputs[1].default_value = 1.0

bpy.ops.render.render()

faux_name = "tensor_" + str(time.time()) + ".png"
fp = os.path.join("/home/zeffii/Desktop", faux_name)
bpy.data.images['Render Result'].save_render(filepath=fp)


Problem with creating edge rings on a model I always mess up my model in blender. At some point I manually add vertices on edges with subdivide and then I connect them with J, and sometimes I have to fill faces with F.

As you can see my model is a little bit messed up and this happens all the time. And I can't properly use the loop cut tool anymore.
Any idea how to fix this?
Update:
Here is the blend.file
http://www.pasteall.org/blend/25381

This is happening because of two things.

Because you are using N-gons. N-gons perfectly fine when making hard surface models but when it comes on to topology, they get a bit difficult to work with.

You have faces on the inside of your model. This is a no no and the Edge Ring tool will detect these when you are trying to make a ring and won't allow it.

So to fix, you can use the Knife tool to try and cut the ngons into quads (See this post on how to use the Knife tool), don't just select vertices and press F. Next, remove all inner faces of your model, you can just go into Wireframe view and select the faces and use X > Faces.
Trying to create an edge ring with inside face(s).

Creating an edge ring without inside faces.

Trying to add edge rings to an Ngon vs trying to add edge rings to quads.


Circular Brush Metal Is it possible to create this circular brush metal texture using the noise node(procedural) in blender 2.8 ?

The Principled BSDF has anisotropic and anisotropic rotation settngs in order to achieve this.

This video explains pretty well how it works.


Bevel and Subsurface makes concave corners weird In hard-surface modeling there are often sharp edges and smooth, flat areas side by side. To get smooth areas, subdivision surface modifier is used. Edges that need to stay sharp, must be surrounded by edgeloops or have to be creased. Manually setting edge loops needs a lot of work and often don't work as expected as edgeloops need to loop the whole object, which creates problems in areas that need to be smooth.

I'm trying to use bevel modifier for edgeloops as this is a non-destructive way to sharpen out edges, furthermore I can control which edges get bevelled by using weights or vertex groups.

In the picture I manually beveled my mesh to showcase the problem.

It seems that when bevelling concave edges, the subdivision surface kinda overlaps the mesh.

Blender file

Previous questions didn't have clear answer or suggested usin edge loops, which don't work in many cases.
Is this sort of problem fixable without using edgeloops or creases?

Thanks in advance

In edit mode
select the edges
press CTRLB
Roll the MMB (mid mouse button)
turn until you get the number of bevel cuts you want and press enter or LMB (left mouse button)

and that's all the work is done
The only thing you should do is practice these types of bevel exercises

Blend Solution

 Click in the pumpkin


Save all render passes to EXR image? I am having an issue with EXR file export that I did not encounter in previous versions of Blender. I used to be able to render a render layer with all its passes and get all the passes included with the render layer with the EXR export; the problem I am finding now is that I am not able to "pack" the passes with the EXR file (see graphic below). I am working with "standard" EXR, as I understand that the EXR multilayer is for multiple file handling (packing all the image files into a single container), but I may be wrong.

In the screenshot, the graphic is an EXR saved from the rendered layer; you can see in the screenshot how the "extra" passes from the render layer has been ignored by the graphic and only shows the standard image, z and alpha passes. I found this issue for the first time with Blender 2.71; and maybe with Cycles; in the past I have never had an issue with EXR export.

Am I missing something? I hope EXRs still work with Blender, I wouldn't know how to composite without such invaluable aid. Sorry if this question has already been answered somewhere; I have really searched the site for information on EXR but I could not find an answer to my issue.

Single EXRs or Multilayer?

First you have to decide what type of OpenEXR you want to render:

OpenEXR to get single files of your passes or channels/layers
EXR Multilayer to get a multi-channel file with all your passes or channels/layers included

This decision really depends on your further workfow. For e.g. Blender or Nuke it's much more useful to have one multi-channel EXR, but in Photoshop, After Effects or Fusion it's easier to use single EXRs.

In the context of the Layer Management the EXR Multilayer term is quite confusing. For this reason and also to consider the OpenEXR concept it should be named EXR Multichannel.

Passes/AOV's

Then you have to decide which passes are key for compositing. In the view Layer tab->Passes section of the properties editor select the passes you need:

For 2.79 and earlier: In Scene Tab you can enable all standard passes of the render engine and create individual render layers.

You are ready to render if Multilayer EXR fits your needs. Blender automatically writes all enabled passes and layers as single channels to the EXR as expected.

If you choose OpenEXR, Blender only saves the beauty pass (final render) although other passes are selected. To save all your passes or channels/layers separately is only possible with the help of the image compositor. In this case you have to create a file output node and add new input slots in the properties of the node:

Still the same for Blender 2.8x:

The file output node makes it possible, whether OpenEXR or EXR Multilayer, but especially in the multilayer case, that you can unleash the full power of the format and pack your custom channels e.g. mattes or backgrounds like this:

Note: If a 'Z pass' is required, check out these answers: How can I get a Depth of field render pass?

Cycles light passes for reference

Further explanation in the manual: https://docs.blender.org/manual/en/latest/render/layers/passes.html

Tlousky's production script

To speed up this process you can also use Tlousky's production script. It automatically creates a file output node based on your enabled passes and your output directory:

Note: It's not updated since blender 2.69 that's why some passes are currently not supported.


Offset splines with Animation nodes Before I am getting too deep into AN, I would like find out if there is ability to offset perpendiculary original spline by one of planes(xy, xz, yz), by using same control points? Is there also ability to control(translate, rotate, scale) particular control point in spline?

You can offset the spline along whatever axis you want using the Transform Spline node, all control points are maintained.

To change the location of control points, use the Spline Info node to get the location of the control points, perform whatever transformation you want to do and create a spline from the result again using the Spline From Points node:


Pose Position & Rest Position are Different Though Character Not Posing I'm having a problem trying to understand why my characters eye bones are moving to a different position in pose mode when the character isn't posing? Where the bones are in rest mode is where they should be in pose mode and object mode too. I tried to apply as rest pose but I get an error saying "Actions on this armature will be destroyed by the new rest pose..." and it doesn't let me do it. I tried applying the armature modifer and adding a new armature modifer, I also tried applying location, rotation and scale in object mode and I cannot figure out why these bones in pose mode don't stay in the same place when my character isn't posing. I tried going to blender forums and I found multiple people with this problem and I've already tried all the things recommended and I still don't know what to do.  If anyone has any ideas I'd really appreciate it, Thanks in advance

Here's a video of the problem
https://mega.nz/#!elF2UIKA!y7-iqlRqAHWo12IcPFXyAR1SMa6F-doeNLvABYb_jkw

My problem ended up having to do with me accidentally parenting the eyelid bones to the wrong bones. Once I parented everything exactly how the tutorial I'm watching said, I got the same exact result and things are working properly and now I can continue rigging the eyelids. Since I’ve done rigging before, I guess I got a little overconfident and skipped some parts of the video lol A good lesson to always be humble, learn, and take things one step at a time haha Thanks again!


How to snap an object to another object's edge How to snap an object to another object's edge.
I'm trying to find a more accurate way to place this object so that the edges are touching. I want to do this so that in my next step I can perform a boolean operation more smoothly.

I'm trying to get it to snap to the place where I'm circling it with the mouse.
I've tried googling and searching this site as well as the blender manual.
Any help would be appreciated. I'm really new to blender and trying to learn a good workflow.

Change the snapping mode in the snap tab in the 3d view header to Vertex and drag according on your specific axis until a small ring appears on the vertex you want to snap to when you hover the mouse over it.


Print total rendering time after a long script of several image renders? This wouldn't be for animation, but variations in color and view angle for the same object. So all renders are on frame 1 (in case that matter).

It would just need to add together the rendering time of each images at the end of the script. I have no idea how to do just that though, and how to access the rendering duration info from python in Blender.

I think your question is a bit incomplete but usually the time module is used, then

import bpy , time

def yourFunction(self,context):

    start = time.time()
    ####your script
    ####
    ####
    stop = time.time()

    result = stop-start

    print("Your time is :"+"{:05.2f}".format(result)+" Seconds")

note "{:05.2f}".format(result) It is used to format the seconds by approximating the cent


How to make all polygons into triangles I need to create test file for my program. But it only accepts polygons with 3 vertices - triangles as input. How can I convert all polygons of some object into triangles?

I know how to select all faces, but how to split them into triangles.

You can select all the faces and go to Mesh> Faces> Triangulate Faces in the 3D View header (or just press Ctrl+T for the same effect) while in Edit Mode.

As ideasman42  pointed out in the comments, Mesh> Faces> Poke Faces (accessible with Alt+P) will also triangulate the mesh by adding a vertex in the center of each face and fan-filling around the vertex, it may give preferred results for certain cases, for example, cylinder caps.

You could also add a 'Triangulate' modifier to the object and apply it:

Visualisation of the two methods:


How to have emission plane light the scene including glossy objects but not show up in glass reflection? Using Cycles.  I have lit and rendered 20 different objects with the same lighting set up.
Now using same setup to render a glass object, as part of the series.
However the emmissive plane used for lighting is now showing up in the glass reflection of this particular shot.

I don't want to change the lighting now.  Needs to be uniform across the previous 20 renders.

Tried turning off that light object's Glossy ray visibility, but that made the glossy objects around the glass too dark.

Is there another way to keep the scene just as well lit, but remove the plane's reflection from the glass?

I've got the impression from this post that 'render layers' might have to be involved, but I'm quite new to blender, a bit short on time, and hoping for simpler method, if anyone knows.

Trying Leon Cheung's method:

For the emission plane material, you can make use of Sigular Ray to get rid of perfect reflection and transmission.

Comparision:


I am trying to cut one Object plane using another object plane https://imgur.com/m6H0Kn6

I am trying to cut that cross out of the plane you see around it. The cross is made of multiple objects because it can fold up. The problem is I can't seem to get the bool tool to cut them out of the large plane. Maybe its not working because they are both flat. Anyways I need solution to this problem. any suggestions would be helpful.

You might want to do the "Knife Project" option. Here's a breakdown from Blender:
I tried it in a quick project that I set up similar to yours and it worked well for me. Let me know if you need more help! The Knife Project option can be found in edit mode under the "Mesh" menu.


How can a light cone (volumetric) be setup with cycles? I tried to reproduce the results from the Docs on volumetric lighting unfortunately the video link is broken. And I might have overlooked some related settings.

The spot light is barley visible on the ground.

Increasing the Density of the Volume Scatter Node darkens the sky texture but leads to some light cone from the car's headlight. (only 10 samples in preview).

Which settings do I need to change or should I try a different approach?

Integrator settings are default and spotlight settings were copied from the example found in the docs.

Related:

Creating volumetric lighting (crepuscular rays) in Cycles (pre 2.7)
How do I properly set up a spotlight cone? (BI only)

In real life these effects are caused by particles in the air such as water droplets, which reflect and scatter light. Usually these effects are only clearly visible when there is not a lot of other light sources, such as at night.

In your case it looks like you are going for a more non-photorealistic look, so you may want to give up on trying to simulate the scattering and just use an emission shader.

Add some cones to act as the light sources.
Note that they shouldn't intersect or contain non-manifold goemtry. If you want to intersect them, use a boolean modifier or a remesh modifier to make the final geometry intersection free.

Add some nodes with a horizontal gradient to fade the intensity of the emitted light out before the hard edge at the end of the cone. Note that this particular mapping setup assumes that the origin of the cone is at the point, and that the rotation is not applied.

In this example I also made it so the cone material doesn't illuminate other objects, as I wanted to do the illumination only with spot lamps to further reduce noise. The last mix shader is optional.

There are some limitations, for instance there are no volumetric shadows. But not too bad for converging in about 20 samples :)


Yellow artifacts when baking normals I've been searching and trying a few things for the last couple of hours and I can't figure out why there are yellow spots showing up on the normals when I bake them. Originally the wings had the same issue and the normals had to be flipped, but that doesn't seem to be working for the rest. Any ideas would be appreciated.

Baking normals can be tricky. If the normal of the lowpoly object is roughly the same as the highpoly object, the bake will be that bluish-cyan-pink that we like. However, if the normals points in opposite direction, the bake will be the inversion of those colors, as the yellow-brown-red.

Then why does the normals point in opposite direction? That could happen if the highpoly object intersects itself. The baking process have difficulty to find the correct face, with the correct normal.

Here are some images with a good and bad case:

In the second case the highpoly mesh intersects with itself. The lowpoly object can't be projected on the highpoly with a good result.


How do I remove all loose edges? I have cut a hole in a plane, but I am left with some loose edges.

Is there an easy way to select and delete them all?

See this screenshot:

See this edges siting out with no face?

Select the vertex and the end of one, then press ShiftG> Amount of adjacent faces:

Then delete. (Delete> Vertices)


Keyframes not setting where I place them I have 3 layers. I have the 1st layer animated over 160 keyframes. I am not sure as to which of the other layers is doing it but as I set a frame at say frame 20, it shows up at frame 40 instead, but claims the values are at frame 20.

Also, when I drag the slider, if I drag it to frame 40, the frame count says I am on frame 40 but the slider jumps to frame 20. Is there a way to fix this as I have no idea what has caused it.

Here is the dope sheet if it helps

I thought it may be worth noting that I originally had the earth do 2 rotations from 0-160 and the clouds to only do 1 rotation but when rendered the playback is strange and only does one rotation despite being set up for 2.

Oh ok I've found out, you need to go in the Properties panel > Render > Dimensions > Time Remapping, and choose 100 / 100


Why won't the arms move with my bones? I am learning rigging in blender so I made this:

The bones work fine with everything except for the upper arm on both arms. Take a look here:
Here is my rig:

So it looks like you've parented With Empty Groups, which makes sense for an object like a robot, which is mechanical and not organic.
For a human, With Automatic Weight would be preferable, it would automatically create as many vertex groups as you have bones, and assign these groups to the vertices that these bones are supposed to control. But you'll have smooth transitions between vertices groups, as it is what is supposed to happen in an body.
Smooth transitions between vertex groups is not what you want for a machine, because a piece of a machine is supposed to be only controlled by its own bone. In that case, parent With Empty Groups, it creates as many vertex groups as you have bones but for the moment it doesn't assign them to any vertex, you'll be the one that will assign each group to the vertices you want, without any transition.
To do so, once parented With Empty Groups, you need to select a part of your mesh, for example the chest, then go in the Properties panel > Object Data, Vertex Groups, find the group with the name of the bone that is supposed to control this part (here, Chest), click Assign, and so on fo the other vertices.
Little trick: To sort the vertex groups by alphabetic order, click on the down arrow button on the right of the vertex groups list and choose Sort By Name:


How does one use cycle's image sequence? I would like to create an animation where the source image changes at certain points. Cycles' Image Sequence setting on the Image Texture node looks hopeful. However, I can't seem to figure out what kind of input it wants.

Is this one of those images that are literally just a sequence of different images loaded on one? Thanks for any help!

You can use a sequence of numbered images as the input to an Image Texture node set to Image Sequence.
The key is to ensure your image filenames include a numeric element to represent the frame as the last part of the filename before the file extension - eg, 'flame_heat_fuel_000002.exr'.

Blender will identify the 'frame' part of the filename (in this case '000002') and use that to determine which image to pickup for the current animation frame, with the Frames, Start Frame, Offset manipulate how the Blender current frame maps to one of the image sequence frames :

'Frames' defines how many frames are in the sequence
'Start Frame' defines which timeline frame maps to the first image in the sequence
'Offset' shifts the animation along the image sequence by the specified number of frames (so an Offset of zero will map 1 to 1, 2 to 2, etc., while an offset of, say, 5 will map 1 to 6, 2 to 7, etc.)

Enable 'Cyclic' so as to loop the animation over the specified number of frames.

The Image Texture node shows the actual in-use frame just above the 'Frames' field. As you move along the timeline this will update to show which of the image frames is currently selected.


How to install freestyle stroke shader script to Blender 2.8 Here is the link that directs me to a script.
http://freestyle.sourceforge.net/GALLERY/python.php?filename=CARTOON/disney.py&headerfilename=pythonheader.txt

I have tried to copy and paste this python script in text editor but will not work. Has anyone figured out how to install this?

It won't work without a bit of reverse-engineering. The modules have different names, and they have a few Blender-specific calls.. Check out your [Blender installation directory]/scripts/freestyle/styles for Blender examples.. and the Blender Freestyle API.

You've probably already been there, but the background reading makes for a good start, if you're trying to get your head round other people's code.


What is the function of this normalize? I am generating a render for a brush to be used in sculpture mode to detail the character. I am configuring the node editor and wanted to know. The normalize vector is used for what? What is the function of this normalize?

Normalize (from the blender manual)

  Normalizing a vector scales its magnitude, or length, to a value of 1, but keeps its direction intact.

Why do this for the Z-Pass?

The Z pass is the distance from the camera to the geometry in the scene for every pixel of the image. The camera is the 0 on the scale and the units used for its values are the working units set for the scene (blender units, meters, cm, inches, etc). The Z pass usually has values that exceed the 0 to 1 scale, and thus cannot be displayed as an image.

In order to visualize the information on the Z pass you normalize it so that if fits within the bounds of what can be displayed as an image (o to 1).


render of a white object is gray? I have got a interesting effect while rendering a white coffee mug.

When I render this white mug it appears more grey than white. I have a glossy ~10% and a defuse ~90% shader on this. Both shaders have the color set to white. But those pictures do not look as it should, do they? They are more grey than white.

More pictures and the blend on google drive.

The color of your cup depends on the color of the background, how much light you have in your scene, and the amount of objects you have in your scene. If you add a lamp or an object emitting light and set the value to at least 5, you will get a white mug


Extruding a cylinder unwards and subdividing for a while now I was working with 3ds max student edition, but since I'm not a student anymore I thougt I should go to blender. I started with a simple project today to get myself familiar with the UI, but I've run into a bit of a problem.
I'm basically making a sci-fi bullet and while making the high-poly base model, this happened after I've beveled and subdivided:

I tried remaking the part with double the geometry, but it seemed to be even worse..
I tried creating edgeloops, but that made creases at places I don't want them.

I'm trying to make the high-poly version which I'd later bake onto a lower poly version.

Is there something I can do?

P.S.: I'd post more images of other things I've tried, but it won't let me....

The bevel modifier you're using is causing some bad and overlapping geometry that's making the subsurface modifier mess up. You can see this if you apply the modifier and then poke around at the mesh:

You can also see that if you enable the "adjust edit cage to modifier result" option, the lines that it creates are very unhappy:

One of the key things to understand when working with subsurface meshes is that the more source/control polygons you have affecting a area, the sharper the curvature in that area becomes. So, the primary method of shaping corners on these meshes is adding new edgeloops.

Here's an example of sharpening up this mesh using only edgeloops. The very first thing I did was loop select, extrude, scale the top edge of the cylinder because with with subsurf, if you have something coming together at a point like a cylinder it works much better if you have a final loop of perfectly planar quads; inside that you can usually fill the remaining flat hole with a n-gon or triangle fan or whatever and not have it come out lumpy or strange. Every other thing I did was just single ctrl-r loop cuts.

I did this quick and sloppy without much care for symmetry and it still doesn't look far off. If I wanted good symmetry I'd probably use a mirror modifier, and if I wanted more accuracy I'd work on the un-modified edit cage, though I do recommend working with the modified edit cage when you can because it helps get a feel for how the subsurf works. (Though do be careful of putting edges directly on top of each other, because they won't look like it in that mode.)

You can also use the manual bevel tool in some cases to add sharpening geometry, and sometimes you can get the right effect with the crease tool, though i've never had much luck with the latter.

If you need a model much more sharp and precise than this, I'd suggest learning some non-subsurf modeling techniques instead; you can make good looking curved pieces with just shade-smooth and an edgesplit modifier in many cases. That's also where you'll want to use the bevel modifier, because in plain modeling unbeveled edges tend to stand out and look bad.


Problem with array modifier, incorrect orientation and deformation I am having some issues with this file I am adding. I want to place the cube around this ring but the cube is being deformed (stretched along the larger radius) also the face orientation is wrong. I don't understand what wrong am doing.
Any help will be appreciated. Thank You.
link>>>>  https://drive.google.com/file/d/18bmQSoUdcYCo3ynGP01CEFIM2MGSswCA/view?usp=sharing

You need to apply the scale of your bezier circle with CtrlA. Once done don't forget to correct the vertices radius, given that applying scale will change the vertices radius up to the former scale value (go into Edit mode, select the bezier vertices and in the N panel bring back the Mean Radius to 1):

But anyway, Array + Curve modifiers always deform your object at least a bit, if you don't want it to be deformed you need to use another method like instances on vertices or particles. In the latest versions the Geometry Node Editor is even more flexible.


Setting to texture to a camera I want to set up a portal effect like in the game Portal where one portal will lead to another, and the portals have the textures of what is seen from the other portal. If I have 2 cameras, and let the cameras be textures for the portals, I think it might work. Is there any way to make a texture be the view of a camera?

If not, are there any other approaches to this?

Your question doesn't tell us for which application you need this effect - a rendered animation I guess. (Or a game?)

If you don't need it to be live input, you can just do the following:

Set your camera to the desired position. For every frame the camera is 'active' as the portal is deployed, you have to be in camera view.
Now, just render the animation in this time period (as png's).
Next, go into photoshop/gimp/whatever, and put the portal on it like a border. Everything outside it should be alpha. (To achieve an animated portal you should use different portal borders, a static portal looks quite boring...)
Finally, back in blender, add a plane the size of your portal (you can also use the add-on "images as planes") at the place you want to let the portal appear.

Animating the Texture:

As this is complicated to explain just take a look at this video, which explains the process in detail.

If what I said wasn't visual enough, I could help out with sceenshots and a blend file.


Model splitting automation I'm dealing with large topographic globe model (basicaly displacement map applied to ultra fine UV sphere). Now I want to split it into over 400 facetes (similar to lower resolution UV sphere) for 3D printing.

My question is how to streamline the process?

For two first I did boolean operation and then export result to stl but it's ridiculous for over 400 elements.

Any ideas?

I think the idea is to start with the lower resolution sphere (at the appropriate scale to print individual parts).

From this base sphere, mark the seams you want (seams will be useful to cut it later).

For instance here all edges are marked except for the poles:

Now use the subdivision surface modifier and apply it. The modifier will subdivide but let the seams in place:

Now select an edge marked with the seams, then in the select menu, go to 'select similar' and choose 'seam'.

Now split the parts using the edge menu, then 'edge split'.

Select all. Extrude E but stay in place.
Scale down (still having the extrusion selected) to 0.9, for instance.

The selection is still there. Create a vertex group and call it 'inner'.

Invert the selection, and create another group called 'outer'.

Use and apply the displacement you want, using the 'outer' vertex group on the displacement modifier.

In edit mode, select all again. Then P and 'by loose parts'.

You may be ready for a 3D puzzle...


Can Blender be used for business purposes? Can the free version of Blender be added to a new software by incorporating all the dev tools of it into this new software and then be given away for installation to the common public? Any way how that can be done legally for business?

Blender is GPL licensed - and subject to all the terms of GPL licensing (barring some components of it).  For more information, look here: https://www.blender.org/about/license/


Can i know why this happen during animating and how to solve it? In pose mode, I move the y-axis up and insert a keyframe and this was happening as the picture that I have uploaded.

That part of the mesh isn't affected by bone movement coz it might have been missed in the vertex painting. select the bone which caused it and edit the weight paint. add some to weight to the mesh. It should get back together.


Are my CPU temperatures okay and safe while rendering? I have been rendering quite long animation with my laptop and decided to check the CPU temperatures. I render on my GPU, but the processor (intel i5-8300h) is much hotter. Most of the time the temperatures are fine, but sometimes they hit max (100°C), but just for a really short while (not even a second). I wonder if it's okay or dangerous for the processor...

Here are the temperatures during a 40 minutes rendering session. Left column is for current temperatures, the middle one is for min temps, and the right one is for max temps which appeared during rendering.

The short answer is that you're probably fine.
Personal aside: there have always been these arguments about thermal stress on computer components, ranging from "turning off your pc at night is bad" to "overclocking reduces the lifetime of your components".  It's just a fact that most PC hardware outlives its useful lifespan, and it's either thrown in a landfill or recycled, so I mostly ignore these arguments.  Obviously heating something up to the point it turns off while you're using it is bad, but a modern processor monitors its own temperature and will underclock when it hits the thermal limit.
The long answer is kind of complicated.  Intel's guidance to laptop makers is basically "ride the thermal limit as hard as you can, if you don't you're leaving performance on the table".  As I said the processor will take care of its own thermal situation, so for short batches of processing (basically everything the average user will do in a day) it's in everyone's best interest to let the processor hit whatever frequency it wants to get the work done as fast as possible.  It's not going to saturate the heatsink in that amount of time, the fan probably won't even have to do much work.
You're in a different boat since rendering is a sustained workload.  You saturate the heatsink to a great degree just while rendering pixels (the CPU has to do some work after the GPU compute stage), so when something like a denoising task comes along (heavily CPU bound) the added heat makes your temps go crazy.  You're hitting the thermal limit of 100C (literally boiling), and the processor is backing off to compensate.  It targets a steady state of 90-95C during sustained workloads, so the absolute high end that you're seeing is only the case for a short while.
But all of this is absolutely within spec for Intel, and it should be said that your laptop isn't weird.  This happens a lot.
You can potentially look for some fan options or a "performance mode" in the power options on your laptop, oftentimes they will limit the fan speed for noise reasons.
Otherwise, if you are concerned there are ways to make render times longer.


Animating ZBrush models with Blender for unity Hi Guys I'm trying to make my game and I want to use ZBrush to make my character models, but I want to animate them, to use them in unity with unity new addition (Animator) that is amazing, I remembered that Blender can animate models for using them in unity so I wanted to know if I can make the model in zbrush, animate it in blender and use it in unity!

Thanks

Yes, you can.

I would recommend to export a low poly version of your character from zbrush and a normal map of the high poly model. Then you import in blender the low poly mesh, rig it, animate it, etc... Then import in unity the blend file and the high poly normal map that you assign on the character's material.


Can't get particles via molecular addon (v1.0.2) to behave naturally (e.g. dirt or sand) I can't seem to make the molecular particles immediately settle when they fall through a solidified cylinder to the bottom and remain still. Instead, they jitter, shake, bounce off each other, then slowly... rise... almost like dough. (See the video)

I'm trying to get some realistic dirt or ground till to interact with. Any help would be greatly appreciated.Thanks!

Link to a simple Blender test file I made to showcase the issue: download .blend file

Thanks in advance.

According to the addon description, the 2 features it provides are self-collision of particles and spring-based interaction. (Disclaimer: i haven't used the addon yet nor looked at the code)

Collision may be suitable for some types of granular material, but i think that for true sand-like behavior you would need a tremendous amount of particles and a number of friction effects would simple not be captured by this approach. Already with the moderate amount of particles in your example the solver becomes somewhat unstable (this is simply a limitation of the method as far as i can tell, not a bug).

Spring-based interaction otoh leads to soft-body type motion and probably cannot produce sand material effects either. Connecting particles this way creates elastic forces that don't allow particles to flow past each other.

I would suggest to try and model the sand surface with keyframe animation instead, possibly with displacement and shape keys you could get enough control.

Non-Blender remarks:

In current research and other simulation packages material point methods (MPMs) have been developed in recent years, which allow a much wider range of material simulations, which don't fit well into the soft-body or pure fluid simulation categories. Unfortunately to my knowledge none of these have found their way into Blender at this point, but it might be possible to use external software in the meantime.

For reference: http://www.cs.ubc.ca/~rbridson/docs/zhu-siggraph05-sandfluid.pdf

The sample principle methods have been applied to snow and foam like materials:

https://www.youtube.com/watch?v=O0kyDKu8K-k

https://www.youtube.com/watch?v=3_DdAXV3IDw


Creating a "halo" effect for a material in cycles? I'm trying to achieve an effect similar to this image:

However it's looking more like this:

No halo; the material ends where the mesh ends.

How can I set a material to look like the first image?

Thanks in advance.

This kind of effect is usually created in post processing.  In Blender's compositor I found that the Filter > Blur node gives a result quite close to what you are looking for, though the Glare node may also work.

Just go the the Node Editor view, switch to compositing nodes, and drop a Blur node in between the Render Layers and Composite nodes.  I found that using Fast Gaussian seems to produce the best looking effect.

To get that even wider glow you can add a second blur node with a much larger blur and mix it with the smaller blur.  Set the mix mode to Add and adjust the Fac slider to suit your tastes.

Click to enlarge.

For the actual mesh I just used the IvyGen technique outlined here with a very strong volumetric emission shader (and no surface shader).


How can I create 2D objects? Is there any setting to make a 2D object? Or at least an object that can only be seen from 2 angles.
I tried making an object very skinny, but it did not work.

You can also use curves and keep them as 2D:


Access auto tracking feature detection with python script i'm having some troubles in a script that use the auto detect features function from the tracking layout. The above script return the error:

RuntimeError: Operator bpy.ops.clip.detect_features.poll() failed, context is incorrect

Does someone knows how to force a change context to clip tracking?

import bpy
import random

scene = bpy.context.scene

bpy.ops.clip.open(directory="/home/lucasa/Vídeos/", files=[{"name":"100_0921.MP4", "name":"100_0921.MP4"}], relative_path=True)
print('video clip imported')

clip = bpy.data.movieclips[0]
print("\nMovie Clip %s" % clip.name)

bpy.ops.clip.detect_features()
print('\nDetect Features')

I know this is years late but I will answer this incase anyone stumbles across this.

In this case you need to force context since the operators require a certain context to execute. To do this for the detect_features method you can do:

ctx = bpy.context.copy()
for area in bpy.context.screen.areas:
    if area.type == 'CLIP_EDITOR':
        ctx['area'] = area
bpy.ops.clip.detect_features(ctx)


Why can't I flip key frames? When animating, I realised not all the key frames get flipped! After selecting a column of keyframes in the dopesheet, I press Ctrl+C to copy them, then Shift+Ctrl+V to paste/flip them, but only one keyframe is flipped and the others are not. Why?

Select the keyframes in the dope sheet editor, than - Shift+M (in the menu: Key - Mirror)


Rig Edit Squashing Hands? I've been working with this rig I made for a long time using it for a variety of characters and it has never given me this problem until now? It keeps its shape until you parent it to the mesh and then it squishes the hand and deforms it improperly.

This is what it looks like when its not parented, and as you can see, something on the rig is not right in the fingers?

And this is the result of parenting the mesh to the rig which obviously doesn't look right compared to the first.

Any advice is great because rigging is not one of my favorite things to do although it is necessary for character animation.

.Blend

I would try and place the armature correctly within the mesh before pairing. Then when pairing select 'automatic weights' to initialize the 'painted weights' for each bone. Then it is useful to go into 'Weight Painting Mode' select the problematic bone areas and try to paint the weights so that each bone only effects its nearby mesh.

This is a great series about rigging. The episode I've linked to is about Weight Painting. Highly recommended.
https://www.youtube.com/watch?v=G3gIN4dJYw4

*It looks like your middle finger bone is deforming the mesh of the other fingers.

Good Luck!


Parenting an object does not parent but has broken or dashed lines when I am trying o parent some objects instead of the expected behaviour I get broken lines in the outliner, and they look like a duplicate.

In this picture, you can see the Nissan_logo_Rear is showing dashed lines, and the actual object is outside the hierarchy.

How can I fix this?

OK, so it was because the logo objects were not part of the collection that the parent object belonged to.


Only hair rendering, why? my model, which has texture painting and a skin colour is not showing up on render. Only the hair shows on render. I've tried clearing the restricted render, which I didn't set up anyway, all sorts, but only the hair shows. The hair is particles, I was following a tutorial to try this out and had the hair attached to a vertex group only. When it didn't render the body, I tried duplicating the scalp to another layer and having no particles on the main figure (though it still has wispy hair attached there, no idea why) Can anyone help? I am using cycles render and 2.79. Picture is a bit rubbish, but I'm only learning

Make sure Emitter is checked under Render at the Particles panel.


rig for hardsurface deformation I'm trying to build a simple rig in order to deform a rectangular prism (simple mesh for the time being), but it needs to have its deformation locked to just one an axis. The resulting mesh should be as if we had operated in a mesh level using a shear operator.

How should I build the rig to accomplish the resulting deformation using armatures? I've tried with all kind bone and object modifiers but none gives me a precise deformation.


change viewport layout Yohoo!:)

As a 20 + years user of kind of every cad app on earth i am super amazed i have to ask this question!

How do i change the viewport layout? Like, in any way at all..

I manage to add more duplicate windows(why is it even possible to do that?) and then they cant be removed. I cant move any toolbars to anywhere.

Heeeeeeeeeeellllllllppppppppppp :)

I know it can be confusing, so here we go :)

Flip the header - Right click on header > Flip to top
Remove Status Bar - Window > ✓ Show status bar
Use current layout for new files - File > Defaults > Save startup file

Flip the header

Remove status bar - pretty useful to keep, shows total/selected geometry and available shortcuts


lost keyframes from timeline I seem to have lost my keyframes from the timeline. They're still there on the dope sheet and dragging the frameline in the timeline still plays animation ok in viewport but I can no longer see the keyframes on the timeline. Everything is selected on the dope sheet and in the timeline view 'show only selected channels is unckecked (although this seems to make no difference anyway). What on earth have I done?
Thnx,
/gary

I think the object which the keyframes are on was not selected in the viewport.


Setting up complex gear physics I want to set up a rigid body system of gears hanging off gears.

The picture shows what I want to happen:

The small green gear rotates in place, the big yellow gear is hanging off it.
The small yellow gear is fixed (and rotating) on the big yellow gear, the big blue gear is hanging off it.
The small blue gear is fixed (and rotating) on the big blue gear, the small read gear is hanging off it.

How do I set this all up, so that the gears all rotate correctly, hanging from each other and without slipping sideways?

Here's how it all should move (modeled in Algodoo):
https://www.youtube.com/watch?v=vwk2OUOmkm0

I am pretty sure Blender can do this. The physics is far better than most people think. But....you have to be careful.
I will show you the first step, the next steps you can do according to them.
I made it to animate physically the small golden gear with a motor.

Stabilize the gear with this cylinder (rigid body passive)

change small golden gear to rigid body active, shape mesh, margin 0
same to blue gear
plug the motor like this: add an empty like this: the x - direction is important, else the motor won't work

add rigid body constraint to empty like this:

increase the rigid body substeps:

if you start animation with spacebar, the blue gear will rotate, driven by the small golden gear

result here: https://www.youtube.com/watch?v=LsVekqC-Lno&feature=youtu.be
because of your comments...here next steps

copy the passive cylinder from step 1 to the green gear like this:

stabilize the gear by extruding the cylinder on the other side so that the gear won't fall off like this...please don't kill me because i just make it work, but not pretty, i know my modelling is ugly... ;(

set the green and the big golden gear active bodies with shape mesh and margin 0.

copy the empty from 1st motor to the green gear like this:

change the 1st and 2nd object to green cylinder and month gear like this

extrude the tiny cylinder from step 1 until it reaches in the big golden gear like this:

i will delete it, if you want this.
************** UPDATE *****************
ok, i am very sorry, i will give up for now after trying it for hours. Maybe i am just to new to Blender....just experiencing with it only for quite a month now.
I show you how far i came...here is my result: (bit more than before, but not really satisfying): https://youtu.be/GX0CTrZW9YY
I changed lots of values like weight, friction and so on. Of course the result was different in many ways. Most of the time the gears just fell off....I enlarged the motor gears which helped a lot for stability, but if it will work some time, then the "too large" gears will collide with each other. As you can see in the side view there is a lot of instability with the gears, maybe another good idea would be to create counter weights so that the gears have more stability. Just to make them with "no weight" did not help either so...
And here is the blend file:

*** UPDATE 2 ****
Hi Alda, please don't give up animation. I am not sure but maybe the mistake are the gears...I changed them and then i got this perfect result for the very easy case of just two gears, which i never got before. Video link: https://youtu.be/La7cIyaCQi8. If you are able to change the other gears  (the blue with its corresponding gear) that they can run smoothly like mine (blend file: ), i will try again for the "whole" solution. Unfortunately i am not the right guy to build nice and working gears ...
**** UDPDATE 3 ****
After thinking about it again i remembered my physics class. Important is the 2nd law of Newton: https://en.wikipedia.org/wiki/Momentum#Conservation
So in real physics your example cannot work - i think.
My idea with the counter weight was not bad - but not enough.
Newton says, you have to have the same momentum on both sides (simplified), so you have to add a second motor on the other side with the opposite direction so that it is in balance again.
To simplify it, i have just copied the first gear with my modifications of above which smoothly runs, so i knew it worked. I copied the motor, empty and the gear to both sides...and...i just can repeat: Blender is just awesome and seems to know Newton well...it is not perfect (maybe i made still some mistakes, BUT it looks much better now...with just physics in Blender!!!)
new result: https://youtu.be/LtknpY4xGAw
it is not perfect, but it runs at least in the beginning pretty nice...until it fells off...right now, i am not sure why, but it is an improvement anyway.


Blender 2.8 exports fbx with flipped normals export model from blender 2.8 to UE4-> normals are flipped in ue4. Gotta actually flip the normals in blender for it to come right in ue4. this never happened before.
I use the daily 2.8 build (25.3 as for writing  IDEAS?

Check Face Orientation in the Overlays popover:

In my opinion, in the 2.80 it's harder to recognize a inverted normals in default shading.

Also check, that your object doesn't have negative scale.

Edit: The negative scale can be a byproduct of mirroring (Crtl M) while in object mode. To combat this, mirror the object while in edit mode, and then flip the normals of the mirrored part. Recalculating Normals works just as well.


Add different textures to front and back of plane with solidify? I have a map; a plane and a Solidify modifier. I have already applied an Image Texture to one side, but Blender is obviously applying the texture to both sides.

I want to add a different Image Texture to the other side of the plane, however. Is there a way to do this?

I have tried to add another one using the Geometry > Backfacing feature, but it did not work.

Map mesh and .blend file's material:

Viewport render of map mesh and Backfacing material (not working):

There was only one image in the file, so I substituted a Diffuse BSDF for the second image. There are two options you have now.

Option 1

The reason that the Geometry > Backfacing did not appear to work was because that the Solidify modifier made it so that the map/diffuse went inside the map.

An exaggerated Solidify:

The solution if you want to keep the Solidify modifier goes like this. Apply all modifiers. Use the steps in Add different materials to different parts of a mesh? to apply the other image/diffuse to the non-map faces.

Option 2

Solution produced with Option 2 (low-res; 20 samples):

This is the better solution. Since the Solidify modifier does next to nothing, delete it, and the original node setup will work. The two Diffuse BSDF's outputs are crossed just because it needed to be inverted. I'm sure you understand.

The following .blend file produced the result at the top of Option 2.


how can we remove the blurry effect that has been caused by denoising? (using blender2.82)
hey guys i have been trying to add fog to my scene but when i do it i have a lot of noise in the image i tried to use  blender default denoise but it made it worst because it added huge amount of blur in place of the noise i also tried to use intel AI denoiser but it did the same thing it didn't help
here are the examples:
here with no fog or denoise
and here with fog without denoiser:

and finally here with denoising:

how you see the grass get so smooth in bad way!! can any one help? i just want the noise gone without effecting the other objects !

Denoisers are an imperfect, but useful tool.
I have this scene where there's light coming in through a window and I've given the room a volume to catch the light.  If we run a low amount of samples you can see the fireflies produced.

This is normal, the nature of a volume with lower density is that it will only affect some rays cast from the camera.  The denoiser gives us this ugly result:

with only little wisps of dust visible.  This is also normal, because the denoiser can only work with the information we give it.  I only ran this at 12 samples, and it is really interesting that it can produce this result.
Usually the answer is to run more samples, but even at 300 samples it comes out as this:

Which is part of the way there.  I cranked a small region up to 1200 samples to turn this:

into this:

That's a lot of samples, but you can probably see from the noisy image that it would take many thousands of samples to render this volume in a realistic and pleasing way.  Volumes with lesser density are just very noisy.  The grass will be a lesser case of this, where more samples will give each pixel more influence over itself.
I did find in doing this that volumes aren't contributing to denoising normal or albedo, probably by design, but I wonder if it isn't related.

You may want to play with Adaptive Sampling instead, run some experiments with a render region.


Default value for bpy.props.CollectionProperty How to set a default value for bpy.props.CollectionProperty?

Let's use the example in the documentation for an answer.

I tried to set the default value in the register function, but neither bpy.data nor bpy.context is available at that moment.

The idea is to use application handlers to set the default value for bpy.props.CollectionProperty:

bpy.app.handlers.scene_update_post to set the default value right
after the addon registration via register() and then remove the
handler
bpy.app.handlers.load_post with @persistent decorator to set the
default value after any of the following events:

opening Blender
reloading the start-up file via the keys Ctrl N
opening any Blender file.

Here is the code:

import bpy
from bpy.app.handlers import persistent

class MyCollectionItem(bpy.types.PropertyGroup):
    name = bpy.props.StringProperty(name="Name", default="Unknown")
    value = bpy.props.StringProperty(name="Value", default="Unknown")

def setDefaultCollectionValue():
    myCollection = bpy.context.scene.myCollection
    # set default value if <myCollection> is empty
    if not myCollection:
        collectionItem = myCollection.add()
        collectionItem.name = "Name 1"
        collectionItem.value = "Value 1"
        collectionItem = myCollection.add()
        collectionItem.name = "Name 2"
        collectionItem.value = "Value 2"

# This handler is needed to set the default value for <bpy.context.scene.myCollection>
# right after the addon registration via register()
def onRegister(scene):
    setDefaultCollectionValue()
    # the handler isn't needed anymore, so remove it
    bpy.app.handlers.scene_update_post.remove(onRegister)

# This handler is needed to set the default value for <bpy.context.scene.myCollection>
# after any of the following events:
# - opening Blender
# - reloading the start-up file via the keys Ctrl N
# - opening any Blender file
@persistent
def onFileLoaded(scene):
    addDefaultLevels()

def register():
    bpy.utils.register_class(MyCollectionItem)
    bpy.types.Scene.myCollection = bpy.props.CollectionProperty(type=MyCollectionItem)
    # adding handlers defined above in the code
    bpy.app.handlers.scene_update_post.append(onRegister)
    bpy.app.handlers.load_post.append(onFileLoaded)

def unregister():
    bpy.utils.unregister_class(MyCollectionItem)
    del bpy.types.Scene.myCollection
    bpy.app.handlers.load_post.remove(onFileLoaded)

if __name__ == "__main__":
    register()


How to unwrap a mesh from view in python. blender 2.8 Hy All
Im a blender noob trying to get a font texturised in blender.
Thats how i plan to do it:

create the font (is a curve)
convert the curve to mesh
uv_unwrap the mesh from view (i need just plain unwrapping, since its 2d)
add material
render

So far all works except the unwrap which leaves me with a horridly distorted mapping of the image.
myFontCurve = bpy.data.curves.new(type="FONT",name="font")
myFontOb = bpy.data.objects.new("myFontOb",myFontCurve)

myFontOb.data.body = "my text"

bpy.context.collection.objects.link(myFontOb)

# Set Material
mat = bpy.data.materials['Material'] #Material Nodes Settings are done in gui
# We use nodes here...
mat.use_nodes = True
backgroundfile = "pathtoaffile.jpg"
mat.node_tree.nodes["ColorTexture"].image = bpy.data.images.load(backgroundfile)

# Assign Material to Object
if myFontOb.data.materials:
    myFontOb.data.materials[0] = mat
else:
    myFontOb.data.materials.append(mat)

bpy.data.objects["myFontOb"].uv.project_from_view(orthographic=False, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)

# Render the letter
output = "path to file.jpg"
bpy.context.scene.render.filepath = output
bpy.ops.render.render(write_still = True)

My attempt to do so with unwrap_from_view fail with "'Object' object has no attribute 'uv'".
Like i said, im a rookie and help would  be very much appreciated.
If somebody could point me in the right direction, that would be awesome.
Thanks you

Use the mesh coords
The issue with your script is you are mixing objects and operators.
Here is the autocomplete of the project from view operator in the console.
>>> bpy.ops.uv.project_from_view(
project_from_view()
bpy.ops.uv.project_from_view(orthographic=False, camera_bounds=True, correct_aspect=True, clip_to_bounds=False, scale_to_bounds=False)
Project the UV vertices of the mesh as seen in current 3D view

Trying with C.object.uv. will throw same error as in question since an object has no property uv.
At issue with operators that use the view is they are designed to be run from within that view (it has context) via a button or menu item. Using in script will often require passing an override context or other dicking around, however for this would simply write the UV directly from the mesh coordinates.
To convert the context object to a mesh
>>> bpy.ops.object.convert(
convert()
bpy.ops.object.convert(target='MESH', keep_original=False, angle=1.22173, thickness=5, seams=False, faces=True, offset=0.01)
Convert selected objects to another type

So with a curve object as context object
>>> bpy.ops.object.convert(target='MESH')
{'FINISHED'}

eg this can be called directly after adding the font object and setting its body text.
Using the mesh coordinates
The UV operator template in Text Editor > Templates > Python > Operator UV  adds a UV that is pretty much an orthogonal projection from above as it uses the x and y vertex coordinate as UV.
Here I've tweaked it to normalize the U and V to 0, 1 range.  To have same aspect would scale by the minimum of the X and Y range.

import bpy
import bmesh
import numpy as np
from mathutils import Matrix

def main(obj):
    me = obj.data
    bm = bmesh.new()
    bm.from_mesh(me)
    #bm = bmesh.from_edit_mesh(me)
    x, y, z = np.array([v.co for v in bm.verts]).T
    S = Matrix.Diagonal(
        ( 1 / (x.max() - x.min()),
          1 / (y.max() - y.min()))
          )
    uv_layer = bm.loops.layers.uv.verify()

    # adjust uv coordinates
    for face in bm.faces:
        for loop in face.loops:
            loop_uv = loop[uv_layer]
            # use xy position of the vertex as a uv coordinate
            loop_uv.uv = S @ loop.vert.co.xy

    bm.to_mesh(me)
    me.update()

# Test call
main(bpy.context.object)


How to set the camera position and rotation to my view position and rotation? Hello I have many problems with poitioning the camera in blender. ( I am a noob sorry)

But what is the way / shortcut to position the camera  to my view so it will see what I see in the editor.

Select the camera and use the Ctrl+Alt+Num 0 shortcut. You may also do it via View-->Align View-->Active Camera to View.


Advance audio editing for blender Is there any plug-in for editing audio in blender?
advance editing audio similar lmms or fruity loops

Blender has a Video Sequence Editor which allows very simple editing of an audio clip such as cutting and volume adjustment. Audio clips can then be placed in sync with a video clip to then be encoded together into a final file.

All other audio editing or generating needs to be done in other applications such as LMMS, Garage Band, FL Studio or Audacity before being added to blender.


Split row inside of pop up panel while keeping formatting So I have a panel I want to create a split option for. I experimented with box, row and column but was unable to get anywhere. I basiclly just want (S) and (C) on the same menu without extending the panel to be longer.

else:
                #C/S Sharpen Split Option
                layout = self.layout
                row = layout.row(align=False)
                split = row.split(percentage=0.5)
                col = split.row()

                Ssharpen = icons.get("Ssharpen")
                CSharpen = icons.get("CSharpen")

                col.operator("ssharpen.objects", text = "(S)", icon_value=Ssharpen.icon_id)
                col.operator("csharpen.objects", text = "(C)", icon_value=CSharpen.icon_id)

this is what the menu looks like normally

While the extended menu looks cool I would like it more if I was able to lock it to that layout and had guidance text in the blank area.
But I would rather it just have both the S and C in a panel thats the same size as normal.

use colum_flow(x) and col.label("for the text")
(colum must be equal to get a nice look)

else:
            #C/S Sharpen Split Option
            layout = self.layout
            row = layout.row(align=False)
            split = row.split(percentage=0.5)
            col = split.colum_flow(2)

            Ssharpen = icons.get("Ssharpen")
            CSharpen = icons.get("CSharpen")

            col.operator("ssharpen.objects", text = "(S)", icon_value=Ssharpen.icon_id)
            col.operator("csharpen.objects", text = "(C)", icon_value=CSharpen.icon_id)

it is not exactly what you want, but near...

import bpy

class SimpleCustomMenu(bpy.types.Menu):
    bl_label = "Simple Custom Menu"
    bl_idname = "OBJECT_MT_simple_custom_menu"

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

        layout.operator("object.duplicate_move", text="Duplicate")
        layout.label("1. use for text")
        layout.label("2. use for text")
        layout.label("3. use for text")

        layout.operator("object.duplicate_move_linked", text="Duplicate Linked")
        layout.operator("object.duplicate_move_linked", text="Duplicate Linked")
        layout.operator("object.duplicate_move_linked", text="Duplicate Linked")
        layout.operator("object.duplicate_move_linked", text="Duplicate Linked")

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

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

if __name__ == "__main__":
    register()

    # The menu can also be called from scripts
    bpy.ops.wm.call_menu(name=SimpleCustomMenu.bl_idname)


What is the C# Mathf.Lerp equivalent in Python? I have a basic menu script with a slider. The idea is that the slider will control the rotation of a bone. That bone will then rotate the object. I worked out the exact euler angles to rotate it by, and now I'm a little bit stuck. I've used C# for quite some time and C# has this thing called Mathf.Lerp, and I wondered if there is a python equivalent? If so, what is it?

Here is what I'm aiming for:

elif origin == 'screen_rotation':
    bones = bpy.context.object.pose.bones

    Mathf.Lerp(bones["Screen"].rotation_euler[1] = 0, bones["Screen"].rotation_euler[1] = 1.58825, screen_rotation)

Lerp typically means linear interpolation.

Assume A, B, C are floating point values.

Assume C is in the range [0.0, 1.0]

lerp(A, B, C) might be implemented as

value = (C * A) + ((1-C) * B) // convex combination

When C equals 0 value equals B.

When C equals 1 value equals A.

When C equals .5 value equals the average of A and B.

Of course you can switch the factors (C) and (1-C) depending on your desired implementation.  You can also switch A and B depending on your desired implementation.


Mirroring in Object Mode, taking rotation into account I have a turret, displayed below, which I would like to duplicate and mirror across the global Y axis.

I can do this in Edit Mode, using Shift D, Enter, Ctrl M, X, which shows what I'm looking for:

However, this object is using a mesh shared by several other objects. Mirroring the mesh affects the other objects, naturally. What I'd really like is to mirror the object across the y-axis. But the result is not what I would expect:

That was done with Alt D, Enter, Ctrl M, X. The new position of the duplicate is right, but the angle is not.

I feel like I've missed something obvious.

What is going on here?

(In both cases, the pivot point is the 3D cursor, which is set at the world origin.The transformation orientation is set to global.)

Edit (About context)

The turrets involved are on a larger craft that will be mirrored in it's entirety. I'd rather keep the turrets as separate objects than join them, since I may replace the mesh they use with another, or edit the existing mesh.

There is an easy workaround, and that is to adjust the angle of each mirrored item manually. But I'm still interested as to how to perform a mirror with both the origin and angle transformed globally, as opposed to the origin transformed globally and the angle transformed locally as seems to be the case above.

If you are doing this so that they could be animated I would add a Copy Rotation Constraint and then invert the Y axis.

Or if you are modelling, Create a new collection with the left side (M) and then place a Collection Instance (Shift-A) of that and mirror the Instance. The collection instance has it's origin in the centre but it can be moved in the Context menu for the object -> Collections.

If you later on want to commit this to be real object you, just Make Instances Real (search for it with F3). They will still be linked copies.


How can I upload Blender videos to Youtube? So I'm trying to upload videos to Youtube, but it says it doesn't recognize the file format.

I made a simple edit with the video sequence editor. I imported a picture and gave it a longer duration.

I'm just saving the file as it is, and then uploading it.

What should I do?

Blender files are not video files. You need to render and export your video sequence in order to get a playable video.

(This is my workflow for Youtube publishing. Based on the "Advanced encoding settings" article and Blender's limitations. Of course, there are plenty of other ways to do it, but this is how I do it.)

Be advised that there are issues with Blender's output interface since 2.71. This is planed to be fixed around 2.74.

Video settings

Open the properties window and open the render context with the triangle button.
Under the Dimensions panel, select an appropriate resolution and frame rate. The resolutions that Youtube uses are the following:

2160p: 3840x2160
1440p: 2560x1440
1080p: 1920x1080
720p: 1280x720
480p: 854x480
360p: 640x360
240p: 426x240

All of these use the 16:9 aspect ratio. So if you're using a different aspect ratio, such as 4:3, youtube will covert it to 16:9 by adding black empty space on the left and right sides. Use one of the above resolutions for predictable results on Youtube. Note that this is not the same thing as the aspect ratio shown in Blender!
Make sure that you have set the end frame for however long you want your video to be. This can be calculated by frame rate x length of video in seconds.
Open the Output panel. Select H.264 for the file format. When you select that, a new panel named Encoding should appear.
Open the Encoding panel. Select the Quicktime format.
Select the H.264 codec.
Set the max bit rate to 0 to make Blender ignore it.
Set the bit rate to one of the following depending on your video resolution (These are only suggestions given by Youtube themselves. You can find higher quality suggestions on this page.)

2160p: 35000-45000 (kb/s)
1440p: 10000 (kb/s)
1080p: 8000 (kb/s)
720p: 5000 (kb/s)
480p: 2500 (kb/s)
360p: 1250 (kb/s)

Audio settings

If you want audio in your video:

Select AAC as your audio codec under the Encoding panel
Use whatever bitrate your source audio was recorded in.

Render and export

In order to finally render and export your video:

First, make sure you save your blend file somewhere. I've had issues of it not wanting to export if hadn't saved the blend first.
Under the Output panel, set where you want to export your video.
Go to the Render menu and select render animation.

You will get a .mov file in the folder where you exported your video. You can upload this to Youtube.

If you want to be finicky, you can convert that Quicktime file to MP4 using ffmpeg.

ffmpeg -i INPUT.mov -vcodec copy -acodec copy OUTPUT.mp4


Texture paint mode - the brush paints some weird purple thing instead of color Hi i've finished my low poly of the sculp i made and projected the normals onto it.
Later i tried to paint on it but when i do this weird normal map looking texture with balls and springs on it.
It never happened to me before, what causes this?
[EDIT] turns out it fixes itself if you just delete your current brush and recreate it again

From looking at the OP picture, the OP was using the Normal Map image as a brush texture that is automatically set to Tiled when first used, and that is why it was 'fixed' by deleting the brush and starting over. Could have been easily fixed by disconnecting the Normal Map texture from the brush texture.


Problem with Material drivers for nodes properties I'm following these instructions https://blender.stackexchange.com/a/75652 (paragraph "Setting drivers"), and also the video linked here https://blender.stackexchange.com/a/5384 video: https://vimeo.com/40389198, to understand how to implement a driver Texture Panner.

I added a driver to a Mapping node translateY property by going to Datablock->Objects->Cube->Material Slots->Material.001->Material->Material.001->Node Tree->Nodes->Mapping->Location->Y, selecting Y and pressing D (note: right-clicking the property->Add Driver yields different results).

The expression of the driver sets the Mapping translateY to frame_current * 0.05.

The Debug value is ok and if I render the animation it works as expected.
However the viewport doesn't update the value for preview while scrolling frames.

Is there a workaround to preview it (with scripting maybe?) ?

Edit 1:

Reloaded the file which  had an incorrect texture

This is the code snippet I used in 2.8 experimental. Since the drivers UI part hasn't been implemented yet, drivers can only be accessed with Python. It works in Cycles but not Eevee as of May 2018.

For an approach which works in 2.79 check D. Skarn's answer.

import bpy

mydriver = bpy.data.objects["Cube"].material_slots["Material.001"].material.node_tree.nodes["Mapping"].driver_add('translation',1)

scn = bpy.data.scenes["Scene"]

def getframe_fn():
 return scn.frame_current

bpy.app.driver_namespace["getframe"] = getframe_fn
mydriver.driver.expression = 'getframe()*0.05'

Thank you all for the help!

This is how I solved it in my addon. I made a property on materials specifying if I want to update that one live.

from bpy.app.handlers import persistent

@persistent
def live_update_materials(dummy):
    for mat in bpy.data.materials:
        if mat.wow_m2_material.LiveUpdate:
            mat.invert_z = mat.invert_z

bpy.app.handlers.frame_change_pre.append(live_update_materials)

This will reduce the animation playback FPS in the viewport, since the shader will be recompiled on every frame change. But it lets you preview the changes live and is not decreasing the FPS hard to on good hardware.


How can I composite Eevee and Cycles together in one animation sequence? I have a character model that I’d like to render in Cycles only and the rest of the scene in Eevee.
This was suggested to me by someone I had contacted sometime ago.  He said to speed up render times, they’d render their characters in cycles and the rest in Eevee but I cannot remember where I spoke with the guy, otherwise I would ask him how he does it.
I’ve searched the internet but all I’m finding is that it’s not possible to composite Eevee and cycles together.
There must be someway to achieve this!
Does anyone have an ideas how this might be done?

Organize your outliner like this:

Add a scene and select Linked Copy.

I'm calling mine Eevee.
Set up Eevee scene's outliner like this:

In the Eevee scene, set up the shaders of the objects in the Cycles collection like so:

Be sure to set the Blend Mode to Alpha Clip (unless otherwise necessary).

Back in the Cycles scene, set up the compositing something like this:

And be sure to enable transparency in the film settings:

When you press F12, both scenes will render automatically.


Multiple objects sharing the same name in Blender I need to have multiple objects sharing the same name in Blender.

But Blender is adding a series of number in the name of my duplicates ( object.001 ).

Is there a way to delete those numbers at export, or to force Blender to share the same name on multiple objects ?

Thanks :)

( I'm using the 2.79 build )

So far as I know there is no way you can't give objects the same name. te reason is to make sure you don't get confused with the object, so that you can locate and find parts fast.
So far as I know it's impossible.


How to bake floating geometry to normal map? For the past days I've been trying to find a way to bake floating geometry onto any mesh that's not a simple plane. Now the problem isn't as much getting the geometry to bake properly on the face that I intend to, but the fact that it creates a problem on the faces on the opposite side of the mesh.

Any help is appreciated!

So here is what’s happening. Let say you have object A (the highpoly object you need to bake) and object B (the lowpoly, the object on which you want to use the bake)

The bake is a kind of scan that begins from the faces and goes in the opposite direction of their normals, it goes as long as necessary, until it hits the surface of the object that needs to be baked. That’s the basis of baking (as I understand it). So here is what happens for the top face: With a Ray Distance of 0 the scan begins from the top face, it goes downwards and hit nothing, so no baking.

If some faces of object A go a bit beyond the surface of object B, you need to make the scan begin a bit before with the help of the Ray Distance value. It’s the case here, object A is out of object B, so you need to have a Ray Distance value higher than 0, in your file your value was a bit low, so it didn’t scan the whole object A, you need to increase the value a bit, 0.2 seems good.

The bottom face of your object B scanned in the opposite direction of its normal as it is supposed to do, so it scanned upwards until it hit object A. But in this direction it hits faces that are flipped, so the scan gave incorrect colors.

I suppose you didn't expect the bottom face to have any baking. In that case the simplest solutions are either to paint your normal map with purple, or to close the bottom of your object A with a face so that the object won't be scanned by the object B bottom face (only slopes can be scanned, not surfaces that are parallel or perpendicular to the scan direction).


what would setting W as the way to default exit out of other tools cause in terms of conflict? say you set W to not cycle through and only select the plain selector.
I find myself always having to mouse to the selector icon to exit out of other tools.
example when i use poly build. to exit i hit select icon.
i suppose I could set Select tool to my quick favorites. press q and then selector.

i'd like W as my exit and like crtl+w to cycle box circl lasso sel.

is this a bad idea? (for modeling purposes)

What do you want?

If you want to discuss a modelling process - it is off-topic because it is to broad. Question must be about specific problem with enough detail to identify an adequate answer. Blenderartists.org is better place to discuss broad questions.

If you want to ask is it correct to edit keymap - Yes, it is correct. Feel free to edit keyboard shortcuts as you want.

If you want to suggest it as default - use devtalk.blender.org forum to create discussion about it.