Crashes After Left Clicking (BLI_assert failed: /build/blender-RL3axj/blender-2.82) After fresh install Xubuntu 20.04 LTS

CPU: Intel i7-6820HQ (8) @ 3.600GHz
GPU: NVIDIA Quadro M1000M
GPU: Intel HD Graphics 530

I just installed blender via the apt-get package manager, and its been crashes anytime I left click:

blender(BLI_system_backtrace+0x37) [0x55c4d1670897]
blender(+0x3ac1748) [0x55c4d1651748]
blender(mat3_normalized_to_compatible_eulO+0x3d) [0x55c4d1656b8d]
blender(quat_to_compatible_eulO+0x45) [0x55c4d1656e25]
blender(BKE_scene_cursor_quat_to_rot+0x83) [0x55c4cf068403]
blender(ED_view3d_cursor3d_update+0x154) [0x55c4cf85e9d4]
blender(+0x1ccec97) [0x55c4cf85ec97]
blender(+0x15d1b50) [0x55c4cf161b50]
blender(+0x15d4b71) [0x55c4cf164b71]
blender(+0x15d55bb) [0x55c4cf1655bb]
blender(+0x15d7730) [0x55c4cf167730]
blender(wm_event_do_handlers+0x7a2) [0x55c4cf167f02]
blender(WM_main+0x20) [0x55c4cf15d160]
blender(main+0x2b6) [0x55c4cef303d6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf3) [0x7f3ed7a180b3]
blender(_start+0x2e) [0x55c4cef7e8ae]
BLI_assert failed: /build/blender-RL3axj/blender-2.82.a+dfsg/source/blender/blenlib/intern/math_rotation.c:1703, mat3_normalized_to_eulo2(), at '!(fabsf(_test_unit - 1.0f) >= 0.0002f) || !(fabsf(_test_unit) >= 0.0002f)'

I'm not sure what this error means, nor can i find much on it from searching. If anyone knows anything about this error or how to handle it please let me know

Ok it's just a bug with the one downloaded via apt-manager. Downloading from Blenders official site has it working now


I am unable to preview any game play in blender I have a simple FPS setup, but pressing p to play will not do anything. Is there any information available for this kind of problem? I set as blender game, and it will not do anything but animations. The file came from blender artist thing.  if you can tell me how I can put the file here, so someone else can try it and see if there is something I am doing wrong.

I posted the link to the file I am having trouble with.  It is from 2006 apparently, so maybe it is from an older version of blender.  however if anyone can get it to work I learn much easier by seeing something in action than trying to follow fast talking tutorials on youtube.

As I am Aware now that this can be fixed using an older version, I think it should be amended to work in the current version, so myself and others are not frustrated learning to use blender.  I am not familiar yet enough to fix it, but I think it might be looked at as a tutorial file.

The engine is set to Blender internal. As of 2.73 P only starts the game engine when the render engine is set to Blender Game at the top of the screen:

Also note that that file was made in 2.4x. The 2.4x python api is not compatible with the 2.5x+ api, so the python scripts won't work. If you want to run that file, you can download 2.49b here.


How do I make animated drool? How do I animate drool from nothing to a long string of drool with a rounded drop shape. To look exactly like what is on the tongue of this cat. I did this once with Shape keys but it was difficult to animate and adjust.
Is there a procedural approach?

Use a Fluid (Liquid Domain) with

a relatively small Inflow Sphere (location: tip of tonge),
high Viscosity Strength (docs) (try Strength=5),
small Liquid FLIP Particle Radius
and can slow down the Time Scale (try=0.5 or less)

"When it rains I always think of you: drip":
Note that I only simulate up to frame 50, and the lighting makes the single drip column look like there's a break when there isn't.


How do I change how the blender menu looks? I am teaching an online class that uses Blender. Sometimes a student will turn in an assignment and it opens showing different menu choices. I'm not sure how it is happening and how to get back to the default menu choices.

I did not write this course and I am learning Blender along with the students. Any help would be appreciated!

When you open a new file, go to File > Open. After this you will have a browser, select the file and look for the gear icon on the right top corner, click that and uncheck Load UI


Blender 2.8 Texture coordinates keyframes are not visible in Graph Editor Here's the material property I'm animating: Vector Mapping

No keyframes show up in the graph editor.

I need to change the interpolation mode to linear, but i can't find the keyframes

Edit:

In version 2.81 the same happens.

I have 2 options for you.

1) You need to select the object AND the node that you want to animate. It should now be visible in your Graph editor.

2) You need to disable the "Only Selected" icon in the Graph Editor (little icon arrow).
See picture


Is there upper limit to vertices in texture paint? I'm trying to paint a terrain in Blender. It has a lot of vertices (132 000) and when I'm getting to that step nothing happens. I decreased the number of vertices in the terrain and then everything works fine. So is there a upper limit? And if so what is the limit?

The steps I took in Blender

Selected the object in edit mode.
Unwrap.
UV/image editor.
Saved the image.
3D view.
Texture paint mode.
Add paint slot (normal).

The version I'm using is Blender 2.74

I Found the problem for anyone that get stuck on the same thing.

Here
http://blenderartists.org/forum/showthread.php?281181-Blender-Unwraping-Problem

When i did the unwrap i got a small warning in the upper bar that said. object has negative scale...

in object mode use Ctrl+A / scale


Is it possible to save certain parts of a screenshot I'd like to reduce the time necessary to create screenshots. I want to skip reopening and cutting and saving. Instead I'd like to use a python script to determine the size of the part of the screen and crop the screenshot accordingly.

So, there's three (four) questions in one:

Is it possible to take a screenshot with python?
Can I edit the screenshot with python?
Can I determine the size of an element in the user interface to crop accordingly?
Is there already a solution out there?

This answer is given with assumption that you would like to save different windows screen shot only.

Here are the steps to take screenshots of specific windows in Blender e.g 3dView, UV Windows, Properties.

Hover your mouse over required window.
Press Ctrl + F3.
Before saving screen shot, Uncheck Full Screen box to save only specific windows shot. It is available in Save Screenshot Properties Box.


How to create an arrow geometry using python? I want to create an arrow like in the image using python script. Can someone help me out?

Thanks

a very flexible way to do that is to use the Rigify addon. You enable it in the User Preferences -> Addons tab, look for Rigify and check it.

Now, if you go to Edit Mode of ANY mesh, there's a button in the Transform Panel:

Rigify now creates the code needed to make this Object via Python. Go to a Text Editor, and select widget.py:

This is all the code you need, wrapped in a nice Python function. So to recap: Model your Mesh as you wish it to be, Apply all modifiers, and encode it using Rigify Dev Tools.


Python: Create Polyline and Polyloop How to create polyline and then poly loop with python.
Bmesh fastest way.

Here is an example:

Thanks.

Create a polyline. (btw, imposing pure bmesh requirements on this is probably arbitrary, and using from_pydata is just as good)

import bpy
import bmesh
from mathutils import Vector

scene = bpy.context.scene
meshes = bpy.data.meshes
objects = bpy.data.objects

# generate polyline

bm = bmesh.new()
verts = [bm.verts.new((0, 0, z)) for z in range(5)]

for i in range(len(verts)-1):
    bm.edges.new([verts[i], verts[i+1]])

me = meshes.new('placeholder_mesh')
mesh_obj = objects.new('polyline', me)

scene.objects.link(mesh_obj)

bm.to_mesh(me)
bm.free()

Run this on a polyline:

import bpy
import bmesh
from mathutils import Vector

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

# Get a BMesh representation
bm = bmesh.from_edit_mesh(me)

bmesh.ops.extrude_edge_only(bm, edges=bm.edges[:])
bmesh.ops.translate(bm, vec=Vector((0,1.2,0)), verts=[v for v in bm.verts if v.select])

bmesh.update_edit_mesh(me, True)

See TextEditor -> Templates -> Python -> Simple Bmesh (edit mode) for the templates.

It might just be simpler to construct the polygon loop from scratch using from_pydata. It really depends on the final use-case


Adding camera to scene I'm trying to add a new camera to the scene and render it using multiview (with python script).
at first, I remove all the objects besides the light from the scene:

    bpy.ops.object.select_by_type(type='MESH')
    bpy.ops.object.delete()
    bpy.ops.object.select_by_type(type='CAMERA')
    bpy.ops.object.delete()

But I saw that it didn't erease the camera from bpy.data.cameras which will give me a problem later on.
After that, two cameras were added with init location and rotation:

    bpy.ops.object.camera_add(location = [9.69,-10.85,12.388], rotation = [0.6799,0,0.8254],enter_editmode=True)
    bpy.data.cameras[0].lens = 18

    bpy.ops.object.camera_add(location = [9.69,10.85,12.388], rotation = [radians(40.6),radians(-5.5),radians(140)],enter_editmode=True)
    bpy.data.cameras[1].lens = 18

The cameras are perfectly set in terms of location and rotation but not for the focal lens for some reason.

What is the right way to insert a new camera?

and another quick question - in order to be able to render the scene in multiview are the following lines are all is needed?

    bpy.data.scenes[0].render.use_multiview = True
    bpy.data.scenes[0].render.views_format = 'MULTIVIEW'

BR,
Aviv

It looks to me like you've got camera objects confused with the camera data. In the code above, you delete all camera objects in the scene, but the data for those cameras is left over. When you later reference the camera by index, you're referencing unlinked, left over camera data from those deleted objects.

You don't necessarily need to clear the left over camera data - you just need to make sure you're pointing to the correct camera data later on (using pointers, for example, rather than indexing).

In the following code, I create the camera object and data directly from the low-level API, which allows me to store pointers to those objects, and their respective data, and change the properties directly:

scn = bpy.context.scene

# create the first camera
cam1 = bpy.data.cameras.new("Camera 1")
cam1.lens = 18

# create the first camera object
cam_obj1 = bpy.data.objects.new("Camera 1", cam1)
cam_obj1.location = (9.69, -10.85, 12.388)
cam_obj1.rotation_euler = (0.6799, 0, 0.8254)
scn.collection.objects.link(cam_obj1)

# create the second camera
cam2 = bpy.data.cameras.new("Camera 2")
cam2.lens = 18

# create the second camera object
cam_obj2 = bpy.data.objects.new("Camera 2", cam2)
cam_obj2.location = (9.69, 10.85, 12.388)
cam_obj2.rotation_euler = (radians(40.6), radians(-5.5), radians(140))
scn.collection.objects.link(cam_obj2)

Also note that this code was written for Blender 2.80. If you're using 2.79 or previous, replace scn.collection.objects.link function calls with scn.objects.link.


How to lock viewport to object via the Python API From the Blender UI there is the option of "Lock to Object" of the Viewport that can be seen in the following image. I wanted to ask how is it possible to enable this option via Python?

Property of the 3D view space
Similarly to Change tile grid shape and similarly to the answer it was similar to.
Mousing over the property in UI (with developer extras enabled) shows the proprerty as
SpaceView3D.lock_object

Python console, lock 3d viewport area of screen to context object.
>>> for i, a in  enumerate(C.screen.areas):
...     i, a.type
...
(0, 'PROPERTIES')
(1, 'CONSOLE')
(2, 'OUTLINER')
(3, 'VIEW_3D')

>>> space = C.screen.areas[3].spaces.active

>>> space.lock_object = C.object
>>> C.object
bpy.data.objects['Cube']

>>> space.lock_object
bpy.data.objects['Cube']

>>> type(space)
<class 'bpy.types.SpaceView3D'>

set to None to remove
space.lock_object = None

For scripts run in the context of the 3d view
space = context.space_data


Add-on in blender 2.8 not installing I am a newbie to Blender, and I want to export a house I made to unreal. To do this I am trying to download an add-on, but the addons will not install.

I have tried several different add ons, I tried dropping the addons straight into the add-on menu, I tried looking for a separate add-on folder, but there is none to be found on my laptop.

I am using blender 2.8.

If I press the install button as seen in the photo and the add-on disappears

When you download the BlenderTools.zip
extract it, and goto send2ue/addon which will contain folders like dependencies, functions, ui and some files.
select all the files & folders,
zip them & rename the folder to send2ue.
This can be installed as plugin in blender.
I know it's a late reply to this thread, but someone might find it useful. :)
A blessed guy made a tutorial.


I want to close gaps in a model to make it printable I'm trying to learn Blender through a project: preparing a model for 3d printing.
This particular model has a big problem: it's non-manifold. In a big way!:

As you can see, as the model was created to be seen from a front view, it didn't need to have a body under the longcoat. It's up to me to close that big gap so it prints, melding the legs together with that in the process.
I tried creating a plane, intersecting at the height I calculated it would touch both legs and the coat.

I made a boolean modifier, with union. My reasoning was, once the boolean is complete, I'll be able to select the exterior section of the plane, that will be cleanly cut by the exterior silhouette of the model...

However, that is not the case. The plane kind of becomes bugged out, and the area of the plane that sits right where I want it is not really separate from the rest.
How would you solve this particular problem?

The problem seems to be that you have way too many vertices it would be expected that the plane makes many triangle faces and looks very buggy.
A way to approach this is by not using a plane at all. Try hiding everything that is not the underside of the long coat (bottom of the torso if you will). Then you can switch to bottom view by pressing Ctrl + Numpad 7 and box selecting (B) all the faces you see. Afterwards you can extrude these faces down and flatten them on the Z axis with S + Z + 0. This should create a flat surface that you can drag to a desired height.
P.S. If you don't have vertex groups and are finding hiding everything difficult, you can also circle select (C) the underside faces manually.


How to output multiple images from Blender's compositor with Python? I know how to render one image via Python and get an output with Blender's compositor.

What if I need it to render 100 images for me with numerical names e.g: img_1, img_2, img_3 etc.?

Give me please an example of a working script via Ubuntu terminal and Python sys.argv?

Can I for example setup compositor nodes, and then simply render scene and get composited render as a result render?

Python code for rendering 1 image:

import bpy
import sys

argv = sys.argv
argv = argv[argv.index("--") + 1:]

current_frame_path = argv[0]
print(argv)
ob = bpy.context.active_object
scene_rd = bpy.context.scene.render

scene_rd.filepath = current_frame_path
bpy.ops.render.render(write_still=True)

Shell script for rendering n images

#!/bin/bash

imgs_cnt=n

output_frame_path='RenderedImages/img'

for (( i=1; i<=imgs_cnt; i++ )); do
  echo "Rendering frame ${i}/${imgs_cnt}..."

  (
    cd /path/to/model/
blender --background Model.blend --python Render.py-- "${output_img_path}/img_${i}.png"
  )

  echo "Image ${i}/${imgs_cnt} has been rendered"
done

Here's an example for what I'm trying to do:

This is an automatically generated scene with plants, and I render it via executing shell script in terminal. It use 3 python scripts for blender. 1st script is for generating the scene, it places objects on the scene with different location and rotation settings and check if objects are intersected (to avoid clipping). 2nd script is for rendering scene. 3rd script isn't yet ready but it will be generating a mask for generated scene via cryptomatte.
As a final result I want blender to output me 2 images into 2 different  directories. 1st for the original images and 2nd for mask annotations.

You can add File Output nodes to the compositor to get multiple files saved from any point of your compositing without the need for any Python:

You can also use Python to add more nodes:

import bpy

bpy.context.scene.use_nodes = True
tree = bpy.context.scene.node_tree

for every_node in tree.nodes:
    tree.nodes.remove(every_node)

RenderLayers_node = tree.nodes.new('CompositorNodeRLayers')
RenderLayers_node.location = 0,0

comp_node = tree.nodes.new('CompositorNodeComposite')
comp_node.location = 400,0

links = tree.links
link = links.new(RenderLayers_node.outputs[0], comp_node.inputs[0])

for i in range(0,100):
    output_node = tree.nodes.new(type='CompositorNodeOutputFile')
    output_node.name = "Output node number "+str(i+1)
    output_node.location = (400,(-140-i*110))
    link = links.new(RenderLayers_node.outputs[0], output_node.inputs[0])

See the documentation for more info.


Can I make a camera use the lens distortion parameters determined by camera tracking? The camera tracking utilities allow you to specify or estimate lens distortion parameters (k1, k2, and k3).  Is it possible to get the Blender camera to adopt this specific distortion?  I can't find a way to set these directly on the camera.  Nor can I find a way to get the lens distortion in the compositor to take these.

I have a really great track on a very wide angle scene with a very nice distortion.  I can't seem to match the distortion perfectly.

Thanks in advance.

Yes it's possible.
Once you've determined the distortion values using the movie clip editor's lens distortion's tools you can use them on blender scenes using the compositor.
You need to add a Movie Distortion node in Distort mode, to your render layer. Make sure you select select the video clip as source.

Read: https://blender.stackexchange.com/a/15622/1853


Weird shadow issue with Cycles? Relearning blender, I notice when I render my image, the shadow looks pointy.. the mesh is very smooth so I don't know whats causing this. The same thing happens in Eevee. Anyone know what might be causing it?

I've tried playing around with the lighting strength and trying different angles but still get the same issue. I'm using just a default point light, what is wrong?

The way Cycles works is by creating a rough approximation of the final image and then cleaning up the noise over time.  The more samples you set in Cycles, the more time it has to clean up the scene (but the longer it takes to finish rendering).  The reason it's not cleaning up anymore for you is that you don't have the samples set high enough.  You can change how many samples you use in Properties -> Render -> Samples.  There are two settings, one for the viewport and one for the final render.  You typically want the final render to have more samples than the viewport.  If the image is too noisy, you can increase the samples, and if it takes too long, you can decrease the samples.

If you're not sure how many samples to set it to, you can set the viewport samples to 0 (aka infinity) and wait until the image clears up (and you can't move around in the scene while it's clearing up).  Once it's clear enough, you can look in the top left where it says, "Path Tracing Samples", and whatever number that's at, you can set the viewport or final render to that.  Note, it's okay if you have the viewport samples set to something low enough that it still is a little noisy.  As long as the final render samples are high enough, the final render will look good.

(In this scene, 38 samples is good enough for the viewport, but I'll probably want the final render to be set for something like 64 or 128 just to make it nice and clear [if you look closely at the shadows, you can see a little noise])


How to compile several maps into a texture I downloaded some textures recently and they come with several other files, used to dictate height, normal, roughness, and ambient occlusion. I was wondering how to use all these so they produce a nice final texture. Do I do this with the node editor? I'm in Cycles.

Yes.  Here's a basic node layout:

If you have a normal map you wouldn't also need the height map generally.  Note on the annotation that you need to set the right type of normal map.  If you don't know, you can try the different types.

The images are, from top to bottom, Ambient Occlusion, Color (Diffuse), Roughness, and Normal maps.

Note as JtheNinja points out, Ambient Occlusion is not "real" lighting...so it's a stylistic effect rather than realistic.  You might play with different modes (besides Soft Light), or decide to not use that map.  Blender also has built-in AO that you can turn on if you choose to.


Physically accurate glass surface touching diffuse surface I have a solid glass block with a diffuse sphere inside. To keep the geometry simple, the glass has no hollow portion to fit the sphere inside. This means that I must "fake" the contact surface between the glass and the diffuse sphere.

The contact surface is just a diffuse shader.

The contact surface is diffuse with a clearcoat on it. Clearcoat because the ball is surrounded by glass, and glass is reflective.

What's the physically correct way?

If an object is diffuse it will be diffuse in glass same as in the air or in water. If you drop something diffuse into water it does not become reflective because water is reflective it stays diffuse unless there is some other material in between it and water like for example air bubbles stuck in surface imperfections, dirt or oil, or something else or if the materials react chemically. If the object is fully submerged in another material, the way it reflects light will not change. The type of light that can reach the object or the amount of it can change because of the material it is in, but not it's reflectivity. If there is no interface of two transparent materials there will not be any change in the direction light travels as well, so there is no need to do anything at all for it to be accurate if an opaque object is fully submerged in a transparent material.

The first image is physically correct if there is nothing inbetween the object and the glass and if the object is diffuse. Volumetric effects should work correctly as well, since all that is needed to calculate them is the depth from the surface of the glass to the surface of the object.


Can't export mesh to .fbx I'm new to Blender and I'm making a track for Assetto Corsa. It's an ambitious project but it's very important for me.
I can't export my track to a .fbx file. This error appears:

I leave my blend file for any checking you need. I uploaded it in mega because it exceeds the 30MB limit.

There was a nurbs path which wasn't cyclic and was tiny, also without material. When I deleted it everything was exported successfully.
There were also modifiers not applyed and scales and rotations not applied.


Setting keyframe on all vertices of a mesh I'm modelling a sea wave-field by animating the vertical positions of vertices (https://youtu.be/mWC9Gd0aSmo). This works but is very slow as I have a lot of vertices.

The code that I use now is:

mesh.vertices.foreach_set("co", vertices)
for vertex in mesh.vertices:
    vertex.keyframe_insert(data_path="co", frame = i_frame)

I was hoping that there is a way to avoid the loop and to set a keyframe on all the vertices at once.

I'm not sure that's the best way to go about that issue, vertex animations are a lot of trouble, it's better to use a wave modifier to get that result.


Blender 2.8 Cycles Importing Image as Plane isn't transparent I'm importing a logo image as a Plane and putting it on top of an object:

However, the image appears with the checkered pattern behind the image - not the actual Blender object ... which defeats the purpose of the transparency.

At the same time, even when I render the image completely in cycles, it still shows the checkered pattern!

My material settings for the logo image:

How can I get rid of the checkered pattern and make the image truly transparent and blended in with the objects in my scene?

@rjg got it right.  Turns out the transparency pattern in the back was inside the image itself - might be because of Google Images.

Everything is working smoothly now!


Lock Rotation of Face When I rotate a mesh, I'd like the rotation of one face to stay the same but the rest of the mesh to rotate, is there a way I can lock the rotation of the face? Thanks!

You can use the Hook modifier.

Select the face and add it to a new vertex group
Add a new empty (position doesn't matter)
Add Hook modifier to your Object and target the Empty and the vertex group

This cube has a "Static Face" vertex group containing one face


Weird UV maps and textures not aligning I have the issue that when I uv unwrap a cone, like the nosecone of a rocket, the pieces are not aligned in the uv map and the textures don't align. Does anybody know how to fix this? Here is a picture:

Edited:
Just don't use that many seams and the texture will align better.
I added seams only to cut off the side 'wings', and the rest is just one piece.


Convert imported SVG shape to Bézier/NURBS surface I have a closed Bézier curve created in Illustrator which I've imported into Blender via SVG. I don't want to extrude it, but rather make it a filled surface (at the moment it's just a path) which I can then manipulate. Ideally it'd either be a bezier surface (is there such a thing) or a NURB, but if need be I can work with a mesh. How do I convert it to a more useful Blender object type?

Just make the shape 2D and it will be filled.

The shape will still be editable as NURBS.

If you need to convert it to a mesh press ALT+C


Hook/parent/constrain to particle hair? Is there any way to hook, parent, or constraint something to a vertex of a particle hair strand? Such as a hair accessory dangling from a braid that needs to move with the hair?

Converting the hair to mesh isn't viable, as I then lose hair dynamics and have to rig some other way.

Scripting solutions are fine too. There must be some way to get the location of a particle hair vertex or vertices from the API. Then you could have an empty copy it or something?

I've found a method to do it. It's not perfect but it works :). It uses a Particle Instance Modifier.

Add a Cube (place its origin point in the same place as emitter's origin point). Scale it along the Z axis, then Subdivide, so it has the same number of loop cuts as the number of segments of your hair particles. Go to Object Mode and apply its transformations (Ctrl+A).

Go to Modifiers header and give it a Particle Instance Modifier. Enable the modifier's settings as pictured below.

It may not work properly though. If something's wrong just rotate your Cube 90 degress on the X axis (or Y, or Z, depending on your situation).

Now add an object which will be following your strands and rotate it perpendicular to your Cube. Select it, then the Cube and enter the Edit Mode. Select the opposite 3 vertices, as pictured below and press Ctrl+P-->Make Vertex Parent.

Go to Object Mode and place the following object (Torus in this case) wherever you want. Select a Cube and move it to another layer to see only the hair particles.

EDIT:
You may precisely parent any object to a chosen strand's segment. In Edit Mode select any vertices, then enable an option as pictured below (marked in red) to see where their location on the instance is.

Add a new object and parent it to selected vertices.

Then place it on a proper segment's location.

Now the object copies the location of the strand's segment.


Blender crashes when opened I just downloaded and installed the latest version of blender for the first time but every time I run the blender.exe file a window with text similar to cmd opens for a split second and closes. I was able to get a screen shot and here is what comes

First of all try running Blender as Administrator.
If that does not work try those steps suggested in developer.Blender.org:

  Ensure your GPU driver supports at least OpenGL 1.4
  Ensure you have installed MSVC2013 redistributable package
  Try  to disable any running antivirus
  Ensure you have no python executable available in your %path% environment variables
  Try to start Blender in factory settings       (--factory-startup commandline option - this will show whether this  is a userpref or
  add-on issue or not).
  Try to place this dll next to     your blender.exe (software OGL, will be slow, but will show whether  this is a driver issue or
  not).


Can't find the palette to alter new objects When you add a new object into the blender scene, normally on the tool shelf a window will become available where you can put in the objects size or number of vertices etc.

These options:

For what-ever reason, when I now add an object I am no longer seeing that area where I can alter the measurements. Currently I want to use the Spin function but I need to alter it but I have no way of effecting how the spin operates.
Does anyone know what I have done or how to fix it?

It sounds like you resized the top portion of the tool shelf, and collapsed or shut the operator properties part.
If that is the case you should be able to click on a little plus button on the bottom of the tool shelf and get it back. Then you can drag the separator to resize the operator properties.


Choppy Display in Cycles What on earth is happening here?! I cant seem to find the cause. Happens in solid and textured view. Its not like the meshes are crazy or broken or anything. Thanks for your help in advance.

Your Start Clipping is probably set too low.  Press N to bring up the Properties in 3D View and change the Start Clipping to something reasonable... usually .01 or greater.  It depends on your field of view.

Then in your Camera Properties, menu, set your Start Clipping there as well:


How to make smooth curves and rough edges I'm currently trying to make a plane, a Short SC.7 Skyvan.

And as you see here, on the tail, there is a smooth curved corner at the front and a sharp edge at the back. How could I do this?

]3

I've started with a cube but I've no idea how to make that shape. Any ideas?

Here's one approach:

6-sided circle
Fill (F), and Knife cut (K) using Ctrl to hit center of edges
Drag out back edges. (Scale thinner if you like)
Add loop cuts (CtrlR). Assuming you might want to bend the aerofoil.
Extrude (E) perimeter edges
Maybe pull out the middle edges of the side? and put in a holding edge-loop (CtrlR).
Add a Mirror modifier,
And a Subsurf modifier.


Low quality mp4 renders I have imported a 337 MB mp4 video file with no audio into Blender. In Blender, I am primarily just adding audio and then rendering back out to mp4. However, the rendered video quality is drastically lower, making much of the text in the video unreadable. The size of the output file is 65.7 MB.

In this image you can see my output settings:

Can anyone tell me what I am doing wrong? How can I get a higher quality render to mp4?

You should increase the bitrate. It determines the compression of the video data.
A starting point could be to set the bitrate as least as high as in the input file, and then add the Mp3 rate of 192kbs.

1920 x 1080 = 2,073,600 pixel count
24 frames per second
4 = High Motion

(2,073,600 x 24) x 4 x 0.07 = 13,934,592 bps / 1024 = 13,608 kbps bitrate

See sections 4 (Quality versus Streaming) and 5 (Starting Points), in this tutorial.


Gizmo types in blender 2.8 So, in Blender 2.8 avialable Gizmo Widgets(bpy.types.Gizmo, bpy.types.GizmoGroup).
i am tring to find out how to use different type of widgets(gizmos) but cant find any information about them.

Here is standart example:

# Example of a group that edits a single property
# using the predefined gizmo arrow.
#
# Usage: Select a light in the 3D view and drag the arrow at it's rear
# to change it's energy value.
#
import bpy
from bpy.types import (
    GizmoGroup,
)

class MyLightWidgetGroup(GizmoGroup):
    bl_idname = "OBJECT_GGT_light_test"
    bl_label = "Test Light Widget"
    bl_space_type = 'VIEW_3D'
    bl_region_type = 'WINDOW'
    bl_options = {'3D', 'PERSISTENT'}

    @classmethod
    def poll(cls, context):
        ob = context.object
        return (ob and ob.type == 'LIGHT')

    def setup(self, context):
        # Arrow gizmo has one 'offset' property we can assign to the light energy.
        ob = context.object
        mpr = self.gizmos.new("GIZMO_GT_arrow_3d")
        mpr.target_set_prop("offset", ob.data, "energy")
        mpr.matrix_basis = ob.matrix_world.normalized()
        mpr.draw_style = 'BOX'

        mpr.color = 1.0, 0.5, 0.0
        mpr.alpha = 0.5

        mpr.color_highlight = 1.0, 0.5, 1.0
        mpr.alpha_highlight = 0.5

        self.energy_widget = mpr

    def refresh(self, context):
        ob = context.object
        mpr = self.energy_widget
        mpr.matrix_basis = ob.matrix_world.normalized()

bpy.utils.register_class(MyLightWidgetGroup)

I want to find out wich types i can set to:

mpr = self.gizmos.new("GIZMO_GT_arrow_3d")

and what properties(and types of them) this gizmo will have.
Any ideas?

One of the great thing about blender is that when something is not documented you can just look at the source. :)

Here are the ones I've found (untested):

GIZMO_GT_arrow_2d

GIZMO_GT_arrow_3d

props:

offset

draw_style:

NORMAL | CROSS | BOX| CONE

transform:

INVERT| CONSTRAIN

GIZMO_GT_blank_3d

GIZMO_GT_button_2d

props:

icon | shape| show_drag

draw_style:

OUTLINE | BACKDROP| HELPLINE

GIZMO_GT_cage_2d

props:

dimensions

draw_style:

BOX | CIRCLE

GIZMO_GT_cage_3d

GIZMO_GT_dial_3d

GIZMO_GT_move_3d

GIZMO_GT_primitive_3d

GIZMO_GT_value_2d

props:

offset

VIEW3D_GT_navigate_rotate

GIZMO_GT_mesh_preselect_elem_3d

props:

object_index | vert_index| edge_index | face_index

GIZMO_GT_mesh_preselect_edgering_3d

VIEW3D_GT_ruler_item

I'm actually working on custom gizmos so I'll update this answer to document my findings.


snap element, snap to vertex OR edge (both) Is there a way to make the "snap element" be both vertex AND edge?

In the tutorial I'm following I need to stitch two different objects together. I do this manually by adjusting the vertices of object A to either the vertices or the edges of object B.

Currently I'm constantly switching from snap element=vertex to snap element=edge, which takes me about 1sec every time (and there are a lot of vertices..) and it would greatly improve my workflow if blender could just snap to whatever my mouse encounters (edge OR vertice).

An add-on maybe?

Not at the moment, as far as I know.

Multi target snap has been introduced in New Feature Proposal: Mixed Snap in 3d View. by Germano Cavalcante, and is planned for the upcoming 2.8 releases.

For the time being as a workaround you may try multi point snapping


How do I Include scene.camera name in render output filepath? So I have multiple cameras for different angles in my scene. I want the output file to be something like: renders\CAMERANAME\framenumber.png
It would be nice if this could be done automatically - currently I'm just typing the camera name in by hand, but I would like to streamline this so if I switch cameras it changes the folder for me.
I have been trying to use python but I am not very good and not sure how to do what I want.
this is as far as I got(not very far haha)
import bpy
import os

scn = bpy.context.scene

path = scn.render.filepath
cam = scn.camera

scn.render.filepath = path + cam +scn.frame

the script automatically creates the directories with your cams names. If it is already there, the script just puts the animated pics in these folders.
check this out:
import bpy
import os

scene = bpy.context.scene

oldPath = bpy.context.scene.render.filepath

for ob in scene.objects:
    if ob.type == 'CAMERA':
        bpy.context.scene.camera = ob

        filepath = bpy.context.scene.render.filepath

#        filepath = bpy.data.filepath # blend file
        directory = os.path.dirname(filepath)

        name = ob.name + "/"

        directory_to_test = os.path.join(filepath, name)

        if not os.path.exists(directory_to_test):
            os.makedirs(directory_to_test)
            print("created directory: ", directory_to_test)

        file = directory_to_test + "render"

        bpy.context.scene.render.filepath = file

#        bpy.ops.render.render( write_still=True )

        bpy.ops.render.render(animation=True)

        bpy.context.scene.render.filepath = oldPath


How to render an image with holdout material in Cycles 2.8? thats almost litterally the question asked here but these don't seem to be working with 2.80
Can Blender render pngs with the background transparent?

i have PNG, Rgba, 8bit, 15% compression  and the holdout material still renders as black.

You need to enable World background transparency.

It's in Render Tab > Film > Transparent
Check ✔ Transparent and you're done.


How can I automatically create edges according to the number of vertices? I wanted to create edges between these vertices automatically:

But when I selected all these vertices and pressed F this is what i got:

To create edge between each vertex I selected 3 or 4 vertices at a time and then I pressed F

And I did the same for all:

So is their any shortcut method to do this?

You have a couple options:
Triangulate:
Press F with everything selected to make an n-gon, then press CtrlT to triangulate it:

Bridge:
As Leon Cheung already mentioned, you can use the bridge tool.
Select the opposite edge loops (in this case, everything) and press W> Bridge edge loops or WE.

This method will create quads if the the edge loops have the same vertex count but otherwise creates triangles. You can press AltJ to automatically convert some of the tris to quads.
Fill:
You might already know this, but I thought I'd mention it just in case.
Fill now automatically detects vertices for the new faces, so to do what you did in your question you only have to select two vertices and then repeatedly press F.


Weird connecting lines with no edges/vertices Anyone able to explain this and how to kill it?  New to Blender.  Not sure of any terminology otherwise I'd try to search for my own answer. I even tried ⎈ CtrlF to create new faces hoping to eliminate this problem.

This is because you have a non-planar ngon, i.e. a non-flat face with more than four sides. This is particularly problematic with an ngon as blender has no indication of what the topology should be inside the face, resulting in ambiguous geometry. For display purposes there must be something there, so it takes a guess.

You should try to avoid such faces, as they will not behave well with subsurf or deformations (to name a few issues).

To fix this, you can either

Delete the face and fill in the hole with planar quads. Grid fill might be of help here.
Triangulate the face (⎈ CtrlT), splitting the large ngon into multiple planar triangles:

You could also try Mesh > Cleanup > Split non-planar faces.

Note that this still won't subdivide or deform nicely.


Complex lighting situations issues_light intensity decreases > number lights increases I’ll try to explain the issue as best as possible, I’ll attach some pictures to better explain the problem.
I have noticed that the more “lights” are introduced in a scene (both interior and exterior) the more the intensity of each lamp is reduced.
I’ve notices the same issue with HDRI images. Again, adding more sources of light into the scene, results in a decreased intensity of the HDRI image itself.
Clearly, the problem becomes extremely limiting especially in situations where multiple sources of illumination are required.
In the attachments I’m showing the aforementioned issue, as you can see the source of lighting (in this case a simple Point lamp) decreases its intensity as the number lights increases. On every picture I’m adding one or more lamps.

The default "Path Tracing" integrator is coded so that for each sample, it will bounce light from a randomly-chosen lamp.

My suggestion is that you change the integrator to "Branched Path Trace", which you can change from the Sampling sub-tab.

Using Branched PT will make cycles take bounces from every light for each sample.  This comes at the cost of increasing render times, but with the added benefit of reducing noise.

More info here: https://docs.blender.org/manual/en/dev/render/cycles/settings/integrator.html

EDIT: As a further note, Blender 2.79 will feature probablistic termination of lights based on contribution.  Basically, it will randomly skip sampling from lights if their contribution to a sample would be below a certain threshold, causing it to spend less time computing bounces for lights which make little or no difference for a given sample.  This provides speed gains in complex lighting setups, particularly where some of the lights are distant or occluded.  More info here: https://developer.blender.org/rB26bf230


Snap to Grid unexpected result I was working with the Snap to Grid option and due to the unexpected result obtained I would like to show you the case that can be summarized as follows:

I take a Cube (2x2x2).
Set the Z dimension in 0.
I set the Cube in Edit Mode and selected a vertex that was move to the right side.
I made “Snap to Grid” and the result was the vertex goes to the Object Origin and not to the nearest grid intersection.

In the following link there is a PDF with pictures that illustrate the case:

https://drive.google.com/open?id=0B1emiHzIWh8eMzZNTFBHWHc5Y0U

Cordially,
Ricardo Amaya R.

When You set Z dimension to 0, it makes z-scale automatically to 0. It means that all Z - coordinates in model will multiply by 0:

 global coordinates = local coordinates * scale

When you select “Snap to Grid” it snaps globaly, and global coordinates needs to convert to local.  That means if you have scale 0.5 local coordinates must by twice bigger. So, the formula is:

local coordinates = global coordinates / scale

So, if you set scale to 0 the formula will be:

local coordinates = global coordinates / 0

But division by zero is mathematically impossible. So it will raze an exception that reset coordinates.

See also: Why is it important to apply transformation to an objects data?


How do I emulate the Home key on a mac laptop in Blender? I am trying to set the camera to the viewport on a mac laptop.  I use View>Align View>Align Active Camera To View.
This gives me the view but the camera is too zoomed in.  From looking on the stack exchange I believe if I press the Home key this will give me what I want.  How can I do this on my macbook pro keyboard ?

For the Home command, press down the Fn+Left Arrow or Fn+Shift+Left Arrow.

Home : Fn+Control+Left Arrow (Works exactly similar to Windows Home key)

End : Fn+Control+Right Arrow

Page Up : Fn+Up Arrow

Page Down : Fn+Down Arrow

Essentially, all the buttons that would normally appear above the arrows on a  windows keyboard, are mimicked by using arrow keys with modifiers.

I don't know why the other answers are talking about un-related number pad, which is another key group entirely.


How to create individual shaped tunnel by using a curve? I try to create a square shaped tunnel with the help of a curve and a cube, i have this path curve:

And i try to use the cube to create a tunnel or closed mesh which looks something like this:

I was able to create a circle shaped tunnel by changing the object data of the curve:

But is it possible to use individual forms to create tunnels?
I tried it with using a curve modifier in addition with an array modifier, but the result is ugly.

You can do this by using a square shaped bezier circle (no oxymoron here as you'll soon see):

First add a bezier circle (Add --> Curve --> Circle)

Then go to edit mode (Tab), select all the control points (A), then press V --> Vector, to make all the corners sharp.

While still in edit mode, rotate the circle along the Z axis by 45 degrees (R --> Z --> 45 ).

Now use this circle as a bevel object for your tunnel curve:

Scale the circle (S) to adjust the size.

You can manipulate this circle to change the shape of the tunnel's profile whichever way you'd like.


Armature out of place in object mode but not in edit mode...or almost for some reason that I don't understand my armature seems to be out of place in object mode,but not in edit mode and I don't know how to fix it. Can someone helps me ? I've attached 2 pictures to show you.

Have you accidentally moved the armature or bones in pose mode? You could try switching to pose mode

⎇ AltR to reset all rotation,
⎇ AltG to reset all translation,
⎇ AltS to reset all scale.


Modelling problem: How to get rid of "Edgeless Edge" Okay, so when I'm modelling and making the general shape (or any shape) from my mesh, sometimes when I would form it into a certain way it would act like it was "inverted" or something and make this "Edgeless Edge". It shows no actual edge line. Is there anyway to get rid of these edges or faces?

Pic for reference on what I mean below.

Thanks]1

It's probably the result of a highly non-coplanar face.

In that case, the edge is of one of the triangles created not by you, but by the viewport renderer in the course of giving you a shaded image.You could make the edge explicit by hitting CtrlT - 'Triangulate Faces'.


What is the best way to import images as texture, then render out at original size? I'm using Blender as a tool to warp packaging labels, then taking the render into Photoshop for compositing onto the photographed product.

When I load the label as an image texture in the UV window I want to make sure that I'm not sizing the file up beyond the original dimensions. I check this by first importing the art as an image plane, and using this to size the bottle shape to match it.

Is this a valid way to do this? What would a better method be?

I don't think there is a better way than your method, there is no direct relation between pixels and blender units, and the rendering process will always compute new values from the texture's pixel data and adjust depending on the camera's view angle.

If you know what the label's print dimensions are ,you can set the DPI of the  image in the addon's import options, which is great since it also preserves the aspect ratio.

If you want to load the image in the UV directly with the correct aspect ratios ,just set the display aspect ratio to the image dimensions , there is also a visual tool to check which faces are being stretched, but none to check up/down scaling sadly.


Motion Tracking video tips I just started with motion tracking in blender and it a really awesome feature but I discovered that shooting the right video is very hard.

The image below is a part of I test video I made where I moved my phone from left to right and than to the left again. Like you can see on the image, all the tracking points on the left are useless for blender and it is really hard to works with only the right part of the video.

My question is: has somebody tips about how to shoot a good video for motion tracking?

Should you just walk around an object with some good marks instead of moving the camera from left to right like I did.

I think the best way to shoot a video is either by using a tripod and not turning the camera, which means you almost need to do no motion tracking at all, or you film it by hand and try to do it as smoothly as possible, any blurry frames mess up your trackers. or you just don't do motion tracking at all and try to animate the camera into the same position in the 3D viewport.


How to achieve the perfect material for an aircraft glass canopy Well, in my previous question I asked the same thing , i got some good results but it looks unrealistic till the core here is one.

My node setup for the glass was like this

I wanted to achieve this kind of quality.  For the body I can easily do this but the glass is so tough.

Last time a guy called Jachym Michal helped me a lot by sharing me the appropriate term , but I would like to see someone try it themselves and achieve the glass effect as seen in the above pic.

Well let me say you that almost every jet has something called iridescence effect and you have tried hard to fake it but its ot a big deal to do  it you need to know that the effect of iridescence is created only in the border of the glass take for example this  and also the effect is minute in some angles but more visible in some , for the effect you need to use noise and hue saturation nodes. here is the setupand here is the result [3]
note if you want more colorful effect then reduce the factor of fresnel .also make sure to apply solidify modifiers to your glass . greetings !!!


Is there a bpy function to convert from blender units to Imperial? Is there a bpy function to convert from blender units to Imperial? something like:

   >>> blender_to_imperial(2.0)
   ... 6.562'

This functionality is present when showing edge lengths, but I can't seem to find a function that can return the conversion.

I found one in the caliper script by macouno, but am wondering if this isn't something that exists already in bpy.

I found several internal conversion code in the source, like one in view3d_ruler.c for bpy.ops.view3d.ruler(), or in drawobject.c for measurement stats, none of them with direct Python interface. No reference to it, too, in the API manual.

CMIIW, but I think we'll have to write one. All distributed addons so far, like Measure Panel, also write their own conversion function, and it looks like the aforementioned addon have several function we can use directly:

import space_view3d_panel_measure as pm

uinfo = pm.getUnitsInfo()
print(pm.convertDistance(2, uinfo)) # prints 2.0m, 2.0 BU, or 6.56168'
                                    # depending on selected unit system.


How to use a material node data path as driver, that is located inside a material group? I would like to get the data path of a material node, that is located inside a material node group.
I would like to use it as a driver. In Blender 2.8 you can just copy a data path to use it for drivers e.g.

But if you do this for data inside a group, then it will be refreshed only at rendering time or if you play the animation, but not in realtime.

How to get the complete data value path for nodes inside of material groups?
How the complete data path have to be written?

node_tree.nodes["Group"]. what have to follow then to access a math node e.g.?

With blender 2.81 and up you can right-click in the field and choose "Copy as New Driver", then right click in the driven field and click "Paste Driver".

The resulting data path (in my file anyway) :


Problems with Python syntax I am a more or less skilled Python user in Maya for quite some time and wanted to look into Python within Blender (Version: 2.79).

This is my code:

def posRotSclObj():
sel = bpy.context.selected_objects
sel2 = sel[0]
sel1 = sel[1]
print(sel1)
print(sel2)

pos1 = sel1.location
rot1 = sel1.rotation_euler
scl1 = sel1.scale
print (scl1)

pos2 = sel2.delta_location

sel2.location = (pos1[0], pos1[1], pos1[2])
sel2.rotation_euler = (rot1[0], rot1[1], rot1[2])
sel2.scale = (scl1[0], scl1[1], scl1[2])

posRotSclObj()

I have 3 problems right now:

When I define my selection by sel = bpy.context.selected_objects then sel[0] is the second object I have selected and sel[1] the first...that's pretty counterintuitive, especially because it was the other way around in Maya. Is this right?
print sel would work in Maya but Blender needs brackets around my variable: print (sel). Why is there difference in syntax?
When I indent beginning from the line after def except for the last where I call my function and paste it into the python console within Blender it gives me indentation errors on every line that has one indent.

As we can see from https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2018/ENU/Maya-Scripting/files/GUID-C0F27A50-3DD6-454C-A4D1-9E3C44B3C990-htm.html :

  Maya installs Python with your Maya installation. Maya uses Python
  version 2.7.11 on all supported platforms.

Maya uses an old legacy version of Python while Blender uses Python version 3.5.3. There are syntax differences between these versions and brackets is one of them. I am not sure about indentation in 2.7.11, but in the version that comes with Blender it is 4 spaces.

The sequence in which the selected objects are stored is not something that can be intuitive in my opinion and there is no logical reason one way is better than the other, however if you wish to reverse the order you can do so with Python very easily:

sel = bpy.context.selected_objects[::-1]


Why are there gaps in between my model? I just started to learn Blender and was following a tutorial on YouTube on making ice-cream. I was almost done with the cream but when I added subdivision modifier my model started having gaps. Please give me some suggestions how to solve it. I am pretty sure I followed the tutorial. Here is the link to the tutorial on Youtube:
https://www.youtube.com/watch?v=EvTrZ0soo_Q&list=PLrjIgEdKLivgpCMmFC0_sV60Y_Ftp-WLD&index=2

Please tell me if you want more screen shots.

You missed at least two things while following the tutorial.

At 11:15 Steve explains that you have to set the Array Modifier to Fit Curve. Your screenshot shows you've set it to Fit Length.
The second thing is, after adding the Subdivision Surface Modifier he explains why it doesn't look smooth enough yet and at 12:25 he enables the option Merge in the Array Modifier.

Maybe these two things might help to make it look right.


How to fix grains within render? I've been trying forever to find solutions to this problem.
When I render, my scene gets grainy under the influence of light and after searching the internet I can't find a proper solution:

I want to know how to get rid of the grainy-ness on the diffuse object under the light, and also the two random white pixels. I'm using Cycles, my sampling is at 4000 and my light bounces are set the limited global illumination.

P.S. Can anyone tell me how my GTX 1070 took 5 minutes to render this (and/or how I can render more efficiently)?

Turning up the AA Samples helps.

25 is decent, higher is better.
Glossy and Transmission tend to be noisy, so I turn those up.

I usually click render, then go watch TV.
If I come back an it looks OK, then I stop the render.
It only ever goes through all 64 passes if I fall asleep.


Transition with walk cycle I made a walk cycle action : the character has nothing in his hands.
Then, I made an action to take an object.
Then, I would like my character to keep his path, using walk cycle action again, and with the object in his hands.

The problem is that the walk cycle action does not work when there is the object in the hands.
More precisely, I think it is because I made a mistake while doing the transition between the action to take the object, and the action to start again the walk cycle action.

How do you do such thing properly?

We have to guess, as you did not provide us with a minimal example file that demonstrates your issue. Most likely, the "object in hands" action contains fcurves for the rest of the body too, not just the arm/hand holding the object. These then override the walk cycle. If my guess is correct, the solution lies in removing the lower body fcurves from the "object in hands" action.


Can't Paint in Texture Paint I have tried all the fixes I could find with no luck. Can someone take a peak at my blender file and help me figure out why I can't paint in Texture Paint?
https://drive.google.com/file/d/10qybvIDgkR-VLeLwaWkIyVdXHQZHrfAR/view?usp=sharing

In your active brush a completely black texture is enabled, so that every stroke has 0 effect. Just disable the texture in brush options.


How to animate musgrave texture? I was looking for a way to animate a procedural texture when a stumbled upon this.  I was wondering if there was a way to do something similar with a Musgrave texture.  As in the other post, I would not like the texture to seen as moving.  I assume that there is no way to do this in Blender without using a script.  The example also did not have a vector input, which I would need.

To seamlessly animate a moving texture you can use the same technique as described in Seamless animation loop of procedural textures but using a Musgrave texture in place of the two Voronoi. Here's the result of the Blend file from the linked answer with the Voronoi swapped out to Musgrave textures :

However, for a static but animating musgrave you would need to have an additional 'dimension' of the texture that can be varied without affecting the mapping (as in the OSL solution linked to your question). OSL does not seem to provide an equivalent texture to the Musgrave node so you would either need to reconstruct it mathematically (if you know the algorithm for generating the Musgrave texture) or you need to be able to use the 3-dimensional Vector input of the existing Musgrave node to simultaneously map to your mesh while still providing a dimension to vary for the animation.

To achieve this you could simply unwrap your mesh, providing UV coordinates that can be used for the X and Y coordinates to the Musgrave texture and vary the Z coordinate. This can be achieved using the following nodes :

In my case I unwrapped Suzanne using a Sphere projection. Varying the Value node effectively animates the Musgrave texture by selecting a 'slice' of the XYZ texture space to map to the 2-dimensional UV space.

This can produce the following result :

Another alternative is to produce a musgrave-like texture by combining Noise textures to produce an output that varies similar to Musgrave fBM. By tweaking the settings we can get something very similar to Musgrave. For example, in the following image the right-hand-side is the default Musgrave texture while on the left is produced by combining two Noise textures :

To produce this we can use the following nodes :

This will produce a true 3D texture (rather than mapping via UV as in the previous solution) and so does not suffer from 'seams'. By animating the input vector (which effectively acts as a 'seed') we can smoothly vary the effect.

This works by taking the Object coordinates and generating two vectors - one moved in the direction of the 'seed' and the other moved in the opposite direction. By using two offsets we can remove any visible 'direction of motion' while changing the 'seed' since the two vectors effectively cancel each other out. The two vectors pass to two Noise textures - these should typically be set to the same values (in particular the Scale) but you may get some interesting results by using different settings. In order to produce the Musgrave-like range of output, we then subtract one noise from the other, one channel is extracted (so it becomes monochrome - you can optionally use the other channels which will produce a similar output (but different pattern) and this is scaled with a Math node to produce output approximately in the range -1.0 to 1.0 similar to the actual Musgrave output.

You can animate the result by varying the 'seed' vector to produce a result similar to the following :

Blend file included


Get children name and move it to a separated collection automatically I want to automate the objects sorting in my scene, the idea is to select the parent object and create a collection for each child (this is done) and then moving one of each of those to their own named collection (here is where I'm stuck). I know how to move selected objects to one collection, but in this case were the names are being retrieved automatically I don't know how to proceed.
Here is the code that creates one collection per children when I select only the parent:

After the collections are created by this script I need to move each of those children to their own recently created collection.
import bpy

def getChildren(myObject):
    children = []
    for ob in bpy.data.objects:
        if ob.parent == myObject:
            children.append(ob)
    return children

myObject = bpy.data.objects['OBJECTS']
children = getChildren(myObject)
for c in children:

    CollList = [c.name]

    CollLen = len(CollList)

    for x in range(0,CollLen):
        y = bpy.data.collections.new(CollList[x])
        bpy.context.scene.collection.children.link(y)

    ListObjects = [ x for x in bpy.context.selected_objects if x.type == 'MESH' ]

    for z in ListObjects:
        bpy.data.collections[NewCollectionName].objects.link(z)

Use the objects children property.
A blender object already has a children collection, there is no need to reinvent the wheel.
Test script,
loop over the children of the context object, (optionally) if they are linked to another collection, unlink, create a new collection with object name, link child object to it, link collection to context collection.
import bpy

context = bpy.context
coll = context.collection
ob = context.object

def unlink(ob):
    for c in bpy.data.collections:
        if ob.name in c.objects:
            c.objects.unlink(ob)

for child in ob.children:
    if child.type != 'MESH':
        continue
    # unlink from any other collection?
    unlink(child)
    new_col = bpy.data.collections.new(child.name)
    new_col.objects.link(child)
    coll.children.link(new_col)

# to remove if the context object is only a temporary place holder
bpy.data.objects.remove(ob)


Why can't cycles cast one ray per image pixel, instead of rendering progressively to infinity? I am wondering why Cycles renders progressively to infinity. Why is it not possible to do one ray per pixel in the image, letting you have a finished result with X * Y rays cast? I suppose this question could apply more generically to raycast rendering in general.

That is exactly what happens if you set the numer of samples to 1. You can try doing that. The result you get, however, will be unsatisfying.

The problem is that every sample can only travel one path each time it hits a surface. But most surfaces allow a lot more than one reflection direction. A diffuse surface is characterized, for example, by reflecting incoming light in an almost completely random direction.

So if you sample Pixel 1, and the light hits the first surface and happens to reflect, say, towards the dark night sky, this ray will tell the renderer that it shot to ~infinity and found no light. So this pixel is black.
On the pixel next to it, the ray, due to the randomness of the reflection of the surface, will happen to be reflected to the right, towards a big lamp, and will find a lot of light traveling this ray path, so this pixel will be very bright.

If you repeat this for all pixels, the result for each pixel is very random and the image you get is very, very noisy (more so the smaller your light sources are).

So, essentially, the reason why you need to shoot several times per pixel is because you have to shoot enough times that for every pixel, most directions have been "probed" and they all give approximately the same result.

If you only render perfect mirrors with no variation in reflection direction, one sample per pixel is enough, nothing will change with the second one. This is very rare as a scene though.


How to change snap UV grid I'm trying to snap UV into little units.
Even if I did mange to change the grid size and snap correctfully in Modeling window,

I cannot find a way to do the same in the UV Edit window (even by pressing Shift, the snap is too wide)

Oops no, @3fingeredfrog was right :
In order to snap correctly to pixels you have to choose the Snap to Pixel option but ALSO have to UNCHECK the snap magnet tool into the main toolbar, or else this will be the main snap overriding the snap pixel option.

Thanks again


How do I deform multiple meshes in the same way? What I would like to do is deform multiple meshes (that are not the same shape) along the same path, or curve, or plane. The best analogy I have is a flag in the breeze made of multiple overlapping pieces, or if you prefer, the goal is to model some flexible electronics.

Anyway if I try a curve modifier, for example, using the same curve on two objects, they distort in different ways. And of course I don't have two objects but like 50 that I want to distort together, which is why I don't just do it by hand.

Let's assume this is your "flag" made of multiple separated objects.

Add a bezier curve

Placed it in the middle of your objects group.

Select one of your objects

Go to modifiers and add a Curve modifier.

Then in the Curve modifier options (Object:), select the Bezier Curve that you previously created

The object with the modifier will move (that's ok).

Now, select all of your "flag" object, all except for the one with the modifier.

Now, this is important, with ALL the other objects still selected, hold down shift and select the one with the modifiers.
Now they all look selected but the last one is highlighted in a diferent lighter color.
Press Ctrl + L and select "Modifiers" from the menu.

All the objects now have the same modifier and all are following the curve. If the objects are out of the curve like the image.

Just move all the group of objects to match the center of the curve or at the position that you need and your done. You can now modify the curve to give the wave effect that you want and the objects will follow it.


Correcting perspective distortion for an angled projector (Keystone effect) My goal is to create a realistic reproduction of a projector mounted on the ceiling. So far I can reproduce a projector that is projecting straight. But I cannot wrap my head around how to correct perspective distortion when the projector is tilted down.
Edit:
The Solution shoud work like you woud expect from a real world projector. With the light beam originating from the lamp position spreading out onto the surface and interacting with objects in between.
For a projector that points 90° to the wall evything works fine.

As soon as i tilt the Projector i introduce Perspective distortion

Node tree to get the lamp to project a texture without barrel distorion like here or here

This example file:

I don't know whether this suits, you might be wanting more of a simulation of real lenses. But we have an unusual advantage here in CG-world .. the projector can know how far away it is from the points it's projecting onto, via a Ray Length output of a Light Path node.

By similar triangles, (multiplying the normal by the ray-length) the spherical look-up, using the lamp's normal direction, can be corrected back to an orthogonal look-up into the texture, correcting the keystone.

Assuming the lamp is rotating around its X axis, that angle can be used in a driver to correct the aspect ratio of the resulting rectangle.A sine is taken only because the wall is at 90 degrees. If the lamp was projecting onto the floor, or the lamp was parented to a screen with its Z pointing towards it, that would be a cosine.

I've also set the lamp's falloff to 'Constant', so the image is evenly bright. You may want to switch that out.


Could someone find any logic in the rigid body world and rigid body constraints behavior? I have a scene where I'm trying to find a logic for better understanding of rigid body world and rigid body constraints regularity.

The setup seems work as I expected, but when I move the "Vert" object to the negative X direction or to negative Z the constraint on "Empty.007" doesn't move the "Circle" object and the "Circle" doesn't fall. I guess that happens when the "Vert" object gets out of the limits of the constraint. But I'm not sure because when I try to expand the limits it doesn't help.
Also I completely don't understand why the disabling the collision of the constrained objects (by "Disable Collisions" checkbox) in "Empty.007" makes the Circle object stay still.
And as you see I made a weird "Vert" object. That's because I didn't find a working way to bind the "Circle" object to Empty by a Rigid Body Constraint. Is it even exists or I must have a manifold Rigid Body for that?

Probably that are a bugs of Blender 2.83.6. It seems like all works as expected with Blender 2.91.


How to make a .mtl file from .obj file ? How to make a .mtl file from .obj file ?  I just have the obj file of a Open quick haptics and i cant work with it without the mtl file,

Well, when I export mesh to OBJ format, it also creates an MTL file.

Google said that:

  MTL file is an auxiliary file containing definitions of materials that may be accessed by an OBJ file.

If possible, you need to Import to Blender and then Export to OBJ. MTL file will be generated automatically.


Extending animation out-of-range by looping, repeat, or cycle I'm trying to look for an easy way to extend a simulation in one of several modes, similar to that in 3ds Max "out-of-range" feature, where I can specify that the simulation should repeat or be extended before and after the first and last keyed frames.
The feature dialog in 3ds Max shows a dialog that allows you to select what might happen before and after what is keyed, such as Constant (nothing, disabled), Cycle (repeat the animation), Loop, Ping Pong, Linear, Relative repeat (repeat from the present position, rotation):

How can I accomplish this in blender?

This is possible by using Keyframe Extrapolation, Shift+E in the Graph Editor. This shortcut is also available in the Timeline and Dope Sheet, and you can Ctrl+Tab to quickly access the Graph Editor from any of those panels.

Further, you can change Keyframe Interpolation with T

Finally, you can fine-tune these Modifiers in the Graph Editor under the N menu to restrict their frame range, among other adjustments.


How to show to the user a progression in a script? I'm making an python script which create a lot of object and this could take a lot of time. My question is how to show to the user of my script, the "progression" of the script?
For now I print an progress bar in the system console.

But you have to open the system console befor and (apparently) the system console only work with Windows.

Is there an other way to show the progression of my script with python like control the mouse percentage icon (the little icon that replace the mouse while baking) or another idea?

Progress of script can also be printed and updated with sys module to the console:

import sys
from time import sleep

sys.stdout.write("Some job description: ")
sys.stdout.flush()
some_list = [0] * 100
for idx, item in enumerate(some_list):
    msg = "item %i of %i" % (idx, len(some_list)-1)
    sys.stdout.write(msg + chr(8) * len(msg))
    sys.stdout.flush()
    sleep(0.02)

sys.stdout.write("DONE" + " "*len(msg)+"\n")
sys.stdout.flush()

This can look like this:

You can also copy paste this next function to display a progress bar:

import time, sys

def update_progress(job_title, progress):
    length = 20 # modify this to change the length
    block = int(round(length*progress))
    msg = "\r{0}: [{1}] {2}%".format(job_title, "#"*block + "-"*(length-block), round(progress*100, 2))
    if progress >= 1: msg += " DONE\r\n"
    sys.stdout.write(msg)
    sys.stdout.flush()

# Test
for i in range(100):
    time.sleep(0.1)
    update_progress("Some job", i/100.0)
update_progress("Some job", 1)

This results in:


Part of rigged mesh doesn't move with the rig I created this mesh, then made a rig for it and did everything right with the IK rigging.

As I go to test it I turned the head and half of the face doesn't move with it. I kept trying a multitude of things to get it to move but it just stays there. Can anyone Help me?

Things I have tried Re-rigging it and reapplying the mirror modifier.

If some vertices are not influenced by the movement of the deformation bone probably the don't have enough weight assigned. In Object Mode select the bone first than the mesh, change to Weight Paint and add more weight to the vertices (blue is completly unbiased).


Scripting about properties panel When my mouse in properties panel, How can I create a shortcut such that when I press 'FIVE' then toggle to modifier panel.
Blender Ver: 2.91

bpy.ops.wm.context_set_enum(...)
Setting a value from a context path for a shortcut use one of the bpy.ops.wm.context_set... operators
>>> bpy.ops.wm.context_set_
                           boolean(
                           enum(
                           float(
                           id(
                           int(
                           string(
                           value(

This one is an enum property (string would work too)
>>> bpy.ops.wm.context_set_enum(
context_set_enum()
bpy.ops.wm.context_set_enum(data_path="", value="")
Set a context value

For the equivalent to
bpy.context.space_data.context = 'MODIFIERS'

using an operator will be,
bpy.ops.wm.context_set_enum(
        datapath="space_data.context",
        value='MODIFIERS',
        )

cannot test this in python console because it is not in the correct properties space context, instead add it manually to test, Edit > Preferences > Keymaps > Properties Edit

...Ok numpad 5 now switches to modifiers tab.
To set up shortcut using python see
Create keyboard shortcut for an operator using python?*


Which is better extrusion or assembly for creating blueprints? When creating a a model of something that will be assembled, in particular furniture blueprints, which is a better approach?

To do many extrusions of the object or the create the pieces separately and join them in parent child relationships?

I would create the pieces separately and then join them later. Here are some reasons why:

It allows you to preserve separation of concerns. This in itself has many benefits; for example, you could have different team members working on different parts.
It allows you to easily animate assembly instructions by simply moving the objects.
Logically, it makes more sense: the pieces are physically separate; in the real world, they are separate objects, so they should be in Blender as well.
You can join the pieces together at any time by selecting them and pressing CtrlJ or 3D View → Tool Shelf (T) → Join, and you can separate them again with Separate (P) → By Loose Parts while in edit mode.


pan with RMB instead of MMB? I've got a bunch of Logitech MX mouses (mice?) which work great for most applications. However for some reason pressing MMB to pan and rotate, causes Blender to zoom in even when I'm not scrolling the wheel. Really annoying.

I'd like to use the RMB or LMB as the rotate / pan selector. So MMB becomes only zoom in / out.

Is this possible? I'm looking through Input but not seeing a remap for MMB -> RMB or LMB.

You're rightly looking in File > User Preferences > Input - it is indeed there, just obscured:

Just set Rotate View and Move View as you like.


Multiple cubes as just one object? I'm new to Blender, and am following this tutorial on how to create a nighttime cityscape:
https://www.youtube.com/watch?v=ygGQaQld3mc&t=140s
At around 02:20, he is able to duplicate a lot of cubes but keep them all as part of one object. I was wondering how you would go about duplicating an object but still keep everything as what would appear to be one cube object. I've tried every hotkey I can find to do with duplicating, but all of them seem to create a brand new object, which isn't what I want. I'm currently running Blender 2.82, so maybe it's an outdated thing? I appreciate any help :)

What you're trying to accomplish is achieved in Edit Mode. You can enter the dropdown menu in the menus section of your header, or press Tab. Enter Edit Mode, select all the vertices of the cube, then use Shift-D to duplicate.

Ian Hubert's tutorials are for intermediate users. He operates under the assumption that you are already familiar with the basics of Blender. I recommend following a beginner-friendly tutorial series, then continuing where you left off.


My Blender is crashing after I installed an addon twice by accident. How can I fix it? System: Ubuntu 15.10 (so I can use GPU in Cycles since my GPU isn't supported for anything newer)

Installation:  Installed with my Steam account since it makes keeping updated versions of Blender easier.

Hi, I installed an add on and it didn't work the first time.  I installed by going to properties and addons and then install by file, next I selected the zip file and it didn't show my addon was installed and nothing changed after I clicked on save.

So I restarted Blender, and it still didn't show so then I clicked install by file and selected the .py files in the folder after I extracted them.

Then Blender complained that multiple addons installed with the same name.  Rather than trying to figure out which one installed to what location I just deleted the entire /scripts folder. Now when I start Blender it crashes immediately.

I tried to re-verify the files within Steam.  That didn't work, then I tried downloading a Blender from it's website.  It will launch from its' own installation.

I replaced the entirety of the Steam Blender folder with the new one I downloaded. It will not launch from within Steam, but if I launch it from the file browser it launches.

I clicked on reload default startup file. That should tell Blender to not install any mods that aren't default ones (pretty sure that's what I needed).  I clicked save startup and then removed Blender from Steam and then re-downloaded.

After re-installation within Steam I checked the addons folder.  It contains all the addons I previously had selected.  After trying to launch it, it still will not launch from within Steam.  I'm out of ideas.

Does anybody else have any?

When you say that you deleted the /scripts folder, what do you mean exactly? You should never delete the folder that is under the blender installation path, as that will mean Blender cannot start up (some scripts are essential).

When you add an add-on from File -> User Preferences, it will be copied to your local blender user  directory. This is ~/.config/blender/[VERSION].

No matter where it is installed, Blender will be looking in ~/.config/blender/[VERSION] for add-ons, which might explain why they are still present even after you have purged the installation directory and reinstalled.

If you haven't already, try deleting ~/.config/blender/[VERSION] (if my memory serves, it would be sudo rm -r ~/.config/blender/[VERSION]). Then reinstall a fresh copy of Blender via your preferred mechanism (e.g. Steam).

[VERSION] should be 2.78 or whatever you are using.


How can a I read and update the keyframe value of a material node in Blender 2.8 via Python? This question/answer (Control Cycles material nodes and material properties in Python) has been very useful, so I know now how to enter a keyframe for a given material node using keyframe_insert(). But I would also like to update these keyframe points at a later time: I have created a node group, which I would like to duplicate (multiple times), to reuse it as is, but for the keyframe points --the number of keyframe points will remain the same, only their values are to change.

If accessing and updating the keyframe points is not possible (like position, scale...), I could at least delete them via keyframe_delete() and then insert new ones. If this is the only way, what's the data_path to one of these node properties?

I don't know if this is the best way to do it, but it does exactly what I want it to do.

I have a Group of nodes. As part of this Group, there is a Value input node. I want to keyframe the default value of this Value node. So this is how it works.

Inserting a new keyframe point

1- Get a reference to the Group node:

group = bpy.data.materials['Material'].node_tree.nodes['Group']

2- Get a reference to the Value node within the Group:

node = group.node_tree.nodes['ValueNodeName']

3- Set the default value of the output of the Value node, and insert a keyframe (in this example, the value to insert is 1, and the frame number is 21)

node.outputs['Value'].default_value = 1
node.outputs['Value'].keyframe_insert('default_value', frame = 21)

Repeat step 3 for each new keyframe point to insert.

Overwriting an existing keyframe point

If I needed to overwrite an existing keyframe point, I could enter another keyframe point for the very same frame number. For example, if I wanted to update the keyframe point at frame 21 from value 1 to value 33:

node.outputs['Value'].default_value = 33
node.outputs['Value'].keyframe_insert('default_value', frame = 21)

Accessing a Keyframe Point from an F-Curve

Instead of adding, deleting and overwriting keyframe points from the node's output properties, we could get a reference to the F-Curve used to animate those properties and modify them that way. If material is a reference to the material containing our value node, this is how we could proceed:

action = material.node_tree.animation_data.action
if action:
    fc = action.fcurves.find(data_path)
        if fc:
            for kfp in fc:
                print(kfp.co)

The previous snippet would print the coordinates of all the keyframe points belonging to the F-Curve stored under data path data_path. For example, if the name of our value node were MyValueNode, the data path would be

data_path = 'nodes['MyValueNode'].outputs[0].default_value'


Should I always keep all edges looping? After finishing Blender Guru's both doughnut and anvil tutorials I conceived that I should keep mesh quad-only. Moreover, all edges of my final meshes were looping, which I took as a rule too. But is there such a rule or how strong this rule is? Sometimes I end up with meshes like on the picture below, where all the faces are quads, but not all edges are looping. How bad is it?

More specifically, should I keep all vertices always connect four other?

The best way to work is having a good topology (here's why why we need topology).
In low poly or other situations you can probably ignore a not perfect topology.

In particolar good looping are super userful if you need to control thge curvature of your mesh.


Problem with normal map display in glsl texture paint mode Looking through past posts I see this problem has been addressed often. I have tried many of the offered solutions unsuccessfully. I have a hi poly sculpt that I have normal mapped to a lower poly object. I would like to see the effect of that normal map while painting in a diffuse color slot in texture paint mode. The map looks fine while in the render viewport setting but does not show up in any other viewport setting. Painting while in a render viewport is too slow and not a viable option. To check my basic settings I made a simple scene with a plane object normal mapped with a sculpt and was able to see the mapped result fine in texture paint solid or texture viewport. So it seems the process does work but I cannot get it to work on this particular file. Is there a poly count limitation at work here or am I totally missing something obvious? Please see attached images demonstrating this issue.

Textured shaded mode may be what you are looking for.  It's shown in the animated image below.  Sorry about the messy .gif.  Apparently LiceCap really does not like Texture Painting.

To use this viewport shading mode with normal maps, you should add some lighting or all you will see is a sold black model.


Volumetric slicing in Blender Is there a way to slice a 3D object into planes (see attached image), merge them and export it as a single .obj?
I do not want to see the parts of the object that are left between planes, I just want to see the slices. Kind of like a tomography.
I saw a video of guy make this in Houdini, is it possible to do in Blender?
Link to the video: https://youtu.be/4ggS6G9HIh8?t=685

You can get a similar result with a Boolean modifier

Create your slicing planes (you can array them using Array modifier)
Add a Boolean Modifier > Intersect to your object
Target the slicing planes

I hid the slicing planes in the gif, so the result is better visible

For more detail refer to the following links:
How can I slice an object horizontally into equal pieces?
Model as multiple unique thin sheets
How do I create slices of a topographical mesh?


Why am I not getting equal squares when I unwrap? I'm making a pillow and I have marked a seam in the center. When I unwrap with pressing U, instead of getting squares I'm getting a different result.

This is the uv result:

I tried smart uv

Why am I not getting just to equal squares? Any suggestion or Help

It appears that you had "Pinned" parts of the UV's. I removed the pinned UVs in the UV Editor ALT+P to Un-Pin. And in object mode as a matter of habit applied scale and rotation CTRL+A. Then back in the UV Editor keeping the seam you created unwrapped Press U and select "Unwrap" from the drop down menu.


removing reflection in plastic for final rendering My boss wants it completely free of all reflections. I can get them off the top piece and I removed it to work on the power supply and the ethernet box. It is the reflections in the glass I need to remove. I added pictures of the lighting and the nodes I used for the transparent part.
I need to get the reflections of the stuff inside off the edges of the plastic. How can I do that?

The apparent reflection in the side of the glass cover is not actually a reflection but is a refraction - due to your glass cover not having 'thickness' and only being a single surface (so it's as if the whole inside is solid glass). Give it some thickness (either extrude it or just add a Solidify modifier) and that apparent reflection will disappear.


Why does the top fade out earlier than the bottom in this scene? See, in the scene, the top of the flag ends and becomes transparent at a different point then the bottom.  I want the end to be straight, not slanted like I have now.

Connecting different socket types is generally a bad idea. In this case you have the Object coordinates (a Vector - as indicated by the blue socket) connected to the scalar Value input of a Multiply Math node. This will automatically convert from the vector into a scalar (ie, a plain number) by averaging each of the X,Y,Z values of the vector together - not what you want. Instead, replace the Multiply node with a Separate XYZ node and then use whichever of the X, Y, Z outputs matches your requirements (probably X as indicated in the comments).


Why are these edges appearing in the render? Is there any easy way to get rid of the visible triangles in the final rendering?
It seems the subdivison in some places is more intense than in others.
Or is the only solution to rebuild the mesh?

You will need to create loop-cuts from the corners of the doorway horizontally and vertically, so your shape will be essentially 6 'faces' but with the removed doorway.
This SHOULD fix your problem.
One thing you could do is research 'topology' and understand how shapes and vertices work together.


How do you get "this" look? I always see this style of 3D art that really stands out. They kind of look like toys, like the material looks unnatural yet appealing. Ill post some examples, you know it when you see it.

By Dimas NP

(Tried looking everywhere for the artist but I can find the name, sorry!)

by Julien Kaspar
This one is maybe closest to what im talking about.

Ive never really seen a tutorial on how this style is done so I hope someone can help

Perhaps what you like in these pictures is that the materials are somewhere between plastic, modeling clay and skin, which I guess is a mix between glossy and translucency. You could try with this: Mix Diffuse and Glossy nodes, with a Fresnel as factor, and mix this with a Subsurface Scattering which will give the translucency and lightness. For the second picture maybe he used an Image Texture for the skin (blushed cheeks), that he plugged into the Diffuse.


Duplicate child wihout parenting Is there any way that I can duplicate children of other objects without automatically parenting it?

I mean, Each time after duplicating child objects (more often when making helper bones in a rig), it seems I have to manually clear the parent after that. So I wonder if there is any existing operation for that. Thanks!

While there is no built-in solution other than multiple keystrokes, an addon can easily add this.

This small script adds a "Duplicate without parenting" operator and connects it to the shortcut ⇧ Shift⎇ AltD This is available in object and armature edit modes.

import bpy

bl_info = {
    "name": "Duplicate object(s) without parenting",
    "author": "sambler",
    "version": (1,0),
    "blender": (2, 65, 0),
    "location": "Shift-Alt-D",
    "description": "Duplicate selected objects or bones without copying the parent connection",
    "warning": "",
    "wiki_url": "https://github.com/sambler/addonsByMe/blob/master/duplicate_without_parent.py",
    "tracker_url": "https://github.com/sambler/addonsByMe/issues",
    "category": "Object",
}

class DuplicateWithoutParent(bpy.types.Operator):
    """Duplicate selection without parenting"""
    bl_idname = "object.duplicate_no_parent"
    bl_label = "Duplicate without parenting"

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

    def execute(self, context):
        if context.active_object.type == 'ARMATURE' and context.active_object.mode == 'EDIT':
            bpy.ops.armature.duplicate()
            for b in context.selected_bones:
                b.parent = None
        else:
            bpy.ops.object.duplicate()
            bpy.ops.object.parent_clear(type='CLEAR')
        return bpy.ops.transform.translate('INVOKE_DEFAULT')

addon_keymaps = []

def register():
    bpy.utils.register_module(__name__)

    if bpy.app.background: return

    wm = bpy.context.window_manager
    kc = wm.keyconfigs.addon
    if kc:
        km = kc.keymaps.new('Armature', space_type='EMPTY')
        kmi = km.keymap_items.new(DuplicateWithoutParent.bl_idname, 'D', 'PRESS', alt=True, shift=True)
        addon_keymaps.append((km, kmi))

        km = kc.keymaps.new('Object Mode', space_type='EMPTY')
        kmi = km.keymap_items.new(DuplicateWithoutParent.bl_idname, 'D', 'PRESS', alt=True, shift=True)
        addon_keymaps.append((km, kmi))

def unregister():
    for km, kmi in addon_keymaps:
        km.keymap_items.remove(kmi)
    addon_keymaps.clear()

    bpy.utils.unregister_module(__name__)

if __name__ == "__main__":
    register()


Is there away to export textures created with nodes to fbx? I had my monkey textured with nodes, and did an fbx export. Usually fbx takes my materials in blender render, but in cycles, the nodes don't transfer so there is no texture. Is there a file I can export in so the nodes come? Thank you so much to all my helpers!

No there is not, nodal materials are not supported (by any exporter afaik), this would require some generic work first to be able to 'translate' those advanced shading representations in the basic, 'fixed' shaders supported by FBX and similar formats (and results would likely not be that great anyway)…


When I recalculate Bone Roll in Edit Mode the recalculation doesn't transfer over to pose mode The bones in my characters right leg are misaligned in pose mode, but look just fine in Edit mode. Here are some pictures:

This makes it impossible to animate my character, as when I can't really move that leg forward without it skewing to the right...
Thank you in advance!

Its because you use IKs. They are only calculated in Pose Mode. If you are using IKs its really important that your Bones that are affected are not in a straight line, else the algorithm will not know in which direction to bend. Also in the IK settings there is a Pole Angle with which you can experiment after you created that bend. To create that bend I recommend to move the knee connection almost to the skin, that will help later with deformation


how to setup blender for Surface Pro 4 Using blender on Surface Pro 4.
I've set the virtual pixel mode to "double" and it's great for the display UI. But I can't manipulate anything with the rotate tool using either the pen or a mouse.

I've tried playing with the manipulator size and handle size, but that doesn't help.

I also can't navigate/move the view using the pen.

Anyone have any setup suggestions to get me going?

The Emulate 3 Button Mouse setting let me use the pen to interact with objects and the scene.

The problem I was having with the rotate manipulator turned out to be a separate issue, and was fixed by changing the selection mode under User Preferences>System from automatic to OpenGL Occlusion Queries.


How does Blender figure out the normal of a face? I want to use bpy module to create a polygon in blender.

However, I have some problem with the normal of faces.

See the following example (adopt from this post):

Works:

import bpy

verts = [(1.0, 1.0, -1.0),
         (1.0, -1.0, -1.0),
         (-1.0, -1.0, -1.0),
         (-1.0, 1.0, -1.0),
         (1.0, 1.0, 1.0),
         (1.0, -1.0, 1.0),
         (-1.0, -1.0, 1.0),
         (-1.0, 1.0, 1.0)]

faces = [(0, 1, 2, 3),
         (4, 7, 6, 5),
         (0, 4, 5, 1),
         (1, 5, 6, 2),
         (2, 6, 7, 3),
         (4, 0, 3, 7)]

mesh = bpy.data.meshes.new('CubeMesh')
mesh.from_pydata(verts, [], faces)
mesh.update()
cube = bpy.data.objects.new('Cube', mesh)
scn = bpy.context.scene
scn.objects.link(cube)

The normals in the edit mode are correctly outward.

Then, I did some experiment on the same example code like this:

Don't Work:

import bpy

verts = [(1.0, 1.0, -1.0),
         (1.0, -1.0, -1.0),
         (-1.0, -1.0, -1.0),
         (-1.0, 1.0, -1.0),
         (1.0, 1.0, 1.0),
         (1.0, -1.0, 1.0),
         (-1.0, -1.0, 1.0),
         (-1.0, 1.0, 1.0)]

faces = [(0, 1, 2, 3),
         (4, 5, 6, 7),         # (4, 7, 6, 5) --> (4, 5, 6, 7)
         (0, 4, 5, 1),
         (1, 5, 6, 2),
         (2, 6, 7, 3),
         (4, 0, 3, 7)]

mesh = bpy.data.meshes.new('CubeMesh')
mesh.from_pydata(verts, [], faces)
mesh.update()
cube = bpy.data.objects.new('Cube', mesh)
scn = bpy.context.scene
scn.objects.link(cube)

If you copy and paste above code, you will see the face defined by (4, 5, 6, 7) flipped down.

It seems like the order of the vertices which define a face are critical on determining the direction of the normal.

My question is then how Blender internally determines the direction of normal of a face given the vertices? Is it the right-hand rule or something else? If it is so, is there any helper function or module that can help me with ensuring an outward normal of a face with respect to the world origin (0, 0, 0)?

Thanks.

Yes, the order in which we define the vertex indices of the Face directly influence the Face's normal.

See this thread on StackOverflow for some insight

Usually when constructing geometry you can keep track of the order and never encounter this problem, just be consistent. If you suddenly change the order in which you specify the vertices, you will get an inverted normal on that face (which is what happens to you). There's no way for Blender to know if that's intentional or not.

Sometimes it can be more convenient to let an algorithm recalculate normals at the end, as an extra processing step.

bmesh.ops

There's a bmesh.ops to recalculate normals .

bmesh.ops.recalc_face_normals(bm, faces=bm.faces)

See TextEditor > Templates > Python > Bmesh Simple for the template to get a bmesh representation from an object.

import bpy
import bmesh

verts = [(1.0, 1.0, -1.0),
         (1.0, -1.0, -1.0),
         (-1.0, -1.0, -1.0),
         (-1.0, 1.0, -1.0),
         (1.0, 1.0, 1.0),
         (1.0, -1.0, 1.0),
         (-1.0, -1.0, 1.0),
         (-1.0, 1.0, 1.0)]

faces = [(0, 1, 2, 3),
         (4, 5, 6, 7),         # (4, 7, 6, 5) --> (4, 5, 6, 7)
         (0, 4, 5, 1),
         (1, 5, 6, 2),
         (2, 6, 7, 3),
         (4, 0, 3, 7)]

mesh = bpy.data.meshes.new('CubeMesh')
scn = bpy.context.scene
mesh.from_pydata(verts, [], faces)
mesh.update()

bm = bmesh.new()
bm.from_mesh(mesh)
bmesh.ops.recalc_face_normals(bm, faces=bm.faces)
bm.to_mesh(mesh)
bm.free()

cube = bpy.data.objects.new('Cube', mesh)
scn.objects.link(cube)

You may want to work this into a function for clarity.

bpy.ops.mesh

You can use normals_make_consistent() if it's more convenient, there are however general reasons to avoid using bpy.ops within a scripting context. See the post on why to avoid bpy.ops

def make_object(name, verts, faces, normal_recalc=True):

    scn = bpy.context.scene

    mesh = bpy.data.meshes.new(name + "_Mesh")
    mesh.from_pydata(verts, [], faces)
    mesh.update()

    ob = bpy.data.objects.new(name, mesh)
    scn.objects.link(ob)
    if normal_recalc:
        scn.objects.active = ob
        bpy.ops.object.mode_set(mode = 'EDIT')
        bpy.ops.mesh.normals_make_consistent()
        bpy.ops.object.mode_set(mode = 'OBJECT')

    return ob

make_object('my_cube', verts, faces)
# make_object(name, verts, faces, normal_recalc=False)


Object displacement - ocean of hexagon tiles I want to make an ocean of cubes / hexagon tiles with varying  z locations. There was this guy with extrusion images and I wonder how he made it.

Like this...

however, in the process, mine looks more like this:

I used a cloud map and joined all hexagon cylinders into one object. Then i wanted to displace only each element from the object along the z axis.....

That was the plan at least. Could you point towards a solution? Maybe you got a better idea how to do that?

Thanks a lot.

Just scale all of the individual parts down to a size of 0 in the UVmap (using individual origins as scaling center). That way, each part will stay intact, but will be displaced as a whole according to the value of your noise where that UV island resides.

UV Map:

Result:

Edit: if you use a displacement modifier instead of shader displacement, it's easier to control the axis of displacement:


Why is the object not running in the given path I have a curve and a simple object that I want to run on that curve. I have selected the object and the curve and press ctrl+p and follow the path. it started from the starting point and end point. But when I stop the animation and want to start again its not at the starting point and the animation also too fast. I did not know as if its running on the path or just away from the path. I have tried with the duplication frame its not working with that also. Any suggestion or help. Thanks

The main reason it's not working is because you've offset the centers of the the curve and the object.
Here I've selected each and pressed Alt + G to move them back to the origin.  I then select the object and add Follow Path constraint and select the curve as the Target.  I then use the timeline to step through the animation.

After you know it works the way you want, you can scale, rotate, and move the curve any way you want.  But the object needs to be at the origin before adding the constraint.
Anything different will create an offset to the path and, unless you know what you're doing, can cause unpredictable results.  It's probably just better to set it to the origin and manipulate the curve so you can visualize the transformation.