I cannot figure out how to use/print globalDict I am trying to see (printed in the terminal window) a list of all the objects in the game while game is running.

Posted game file on Github

The print statements you have should show the globalDict contents, if it is empty then you will only see {}, once containing values, it would show as -

{'key1': 'Value One', 'key2': 2}

Note that it doesn't have any values unless you add them, bge.logic.globalDict is a user data dictionary, it doesn't contain game engine properties.

As with any python dictionary, you can loop over the contents using dict.items() to get more control over formatting, there is also dict.keys() and dict.values() if you don't want both of them.

import bge

print('globalDict is')
for k,v in bge.logic.globalDict.items():
    print(k,v)


Add a Keyframe Option to a Button in a Panel I am trying to create add a keyframe option on Buttons in my Panel. As instructed by a tip here, using
layout.use_property_split = True and  layout.use_property_decorate = True seems to only add a keyframe option to sliders. Is it possible to enable keyframing for buttons?

import bpy
from bpy.props import BoolProperty

win_man = bpy.types.WindowManager
bool_prop = bpy.props.BoolProperty

def update_test(self, context):

    if not context.window_manager.test:
        test = 1
    else:
        test = 0

    return

win_man.test = bool_prop(default = False, update = update_test)

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

    def draw(self, context):

        wm = context.window_manager
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = True
        obj = context.object

        col = layout.column()
        col.prop(obj, "location")
        row = self.layout.row()
        sub = row.row()
        label = "test = 1" if wm.test else "test = 0"
        sub.prop(wm, 'test', text=label, toggle=True)

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

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

if __name__ == "__main__":
    register()

Here is the test example used in the previous link with a button property added to demonstrate my point.

from bpy.props import BoolProperty

win_man = bpy.types.WindowManager
bool_prop = bpy.props.BoolProperty

scene_man = bpy.types.Scene

def update_test(self, context):

    if not bpy.context.scene.test:
        bpy.data.objects["Cube"].location[0] = 1

    else:
        bpy.data.objects["Cube"].location[0] = 0

    return

win_man.test = bool_prop(default = False, update = update_test)
scene_man.test = bool_prop(default = False, update = update_test)

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

    def draw(self, context):
        loc = bpy.data.objects["Cube"].location[0]
        wm = context.window_manager
        sn = context.scene
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = True
        obj = context.object

        row = self.layout.row()
        sub = row.row()
        label = "cube = 0" if sn.test else "cube = 1"

        sub.prop(sn, 'test', text=label, toggle=True)

        return
        icon = 'DECORATE_KEYFRAME' if sn.arm_ik else 'DECORATE'
        sub.operator("object.simple_operator", text="", emboss=False, icon=icon)

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

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

if __name__ == "__main__":
    register()

Here is what I tried. The keyframes now work but they don't save the position of the cube, they only seem to affect the button display. How do I make the keyframes react to the location of the cube instead?

Window manager properties are not animatable

Doh.. should have looked harder. The issue here is the use of window manager

>>> C.window_manager.keyframe_insert('test')
Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
TypeError: bpy_struct.keyframe_insert() property "test" not animatable

Use another ID type, Scene for example and all is sweet.

import bpy
from bpy.props import BoolProperty

def update_test(self, context):

    test = int(self.test)
    return

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

    def draw(self, context):

        scene = context.scene
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = True
        obj = context.object

        col = layout.column()
        col.prop(obj, "location")
        row = self.layout.row()
        sub = row.row()
        label = "test = 1" if scene.test else "test = 0"

        sub.prop(scene, 'test', text=label, toggle=True)

        return
        icon = 'DECORATE_KEYFRAME' if wm.test else 'DECORATE'
        sub.operator("object.simple_operator", text="", emboss=False, icon=icon)

def register():
    bpy.types.Scene.test = BoolProperty()
    bpy.utils.register_class(HelloWorldPanel)

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

if __name__ == "__main__":
    register()

Notice can emulate this with an operator. Have put in the draw method to display only icon for operator (example toggles icon simply using bool value)  Otherwise could pass the path to operator and keyframe insert, change icon based on key at that frame.


Surface normals in Blender? I currently have a .ply mesh, and I am trying to compute the surface normals of the blob-like object. I wish to encode the normals in an RGB map, so I tried linking the geometry node's normal to the emission shader as shown below:

However, I checked the output for the rendered image (in MATLAB) and the normals were certainly not right. In the preview pane, the cube looked like this:

Clearly, something isn't right, as I would want the face facing the viewer to be green and not black.

Does anyone have any input?

If your goal is to get a texture with those values then just bake the Normals but select World instead of Tangent in the menu.


Append python script for Blender 2.8 I'm trying to write a script to append an Object or a Collection from a blend file to a new file. Can someone please point what I'm doing wrong?

import bpy

filepath  = "/home/lucas/Desktop/Auto_Eye/02_versions/auto_eye_v03.blend"
directory = "\\Object\\"
filename  = "auto_eye_v03"

bpy.ops.wm.append(filepath=filepath, directory=directory, filename=filename)

This code gives me this error:

Error: '\Object\auto_eye_v03': not a library
Traceback (most recent call last):
  File "/Text", line 7, in <module>
  File "/home/lucas/Programs/blender-2.80/2.80/scripts/modules/bpy/ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: '\Object\auto_eye_v03': not a library

Error: Python script failed, check the message in the system console

And the other method that I've found here on Blender Stack Exchange.

import bpy
scn = bpy.context.scene
filepath = "/home/lucas/Desktop/Auto_Eye/02_versions/auto_eye_v03.blend"

#append object from .blend file
with bpy.data.libraries.load(filepath) as (data_from, data_to):
    data_to.objects = data_from.objects

#link object to current scene
for obj in data_to.objects:
    if obj is not None:
        scn.objects.link(obj)

And this code is given me this error.

Traceback (most recent call last):
  File "/Text.001", line 6, in <module>
OSError: load: /home/lucas/Desktop/Auto_Eye/02_versions/auto_eye_v03.blend failed to open blend file

Error: Python script failed, check the message in the system console

I run this two commands on the Blender Console.

>>> bpy.data.libraries
<bpy_collection[0], BlendDataLibraries>

>>> bpy.data.objects
<bpy_collection[5], BlendDataObjects>

So I didn't have anything on the libraries of the file, but I can't find a way do add then to the libraries.

In the "bpy.data.objects" it lists the objects that I have on the scene, so I need to learn how to append the objects from there.

With some help on twitter, this code is working now.

import bpy

bpy.ops.wm.append(
    filepath="cube.blend",
    directory="/home/lucas/Desktop/cube.blend\\Object\\",
    filename="Cube")

Basically,

filepath= .blend file name

directory= directory of your file and the last part is the folder inside the blend file.

filename= Is the object, material, collection or whatever you want to append.


How do you copy an object including all its properties, and make it single user? I specify that I know how to copy an object but I haven't found an answer for some time.
I want to copy an object and its date, then its vertex groups, including all the custom properties of that object, without it being linked to the original object anymore.
First example, copy entire object:
copy_ob = bpy.data.objects['ob'].copy()
bpy.context.scene.collection.objects.link(copy_ob)

Good solution , but have a problem, he object is still linked to the first, and any changes will also occur to the second object and vice versa.
Second example:
#This is a small function that I am using at the moment:
def copy_object(ob,new_name):
    copy_data = ob.data.copy()
    copy_ob = bpy.data.objects.new(new_name,copy_data)
    copy_ob.location = ob.location
    copy_ob.rotation_euler = ob.rotation_euler
    copy_ob.scale = ob.scale
    return copy_ob

new_ob = copy_object(context.object,'New Object')
bpy.context.collection.objects.link(new_ob)

The second solution is proposed many times in many sites, but it presents a very big problem, which hardly anyone takes into account.
Loss of any property related to the first object, loss of positions, locations, rotation, vertex group, and any other property that is not contained in the ob.data.
How can you do to avoid this?
The first solution, if you could make it "Single User" would be the best. But I really can't find an answer about it.
I am trying at all costs to avoid bpy.ops
Definitely:
Thanks to Andrey Sokolov's answer, I have finally come to a conclusion on how to copy an object without it being linked to the First. Here is my little code, with a function that does this copy. I leave it here, so those who need it can easily use it:
import bpy

def copy_object(ob,new_name):

    copy_data = ob.data.copy()
    copy_ob = ob.copy()
    copy_ob.data = copy_data
    copy_ob.name = new_name
    copy_ob.data.name = new_name
    return copy_ob

ob = copy_object(bpy.context.object,'New Object')
bpy.context.collection.objects.link(ob) #context collection is the collectionin which you are working

In the first case it is not unlinked because it continues to use the same mesh data block. So all you need to do is copy object, copy its data and assign the new data to the new object like this (with default cube):
import bpy

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

new_mesh = obj.data.copy()
new_obj = obj.copy()
new_obj.data = new_mesh
for col in bpy.data.collections:
    if obj.name in col.objects:
        col.objects.link(new_obj)


How to partially blur an image in the compositor? I want to blur an image I used as a background in the compositor but have it blurred more towards the top and in focus in the foreground.  Is this possible to do with nodes?

Thanks

This is the node setup:

you can use the box mask node. if you need a gradient from top to bottom you could blur the box mask


How can I scale a quad by its X axis rather than my point of view? How can I scale a quad by its X axis rather than my point of view?

Choose normal as transformation oriention.


Is there a Blender Python UI code to draw a horizontal line or vertical space? So that in a tool shelve you can either via a line or a and empty space indicate groups of buttons without having to use the class command to define sections in a panel?

The only two ways I see currently is either via a label

Or via the class

The definitive place for UI examples is the UI cookbook. The layout templating syntax hasn't changed much since the early 2.5 releases.

There is layout.separator() for a subtle space between consecutive items. The vertical space is added automatically if multiple items appear on one row.

class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

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

        scene = context.scene

        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        layout.row().separator()
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")
        layout.row().separator()
        row = layout.row()
        row.prop(scene, "frame_start")
        row.prop(scene, "frame_end")

Or for a more defined delineation, one might use layout.box()

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

    scene = context.scene

    box = layout.box()
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")

    box = layout.box()
    row = box.row()
    row.label('some label')
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")

    box = layout.box()
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")

A vertical split using box and column. You might struggle with this, this is normal.

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

    scene = context.scene

    col = layout.row()
    split = col.split(percentage=0.5)
    box = split.column().box()

    row = box.row()
    row.label('some label 1')
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")

    box = split.column().box()
    row = box.row()
    row.label('some label 2')
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")
    row = box.row()
    row.prop(scene, "frame_start")
    row.prop(scene, "frame_end")


I merge 2 points and i want to get it back no ctrl + z available By mistake I merge this 2 points and I want to get them back how I can do it ?


How can I delete mesh parts with python? Suppose I have identified or can identifiy some meshparts I no longer want in my mesh and want to delete them, how would I do it?

I know that bmesh.ops.delete exists, I just don't know how to use it, because the API is a bit lacking for that function. :)

Thanks

using the bmesh simple template from the text editor, and a bit of snooping around. You should experiment with the geom and context parameters.

The context is enumerated so (source: bmesh_operator_api.h):

enum {
DEL_VERTS = 1,
DEL_EDGES,
DEL_ONLYFACES,
DEL_EDGESFACES,
DEL_FACES,
DEL_ALL,
DEL_ONLYTAGGED
};

This example assumes we have a mesh object in edit-mode and several faces selected. Running the script will delete edges and faces associated with the selection.

import bpy
import bmesh

# Get the active mesh
obj = bpy.context.edit_object
me = obj.data

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)
faces_select = [f for f in bm.faces if f.select]

bmesh.ops.delete(bm, geom=faces_select, context=5)

# Show the updates in the viewport
# and recalculate n-gon tessellation.
bmesh.update_edit_mesh(me, True)


BI "Front/Back" vs Cycles "Facing" - Angle of Incidence in Blender Internal In Cycles the Layer Weight node has an output called Facing.

In Blender Internal the Geometry node has an output called Front/Back.

Do these perform the same function and just have different names, or are they doing something different?

Thanks

Do these perform the same function and just have different names, or are they doing something different?

No, they don't. They perform something different:

Facing output from Cycles Layer Weight node gives angle of incidence. You can read about this node and how it compares to the Fresnel node here: Relation between Fresnel IOR and Layerweight blend?

You can make it from scratch in Blender Internal node material like this:

Front/Back output from BI Geometry node is the same as Backfacing output from Cycles Geometry node and gives a binary true/false (1/0) if a face is oriented to the camera with it's normal or not.


2.8 is missing the Carve option in the Boolean Modifier Was there a specific place to post 2.8 observation? I would like to continue to use 2.8 but used the Carve option in 2.79 which is missing

As mentioned here, by developer Sergey Sharybin, 'Carve' was removed in favour of focusing on one boolean implementation (BMesh):

  We've got quite comprehensive BMesh based implementation, which is way
  easier for maintenance than abandoned Carve library.

  After all the time BMesh implementation was working on the same level
  of limitations about manifold meshes and touching edges than Carve. Is
  better to focus on maintaining one boolean implementation now.

A task remains open to track any issues with the BMesh implementation:

https://developer.blender.org/T47030

There is also a fairly brief discussion on devtalk.blender.org regarding this topic (there may be other discussions - I just found this link quickly) which includes a few comments from a developer who is working on the BMesh library:

https://devtalk.blender.org/t/carve-was-the-only-boolean-mode-that-worked-for-sculpting-and-it-got-removed-in-2-8-wtf/5576


How to unhide hidden objects? so I hid some masked object with Hide (box) shortcut H, and now I want to unhide hidden objects so I can work with them again. Can't seem to find how.

Just press Alt + H
It also selects everything that was hidden. Works with hidden parts of your mesh in Edit Mode and Hidden Objects in Object Mode.


How to join vertices to edge The vertices does not join to the edge so a gap is form. The thing is I do not want to create a new face to fill the hole because I want my mesh to be quad. How do I fill the hole while keeping things the same?

If you want only minimal changes, you can just snap the vertex to the edge. It is "messy" from a topology point of view but you will basically get what you want. (As long as you don't use any modifiers)

The quality way would be to add an edgeloop to the quads shown on the right (split each quad into two) and connect the vertex to the end of the edgeloop:


Why do my mesh planes get deleted when I bind all objects using control + j? When I bind all objects the mesh planes get deleted, I’m trying to export it as one piece so any solutions?

Probably they get moved, not deleted. If so, before joining, select the disappearing objects and press Alt P "Clear and keep transform", then join with Ctrl J.


How do I correctly reduce geometry on part of a mesh? Good afternoon,
I already know that there are easy ways for reducing face count for the entire model. However I am trying to find a way to reduce faces only on specific parts of my mesh while keeping it deformation and rendering-friendly for animation.

From youtube tutorials I managed to figure that all I can do is to manually dissolve edges and verices and create new edges to form triangles to connect large faces with the smaller ones as follows (I must avoid faces with more than 4 vertices as far as I know):

Is this the "good practice" way of character modeling? Will the model UV unwrap, animate and render properly afterwards? (I know the example mesh from the screenshot is not a character, but I will need to create one and sculpt details on parts of the character). Or is there an easier way of doing this? Please help.

You can try the decimate modifier. It can take a vertex group so first add the faces you want less detailed into a group, then select it in the modifier.


Fill Curve Cube without intersecting parts I created a cube out with just Curve paths and filled it as shown at the screenshot. But this mode creates intersecting parts (Screenshot 3-4)
Is there a way to do this without intersecting parts?

Well,This expected from what you did.There is no way to solve this.

Instead you can use the Wireframe modifier to generate a similar result.

You can also flatten the face to get a more neat result:

Flatting can be done using the keys S + Axis + 0 after selecting the right faces.


Normals problem; Difference between shading modes? I have this surface with bad look in Smooth Shading mode. If I change it to Flat it looks OK. What's the difference between these two Shading modes?

This is a model for a game. When I export the model for the game format it will use the Shading mode that I selected or it will force Smooth mode?

After modeling:

After recalculate normals:

Smooth Shading mode:

Flat Shading mode:

First make sure all your normals are consistent, and all pointing out. If some of them are backwards, that will wreak havoc on the shading.
Mesh Shading
The difference between smooth shading and flat shading is in how the normals are interpolated.
Flat shading uses one surface normal per face, to define the surface's shading. Which makes one color for each face.

Smooth shading takes uses the vertex normals, one normal for each vertex. Which blends the normals of the agents faces to create a smooth transition between the two faces.

What I think is happening in your mesh, is that the top is not completely flat and the small edges are making a problem for the smooth shading.
Because you are exporting it for a game, blenders shading model really does not matter. The game engine will control the shading, however it probably will use its own smooth shading.
To ensure that the sides and the top do not get lumped together in some smooth shading artifact, I would recommend adding a Edge Split modifier. Set the Split Angle to something around 80°.

Doing so will separate any faces that meet at an angle of 80° or higher. Because the faces will be separate, it will eliminate any chance of smooth shading artifacts around the edges.


Strange painting behaviour I have a strange behavior with texture paint I cannot explain.
When I draw at the Mesh, the paint appears on the faces on the other side of the mesh... see the picture.
It's quite impossible to work with this. In the UV view, I am unable to draw at all the brush just not appears there. So has anyone an idea, what I could be doing wrong or how to fix this?

If not, is there a possibility I export the UV with the mesh lines on it? So I can use an external program to paint it?

Thanks very much in advance for any help!

This is the unwrap...
Nothing is dangled or overlapping I already tried to reset the normals... but this didn't work either...

You need to apply your Mirror modifier before unwrapping, otherwise the faces will overlap.


Weird Color Overlay in Solid Shading Mode in the Viewport When I am displaying my mesh with solid shading in the viewport it looks wrong:

It has some weird blue overlay when it should have colors that look more similar to the ones I have in "texture" viewport shading mode:

Any idea where I'm going wrong? I can upload the file if necessary.
This is my file

I don't really know what is causing it, probably a visual glitch.

Whatever it is, its produced by a vertex color layer named "Col" your object has, removing it makes it display properly.

It is only present in Multitexture viewport shading mode, if you switch to GLSL the blue tint is gone.


Is it possible to use bpy.props.PointerProperty to store a pointer to an object? If the user renames an object, the reference via string key is lost.

Is it possible to store a pointer to an object in a property assigned to a class of bpy.types

I checked

>>> type(obj.bl_rna.properties['parent'])
<class 'bpy.types.PointerProperty'>

However type for PointerProperty is expected to be a subclass of bpy.types.PropertyGroup but bpy.types.Object is inherited from bpy_struct and bpy.types.ID.

As of release 2.79
it is possible to store a pointer to an object

Usage example:

my_pointer = PointerProperty(name="My Pointer", type=bpy.types.Object)


Blender Online Product Configurator - Dynamicly Updates Geometry Is it possible to make an online product configurator using Blender Cycles rendered models that dynamically stretch and grow?

As user enters their custom dimensions (height and width) could their product's 3D model update to that size in real time?

Bonus: could objects be added as the product gets bigger?

Like a ladder that could be any custom length, but for every extra 12" it adds another rung.  Then re-spaces all rungs equally apart.

Couldn't find any configurators like this.  Usually they only change color and swap parts.

Yes, Blend4Web offers JavaScript API which you can use to modify the geometry in run-time.

Additional objects can be added too.


Array isn't following edges of curve I converted my rectangle into a curve so that the array can follow the path, but as you can see in the picture it's trying to smooth the edges. I already applied scale, location and rotation for the curve and the array, but it didn't solve the problem. I don't have any unapplied modifiers on my curve.

File: https://drive.google.com/open?id=1c2ogiodGyhzVrWPXdxHMtTJrR9jsoBaK

This is happening because your curve Preview resolution is low,

So, in the curve-properties, increase the curve Preview resolution


Selection Problems with Converting Quads to Tris in Game Engine? I'm trying to make it so that when the user clicks while the game is playing, it converts the quads of the "Gem" object into tris.

I have the camera with a sensor for the Left Mouse Button connected to a python controller.

The python script is as follows:

import bge,bpy

cont = bge.logic.getCurrentController()
lclick = cont.sensors["lclick"]

if lclick.positive:
    print(len(bpy.data.objects["Gem"].data.vertices))
    cam = cont.owner
    origMode = bpy.context.object.mode
    bpy.ops.object.mode_set(mode = 'OBJECT')
    bpy.ops.object.select_all(action="DESELECT")
    bpy.data.objects["Gem"].select = True
    bpy.ops.object.mode_set(mode = 'EDIT')
    bpy.ops.mesh.quads_convert_to_tris()
    bpy.ops.object.mode_set(mode = origMode)
    print(len(bpy.data.objects["Gem"].data.polygons))

This seems to fail sometimes depending on what was selected before starting. When it doesn't work, it gives me the following error:

TypeError: Converting py args to operator properties: enum "EDIT" not found in ('OBJECT')

Furthermore, when I exit the game engine, it does indeed show that "Object mode" is the only available mode for the selection, despite the fact that it shows the "Gem" object as the only thing selected (though, it is outlined in a darker orange than usual).

Can this not be done this way in the game engine? Is there a better way to do it?

Running bpy.ops operators in the game engine wont work well (if at all),

Best have the triangulated mesh on a hidden layer, and swap in the triangulated mesh when you need it.

Note, if you really wanted you could use LibLoad to convert a mesh while the game runs, and you could also use bmesh to triangulate the mesh, but this is fairly advanced API use, and Id not really recommend it since it wont work in the blender player.


Opened blender file, lost objects new to blender Hello all, I opened the blender file I was working on and it opened to the enclosed img. I am not sure why or how it opened into this and I am not sure how to return it to normal. Please help

I think you are in the Image Editor.

Press Esc or click on this small button a drop down and select 3D View:


Renderman works fine but rendering in 'it' just shows 'it' showing 'Empty' and does nothing I've been a user of Blender for a very long time (not that I'm skilled though XD ) and while I normally use Cycles or LuxRender, I gave Renderman a try.

I was able to install it successfully, even installing the Maya Renderman even though I don't have Maya, just to get 'it'. But there's a problem.

I modeled a really simple scene:

And while rendering it using Blender's internal framebuffer works,

rendering it with 'it' fails for some reason, and just shows 'it', doing nothing, "Empty" written in its title bar.

Nothing happens no matter how long I wait, Blender becomes non-functional from here on because cancelling the render just takes forever, and I have to force close Blender from the task manager and restart Blender just to take another try.

My Blender version is 2.78a, my Renderman is 21.2, and since I can somehow render images, just not with 'it', I'm sure I installed Renderman and the Blender plugin correctly, but what could be wrong?

Thank you in advance for your support.

I have been using RM for a month or so now.

Make sure your IPR is running before you render. Using your viewport is almost pointless for viewing your renders.

Everything is run through "IT".

Make sure you have Blender rendering to "IT"

If you want to upload your blend file I can test it out.

I would recommend going through the RM forums

https://renderman.pixar.com/forum/forumdisplay.php?s=&forumid=166

They are awesome, they usually respond very fast for any problems.

PS Not sure what you meant by installing the MAYA version to get "IT". That might be the problem. I didnt do it that way. "IT" should just come with RM. I did NOT install the MAYA version, I still have "IT".


Animate multiple material transitions How can I animate an object to have a different material? I made 10 different materials and I want to make a sequence of this object with all (animated) materials.

You could put the materials into nodegroups, and switch between them.
This setup can switch between any number of groups by animating the value node.
(I'm sure this was answered somewhere before, just couldn't find it)


When declaring a panel, what does the 'bl_context' value need to be? I'm confused about how to declare a panel.

I've tried to write a simple panel but it doesn't work:

class TestPanel(bpy.types.Panel):
    bl_idname = "object.test"
    bl_label = "test"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'TOOLS'
    bl_context = 'sculptmode'
    bl_category = "test"

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

I would like which values can be used in bl_context

In you specific case, the bl_context you are looking for is sculpt_mode. There are many others including:

objectmode
mesh_edit
curve_edit
surface_edit
text_edit
armature_edit
mball_edit
lattice_edit
pose_mode
imagepaint
weightpaint
vertexpaint
particlemode


Hair emitting from wrong side of mesh I made a head using the mirror modifier, and for the hair duplicated the scalp so I could add hair particles across the whole head and not just the side that I had sculpted the actual mesh. I flipped the half of the scalp using Ctrl+M along the X axis, and joined the two halves together into one object. When I went to add hair particles though, all the hair particles coming from the mirrored side were facing inwards.

After a bit of googling around, I though it might be that the normals had become flipped, and that was causing the hair to grow inwards. However, flipping the normals did not seem to change anything in regards to the hair.

I just dealt with this. Check your Timing panel and make sure the ending is set to 1.0

Hope this helps. It did it for me.


Render shows no image, just a color screen I am trying to make a wallpaper 2560x1440, but in the render result I can't see anything, just color as shown in the screenshot.

That is the .blend

There were two reasons.

you had no light in the scene. (I just added a sunlight)
You had your camera aperture set to .2 ( I just disabled DOF)


Is it possible to use timeline markers for driver expression? I want to use timeline markers for driver expression, is it possible? And is it need to be added to bpy.app.driver_namespace for quick driver add like #frame? If yes, then how?

Thanks

It is possible to use marker for rendering frame ranges, but not through driver, which is normally used to trigger value change based on Scene.frame_current. What you need instead, is property manipulation based on TimeLineMarker.frame.

The only thing you need to do is iterating over Scene.timeline_markers, because manipulation of Scene.frame_start and Scene.frame_end for each render batch is already taken care of by the addon. Get the list of frame ranges used by the addon, which is Scene.batch_render.frame_ranges, and insert positions of the pair of markers into it. It is this last step that wouldn't be made simpler by a driver.

Below's an operator for you to edit and use. It converts each pair of markers named start and end directly into frame ranges:

class OBJECT_OT_MarkerToFrameRanges(bpy.types.Operator):
    bl_idname = "batch_render.marker_to_frame_ranges"
    bl_label = "Marker To Frame Ranges"

    def execute(self, context):
        batcher = context.scene.batch_render
        marker_list = sorted(context.scene.timeline_markers,
                             key=lambda x: x.frame)
        marker_frame_ranges = []

        for marker in marker_list:
            if marker.name == 'start':
                marker_frame_ranges.append({'start': marker.frame})
            elif marker.name == 'end':
                range_dict = marker_frame_ranges[-1] if marker_frame_ranges\
                    else {}
                range_dict['end'] = marker.frame

        for index, range_dict in enumerate(marker_frame_ranges):
            marker_start = range_dict.get('start', 0)
            marker_end = range_dict.get('end', context.scene.frame_end)

            if index >= len(batcher.frame_ranges):
                bpy.ops.batch_render.add_new()

            batcher.frame_ranges[index].start_frame = marker_start
            batcher.frame_ranges[index].end_frame = marker_end

        return {'FINISHED'}

EDIT: To strictly answer your question: Yes, it is possible to use timeline marker for driver expression. The function below will return True only if there's a marker at the current frame:

def any_marker_at_frame():
    frame_current = bpy.context.scene.frame_current
    markers = bpy.context.scene.timeline_markers

    for m in markers:
        if m.frame == frame_current:
            return True
    return False

bpy.app.driver_namespace['any_marker_at_frame'] = any_marker_at_frame

You can then use any_marker_at_frame() in your scripted expression.


How do I render specific render layers using python? Does anybody know how to choose one or more from multiple defined render layers by name from command line or from the blender python console? To disable all render layers except the ones specified.

Here's a little script, that iterates over all render layers and checks for some condition (e.g. does the layername start with 's'?). Then it disables all render layers and enables one that fulfills the condition until there are no more layers:

import bpy

render_layers = bpy.context.scene.render.layers

for layer in render_layers:

    # some condition
    if layer.name.startswith("s"):

        # disable all
        for l in render_layers:
            l.use = False

        # re-enable a single one that matched the condition
        layer.use = True

        # RENDER HERE


What does the Mantaflow 'time' setting for noise do? Does anyone know what the 'time' setting for noise is supposed to do?
I've made a sim, and I'm trying to make the noise move/develop/scintillate more slowly. Which I'd sort of assumed the 'time' control was for, but my findings would make it appear otherwise...

So here's the same sim, with multiple different 'time' settings for the noise:

https://www.youtube.com/watch?v=HNbeHS5C3xE&feature=youtu.be

It's a bit difficult to watch eight at once, so I knocked it back to four:

https://www.youtube.com/watch?v=4ghOibSh5vA&feature=youtu.be

I can't see much of a difference between them, I definitely can't see a 1000 times difference between 0.01 & 10!

Here's the smoke zoomed a bit:

https://www.youtube.com/watch?v=Z9JsSyI-im8&feature=youtu.be

Still not seeing terribly much difference! Am I using the control wrong?
I mean the tool-tip says 'animation time of noise', which you'd think made the noise faster or slower, no?

I must admit I've only used Mantaflow for Gas sims so far, so this control may well be fantastic for 'wet' fluid sims, but does anyone know how to slow the noise down in a gas sim?

For that matter - does anyone have any docs for Mantaflow in general?!?

My understanding is that the time factor basically acts as a control for the coordinates of the noise. So it just changes the position and look of the noise, but not really related to time in the sense of how the noise behaves over time.


Hair particle system as dynamic paint brush not working? I am trying to create a moving paintbrush effect using dynamic paint (in Blender 2.79).  A particle system of "hair" type is the brush and a subdivided plane is the canvas.  The notion is to have each brush hair/bristle paint individually, so that using collision physics the brush shape will deform as it is dragged across the canvas, and the dynamic paint will reflect that.
However I'm darned if I can get the hair particle system to paint anything!  If I change the particle system to the "emitter" type it works as expected, so I think I have the basic dynamic paint setup correct.  But no matter how I modify the brush settings the canvas is unmarked when the particle system is set to hair (e.g. modifying the particle effect solid radius under "Dynamic Paint Source", checking/unchecking "use particle's radius").  This is even true if the hair system is rendering objects (little bristle strand objects) rather than paths.
Maybe this is a bug, maybe it's just not implemented, maybe I'm missing some necessary setting?  Would appreciate any guidance!
Note: although I have the collision / deformation working, I've turned it off while I'm trying to get the dynamic paint working.
UPDATE: well I have still had no luck with the hair particle system.  The best I've been able to do is convert the hairs to curves, then to a mesh, and use cloth physics to model the deformation.  Preliminarily it comes out something like I wanted, although getting the cloth physics right is a challenge.

Still: it would be much handier to do all this with the hair particle system!

Use Particle Instance modifier.

I used Cylinder as basic mesh, which was instanced via another object's Hair system.

So, this Instanced mesh will be a Dynamic Paint Brush, set brush option to Mesh Volume or Mesh Volume + Proximity to get it work.

Default Cylinder is vertically oriented, but I gave it 90 degree rotation on X axis in Edit mode (note, that you should do transforms in Edit mode, otherwise transformations will affect whole instanced object). Add some loopcuts to make it easier to bend along hair strands.

Cylinder in Edit mode:


Changing the default object origin from center to corner? Newly added objects are always added from their centers by default. I'd instead like to add them from their top-left bottom corners.

Below is an example:

I don't want to adjust the origin afterwards, but from the outset when I add a new object, they should be added, scaled or rotated from the top-left bottom corner position.

So, for example, if I wanted to add another object on top of this cube (e.g. cylinder), all I should need to do is to move the 3d cursor to the top-left top corner of the cube and then add object without needing to translate it along the x/y axis for alignment with the cube below.

At the moment however, whenever I add a new object it gets added from its center, as shown below:

Is there any way of changing this?

As far as I know there is no built in way of doing this natively, at least not without some python coding or script/addon involved.

There is one addon for aligning objects that has an additional feature that allows you to align object centers directly from object mode though.

It doesn't do it automatically but maybe it can save you a few steps http://blenderartists.org/forum/showthread.php?256114-Add-on-Advanced-align-tools


Can a curve with a bevel profile have 2 materials Dear friends and fellow Blenderheads, could you give me a hand with that profile? I have curve with a bevel profile - basically a lofted cornice. And it should have a cover on top. Is there a possibility to still have it as a curve without converting to mesh and have 2 materials assigned to it. E.g. material 1 - white stucco and material 2 - metal plate? Thanks.

There is currently no way to have multiple materials using a single curve and a profile object.

You could have a single material containing 2 different shaders, but you would need a way to separate what material is for what part of the object. One way to do that would be to use a bevel object curve composed of two separate splines inside. You could flip the direction of one of the splines (w -> Switch Direction with the spline selected in edit mode) in order for the result to have one part of it with inverted normals.

You could then use Backfacing output of the Geometry node to mix your different shaders. Note that you will have the normals inverted so you will also have to take that into account in one of your shaders: for example you would have to invert the IOR value of the Fresnel node if you used one in the shader:


BakingProblem with Normalmap so i made this model of a shark and wanted to bake the high poly to the low poly but something isn't working properly. At least the normal map doesn't look right (look at the picture). And yes i lined them up before baking. I just moved them so it is easier to see.
Thanks in advance for the help.  [1]: https://i.stack.imgur.com/d50hA.jpg

Create a new image for your bake with the 32 bit Float option enabled
Shade smooth your 2 objects
The unwrap of your low-poly is bad, UV are overlapping, so re-unwrap with the Smart UV Project mode
Bake, it should work:


Saving and Restoring View Changes Edit/Note: I edited the title of this question to match the only answer that seems to be available for this situation. Original question was how to "Undo/Redo View-port Changes"

Original Question:

I'm pretty sure Blender does not have any direct way to undo view-port changes (similar to Max - if I rotate the view, I can press a command to go back to the starting point of that rotation). But has anyone figured out any trick or found any script that accomplishes the same thing?

I'm surprised so few people have asked about this. I definitely abused this ability in my Max days, and wouldn't mind doing it in Blender, if its possible!

Edit: Another similar question would be the possibility of saving view-port orientations and reloading them via commands. Is something like this possible without a lot of hassle?

Thanks for any advice!

There is an addon called Stored Views (3D View: Stored Views) which comes with Blender 2.80. This simple extension allows you to save views (location & rotation of viewport). The UI for it is located in the [N] sidebar panel under View -> Stored Views.

You can save and name any (?) number of views and quickly restore them by pressing their respective buttons. No cameras required. Although it actually allows you to save the current view as a camera as well.

It is not exactly what I originally asked for (restoring viewport changes), but it is the next best thing. Maybe actually better in terms of workflow.

Hopefully this will help those (like me) who model objects at crazy orientations.


How to Relink a Linked Object? I have to replace a linked object with another one but it would be nice to keep all object transformations of the old proxy.

What is the common way to do this?

Select all objects that share linked data, then select your new object last so that it is the active object. Then press CtrlL and select Object Data from the menu.

Before:

After:


How to get absolute file path for linked texture image? I am writing a custom export script for blender and need to copy the textures from the materials texture slots to another location.
I am using shutil for copyfile:

copyfile(bpy.path.abspath(texture.image.filepath), export_path + filename)

This works, as long as the texture isn't linked from another .blend file. In this case, texture.image.filepath returns the path relative to the source blend file, not the current working file. bpy.path.abspath then just appends it to the current working directory, which is wrong of course. How to deal with this?

Not very nice, but it's working.

import os
import bpy

tex = bpy.data.images['WALL_1773.png']
# linked image from /project/assets/shaders/walls.blend

tex_path = tex.filepath
# '//../textures/walls/WALL_1773.png'

blend_dir_path = os.path.dirname(tex.library.filepath)
# '/project/assets/shaders'

full_path = blend_dir_path + tex_path[1:]
# '/project/assets/shaders/../textures/walls/WALL_1773.png'

norm_path = os.path.normpath(full_path)
# '/project/assets/textures/walls/WALL_1773.png'

Better code based on batFINGER's comment

import os
import bpy

tex = bpy.data.images['WALL_1773.png']
# linked image from /project/assets/shaders/walls.blend

full_path = bpy.path.abspath(tex.filepath, library=tex.library)
# '/project/assets/shaders/../textures/walls/WALL_1773.png'

norm_path = os.path.normpath(full_path)
# '/project/assets/textures/walls/WALL_1773.png'


How do I model from a side view with a reference image? I know how to setup it up, but if I for example, want to model a car, I will use planes and model it with a  reference image on the back. But then, from time to time, I switch off that view, and I realise what everything I was doing, is looking at the wrong way, and the planes extrude inwards except upwards... What am i missing? should I hold something when extruding? Or is there anything I should know? Maybe it's too advenced for someone who started recently but I would really like to learn how to design like that.

Feel free to share any tips

You need to use background images either in orthographic view, or using stationary camera views rather than planes. Background images is in the properties window on the right hand side when you're in 3D view (you can toggle its view with the "n" key). from there you can load up images, and choose which views they are visible from. all views except for camera view are only visible in orthographic mode which is the view when you press 5 on the num pad and then press 1, 3, or 7 to see front, side, or top views. since things are not orthographic in real life you can also use a camera view background image to keep the reference image stationary against the  model.


Modal Operator to Keep UI Active while Listening to Network Traffic and Updating Display I am working on a Blender plugin that updates light fixtures in response to network data. I have the main aspect of the program completed (parsing the network packages into instructions for how exactly a certain light should be changed), and now I am trying to address lingering issues, the most critical of which is the UI locking up while the program runs. My understanding is that a modal operator would allow my program to essentially run in the background, which would let packages be processed and lights be updated without restricting the user's ability to interact with the 3D view (for example, lights could be pulsing while the user rotates their view).

Current State: Right now, I have a version of my code that is essentially spliced into the Blender template modal operator (timer version). Here is an outline of what I have:

/* import statements and initial setup here */

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

    _timer = None

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

        if event.type == 'TIMER':
            /*code that process a network packet into an array called dmx here*/
            #now change the lights based on the dmx data
            objects = bpy.data.scenes
            scene = objects[0]
            #if this packet is different than the last one we applied
            if(dmxOLD != dmx):
                for light in scene.objects:
                    if "prop" in light:
                        chan = math.floor(light["prop"]+17)
                        /*code that updates the light here*/
                        #now update the display
                        bpy.ops.wm.redraw_timer(type='DRAW_WIN_SWAP', iterations=1)
            dmxOLD = copy.deepcopy(dmx)
            #END CONTROL OF LIGHTS
        return {'PASS_THROUGH'}

    def execute(self, context):
        wm = context.window_manager
        self._timer = wm.event_timer_add(0.1, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

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

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.wm.modal_timer_operator()

So when I run the full version of this, it basically runs as though the code was inside of an infinite loop and not in a modal operator. In other words, the packets are processed and the display is updated but the user is locked out.

Am I using a modal operator incorrectly? Is this the wrong template to be using?

i will answer my own question:

instead of using a handler and registering it in scene update pre, turn it into a modal operator with a timer caller that checks the queue every close interval.

This way i will be able to execute any type of python script using blender api. You will bypass the handler problems!


Is there a way to create a model and export it into a spriteset of that model 360 view?g There is an example of a ship model that has a sprite every 22.5 degrees.

How can I export a model I make like that is that possible?

You can't export a model as a picture, you have to render it. To make this easy you can animate the camera. For this method of course you have to compose your image so you have to adjust the lights and the materials (or the freestyle lines if you want) of your model. I made a test file what renders the sprite what you ask. Below on the picture you can see what has been adjusted. Here you can download it: https://drive.google.com/open?id=1cycLaGQa0nDICk0urIDQMv2DqP8xw_aO

Just swap the monkey to your own model and click on Animation.


How to change dimension of circles without scaling it? https://photos.google.com/share/AF1QipM6N7e-ZtVL0fwkwy3ro-GcIc6N8B31TkXccejEsRnbLwbFGzJ-_8oVY9HKey7FxQ?key=VjVvekRZbm5vQzdHUUhEQ0p5dWkySlVWOWJoLV9R

I want to make all circles with same thickness.

Also with different dimensions in circles but scaling changes the thickness of the circle.

Please provide me solution.

One way of doing this (it may not fit your workflow, though) is using an array modifier, fitting and following a circled curve (you can create a mesh circle, then convert it to curve with ALTC in object mode):

First, you create a thin rectangle that will fit and then follow a curve, with modifiers. A thinner rectangle will give (as replied by array) higher resolution of the curved shape.

which produces this:

to make another circle, of the same width, duplicate both curve and rectangle, first:

then, scaling the curve, will keep the same width:

another bigger curve:

If you need to have just static meshes, you can then apply (in order) modifers... (maybe keep a "dynamic" copy to create new ones...)


How can i switch form Circleselecion back to Boxselection in Edit Mode First of all I am really new in Blender.
I´m working on a little project but while I was working in Editmode the permanent Selection switched from Box to Circle and don´t know the shortcut to switch again. Maybe I pressed a wrong but I don´t know wich one. Also I don´t mean the Circleselection wich comes when you press C.

You can do this with the mouse or the keyboard.

Mouse

Click and hold the selection to expand the options.

Keyboard

Press Shift + Space then:

B for box
C for circle
L for lasso


Visual aid to show IK Rotation Limitations I'm working with rigging right now and would like to know if there is any visual aid in blender 2.7x to show me the limitations of a bone rotation in a chain?
Such as in this picture of 2.6 documentation:

I can't find any button or shortcut to do so.
Thanks in advance.

Two years and no answer, damn, I've been trying to find the answer to this for a while now and just decided to click on everything i could find and eventually found the answer.

In the properties panel, hot key is N, under the display sub heading, tick "Relationship Lines" and those visual aids should appear yet again.

Hope this helps anyone still looking for the answer.


I am trying to add a custiom property to an add on but it shows me an error I am following this video
https://youtu.be/XqX5wh4YeRw?t=2451
i have done everything the same way but it does not seem to work
here is my code
import bpy
from math import radians
from bpy.props import *

class MyOperator(bpy.types.Operator):
    """Tooltip"""
    bl_idname = "object.my_operator"
    bl_label = "MyOperator"
    bl_options = {'REGISTER', 'UNDO'}

    #create properties
    noise_scale : bpy.props.FloatProperty(
        name = "Noise Scale",
        discrription = "the Scale of the noise",
        default =1.0,
        min = 0.0,
        max = 2.0
        )

and it shows me this error.
'MyOperator' object has no attribute 'noise_scale'

Spelling Error
Quite likely the property fails to register because it has no idea what discrription  is. (Most likely you are alerted to this error when trying to register the operator class) Coding is about attention to detail.  Recommend for blender coding questions here, adding minimal, but runable, code to your question eg the register code for above.
Sure enough, tacking bpy.utils.register_class(MyOperator) to the question code, and checking system console
TypeError: 'discrription' is an invalid keyword argument for FloatProperty()
ValueError: bpy_struct "OBJECT_OT_my_operator" registration error: noise_scale could not register

any attempt to use noise_scale with this operator will lead to error as mentioned in question.
Use description instead and will register as intended.
>>> bpy.ops.object.my_operator(
my_operator()
bpy.ops.object.my_operator(noise_scale=1)
Tooltip


Eye to head parenting/rigging I have two objects-Head and eyes. I have set up the rigging for head movement and rotation. How to make the eyes move with the head movements. I tried rigging my head bones both to head and eyes. It kinda worked. But the eye lid movements got weird as eyes were also affected now.

Make the eyes bones parented with head bone. Then select the eyes object and set parent to with automatic weights (Ctrl+P). And now if it moves weird you must check that all the rest of the bones are not affecting the eyes in weight paint mode. (sorry for my bad English U_U)


Pants and Shirt Not Moving Properly(Weight Paint Issue?) I'm having a problem adjusting the weight painting for the pants and shirt of my character. The problem is that when my character raises his foot, I don't want the top of the pants to poke through the bottom of the shirt. I already tried finding the right bones to change the weight paint influence and this helps a little, but the intersection still happens. I rigged the pants and shirt with automatic weights. Is that the best option or is there a better/easier way to do this? Thanks in advance.

Here's a video.

https://mega.nz/#!D5NA2YaR!2pSZiTbSj5V3QMSv4DA2bLbIiJRM_gQeDh6lzYFlcRY

I answered my own question. I found out that both the hip bones and the other leg bone were influencing the movement of the shirt on the leg I'm working on when they shouldn't have been. I'll need to click in between these few bones and adjust the weight painting until the shirt looks good when the leg is lifted.


Calculating and exporting global rotation of faces created from splitting an isosphere I have created a large set of individual objects by splitting an icosphere along its edges. I am currently trying to import these objects into unity, along with their appropriate transforms, relative to the origin in blender. I have been successful in importing the positions using the experimental transform functionality, however all of the newly created objects' rotation transforms are set to (0,0,0), i.e. the original parent icosphere's rotation. How could I go about recalculating the rotation of the new child objects prior to exporting to a .fbx format?

Thank you for your help, any assistance is greatly appreciated :)

A script to do this

Shows origin and local orientation of one split off face

Adds an icosphere, edge splits, separates and returns to object mode
Selected objects are the result of separate modifier.
For each face object get its lone face and calculate the global center and normal.  See how far the normal is rotated from default quaternion.

Use this to create the global matrix aligned to normal, origin at center.  The object space inverse is applied to the mesh with transfrom (makes origin (0, 0, 0).

The global transform is given to the object by way of world matrix.

Script.

import bpy
from mathutils import Quaternion

context = bpy.context
bpy.ops.mesh.primitive_ico_sphere_add(enter_editmode=True)
bpy.ops.mesh.edge_split()
bpy.ops.mesh.separate(type='LOOSE')

bpy.ops.object.mode_set()
z = Quaternion()
for ob in context.selected_objects:
    print(ob)
    me = ob.data
    mw = ob.matrix_world
    mwi = mw.inverted()
    f = ob.data.polygons[0]
    c = mw @ f.center
    n = mw @ f.normal

    q = z.rotation_difference(n.to_track_quat())
    M =  q.to_matrix().to_4x4()
    M.translation = c
    me.transform(mwi @ M.inverted())
    ob.matrix_world = M

Related. Another example of making a matrix based on known orthogonals.

https://blender.stackexchange.com/a/177331/15543


How to modify Blender data from vector/arrays in Python? I was writing a script and discover weird thing. I have code like this:

import bpy
obj = bpy.context.active_object
for s in obj.scale:
    s *= 2.0
    print(s)

and it doesn't change scale of the object although print(s) shows me correct values. I thought I get a pointer to the object's property as I get pointer to the object in case with:

for obj in bpy.context.selected_objects:
    # do something

The issue here is that its not always clear when values are wrapped or not, that is to say, when modifying a value will apply changes back to the Blender data the values originally came from.
The rule of thumb here is that array/vector/matrix/quaternion/euler/color types wrap blender internal data, but when you get a single number from any of these types, changes to it won't be applied back to the original data.
Taking Object.scale as an example...

This will modifiy the objects scale:
obj.scale[0] = obj.scale[0] * 2.0

# or...
obj.scale[0] *= 2.0

# or...
scale = obj.scale
scale[0] *= 2.0

This won't modify the objects scale:
# s is a float and holds no reference to the original data
s = obj.scale[0]
s *= 2.0

# or...
# this does nothing other then to do a multiplication and ignore the result
obj.scale[0] * 2.0

# or...
# by making a copy of the scale, the reference to blender data is dropped,
# this is often useful when you *want* to get some data and manipulate it
# without touching your data in Blender.
scale = obj.scale.copy()
scale[0] *= 2.0

# or...
# by decomposing the scale value by axis,
# we get a list of floats which won't wrap original data,
# this is like '.copy()' but gives us a list rather then a Vector.
scale = [obj.scale[0], obj.scale[1], obj.scale[2]]
scale[0] *= 2.0

# or...
# this also has the effect of returning a new, modified copy.
scale = [s * 2.0 for s in obj.scale]

Note:
While this is a Vector, the same thing applies to color, eulers... etc as mentioned before.
In the example given in the question, its looping over numbers, so you would have to do something like this...
for i, s in enumerate(obj.scale):
    obj.scale[i] = s * 2.0

Note that in this case Vectors can be multiplied by numbers so its best to do:
obj.scale *= 2.0

Note:
if you have a mathutils class - Vector/Matrix/Color/Quaternion/Euler, you can check to see if they reference some other data with the readonly is_wrapped attribute. You can even get the data they came from using owner


Eevee rendering 2.82, Viewport is fine. Final render has white transparent gloss or film over entire image. Cycles works fine Cycles render

Eevee render

1.)The Cycles render is a cropped image of some shelves, the books on the shelves, two converging walls and the world backround above.

2.)The Eevee render is a cropped image of the end of those same shelves, the wall, and the world backround through a open window.

If at all informative. Eevee renders the image without the white glossy overlay until finished,as if only when the render is fully complete does the white film appear over the otherwise normal render.
Thank you for reading.

These are the passes I had enabled, I turned them off and on in multiple combinations and also tried a render for single layer. No luck I am afraid.

I realize I posted this in answers rather than comments. I am new please excuse this mistake.

Update:

I have found something that has seemingly fixed the issue for a picture render. After the render has completed If I set the following dropdown menus from left the right as the following values,
1) slot one
2) view layer
3) combined
4) color and alpha

Then I can save my image as intended. I can only hope this temporary fix will also work for an animation. I cannot be certain until I render it.
I still am curious as to if this is a proper and permanent fix. I fear it is not.

Final update:

I have fixed my issue. Combined with what is above turning off both compositing and sequencer in post processing worked.

There may be some unnecessary changes, as in what is in my first update. Or perhaps compositing is the problem and sequencer is not and vice versa.
I will not know until I test more, but I am done with this thread.
Thank you to the poster who set me on the right track.
Thanks for reading.


Is it possible to create a compositor node with PyNodes that outputs camera clip_start and clip_end? Im not looking for a how to, but some of you may know if this is possible or not. An example of a dummy node added to compositor would be much appreciated, i can't find any (or i'm looking in all the wrong places)

The PyNodes documentation is here, The TextEditor template Custom Node creates a custom node tree, but what am I supposed to do with that?

Not sure if this is possible with PyNodes, Seems like the sort of thing you'd use Drivers for.

You can use node settings to drive these values too,
Add a driver to the cameras clipping, and set the driver to point to a scene property, eg: node_tree.nodes["Mix"].inputs[0].default_value

And the other way around you can do too, of course. Add a driver to a value node, and set the driver to point to the camera property like clip_sta and clip_end.


Radius is different even though mean radius is the same on beveled curve The scale and mean radius on this beveled curve are all set to 1 yet the radius on that one vertex is is smaller than every other radius. How do I fix this and make them the same radius?

For a single vertex, you can edit it inside the Menu>Item>Transform>Radius;
but for several at once, it seems impossible at the moment.


What is the difference between using an attribute node and texture Coordinate for a UV map? What is the difference between using the attribute mode vs the texture coordinate node?

There isn't really a difference. The attribute node has a few advantages though:

It allows the use of more than one UV map. The texture Coordinate node uses only the UV map with the camera icon selected.
It Contains the name, which can be useful for organizational purposes.

Note:

Their is also a UV map node coming into cycles, which will eliminate the need for both of theses methods.


Are odd shaped quads ok? Is this okay, wrong, what? I started 3d this year, and I didn't see anybody taking about this, but I think that later on when that mouth moves that vert will make the deform weird but I'm not 100% sure.

A non-rectangular quad is fine. (Most times it is the only way to keep a mesh all quads). Just be sure to keep them convex quads.

However

There is almost* no need for the extra vertex and edge in there.

You can still get all quads simply by removing that vertex and using the surrounding four vertices to make the face.

*There is always the issue of edge flow. This image below shows the edge flow of the two different methods. Do note that the method on the right is much less prone to pinching.


Baking multiple objects to keyframes resets their orientation by their origins I made a breakable object and the simulation is fine. But when I bake the simulation all the pieces of the breakable object just stack in the same place in space.

The pieces are driven by a cube the first 60 frames, then the simulation makes the rest.

.blend in a zip file: https://copy.com/qo3Rx2dNz0xn

I found the answer.

First, the steps that caused the problem:

After breaking the object using the cell fracture addon, I needed the physics of all the 700 pieces to be driven by an animation (they where parented to a cube which has keyframes to make everything "fall" in one piece).
Then I keyframed the physics of one piece (1), but there where like 700 objects that I wanted to have that same behavior so to copy those keyframes I read that I just needed to link the animation data as I did (2).
How I found the problem:

An action was shared linked by 757 objects (3).
Solution:

So I selected my group of pieces, hit U to unlink the animation data (4) and then I baked the animation and everythig was almost fine. I didn't knew why but I simply had to unparent all the shards.


Open Blender maximized by default On my PC when I open Blender I always need to manually press maximize button on the window. Is this just something on my PC or is this how Blender starts?

Is there anything I can do so that it's always open maximized?

It's controlled based on the window when you save your startup .blend.

To make it default to maximized:

Maximize the window.
CtrlU> Save Startup file, or File Menu -> Save startup file.

Note that if you make any  other changes (not including the splash screen), they will be saved as defaults as well.


Can not hear audio in 2.8 Audio file uploaded to Video Editing, AV Sync on, but can not hear it? I just upgraded to 2.8 version, and I had never had any problems with audio on 2.79 version. Please help!

Resolved the problem by changing System -> Sound -> Audio Device from SDL to OpenAL.

Your problem was solved, but I would like to mention that the Audio Device that works can differ because I couldn't hear anything in the sequencer with OpenAL but when I changed it to SDL it worked for me. So if it's not working for you I think you should just try all Audio Devices.
Note: I'm on Linux Mint so it could have to do with your OS.


Blender 2.8: Why cannot I colour on the same plane? Hi may I know how come I can't draw/colour on the same layer? the colour goes behind my intended plane of colouring. See the photo below

I've had the same issue.
There is the ability to select your drawing pane, and lock strokes/fills to that pane. Depending on which build of 2.8 you have, this has moved, so check the image below.

For my selection, to lock it to the same pane as the Ink Strokes, I needed to select Side (Y-Z). In your screencap I can see you have it set to view, so that if you rotate around your scene you'll move the drawing pane.
Selecting one from the drawing pane dropdown will lock it down for you.


Can the 3D viewport be set to draw smooth (anti-aliased) wireframe? When I create mesh etc the wireframe looks so jagged. Coming from other applications I've used, most of them seem to have smooth wireframe (Maya to name one).

Are smooth wireframes possible in Blender?

I'm using a MacPro and my version is 2.71.

I'm assuming you're talking about anti-aliasing:

This can be turned on in the User Preferences (found in the File menu), in the System tab:

You may need to click Save User Settings at the bottom left and restart Blender to see any effect.

Warning, on some systems (NVidia specifically) this can cause editmode vert/edge/face selection to fail. (This is an issue with the OpenGL driver and not much Blender can do to resolve)


How do you scale about local axis, x in this case? I would like to scale these down width wise, but even with Transformation Orientation set to Local and Pivot Center for Rotation and Scaling set to Individual Origins, scaling on x or Y turns them all according to the World Axis.

If that's the result you're after:

Try scaling around individual origins and hit SHIFTZ to exclude the Z axis while you're at it.


How can I move many vertices with few dots? I was looking some blender guides on internet and I've found this
So I was wondering how can I do the same thing ? By that I mean manipulate this object that has so many vertices and faces with these few selected dots ?

This is standard subdivision surface modeling. The very general idea is that you create a base mesh that is comprised of very simple geometry, and then add a subdivision surface modifier to increase the amount of detail or mesh density.
In your screenshot, the "few selected dots" is the low poly base mesh. The part that has "so many vertices and faces" is the output from adding the subdivision modifier.

To edit the mesh, you just manipulate the low polygon base mesh, and the high resolution version will conform to your edits.
Here is a fantastic tutorial that covers the basics of subdivision modeling:
https://www.youtube.com/watch?v=xmIIIcCUm8E


Blender output file size versus Zoom recording file size Sometimes I need to tweak a video recording made in Zoom.  According to Zoom, it is an MP4 with M4A audio after conversion (the raw data is, I think, some propriety raw data).  However, a 13 minute Zoom recording resulted in 91MB after converting (within Zoom).
When I made my edit (silenced audio for 1 second where I cursed oops), the rendered output from Blender was 471MB!!
I have tried reducing the audio sampling (32 instead of the 192 default) and the result was still several hundred MB.  I tried removing the audio entirely and the output was about 150MB, still significantly larger.  The recording is a full-screen (2880x1800) so as is the Blender output.
I feel like I'm missing something.  I realize Blender doesn't output M4A, but I can't bring myself to believe an AAC or MP3 track should result in a file 4-5X as large.
FYI, I'm using Blender 2.79, but I get similar results in 2.83.1.
Ideas?
-C64Whiz
Edit 2020/09/22: I tried the 'ffmpeg' solution offered up by @Husch and the resulting file was 55MB smaller!!!!  WTH?  I cut out 1 second of audio, that was it!
Also, I tried again in Blender 2.79 after "Factory Reset" and no audio rendering...and still much larger than the original zoom MP4.
I've downloaded Blender 2.90 (Linux), cleared out all Blender settings I could find in my home dir (including within .config, .share, .etc) and tried rendering with no special settings: after 2% done I already had 10MB of data.  Extrapolate and the final file would be over 500MB...i.e. no change.
I will say this, I keep having to set the render resolution to 2880x1800 as the default even after I add the video to an empty sequencer.  I don't "import" a video.  I "add" one; could this be an issue??
Edit 2020/09/23: Attempted a fresh install of Blender 2.90 on Debian 10 (though a slow 2-core system), and didn't modify the added video...just rendered with settings allegedly identical to the source.  Resulting render was 511MB, ~5X the original 95MB Zoom file.  I repeated the render changing only the % of the resolution setting to 50% (X,Y was still 2880x1800).  Resulting file size was 178MB.
To @susu's comment about compression, I have it set for MPEG-4 container, Video codec H.264, Medium Quality, Good Speed, and audio AAC codec, mono, and 32000 sample rate, 192 bitrate.  The codecs are the same as the source as indicated by 'exiftool', as is the 32000 sample rate.  Not sure about the 192 bitrate and obviously no clue about the video quality level and encoding speed...
...then I did some investigation and found the source, according to 'exiftool', uses 16 "Audio Bits per Sample".  So I tried changing Blender's 192 default bitrate for audio to 16 but it won't let me go any lower than 32...so I kept it at 32.  Resulting rendered file size with Resolution % back at 100% - 494MB.
Sound doesn't seem to be much of a factor but I can't understand why I have to set Video % to 50 when the original shows no indication of it.  (Honestly, I don't even know what % means if the resolution is X,Y.)
I'm stuck. :(

I've tried to import a zoom-recording (downloaded from the internet; 53MB) in Blender 2.91 and the rendered output file from Blender was only slightly larger (55MB). Maybe you can try version 2.91?
However, if your only need is to silence some part of your video, then you can easily/fast do it with ffmpeg. The command is as follows (all on one line):
ffmpeg -i zoom_0.mp4 -af "volume=enable='between(t,0,10)':volume=0, volume=enable='between(t,20,30)':volume=0" zoom_silenced.mp4

The input-file is zoom_0.mp4. The output-file is zoom_silenced.mp4. Two periods are slienced: from second 0 (begin) to second 10 and again from second 20 until second 30.
You can find more information at: https://stackoverflow.com/questions/29215197/mute-specified-sections-of-an-audio-file-using-ffmpeg. There are also lots of YouTube-tutorials on how to install ffmpeg.


Orange squares appearing on render? I'm trying to render a scene in Blender, and as of yesterday (it was not doing this when I was working on it 2-3 days ago), I am seeing orange squares dancing around the rendered image. Google tells me that these are render tiles (I think), but what are they, why are they there, and how do I get rid of them?

They are just indicating the currently rendering tiles:

AFAIK there is no way to turn them off, other than disabling tiled rendering (anyway, IMO they are quite useful).

To disable tiled rendering in cycles, enable progressive refine in Render settings > performance:

To disable tiled rendering in BI, make the tile size at least as large as your render:

Note that disabling tiled rendering will increase render times, as in most cases rendering many small images is faster than rendering one large image. See Are there any advantages of bigger/smaller tiles.


How can I make the materials for this toon fluid simulation? While browsing through toon style shaders on youtube, I came across this cartoon fluid test. I am pretty sure it is an emission shader, but I don't know exactly how to make it. This was originally made in Blender. I could not find any tutorials on it, so I came here. I just want to know the material; I can make the fluid simulation.

Original Video: https://youtu.be/fzB70vwoJoM

Answers with an image of the node setup would be highly appreciated. Thx!

This material is actually very easy to setup with cycles. Blender has a layer weight node which has a facing output. This output will give a material that ranges from black to white, based on how much the point on the object is facing the camera. Black is facing the camera, white is facing away (at least perpendicular to the camera). The default output is a significant gradient though, but you can add a colorramp after to make it just black and white by using the constant interpolation mode. Then you just have to adjust the white slider until it looks right. Once you have that you can use it as the factor for a mix node that mixes two emission shaders.

Here is the node setup for reference:

I didn't have any good fluid simulations on hand to test the material on, but on a subdivided Suzanne model it looks like this:


Leg won't bend right I want the backside of the knee to bend smoother.

Watch the backside of the knee

This has to be subdivided to work. Add a subdivision-surface modifier to the object being rigged, and set the view and render to about 3-4. Also, this should be set to simple subdividing if you want the geometry to look the same.

If it does not look the same, Ctrl+R in Edit Mode, and slide the loopcuts to the sides of the original geometry, this will fix your issue.


Lasso select in straight lines? I'm using the "lasso" selection tool by holding Ctrl and dragging the left mouse button in edit mode in order to select a group of vertices inside the selected area. However, my mouse hand isn't very good at drawing straight lines, and I keep selecting vertices that I don't want. I can select like the top shape, but need to select in straight lines like the bottom shape:

Is there such a thing as a "straight lasso" select tool, instead of the freehand one? I've tried using the B keyboard shortcut to select in a square, but I need to be able to draw my own polygonal shape.

There is no polygon select tool in Blender (yet) but you can hold down CTRL after your first selection and Blender will create a path to the next vertex you right click. There are some settings in the Tool panel to adjust it's behavior. If your selection path is closed you can press H to hide, which then enables you to L link select the island. ALTH and you get the whole gang. A bit of a work around but can be handy.


Loop selection if Vertices have less or more then 4 faces Link to this video

How Blender Guru selected Loops with vertex which has five contiguous faces. When I try to select Loop with vertex which has more or less four vertex Loop selection are breaking on this Vertex

Okay, but what is a difference in my case, why here I can't select all Loops, it breaks right in vertex which has five faces.

Actually it selects the edge all around and by underneath, if you cut an edge on the bottom you'll see that it won't work any more.


Messed up Blender models when exporting to Unity3D I have modeled a simple pocket watch in Blender. Every time I import it into Unity3D, regardless of whether I export it from Blender as an FBX or 3ds file, it always comes out missing faces! Why is this happening? I have never had problems importing models into Unity3D like this before.

Blender Screenshot

Unity Screenshots

It seems to me that different faces appear when I rotate it differently. How can I prevent this? Thanks!

This looks like you have flipped normals.

Blender draws double-sided by default, but you can enable Backface Culling in the Display panel (one of the panels right hand side of the view-port).

You can also enable drawing normals which draws a line in the direction each face points.

So you can use either of these draw options to check which way your normals are flipped.

This could be...

Normals flipped the wrong way in Blender, you can select all in editmode and run 'Mesh -> Faces -> Recalculate Normals' (CTRLN). OR if they are all the wrong way around: you can simply flip the normals. 'Mesh -> Faces -> Flip Normals')
Negative scale on the object. Blender detects negative scaled objects and shows the faces pointing the right way, but many game engines will show normals flipped if you have a negative scaled object.


Arrays: Different image texture I've been looking around a little but could not find a definitive answer for this:
Can I setup my nodes in a way that allows for randomly selecting one out of multiple image textures using an array?

I am modeling a race track and would like to randomly choose different ads for the hoardings.

You cant set a different texture for array's duplicates.

However, you can shift their UVs:

As you can see here, I have a texture of 1/3 ratio. Each third has a different pattern.
My array is set to make three different duplicates, and to shift their UVs of a third (1/3= 0,333...) on the V axis.

The result is quite usable.
All you have to do is a texture file containing your different textures aligned on one axis, adapt your UV to one area of the picture, and set your array's number of duplicates and U/V offset accordingly.


I can't find the Rendering Toggle button in Blender 2.8 I can't find the Rendering Toggle button in Blender 2.8
Someone help me.

You can display the options you want if you click on the key icon:


Render turns black when finished When blender is rendering I can see my model but at the very end the render goes black and the image saves as a black image. I am using cycles. Any help would be awesome!

It sounds like the Use Nodes check mark in the compositer is checked, but the image is not connected to the output.

To fix the above issue you can:

If you are not using the compositer on your image, uncheck the Compositing check mark in the Properties window.

If you do want to use the compositer, then you will need these two nodes at a minimum; the Render Layers and the Composite nodes.


Can I insert Python code into the scale of an object, to get a random width? I have created this:

And I want to randomize the width of the squares, so that there are different rectangles and not only squares... Is it possible to achieve this?

I'm not good at Python but I know something about coding and I think, that you can get a random Integer, using Python.
And is it than possible to use that code to randomize the width (Scale) of the rectangles?

Method: Animation Nodes
You can use Animation Nodes addon, add all the objects to a group, and use this simple node tree:

Method: Randomize Transforms
You can select the objects then use the operator: Object >> Transform >> Randomize Transform, or simply search for Randomize Transform:

Method: Python Script
Select the objects and run this simple script:

import bpy
import random

objects = bpy.context.selected_objects

for obj in objects:
    obj.scale.x = random.random() * 2

You mentioned that you are not experienced in python, Animation Node is like a visual scripting system that can be used to do anything, so I recommend you use it.


help with walls when extruding - total beginner I am a complete beginner when it comes to 3d modeling and have just started to use Blender version 2.70a

I have been following this tutorial step by step from the beginning: http://en.wikibooks.org/wiki/Blender_3D:_Noob_to_Pro/Beginner_Tutorials/Print_version#Improving_Your_House

Everything has gone really well up to module 20 "Improving Your House" where I have come up against a problem: I get borders in the between some of the windows and the doors when I do the extrusion, as shown in the image below:

They also show in the final render.

I don't know how to get rid of them.

Generally two Steps to get rid of them:

For all "zero-area" faces, A to select all, then W  > Remove Doubles;
For the "zero-thickness" frame on the window (where non-manifold appears), you can select them manually, then X to delete. Or, if there are too many of them and you want a quicker selection, ShiftCtrlAltM to select all non-manifold elements (must be operated in Vertex/Edge Select mode), then on the menu: Select > Select Loop Inner-Region. Then delete the selected faces.

EDIT:

In 2.72 or later version, for the second step above, another convenient way is:
First, be sure that you using Edge Select mode, then ShiftCtrlAltM, then hit F6, toggle nothing except Boundaries, then switch to Face Select mode while holding Ctrl. Then delete all faces that are selected.


Realistic Car back lights [Cycles] So I was working on a night scene with a model of a mustang. My scene looks similar to this:

I was wondering if anyone knew how to produce the glow of the rear lights; how they start orange, but are red around the edges.

This is what I have tried so far:

The light source is a point lamp behind the glass.

Any help would be appreciated!

Edit:

Here is the lights isolated from the rest of the car:

Here is the wireframe:

the four dark circles are the front lights

there is a point lamp behind them and the back grey part is glossy with 0.2 roughness

Edit 2:
Changed to Filmic colorspace:

Edit 3:
Final Render using Luke D's suggestion:

Edit4:

Here's the blend file of the rear lights:

Edit5:

Second Render after Luke D's suggestion:

I think it came out rather nice.

Final image with Compositing:

Different Color Ramp and Mapping node setups.

Scene overview:

Scene has three elements Emission source, Glass mesh and mesh to enclosed both of them. Also HDRI lightning.

Emission source:

Three Spheres with Emission shader mixed with Transparent (pure white, #FFF) by Light Path > is Camera Ray. We don't want to see'em.

Glass mesh and material:

Material:

Most important thing here. It's colored Transparent Shader mixed with Glossy by Layer Weight to have glass like reflection and to let light go trough. Don't forget to set Mapping node accordingly to your mesh.

You can control how much white, orange and red color you want.

Mesh:

This is just quick mesh created with Poke Face.

Final thoughts:

I've used also Glare node in Compositing to have nicer overall look.

Blend file:

Without HDRI lightning.


Repeating Image Textures to UV map At the moment I´m working on a model with many different Image Textures.
To publish it on Sketchfab I need UV Maps that fit the texture.
My unwraped Object is however bigger then the texture itself.

How can I make a UV Map out of a repeating Image Texture?
Do I need to manually reapeat it in Photoshop unil it fits?

(I know that you can press Ctrl+A and Ctrl+P to make it fit to the texture. The mappping changes though)

Try pressing S after highlighting your mesh in the UV editor to scale it downward. There should also be a repeat image setting somewhere in the UV editor.


Patches of particles (hair) on a plane following noise I'm trying to make underwater reeds for a scene in Blender cycles.

I have my reeds textured and ready, I'm using a particle system as a hair type and I've set it up so the "grass" covers my floor plane.

My problem is the grass is spread evenly across the plane. I want them to be in patches, clumped together and have the floor visible where they're absent.

A solution in my head would be for the particles to follow a noise node, tightened up using a colour ramp but I cant seem to figure this out, if it's at all possible?

Thanks for your help

The method I would use to clump the vegetation together is by tweaking the 'radius' value in the particle's children tab. Note that children type must be set to 'Simple'.

This is the most simple and easy way to achieve the 'bush' look, but if you want more freedom and customization possibilities, a density texture is the way to go!

For example: I'm using a cloud texture to control where the hair can grow and where not.

For this example I'm using a cloud texture, but you can obviously paint a texture by hand and gain 100% control.

Make sure to check the influence of your texture:

And assign it in the particle system as well:

A fundamental difference between these methods is that by using a texture, you're actually 'cutting' out portion of your scattered hair. By using the radius option under the children's panel, you control where the hair-particles are going to be scattered. So your amount of particles in the settings will be higher when using a texture.


Where is the system console? I just ran a python script in blender.

However it gave me an errror:

Python script failed, check the message in the system console.

I've searched online but i can't find the system console. I have two terminals open to the blender file already but it did not show any error message.

I am using Ubuntu 19, with Blender 2,80

Here, Window, Toggle System Console

But if you run on linux / mac perhaps you need to see if you run Blender from terminal usually from that you going to find the error


Make multiple smaller weapon animation clips out of big default action for use in Unity game engine I made weapon animation for mobile game. I have one big animation that includes all states of weapon ( idle, hipFire, reload, wield, remove, aimedFire, run)
I want to make separate animation clips out of this big one, and then delete it, so i would endup with 7 short animation clips when impotred in Unity.
I wached all vids and tuts on youtube but didnt find one that adresses similar task.
Thanks in advance for any help!
Theres other thing too.
I somehow  have two actions in the file. One that has all keyframes in it. And other without any keyframes, it attached to weapon mesh. I dont know how to get rid of it.

Hope there is solution for my trouble)
Thanks for help guys!!!

[Edit]
i found the way to delete actions from action editor! There is no need to choose Orphan Data in Outliner. You choose All Scenes.You type exact name of action you want to delete. All it`s stuff will appear in Outliner than you right click on it and choose "delete".
So deleting stubborn actions is solved!)
I found this way here Delete actions from action editor?

The easiest in my opinion way to do that is to bake the animation fragments to new actions, separate for each desired state. To do that, use Action>Bake Action which you find in left tab (appears and disappears after pressing "T"). You'll achieve desired bake length by restricting animation time on the timeline to each state duration. After baking just move keyframes of created this way new action to the timeline beginning and voila.
You can get rid of unnecessary action by removing it from the mesh (or whatever else it's assigned to) in Action Editor (click on X icon on the right from the action name) and then choose Orphan Data in Outliner Search menu and click on Purge All. (this way you will get rid of all actions, textures, materials etc. that have no user permanently, so be careful to check everything first).


Unable to assign materials, maybe a material property setting issue I'm unable to assign/view a new material(in this case it is "Leather_dark_brown") to an object. I think it has something to do with my material property setting, since it has no problem assigning other materials.

Cycles materials will display as a solid colour in the viewport, unless the viewport shading is set to material or rendered.

The material settings include the viewport colour to use for the material.


Eyes wrong position after import This is how my character looks in Blender:

After importing him to Unity, the eyes are no longer positioned correctly:

What could the problem be? How do I fix it?

The issue is in your skinning.

For a mesh to be deformed by a bone, you need this mesh to be assigned to a vertex group named exactly like the bone.

Your eyes are assigned to a single vertex group named "Eyes", while you have two bones, named "Eye.L" and "Eye.R". So you have to remove that "Eyes" group, create new groups with the bones's names and assign the geometry accordingly.

Also, for each bone not supposed to deform the mesh, you should uncheck the Deform panel:

This will avoid unnecessary calculations, memory overload, and such non-deforming bones won't create vertex groups as they don't need to.


Prevent fluid to flow through the walls of an obstacle I am trying to make a fluid simulation flow out of the orbits of this skull (I hope this doesn't violate any guidelines), as a little experiment / practice with fluid simulation.

The result is not too bad, but the liquid flows through the walls of the skull, on the left/right temples as well as the nasal cavities.

I have read that in order to prevent that from happening, thickening the obstacle was a good solution. However, when I thicken the skull I get a very crude (albeit somewhat funny) result:

Ideally, I would like the fluid simulation to be not only realistic, but the container / obstacle as well!

Also, for some reason, I feel that the liquid should flow out a little sooner than it does. I'm not really sure how to troubleshoot fluid simulations, and the questions I have found so far didn't help.

Blend:

First of all, you should make sure that the basics of the fluid sim are set up correctly.

The domain should not be larger than necessary. The larger the domain, the more resolution you need for equal quality. You are just wasting baking time.
Scale should be applied (Ctrl+A) to the domain and the obstacle. Otherwise the results are somewhat unpredictable. This is usually the first step in troubleshooting a fluid sim.
There is no point in having a preview resolution of 100. You will always want to look at the final version, not the preview one, so to bake it at a high resolution is just more wasted baking time. Some people like to set the preview resolution to 1 because of this. But if you want to look at your animation before rendering to check the timing of camera movements, or whatever, something like the default 45 will do the job.
There is never ever a need for 4 subdivisions in the fluid boundary settings. At high resolutions (maybe about 300+) or if you want fluid particles, it should be set at 2, otherwise zero. You are just increasing the baking time without getting anything in return.

Now, if you have done all that, there is one more simple thing to do to prevent leakage. In the fluid boundary settings, uncheck Remove air bubbles. With this setting checked (which is the default), the fluid sim will basically avoid to have any space between the fluid and an obstacle, thus preferring to pass through. With high enough resolution this setting does not matter, but at low resolutions, very much so.

I hope that helped.


What is the blend option in the layer weight node? What is purpose of the blend option in the layer weight node?
The documentation just says it "blends" between the first and second shader.

It blends the output between all 0 and all 1. This can be most easily observed by plugging the output into an emission shader:

When used as the mix factor for a mix shader node, it will blend between all of one material or all of the other.


Emitter doesn’t show particles Edit: screenshot and file below
Update: torus (the emitter) particles show up just if I convert the cone (the other emitter) in the modifier tab {which automatically converts also the torus}.
.blend file

I have a sphere and I applied to it hair particle system with two emitters:

one is a cone with material, no problem at all;
the other one is a torus, which got hair particles as well. Particles show up around the torus until I change it to render as object. After that, particles disappear from the emitter, even if the torus still has them.

Anyone who knows why?
With the cone converted:

It’s cycles.
Thanks!

if you choose "render as object" -> and choose "cube" as object, your hairs will be shown as that object, as cube. So it works as it should be.
Blender 2.91 result for me:


How to make Fluid Inflow follow bone? I have made a very simple scne to test Fluids where there are two containers and a moving tap. Basically, the tap moves to one contianer and fills it up, then it stops and moves to the other container and fills it up. I've managed to make the flow stop and start, but for some reason, the fluid doesn't follow the tap.

I parented the fluid origin object(Sphere) and it follows, but when it's time to release the fluid, it just doesn't follow.

How can I make everything follow the bone?

Here is the blend file: https://www.dropbox.com/s/ly2g8j6hipmeain/FLUID_TEST.blend1?dl=0

Okay, I was trying to do things the hard way. I can just keyframe the Sphere itselft and move it around as I need to, withouth having to make it follow the armature.

So it's solved.


Create an object that emits smoke only from specific faces I would like to draw an object, e.g. a cube, that emits smoke from the top face only but not the rest of the faces. How can I do this?

Select the top face in Edit Mode and assign it to a Vertex Group

Select the Vertex group in the Smoke Flow Advanced section
Limit the distance of emitting from surface by setting Surface to 0.


Manuel Bastioni LAB characters are rendered pink/purple on different machines I have made some .blend files on my Windows machine at work and now when I try to render them with my mac at home they render pink or purple (Not good at colors!).

From here I tried Blender-> File -> External Data -> Automatically pack into .blend but I get the error:

  Report: Error
  Unable to pack file, source path /Program Files/ Blender Foundation/ Blender/2.79/scripts/addons/manuelbastionilab/data/textures/human_female_diffuse.png not found

From here I found that the missing textures should be assigned again. So selected

Blender-> File -> External Data -> Find missing files

and then went to the folder

/Applications/Blender.app/Contents/Resources/2.79/scripts/addons/manuelbastionilab/data/textures/

The issue was solved. Now to avoid this happening again you select select the Blender-> File -> External Data -> Pack all into .blend so the textures will be integrated into the .bled file and don't have to be loaded from original texture folder every time.


Hair won't render in cycles? I just followed Andrew Price's video tutorial on how to render hair in cycles, and I have followed every single direction, but no hair gets rendered. Is something not enabled or activated?

It is almost like it is trying to render with the particles grit there.

Here is the blend file.

You may need to enable experimental features in the render tab for Cycles to render hair.

If you have an older version of blender and want to render hair on the GPU, you'll need to get a newer build from builder.blender.org or graphicall.org