toggle Object Mode  Pose Mode by script code I want to toggle Object Mode to Pose Mode by script code, because I usually run blender in Object Mode but sometimes I need to add some keyframes while I run blender. that is why I want to toggle Object Mode to Pose Mode by script code. plz help T_T

I Used and combined this codes.. let me know how to solve it sir T.T

bpy.ops.object.select_all(action = 'DESELECT')
bpy.ops.object.select_by_type(extend = False, type = 'ARMATURE')
bpy.ops.outliner.item_activate(extend=False, deselect_all=True)
bpy.ops.object.posemode_toggle()
bpy.ops.pose.group_select()
first_Bone = bpy.data.objects['Armature'].pose.bones["first_bone"]
first_Bone.select_set(True)

Probably the easiest way for you to toggle between Object Mode and Pose Mode is to simply call bpy.ops.object.posemode_toggle() again. If you're in Object Mode, that will switch you to Pose Mode. If you're in Pose Mode, then you'll go to Object Mode. Here is a link to the Blender 2.83 API, though unfortunately the description is sparse.

Here's a quick script you can run to test, where here I've also created an armature and showed one way to move it via keyframing (since it seems like you were interested in doing that).

import bpy
from mathutils import Vector

# Make armature
bpy.ops.object.armature_add(enter_editmode=False, location=(0, 0, 0))
arm = bpy.context.object

# Enter pose mode.
bpy.ops.object.posemode_toggle()

# Assign keyframes to the armature.
arm.pose.bones['Bone'].keyframe_insert('location', frame=0)
arm.pose.bones["Bone"].location += Vector((0,2,0))
arm.pose.bones['Bone'].keyframe_insert('location', frame=20)
arm.pose.bones["Bone"].location += Vector((0,0,2))
arm.pose.bones['Bone'].keyframe_insert('location', frame=40)

# Return to object mode.
bpy.ops.object.posemode_toggle()

If the code above is in a file test.py, then run blender -P test.py.

If the last line is commented out, you will see this when Blender opens in Pose Mode:

If you leave it un-commented in the code, then you will see this when Blender opens in Object Mode:


Cannot find way to make leaves seem to grow (sapling add-on) I need help! I am making a blender project where a tree grows. The trunk and  branches are working seamlessly (thanks to the bevel option), but I cannot find a way to make the leaves look like they are growing. So far, I have tried adding a transparency BSDF to make the leaves fade in, but I end up with weird black splotches while the leaves are supposed to be invisible:

This is the node web I used:

The green section is the part that controls the look of the leaves, the blue part is the part that controls the transparency, and the pink part is the part I have keyframed.

If anybody can help me fix these splotches, or preferably even show me a better way of making the leaves appear, I will be very grateful!!!

Thanks in advance,

Imaginate

SOLVED: I changed the leaves' pivot point to individual origins, and keyframed the scale.


Speed up I/O when using cached simulations I'm experimenting with fluid sims, so I've been baking and rendering the whole day. One thing I've noticed is that the I/O seems to be really slow. Like really slow. I'm only rendering at 30 samples per pixel and denoising, and when rendering an animation, it takes a couple of seconds to render the frame, then it hangs, I'm assuming reading the cache from the disk, and resumes the render. Guys I'm not kidding, the reading from the disk is twice the time it takes to render the frame. I'm on a SSD and every baked frame in the cache, between the actual sim and the noise sim (I'm working with fire at the moment) is around 35mb, so it should be very quick to load... And yet.
Also the timeline performance is afwul, scrubbing on the timeline is basically impossibile if the cache is active, I have to remove it and the reload it if I want it to be workable.
I only have 16GB of RAM, so I know I won't be able to do gigantic sims, but at the moment blender is only using 1.2GB of RAM during rendering.
Is there a setting I'm missing? IS there a way to I don't know, load more of the cache in RAM or something to speed things up?
Edit: Blend file https://we.tl/t-RCntPkgsnu it's really just a test scene

ok, although this is not an answer to your question, but i think it is important that you understand what is going on in fluid/smoke simulations.
First there is the domain, in which the whole simulation is going on. So every piece of smoke of fluid must be inside of this.
It "normally" makes no sense to move or animate the domain at all (from my point of view). So why are you animating the domain?
Inside the domain you can use inflows or geometry, which is the "real" smoke or fluid which then will be animated inside the domain.
You can imagine the domain as something, which is the world of fluids and all fluids can only live inside of that.
So my first advice: do not animate or move the domain at all. I never made it and maybe i am wrong - but i don't think it is a good idea to move it at all.
Move the inflows or your fluid inside the domain.
Maybe just changing this will solve your lagging problems. If not, just update your .blend file without moving the domain or explain me, what do you want to achieve by moving the domain?


Car Suspension - Getting Contact Depth and Speed From rayCast() So I am making a vehicle physics wrapper for my game(aswell as one other game). I am doing kinda well with it, now I've gotten to suspension. And here I use simple method: I apply impulse downwards from each wheel equalient to it's load - that's the gravity. And I also apply impulse upwards from suspension.
I have found this link:
http://vehiclephysics.com/advanced/how-suspensions-work/
Where it's said that:

Fsuspension = Kspring * x + Fdamper * Vcontact

As you can notice already that springrate and damper force are constants. However, other 2 values are variables. I want to find out how to obtain contact depth(x) and contact speed(Vcontact) from a ray that I cast from wheel joint position downwards(in -Z axis relative to car). I already obtain the distance how far the ray reach, but I need to find out the compression using this distance. And also I need a way to determine the speed of contact.

Thanks already now! :D

OK! Here is the deal.
As I already told, I obtain the length of the contact ray already. I will not discuss it's obtanation here, it is just rayCast() method with some more math.
Now I do suspension_length - ray_distance.
This returns the contact depth or x value. To get the speed of it I make a property exdepth for my suspension and after the end of frame I store the depth(x) value into it. Than on start of frame I compare them like so: x - exdepth and than I get the contact speed value(Vcontact).
And that's it - issue solved;)


How do I remove mask off stuff? I got this grass & I don't know how to make the mask transparent. Basically I just want to see the grass but the cubes are blocking it since it isn't transparent. I also have this tree with the same issue. Just to inform you I am using cycles.

You have to use a shader like this. If your texture doesn't have alpha channel plug the color to the "Fac" input or you can use a separate mask texture of course.


How to automatically merge disconnected bones' heads and tails Let's say I've imported a model and the importer has created an armature with some disconnected bones that shouldn't actually be disconnected. Specifically, this:

The first descendants of the wrist bone should be disconnected, but I'd like the finger bone chains to be properly connected. As an example, this is how the thumb should look:

How can I do this automatically? Something like:
1. Select all bones to be "fixed"
2. Run an operation
3. Done

So far, I'm stuck doing this manually, by placing the 3D cursor at each bone's head, deleting the bone, extruding a new one from its parent, placing the new bone's head where the 3D cursor is, and renaming it. This is pretty slow and cumbersome.

I can't benefit from Merge Bones (Within Chains), since it doesn't do anything (presumably because the bones are disconnected and not a proper chain). I've tried selecting two bones, two tails, two heads, or one tail + one head; all no luck.

Demo file (depicted by image 1)

Quick Script.

As commented, might pay to upload file with armature if more detail like bone roll is required.

Similarly to Straighten all bone chains in an armature a quick little script (in this case) to move parent tail to child head, connect and remove last bone.

In edit mode, grab the parent bones of chains you wish to "flatten and connect"

import bpy
context = bpy.context
arm = context.object.data
for eb in context.selected_editable_bones:
    parent = eb
    while len(parent.children):

        bone = parent.children[0]
        parent.tail = bone.head
        bone.use_connect = True
        parent = bone
    else:
        print("remove bone", parent.name)
        arm.edit_bones.remove(bone)

Note haven't done anything for bone roll. Would probably use the Y axis of original bone as Z or X axis of re-positioned bone


Moving faces radially I would like to move faces radially, but for some reason they don't want that.
When I move the faces, I expected them relatively to the middle / radially.
But as one can see from the screenshot, they move... ermhhh, differently.
One the face with the white circle moves as I expected.

Can anybody tell me how to achieve a radial movement?

Ensure that the Pivot Point is set to '3D Cursor'.
In edit mode, select the faces you want to move radially.
Hit 'Shift-S', then select 'Cursor to Selected'. The 3D Cursor should now be in the center of your selected faces.
Hit 'S' then 'Shift+Z'. This will scale your faces in X and Y but not Z.
Move your mouse or enter a value from the keyboard and hit enter when the faces have been moved radially to the correct position.


How to join 2 objects together? I can't join two skeletons/objects together. Ctrl+J is not working. Any help?

The yellow object and the red object are what I want to join together

If Ctrl-J doesn't work, then you may have a different version of blender (perhaps the older one) which might have a different hot key assigned. You can check that out in file tab -> user preferences -> input and in 3d view, you can change the assigned hot keys.

Further you can use this video if you need : https://www.google.com/url?sa=t&source=web&rct=j&url=https://m.youtube.com/watch%3Fv%3De02O2RPe4bw&ved=2ahUKEwivi6-yv73oAhWw4nMBHQIlDlUQFjABegQICxAJ&usg=AOvVaw0nIQ87x9tRgjiycvBMiaIx

Hope it helps..


Fade to black during animation How can I 'fade out' (or in) my animation? For example, at the end of a scene I want it to fade out to black to indicate time passing and then fade back in from black for the next scene.

(from @Robert's original question)
I found an elegant way to fade to black.
go to compositing, enable nodes.
add an 'rgb' node and an 'alpha over' node.
plug the render layers node into the TOP image input
plug the rgb into the BOTTOM image input
animate the factor in the Alpha over.
you wont be able to see it without a 'viewer' node, but it renders nice.
and uh.. set the rgb to black, or whatever colour you want to fade from
or use an image
or a movieclip
world is your oyster


Area Light being super weak The tutorial that I am following sets the power of a Area Light object to 500W and even turns down the distance. When I do this, the light barely shows, I have to crank it up to like 5000-50,000 for it to be noticeable. Is there any reason for this? Again, I am a beginner so this might be a bad question. Also I am in render view so the light should show. And I have made sure to apply the texture cause when I really crank it up there is a light.

The long and short of it is that the values for lights in cycles don't directly correspond to values you'd use in everyday life.  Sun lamps are expressed in irradiance, for example.  Things in blender also have default values that are often set to meet the needs/expectations of the greatest number of people and may not necessarily be what you need.
You can read a little more in the documentation.


Attempting to remove extra “edges” from truncated icosahedron lead to excessively global consequences I need a truncated icosahedron. Blender lets me do that with add -> mesh -> math function -> regular solid (assuming the extra plugin is installed.) So far so good. However, the mesh that is created does not use n-gons. This means that each hexagon or pentagon face is cut by an unusable edge approximately through the middle. These extra "lines" destroy the visual symmetry I need for the wireframe.
I have tried deleting the extra edges. This results in the in the removal of far more than just the offending edge. It blows a huge hole in the whole object. I have tried merging the two faces (which compose the pentagon or hexagon) into an n-gon. Somehow this again ends up doing far more than just merge the two parts of the face.
No matter what I try I get unintended effects that are far to global. I have also considered drawing fresh lines over only the desired edges. I cannot figure out how to do this either. I have also extracted the faces and edges with python, but those are too cumbersome to edit... and then what?
How do I get a nice clean geometric wire frame without distracting extra edges?

Edge Selection
The connected faces to edges of interest lie in the same plane. The edge angle is the angle between the normals of the two.
Can select all edges of interest by selecting one edge in edge selection mode, then in menu Select > Select Similar > Face Angle

then X Dissolve edges.
This is same behaviour as limited dissolve delimiting by Normal
Limited Dissolve.

Select all, and hit X choose limited dissolve. The use normal to delimit, ie the angular difference between the two faces (or less).


How to model a complex shape like this ornate window? I'm stumped. Two hours now and I can't get it to work. How would you make this window? You are a godsend if you can help. (see the little red circle on the image)

I can create the outer part of it, but unlike a square window which I have no issues with (extruding in, deleting faces, etc), I can't figure this one out.

Thanks!

There are many possible ways you could go about it, but perhaps this will give you some ideas.
Instead of thinking of the window as a solid chunk, think about the separate parts (sill, frame, bar things, glass, etc.) as, well, separate.
For example:

Model the frame:

Add the bar things as separate parts:

Add the glass:

The result here is admittedly pretty terrible, but in my defense I was hurrying so that the the gifs wouldn't be too big.. If you spend a little more time adding details to each of the components, you can get something more like this:

By adding even more detail (e.g. screws) to the places were parts are attached, you might make it even more believable.


Why no displacement seen in cycles render With the node wrangler addon. I tried the node setup. Will the maps. With the cycles render i cannot see the bump result.

Cycles Render Result

Node Setup

In Material -> Setting i have selected Bump+Displacement but wired result.

Any suggestion or help whats going with the nodes.

Displacement > Midlevel 0.6 > Scale 0.1 seems to be working fine.

I don't have the issue of missing bump in provided blend file.
Probably it is work of Denoiser? Pattern in that distance is really small.
Destruction on last image is caused by high Displacement Scale value.


How to make precisely defined trails along orbits in space I'll be animating a large number of small objects following pre-calculated orbits. I'd like to add glowing trails that follow the orbit with an intensity that drops off with a specified decay function. Actually I'd like to emulate this effect as close as possible.

Below is a small demo example to give a rough idea. The script generates an animation ready to run, but the trails are implemented as zillions of mesh objects. This obviously wouldn't scale.

The real thing will be bigger (imagine asteroid belt or Oort cloud or space junk), so I need those narrow, but beautifully defined trails as seen in the first link or here also.

I am thinking of creating one-dimensional mesh objects (a line of connected vertices) and assigning some kind of non-linear material ramp (would that even work?), but maybe there is a better approach.

Run the animation generated by the script...

def RK4(x, v, n, h, F):

    for i in range(n):  # written for readability, not speed

        kv1 = F( x[:, i]                   )
        kx1 =    v[:, i]

        kv2 = F( x[:, i] + kx1 * (h/2.0) )
        kx2 =    v[:, i] + kv1 * (h/2.0)

        kv3 = F( x[:, i] + kx2 * (h/2.0) )
        kx3 =    v[:, i] + kv2 * (h/2.0)

        kv4 = F( x[:, i] + kx3 * h          )
        kx4 =    v[:, i] + kv3 * h

        v[:, i+1] = v[:, i] + (h/6.0) * (kv1 + 2.*(kv2 + kv3) + kv4)
        x[:, i+1] = x[:, i] + (h/6.0) * (kx1 + 2.*(kx2 + kx3) + kx4)

def acc(x):
    """ acceleration due to the sun's gravity (NumPy version) """
    return -Gm * x / ( ((x**2).sum(axis=1)**1.5)[:,None] )

import bpy
import numpy as np

Gm     = 1.3271244002E+20  # m^3 s^-2   (Wikipedia Standard Gravitational Parameter)
t_year = 31558464.         # s  (roughly)
scale = 4.0E-11    # blender units per meter

n_frames = 250
Dt       = t_year / float(n_frames)   # time step

n = 8

X = np.zeros((n, 1000, 3))
V = np.zeros((n, 1000, 3))
T = np.zeros((n, 1000))

tilt = 30. * (np.pi/180.)  #radians
sin_tilt, cos_tilt = np.sin(tilt), np.cos(tilt)

X[:,0] = np.array([1.5E+11, 0.0, 0.0])[None, :] # start in the same place...

V[:,0] = 29300. * (np.linspace(0.5, 1.2, n)[:, None] *
                   np.array([0.0, cos_tilt, sin_tilt])[None, :] ) # ...but different initial velocities

# NOTE!! This is just for quickie demos only.
# Will give wrong result if step size too big.

RK4(X, V, n_frames, Dt, acc)  # pre-calculate orbits

p_size, s_size = 0.2, 0.5

# Create the Universe
ok = bpy.ops.mesh.primitive_ico_sphere_add(size=s_size, location=(0.0, 0.0, 0.0))
sun = bpy.context.active_object
sun.name = "Sun"

n_echos, frames_per_echo = 20, 1
e_sizes = np.linspace(p_size, 0, n_echos+1)[:-1]

things, trails = [], []

for i in range(n):

    ok = bpy.ops.mesh.primitive_ico_sphere_add(size=p_size, location=(0.0, 0.0, 0.0))

    p = bpy.context.active_object
    p.name = "p" + str(i)
    things.append(p)

    echos = []

    for i_echo in range(n_echos):

        ok = bpy.ops.mesh.primitive_ico_sphere_add(size=e_sizes[i_echo], location=(0.0, 0.0, 0.0))

        e = bpy.context.active_object
        e.name = "p" + str(i) + "e" + str(i_echo)
        echos.append(e)

    trails.append(echos)

# Animate the Universe
bpy.context.scene.frame_end = n_frames

for i_frame in range(n_frames):

    for i, p in enumerate(things):

        p.location = scale * X[i, i_frame]
        p.keyframe_insert(data_path="location", frame = i_frame + 1, index=-1)

        for iecho, echo in enumerate(trails[i]):

            i_frame_echo = max(0, i_frame - frames_per_echo*(iecho+1))
            echo.location = scale * X[i, i_frame_echo]
            echo.keyframe_insert(data_path="location", frame = i_frame + 1, index=-1)

Trails can be created in Blender using particles. These trails can be generated from simulations or animation. Since the trails are created as geometry, modifiers, shaders, and compositing can be used to achieve a broad range of effects. This image below was generated using this approach.

Step by step instructions (Blender 2.76)

Setup a scene with an object which which will move. For this example, a physics simulation will generate the motion of a bouncing ball. The details of the physics setup are not discussed. Add a sphere out of view of the camera. Call this sphere 'particle-sphere'. It will be used to visualize the trail with the particle system.

Parent a single vertex to the object. This vertex will be the emitter for all particles on the trail. The vertex will emit the particles for the trail.
Create a particle system for the vertex. To simplify things, choose a large number, like 2000, and set the number of particles, the lifetime of the particles and the emission end at this number. This will lead to a single particle being emitted at each frame. Set the render object to a sphere added for visualization. Set the field weight for gravity to 0. This will prevent the particles from moving.

Simulate/animate the scene. Usually, the spacing between the particles will be too high, resulting in a dotted trail. (This will be corrected in a few steps.)

To fade the trail, a shader is used which make the particles increasingly transparent as they age.

To close up the spacing on the dots, the timing needs to be adjusted. First adjust the animation end time. For this example, the end time will be set to 2000 frames. The retiming can be done in several ways. One method is to retime the physics. The other is to bake the physics, (see How to bake rigid body physics frame in blender render? ) then retime the animation. This is opening the dope sheet, selecting the animation channels, a scaling using 's'. In this example, the original 250 frame animation was scaled by 8 to stretch to 2000 frames.

Finally, this retiming will change the real time playback of the animation. To fix this, the animation is rendered skipping frames. Since the animation was retimed by a factor of 8, the animation is rendered using every 8th frame.

This animation is finally generated!

The blend file for the space animation is located here:

The blend file for the example is located here:


How to check the vertex/edge/polygon count of one or more object? Is there a way to check the selected object(s) vertex/edge/polygon count?

Script to print stats to system console

Script prints the stats of selected mesh object to system console.

import bpy
from bpy import context

sumfaces = []
for o in context.selected_objects:
    if o.type != 'MESH':
        continue
    me = o.data
    verts = len(me.vertices)
    edges = len(me.edges)
    faces = len(me.polygons)
    sumfaces.append(faces)
    print("%s: verts:%d edges:%d polys %d"
            % (o.name, verts, edges, faces))

print("total polys %d" % sum(sumfaces))

Sample output.

Cube: verts:8 edges:12 polys 6
Suzanne: verts:507 edges:1005 polys 500

total polys 506


does blender care what GPU I use? When supplies are more available, I'll be building a new PC and am wondering if Blender works better with NVidia or AMD GPUs or if it even cares. Is it more important to have a card with more RAM?
Thanks!
--ted

This is a very general question and the answer varies over time.  You can always check the open data benchmarks to see what the current status is:  https://opendata.blender.org/
Historically, Blender has worked better with NVIDIA GPUs, but a lot of effort is being currently spent on improving AMD performance.
Yes, more RAM is better, but even that statement has exceptions.


Issue with arm bones I'm having a problem with the bones in my arms, in that the connection between the upper arm and forearm does not deform the mesh properly when I manipulate it, as if the joint never existed.

Can someone provide some insight as to why this is happening, and tell me what I can do to solve it?

So i solved my question. Turns out I needed to subdivide the mesh on the arms as they were too simple, it seems.


How to "refresh" variables / selected components for an operator in python script? I'm working on an addon changing selected verticies per keyboard.
It collects data:
import bpy
import numpy as np
import bmesh

################ update scene ####################
bpy.context.view_layer.update()
layer = bpy.context.view_layer
layer.update()

oa = bpy.context.active_object
bm = bmesh.from_edit_mesh(oa.data)   ## get active...
me = bpy.context.edit_object.data

bpy.ops.object.mode_set(mode='EDIT')

############### active vtx idx ###################
def bmesh_vert_active(bm):
    if bm.select_history:
        elem = bm.select_history[-1]
        if isinstance(elem, bmesh.types.BMVert):
            return elem
    return None
avtidx = bmesh_vert_active(bm)
if avtidx != None:
    avtidx = bmesh_vert_active(bm).index

#######################################################

bpy.ops.object.mode_set(mode='OBJECT') ## update selection

#######################################################
def get_co(oa):
    count = len(oa.data.vertices)
    co = np.empty(count * 3,  dtype=np.float32)
    oa.data.vertices.foreach_get("co", co)
    co.shape = (count, 3)
    return co

def get_ix(oa):
    count = len(oa.data.vertices)
    ix = np.empty(count, dtype=np.int32) # check dtype!!!
    oa.data.vertices.foreach_get("index", ix)
    return ix

...then it calculates new selection from collected data:
def calc_north(ixT):
    ...

...finally the operator:
## deselect all components first
def dslct_all(oa):
    setF = np.zeros(len(oa.data.polygons), dtype=np.bool)
    setE = np.zeros(len(oa.data.edges), dtype=np.bool)
    setV = np.zeros(len(oa.data.vertices), dtype=np.bool)
    oa.data.polygons.foreach_set("select", setF.ravel())
    oa.data.edges.foreach_set("select", setE.ravel())
    oa.data.vertices.foreach_set("select", setV.ravel())
    oa.data.update()

bpy.ops.object.mode_set(mode='EDIT')

### select activeVtx
def bmesh_actvvtx_set(me):
    bm = bmesh.from_edit_mesh(me)
    if hasattr(bm.verts, "ensure_lookup_table"):
        bm.verts.ensure_lookup_table()
    bm.select_history.add(bm.verts[avtx])

################### keymap #######################

## switch selected verts
class nKey(bpy.types.Operator):
    '''up Arrow Key'''
    bl_idname = "view_3d.print_uarrow"
    bl_label = "print up arrow"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        return self.invoke(context, None)

    def invoke(self, context, event):
        bpy.ops.object.mode_set(mode='OBJECT')
        jmpX = calc_north(ixT)
        setSl = np.zeros(len(oa.data.vertices), dtype=np.bool)
        setSl[jmpX] = 1

        dslct_all(oa)

        oa.data.vertices.foreach_set("select", setSl.ravel())
        oa.data.update()
        bpy.ops.object.mode_set(mode='EDIT')

        if avtidx != None:
            avtx = jmpX[avtidx][0] ## idx of activeVtx
            bmesh_actvvtx_set(me)

        return {'FINISHED'}
...

Everything works as expected but, only once! Surely it holds on to all variables,
which leads to reselecting the same verticies ever and ever again.
How can I feed the operator with updated input?
I googled around for days. I couldn't find a solution, despite many attempts.
The "update scene" part is one of them.
How can I make this work repeatetly?

The right answer is, that all tho code outside the OP stays "static".
Running everything inside the OP solves the problem.


how to make streamers I have a image attached. I want to make that streamers. Im not getting how to coil that shape round and round from top to bottom with large and top and smaller at bottom.

There's a built-in primitive for 'growing spirals' in the extra curves addon shipped by default with Blender

Just activate the addon Add curve extra objects and add it through the menu adjusting settings as desired.
You can then add another flat curve as bevel object for a ribbon effect


Cloth Deforms When I Move Character When I attempt to move the rig of the character the clothes overlap for some reason. How can I fix this? I've increased quality steps, applied scale and changed soft body and cloth settings. Would I need to sculpt the cloth?

I'm not a cloth expert but as I told you I think this tutorial by Aneesh Arts gives a series of good tricks.
The first thing I would say is that your gown and pants are rather high-poly and it doesn't help to easily work, you should do a low-poly version and give it a Subdivision Surface modifier.
That said I was able to quickly improve your problem with these 2 solutions:

First, move a bit the vertices of the bottom of the gown with the Proportional Editing enabled. You can even create a new shapekey so that the topology only moves when necessary:

Find and display the deforming bones in the armature layers:

Select the armature, then shift shelect the pants, switch to Weight Paint mode, check each bone and use Blend > Mix or Subtract to increase or decrease their influence. Then do the same for the gown, until there is no clothes overlapping:

At the end you should be able to have a good result:

There is another method that may help, it is to give your clothes a Mesh Deform modifier as I explained here, you could try to associate it with cloth simulation...


How to grab both front and back faces in sculpt mode I am making a sculpture and i want to manipulate a cylinder to make an arm... Im trying to bend it a certain way but the grab tool wont grab the back faces. Is there a function to enable so i can grab the mesh as a whole and not only the front faces?

I also wish there was a way to make things easier, because you can’t always use edit mode. You can in fact manipulate back facing vertices if you zoom in inside the model.


What's the difference between Glossy and Glass shaders in Eevee? What's the difference between Glossy and Glass shaders in Eevee? Also What's the difference between Glossy and Glass shaders and Roughness parameter in Princepled BSDF shader?

From left to right, is Glossy, Glass, and "Shiny". All 3 have roughness at 0.

Roughness in Principled BSDF determines how "shiny" or "polished" the surface of somthing looks. It bears no effect on the underlying colors.
Glossy is the equivalent of metallic - the color determines the hue of the specular reflection (how much of its own color is reflected back with the light). Default (white) Glossy with roughness 0 is the equivalent of Pure Metal (White basecolor, Roughness = 0, Metallic = 1) on Principled BSDF.
Glass essentially a Glossy shader, but with a transparent BaseColor, and some refraction added which also gives transparent/refracted reflections. It also includes a Fresnel to alter the refractions near the "edge" of objects. It is one of the best ways of replicating glass in Cycles, but has its limitations in EEVEE.


How to get outer part of the mesh? I have a mesh which has a clear outer structure but is pretty complicated "inside":

How can I separate ONLY the outside part? Is there any better way than selecting the vertices manually in edit mode?

Are they two separate chunks of mesh? It looks like they are from the images.

If so select only one vertex from the outer shell, press Ctrl+L to Select All Linked and it should select all the outer part.

Alternatively in Edit Mode select all faces, press P > Loose parts and it should break your object apart by all separate chunks.

If they are not separate chunks then I'm afraid you don't really have a chioce other than manually selecting everything.

Under Edit Mode you can enable the option Limit selection to Visible in the 3DView header button, and use regular selection methods to select only the visible parts of the mesh. With some luck the 'inner' parts are occluded and wont be selected.


How to simulate keyboard ESC command using Python builtin modules? For my addon I need a function that simulates just a single ESC button event from the keyboard, using Python. I've tried many things and this seems to be the only way left to abort

bpy.ops.render.render('INVOKE_DEFAULT')

operator without killing the whole Blender.

I've found this Ctypes method. This is builtin module unlike win32api or Pynput, so it can be imported without install right from inside the Blender. It seems to be exactly what I need. But importing the whole module and writing all those classes is obviously way too much for just a single ESC keyboard command, and unfortunately my current programming skills don't allow me to get through the whole module to find what I need. Please, can anyone help me with this?

Here is the solution for Windows I was looking for:

import ctypes

VK_ESCAPE = 0x1B
ctypes.windll.user32.keybd_event(VK_ESCAPE)

Beeing written as a function and appended to bpy.app.handlers.render_pre it simulates pressing ESC on the keyboard and aborts the render.

In my addon I used another solution: it turned out to be possible to replace original Blender main top Render menu with custom one which buttons execute addon's operators instead of original Blender's. It was done by recreating inside the script and re-registering original class TOPBAR_MT_render(bpy.types.Menu) which can be found in your Blender current version folder -> scripts -> startup -> bl_ui -> space_topbar.py

Also I replaced operators for original keymap shortcut settings by editing bpy.context.window_manager.keyconfigs.active.keymaps['Screen'].keymap_items, so in the end user uses the same buttons and shortcuts he used to, but they execute addon's operators instead of original ones, and this is suitable for every system, not only for Windows.


Camera Solve Focal Length Automatically Set To 24 Im wondering why when I go to solve the camera in a tracked scene it defaults to being set to having a focal length of 24. If I have the focal length above or below 24 before doing the solve it sets it back to 24, but I would like it to stay at the focal length I have set before the camera solve.

Motion tracking Solver does not automatically applies the settings of the Solved camera into your scene's camera unless you press Setup Tracking Scene (Movie Clip Editor Window, in the Solve Tab).

Blender's default camera has 24mm so I guess you are not using this feature. If not, you may apply the Camera Solver Constraint manually and then change the Camera properties too.


Objects not touching in collision I'm a total noob - and I'm doing a soft body simulation -  just a ball bouncing. The ball does bounce, but it is not actually touching the collision surface, it is bouncing slightly above. It's like there's an invisible surface holding the ball floating in space. It's very noticeable in a side view (see picture). How do I make the ball actually bounce on the correct surface?

Found the solution! The ball was a cube with a subdivision surface modifier, smooth shaded. The problem was that I did not hit "apply" in the modifier settings. Blender was showing me a nice smooth ball, but was animating it as though it was still a cube -- and held on to it's invisible cube geometry. Problem instantly vanishes by hitting "apply."

Thanks everybody!


Merge vertices while inseting ver. 2.82 I have issue with inset feature, works fine on regular shapes, but when the faces has odd shapes, there is a lot of faces overlapping.

I have read that there is an option that allows to auto merge vertices while inseting, but i can't find the option. Can someone help me with this?

This is possible using the Straight Skeleton Inset function.
It's basically a 'smarter' inset tool.

Enable it in Preferences > Addons > Inset Straight Skeleton
Select your faces and go Face > Inset Straight Skeleton
Done.

You can see the vertices are merging, instead of overlapping.


Why can't I import a SVG file from Adobe Illustrator or Inkscape? I've tried multiple times to  import a SVG file from illustrator CS5.5 to Blender 2.71 and 2.73. However, I do not see a mesh, curve, or anything pop up in my "Outliner" window. So I know its not so small I can't see it. I even made sure under user preferences that the "import and export of SVG 1.1 format" is "checked." I've tried even just importing text from illustrator and I'm still getting no where. What can I do to resolve this problem? If this is common error with this version of Blender, then what can I do to transform an image into a 3D object in Blender?

This is a very common error with a simple solution.
The error:
Just because you saved your file as SVG, it doesn't mean that the information is in vector format, and blender's SVG importer expects vectors (paths) to create curve objects.
Long winded explanation:
Scalable Vector Graphics (SVG) is defined as

a modularized language for describing two-dimensional vector and mixed vector/raster graphics in XML

What that means is that the SVG format can contain three types of graphic objects:
Vector Graphics (made from the 2D representation of paths, points, lines, shapes, fill etc. )
Raster graphics (bitmap images, as pixel information)
Text (using fonts, and XML character data formatting information).
Currently the Blender's SVG importer can only read paths (vectorial graphics). Raster and text information will not be imported.
So how do I import SVG files correctly then?
In this particular case your illustrator/inkscape file is just a bitmap image contained within the SVG file, but is not an object made of paths.
To convert a raster image (pixels) into vectors (paths or curves) it has to be TRACED
In illustrator select your graphic, and form the menu select: Object->Live_Trace->Tracing Options. Then trace.

In Inkscape select Path->Trace_Bitmap (or press ShiftAltB)

Once the image has been properly traced and saved as SVG, the file should import correctly on Blender.

Random tips to deal with SVGs
When exporting from illustrator un-check this box:

On newer versions of there is an option to save as Adobe CEF when saving as SVG. Do not use that, but SVG instead. (see this question)

To import Text.
Text in illustrator doesn't get translated into outline curves automatically when you save as SGV either: You have to select the text and go to Type->Create Outlines first. Once is converted to paths, it's easy to create a SVG file that blender can deal with.
Filled Paths.
In Illustrator you can have paths that are filled but not closed. Those paths might not translate correctly in blender, so make sure to close your paths in illustrator before exporting.
Scale:
The scale in which the objects where created might not match blender's scene scale (Read this post). Upon importing you may see that there are new curve objects in the outliner but they might not be visible in blender's 3D viewport because they are too small (or sometimes too large). If that's the case you might need to zoom in on the viewport to find your objects, or you might also need change the clip point for the viewport. You can fix scale/visibility issues re-scaling the imported objects or re-scaling your scene.
For more on this topic please read this and this:


How do I change the color of particles with a color ramp? I watched this tutorial https://youtu.be/eshOzshjt90 and at 2:18 he somehow magically managed to get a different color on his second particle via the color ramp. But the color ramp doesn't do anything at all? I'm really confused. How do I change or invert the color of my second particle?

If your particle system is instancing an object then you can customise the particles to sample random colours by using this node setup on your instancing object:

Here, all I've done is use the random output of an object info node with a colour ramp :)


How to pick an object before operator execution? (object picker/pointer ux?) I have an operator that needs an object in order to work,
but here's the trick, it is required to use some sort of picker GUI in order to select the object first before execution() (instead of using the more traditional bpy.context.selection or active)
It is for creating a paint bucket tool or something similar
Note that blender does have such "pick before execute" behavior by default, for example you can use
def invoke(self, context, event):
    context.window_manager.fileselect_add(self)
    return {'RUNNING_MODAL'}

to select a filepath before execution, well I want to do exactly the same thing but with a bpy.props.PointerProperty(type=bpy.types.Object) instead of a filepath
unfortunately I didn't find any function similar to fileselect_add(), I was hoping for something like objectselect_add() sadfly it does not exists, does he?
so now I'm stuck as I don't have any picker method at my disposal
I suppose I need to go modal?
i don't have any modal experience, is there a similar project I can take a look at?

Update method on pointer property

Not sure if this is a bit of an XY Problem
In as much as agree that invoking the filebrowser is a way to select the filepath before executing the operator  it is generally displaying other options (often for import export) while it runs modally.
To simply select a filepath before running could achieve same with
def foo(self, context):
    bpy.ops.export_scene.foo(filepath=self.filepath)

Foo.filepath = StringProperty(subtype='FILE_PATH`, update=foo)

So similarly, can "do your thang" when the object is selected via the eyedropper.
Object selection box with eyedropper
import bpy
from bpy.props import PointerProperty

def poll(self, obj):
    return obj.type == 'MESH'

def update(self, context):
    # self is scene (or self.id_data if in prop group)
    ob = self.prop
    if ob is not None:
        print(f"Run operator or do something to {ob.name}")
        self.prop = None # reset?

class TEST_PT_layout_panel(bpy.types.Panel):
    bl_label = "Prop Panels"
    bl_category = "Test Panel"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"

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

        col = layout.column()
        col.prop(scene, "prop")

def register():
    bpy.types.Scene.prop = PointerProperty(
            type=bpy.types.Object,
            poll=poll,
            update=update)
    bpy.utils.register_class(TEST_PT_layout_panel)

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

if __name__ == "__main__":
    register()

Note: have reset the pointer to none after each pick for way of example. Will prompt the "No value set warning in UI.


Create text containing a new line with animation nodes I have two texts I want to add together so they are on two consecutive lines. I have found the option to change line spacing so I assume there is a way to add linebreaks.
How can I add a linebreak to a text object with the animation nodes?

Characters Node in Animation Nodes

Line Break character is added to a list and then joined for output.

Click image above for larger view.

Animation Nodes. Search or Menu.  Composed image above.

Menu >> Add >> Text >> Characters. AN Menus have many items which creates vertical size. Thus the large image to minimize vertical scroll at BSE.


Assign shortcuts to different values from thedrop-down menu "Merge" I want to assign a separate hotkey to "At Last" or "Collapse"
Is it possible?

To make merging vertices faster change in User Preferences setup for this shortcut enabling Type option just below the main options:

Select the desired type from the list  to make this shortcut execute command with given option and skip any dialogs (most likely you will want to create also shortcuts to use other options of the operator).
To disable that either restore settings or press on X button near the Type selector. Read more details on this technique in this post - How To NOT extend selection with Box Select?.

However you have other approaches available too without need to change shortcuts.

One approach would be to use Shift+R to repeat the last action. So you would select 3 vertices in desired order, choose needed option from menu and then after selecting next verts just execute Repeat Last.

Anotehr way would be using list of Undo history from F3. Once doing any action it will be accessible from that list and you will be able to repeat it by pressing F3 > Enter. See more here - Is there a shortcut to repeat the last operation in Blender.

Also you could just choose another way of modeling and dissolve those vertices either with X > Limited Dissolve or Dissolve Edges (make sure to select needed geometry first).


Can I use BSDF for the emission pattern of a lamp or light source? I started to study blender because I want to perform some simulations on bicycle lighting.
My goal is to take a picture of a beam pattern against a wall, then use it as the Bidirectional EMISSION Distribution Function for the light source, rendering its illumination pattern when actually used along a road or other outdoor environment.
For example, a typical distribution for a vehicular headlight is as follows:

Then, I would create a light source with this custom emission pattern (sort of an "UV map" for luminous emission intensity) to render images such as these, with a fair amount of realism (I don't plan to get state-of-the art, 100% physically accurate simulation):

So my questions are:

Is it possible to do shuch a thing in Blender?

If it is, which concepts should I look for?

I plan to use Cycles rendering engine.

Spot into textured transparent shader will work. like this

Shader


Creating the simplest Addon I want to create the simplest addon, viewing the official documentation I found this, the problem is that I don´t see anything.
The code:

bl_info = {"name": "My Test Addon", "category": "Object"}
def register():
    print("Hello World")
def unregister():
    print("Goodbye World")

I try to install the addon.
 Open the user File -> User Preferences, Select the Addon section, press Install Addon... and select the file.
I have to select a .py file, is not it? In my case I select the file "Simplestaddon.py"

I enable the addon

However I don´t see anything...

Where is "Hello World" supposed to appear?
Apparenty, it´s supposed to see in the console but I did click on Window->Toggle System Console and I don´t see anything in the console after doing click on "Run script"

I finally understood what this script does! It is not displayed through any button or menu as expected at first. That´s logic because there is no code that refers to any button or menu. As a script it can not do anything either because it only contains the definitions of the functions but there is no call to any function. The only way to visualize its action is through Open the user File -> User Preferences, Select the Addon section. You write in the search box the name of your addon, in this case "My Test Addon". Once you show it, you give it to the square on the right, a checkbox, that action will enable it, if you press the checkbox again, you will disable it. Each time you enable it, it will write "Hello World" in the console (to see it click on Window-> Toggle System Console) and each time you disable it, "Goodbye World" will be written.


Blender 2.8 no background image in wireframe mode I am modelling a scene from a photo. As I am doing so, I need the wireframe mode to show the background image as well to see where I should position objects. However, the background image only appears in solid mode, not wireframe. I am using an fSpy file as the camera calibration. Initially, the wireframe mode had the background image, but now it doesn't show anything.
The wireframe mode doesn't have the background image.

with the camera selected, in the "add image / depth back / front" menu select front


Looking for a usable solution for Z-pass aliasing i'm trying to render a small video of a city in fog using the cycles engine. The main problem is, i need physically accurate fog. In order to achieve that i'm using the distance of a pixel from the camera to the object calculated by the Z-Pass. But the Z-Pass has no anti aliasing so the end result has a lot of jagged edges. I have already searched for a solution.
The options were:

Switch to blender internal render because it has FSAA (Full Sample Anti Aliasing)

I have tried that and the option does what i need, but i started using cycles and switching to blender internal render
at this stage requires a lot of material work to be redone.
Use super sampling and down scale after the rendering.

This does work but has some side effects. In order to achieve good results i need to render 16 times more Pixels.
In theory i can also reduce the rendering samples per pixel by that factor, so the workload should stay the same.
But it doesn't, this correlation is not linear. It takes considerable more time to render the bigger picture.
5120 x 4096 with 9 samples takes 4m53s and a 1280 x 1024 px frame with 144 samples takes just 3m39s. Which doesn't sound like a lot, but if you need 2400 frames, it does add up.
Also the super sampled result has a lot more noise and is noticeably darker as well.
Use mist pass.

Sadly, i had no success extracting the distance information from the mist pass and wasn't able to get it to work
in my application.

Does anyone have any suggestions?

Use this shader as an override for all your materials in Render layers and render a perfect Z-depth pass that is pixel-perfect anti-aliased like your final render:

It shades the geometry based on distance from camera and renders fast (only 1 emission shader, you can omit the black emission).

It is basically similar to the mist past, but let's you do more magic for example with transparency if you need.


Generating object mask during rendering for data collection I am creating a synthetic hand dataset for machine learning. I am rendering images of characters with different hand gestures in Blender. At the same time, I want to generate a hand mask for each rendered image to indicate the position of the hand in the RGB image. For example, the hand mask would be an image in which every pixel that is part of the hand at corresponding position in the rendered RGB image has value 1, all other pixels have value 0.

How do I generate the hand mask? My intuition tells me that I need to select all vertices belonging to the hand, then calculate the projection of these pixels onto the image plane. However, I am new to Blender so do not know how to do this or if this is possible.

If you are looking to create a black and white image of a portion of a mesh, make the portion you wish to capture a distinct material (top image).

Assign the material a material pass (see yellow arrow), and collect and output that pass in your render (See render stack):

Here's a step-by-step, if this is your desired output: How to put 2 parts of 1 object on different layers?

Hand by SuperDasil on BlendSwap: https://www.blendswap.com/blends/view/81285


Edit Mode: disable closest selection Is it possible avoid Blender 2.79 from selecting the closest vertex/edge/face in Edit Mode?

I find that even when clicking well outside of my model, the closest possible target often seem to selected, I have no idea why Blender would behave this way.

Thx!

Update: the behavior I am seeing: https://streamable.com/y447y

Not really an answer as there is currently no solution to my specific problem in 2.79. But I did find some alternative to de-selection.

I have created a keymap based on the 2.80 "Industry Standard Keymap" proposal in case people ran into the same issue as me.

https://gist.github.com/bitinn/22f6fefe026d8d9e83468864edb8f835


Eevee is using my CPU to render I rendered a short animation using Eevee engine, but my cpu was used 100% of the time. The temperature and fan of the cpu went crazy. How is that possible? Eevee is supposed to use OpenGL and has nothing to do with the settings in preferences, correct me if I'm wrong. I do have Cycles on GPU Compute and Cuda selected in Preferences with no CPU, but that shouldn't matter anyway. I have my both monitors plugged in the GPU display ports. It's a RTX 2070. I rendered the animation 3 times and checked the hardware with CAM and Task Manager. Why is Eevee using my CPU instead of GPU???

If anybody runs into the same problem in Eevee where the cpu is overloaded while rendering check your Compositing mode and make sure you don't have a Denoise filter on. It doesn't create a problem when you render in Cycles but it does put stress on the cpu when rendering with Eevee.


How do I change the name of the default action created when inserting keyframe? My code for creating the animation if necessary

def testAnimation():

scn = bpy.context.scene
arm = bpy.data.armatures["Rig"]
rigobj = bpy.data.objects["Rig"]
scn.objects.active = rigobj
rigobj.select = True

bpy.ops.object.mode_set(mode = 'POSE')

boneSelect = bpy.context.object.data.bones['LBicep']
boneSelect.select = True

bpy.ops.transform.rotate(value=(0), axis=(1.0,1.0,1.0))
bpy.data.objects["Rig"].pose.bones['LBicep'].keyframe_insert(data_path='rotation_quaternion', frame = 0.0, group = "LBicep")

bpy.ops.transform.rotate(value=(math.pi*0.5), axis=(1.0,1.0,1.0))
bpy.data.objects["Rig"].pose.bones['LBicep'].keyframe_insert(data_path='rotation_quaternion', frame = 100.0, group = "LBicep")

bpy.ops.transform.rotate(value=(math.pi*0.5), axis=(1.0,1.0,1.0))
bpy.data.objects["Rig"].pose.bones['LBicep'].keyframe_insert(data_path='rotation_quaternion', frame = 200.0, group = "LBicep")

boneSelect.select = False
boneSelect = bpy.context.object.data.bones['LThigh']
boneSelect.select = True

bpy.ops.transform.rotate(value=(0), axis=(1.0,1.0,1.0))
bpy.data.objects["Rig"].pose.bones['LThigh'].keyframe_insert(data_path='rotation_quaternion', frame = 0.0, group = "LThigh")

bpy.ops.transform.rotate(value=(math.pi*0.5), axis=(1.0,1.0,1.0))
bpy.data.objects["Rig"].pose.bones['LThigh'].keyframe_insert(data_path='rotation_quaternion', frame = 150.0, group = "LThigh")

boneSelect.select = False
boneSelect = bpy.context.object.data.bones['RThigh']
boneSelect.select = True

bpy.ops.transform.translate(value=(0,0,0))
bpy.data.objects["Rig"].pose.bones['RThigh'].keyframe_insert(data_path='location', frame = 0.0, group = "RThigh")

bpy.ops.transform.translate(value=(0,10,0))
bpy.data.objects["Rig"].pose.bones['RThigh'].keyframe_insert(data_path='location', frame = 300.0, group = "RThigh")

bpy.ops.transform.translate(value=(0,-10,0))
bpy.data.objects["Rig"].pose.bones['RThigh'].keyframe_insert(data_path='location', frame = 700.0, group = "RThigh")

bpy.ops.object.mode_set(mode='OBJECT')
scn.update()

keyframe_insert() creates animation_data and an action if necessary, and makes it the new action of the active object.

Thus, you can simply access your object's action and change its name:

bpy.data.objects["Rig"].animation_data.action.name = "foobar"

Note that you shouldn't do this before any call to keyframe_insert(), as it would error out if there's either no animation_data or no action.

Refer to this question to learn about other approaches for animating things:

Python performance with Blender operators


Any word on custom closures, or new ones? In an attempt to re-create Valve's Half-Lambert effect in cycles, I found out it is basically mathematically impossible at the moment, without patching cycles.  Does anyone know/have heard/rumored/what-have-you anything about more closures, or even better, custom closures?

This is, in my eyes, not even theoretically possible to implement in Cycles. The backside of an object cannot be influenced by a light source on the front, simply because Cycles works with samples from the camera over the surface towards the lamp. There is no way that a sample bouncing off the surface on the back could directly end up in the light on the other side as there is an object in-between.

However, I don't think this shader is necessary in Cycles. It was built to allow even light setups with very few lights to not look over-contrasted and harsh. With real global illumination, which you have in Cycles, light bouncing off of other objects around your object will automatically (at least with more than 0 diffuse-bounces) provide a smooth light distribution around your object from a single light source, which is exactly the effect the Half-Life developers tried to fake.


Apply a Follow Path Animation to a Collection of Objects (using Blender 2.8) I understand how to make a single object follow a path animation, using Add Object Constraint, then Follow Path (and specifying a path). But I can't figure out how to make a Collection follow one. Is this supported? If it isn't, what would be the best approach to having a set of objects follow a path? I'm trying to make a truck (comprised of many separate objects) travel along a road specified by a bezier curve. I'm using Blender 2.8.

If your collection is essentially a group of objects that form an entity like a truck, then i would suggest to use an Empty and parent all the objects under the collection to it. With that empty you can then build the follow path animation.
Using the empty also allows to have the objects in the collection keep their location relative to each other, which can be helpful in case you want to animate parts of the truck along the path.
For this you would need to do the following:

Add an empty to your scene and position it to where you want the origin of your truck to be.
Select all objects of the collection by RMB on the collection and Select Objects.

Add the empty to the selection by holding Shift when you select it, making it the active object.
Press Ctrl+P to bring up the Set Parent To menu and choose the first option, Object.
You can then if the empty is not already in the same collection, drag it in there in the Outliner, which will result in all objects in that collection being put inside the empty. The empty, different then the collection though can be animated, as it has a location, rotation, scale and origin.

From here on you can proceed with your plans using the empty to affect the entire collection of objects representing your truck.
Instead of a constraint, you can also select both the empty and then the path to follow as active/last selected object.
Pressing Ctrl+P Set Parent To followed by the Follow Path option, which will be available if the active selection is a curve/path object.

Update: Instead of the mentioned Empty in the solution, a simple object can of course be used as well. It may be needed to hide or reduce the mesh to a minimum of 1 vertex, but the functionality the Empty was chosen for would be achieved as well. Based on the comment by grb2020, this seems to be a solution specifically of use for Apple developers due to restrictions with the export/conversion or lack of such for the Empty. Thus i'm gonna call it placeholder.
Happy Blending


Questions About Smoke? So I am brand spanking new at blender and just learning the ropes. I believe everything about my smoke is set up fine, but EVERYTHING in the scene is getting rendered (like the smoke domain before I messed with the nodes from seeing a similar problem). Could anyone give me a hand as I know basically nothing about rendering in blender?

Here is the .blend for anyone looking :)

For the smoke domain material, I believe that a Principled Volume would work, feed it into the volume input of the output node.  Change the density to 0.  Delete the default diffuse shader.

Or you can make the smoke domain invisible like this: How can I make an object invisible when I render in Cycles?


Is it possible to add multiple materials to a text object? I know that for a mesh you can go into edit mode and select vertices and assign a specific material to them quite easily. I want to know if it is possible to do this with a Text object (which has no vertices).

You can do this by going into edit mode and moving using the arrow keys and holding Shift to select which characters to assign to, all other steps are the same.


is there a way to add foam around an island? I'm trying to create a shader that creates a sea foam around an island, is there a way to make it with just the shader?, i'm using an ocean modifier for the sea, and I want to make a factor in the mix shader that mixes by considering the intersecting line between the sea mesh and the islands.

I achieved the following result.  Apologies for the "before" shot, it's the only thing I have:

I have this "gulf" scene where my beaches are just planes sticking into the "ocean".  That's a plane with a big Ocean modifier and a 20m Solidify modifier.

What I found was that in your ocean's node tree you can use an Ambient Occlusion node set to Inside and that appears to make it aware of intersections through the final mesh after all the modifiers are calculated.

I used various methods to add noise to this and used it as the factor of a Mix Shader for the surface material.


When i try to put textures, everything goes black i did everything that this tutorial says https://www.youtube.com/watch?v=JYBPXTful2g, im around 14:46 but when i open my image from photoshop, my Guko goes white( by pressing alt+z). anyone knows why?

That is your AO image that you made in the tutorial, and loading the image that you painted in the UV Image Editor doesn't automatically apply it to the mesh object - load it in the material texture slot so that it will be used in your mesh. Looks like the tutorial skipped that part.

Also, if your mesh turns black when trying to load the new texture, try adding lights (lamps) to your scene if you are in GLSL.


How to apply a complex mesh object (in a plane) over rounded/curved surface without distorting beyond recognition Sorry, if it has been asked before, however, I tried my best to search on the forum but was unable to find the right solution.

I am new to Blender and 3D art so please forgive me if I am short of the right tech word or the terminologies.

So, I have created an embossed Harley Davidson Badge mesh (in a ZY plane)and want to apply on the gas tank and I am literally struggling "How to" do it without distorting the badge details.

Blender File:
Please find the dropbox link in the comment as the system is not allowing me to share the file since I need 10 reputations to post more than 2 links.

Really appreciate your help.

Thank you!

Here I show how you can try using a curve deform:

you see three objects selected:

a curve, converted from a tank profile strip of edges
the original logo mesh (aside)
the logo mesh deformed by the curve


How do I auto normalize in grease pencil weight painting I'm trying to rig a character and I need to know how to auto normalize it while weight painting, does anyone know how I do this?

The checkbox is located under the brush settings.

Also look at the manual page:

  Auto Normalize

  Ensures that all deforming vertex groups add up to one while painting. When this option is turned off, then all weights of a vertex
  can have any value between 0.0 and 1.0. However, when Vertex Groups
  are used as Deform Groups for character animation then Blender always
  interprets the weight values relative to each other. That is, Blender
  always does a normalization over all deform bones. Hence in practice
  it is not necessary to maintain a strict normalization and further
  normalizing weights should not affect animation at all.

  This option works most intuitively when used to maintain normalization while painting on top of weights that are already
  normalized with some other tool.


How do I scale my reference images correctly within Blender and is there an easier way? I am trying to model this car and I got the blueprints and cropped each of the views and check that they were all within the scale of each other. I used these blueprints here

http://carblueprints.info/blueprints/porsche/porsche-911-gt3-2.gif

I didn't have to resize any of them just crop it so that each view is their own file and saved them in png format. So when I placed them in Blender they got resized and I don't know how to scale them within Blender.

This is what I'm getting so far.

The length of the car from the front is the same length as the car from the side view. I want to scale down the front view of the car but I do not know how. Also is there a way I can prevent blender from scaling so that when I import it, the images all stay in their respective sizes so I won't have to do any scaling in Blender.

You are using background images.
The way you scale a background image is by adjusting the Size value. It is located at the bottom of the background image settings in the properties region (N) in the 3D view.

However you may find it easier to use Image empties instead of the background images.
Question links:
How to set-up the perspective view based on a reference image?
Drag background images in 3D view?

cgCookie tutorial and an older cgCookie tutorial


Problem exporting blender model to substance painter, Marmoset and sketchfab When i export this model in as an .obj and import them into the other software the meshes get all mest up. I recalculated the normals and made sure is facing out but nothing fixes it. Also i used other models i had to test and they all work fine so i don't know why this model in specific is giving me problems.

Weird thing is when i flip the normals (they look darker) and import it into SP it looks fine. So i guess the reason i'm having the problem might be the normals but i don't know. also in sketchfab the model becomes transparent.

It seems it was the mesh itself, there were some vertices that weren't connected, making the mesh act like that when exported to other software. So went back took a good look and connected some vertices and cleaned the mesh, that fixed the problem.


How to optimize a mesh by merging objects and/or reducing faces I've got a highly-detailed mesh of curtains, similar to what you'd find on a stage. The mesh currently has eight objects/materials (1 material per object), but in reality it only needs two - the large middle curtain and the gathered curtains on each side. The two side curtains use the same texture, and the four objects comprising the middle curtain all use the same texture.

What I'd like to do is merge the two side curtains into a single object (each side is currently 2 separate objects), then merge the middle curtain objects into a single object. After several google searches, I've found how to join objects but they're still appearing as separate objects.

Is there a way to combine multiple objects into a single one?

Also, is there a way to reduce the overall number of vertices and/or faces? The entire mesh currently has around 700k faces, and so far decimate can only get it down to around 350k before the mesh starts deforming.

BTW: Losing UVs isn't a big deal for me. Since we're only talking eight materials here, I can easily remap everything if I have to. My primary concern is that the exported mesh is as simple/optimized as possible while still looking good.

EDIT: If it will help, here's a link to the 3DS file I started with: Curtain Mesh

LINK: Here's a link to my blend file.

I noticed that your file was made in 2.49. This is a very old version of blender, and I very highly recommend that you update to a new version if possible.

Using some rather aggressive decimate modifiers, I got it down to 75k while still looking fairly reasonable:

There are a few dark spots where there seems to be some weirdly positioned vertices messing with the normals, but these should be pretty easy to fix with a touch of the smooth brush or the simplify brush.

What I did:

Joined the two side curtains into one object.

To join objects, select them and press ⎈ CtrlJ. The selected objects will be joined to the active object (yellow outline):

Applied the scale by selecting the objects and pressing ⎈ CtrlA> Scale.

It's usually a good idea to apply object transforms as a rule of thumb.
The objects have a scale of .001. The object scale defines an offset which can be confusing and even cause precision problems in some cases.
Merged double vertices on each of the objects to close the small gap in the middle of the main curtain and the side curtains.

To remove doubles, enter edit mode (↹ Tab), select the part which should be operated on (selecting everything with A should be fine), and press W> Remove doubles:

I found that a threshold of about .003 worked pretty well in this case.
Added decimate modifiers to each object.

Note that you can copy modifiers between objects with ⎈ CtrlL> Modifiers.

Here is the resulting .blend. I've applied the modifiers, so it should open in 2.49 just fine.


Draw and update text in viewport without modal operator in blender At the moment, i draw ma text in viewport with this modal operator:

_handle = None

def modal(self, context, event):
    context.area.tag_redraw()
    if not context.window_manager.show_text.enabled:
        return {'CANCELLED'}
    return {'PASS_THROUGH'}

@staticmethod
def handle_add(self, context):
    VIEW3D_OT_ADH_display_text._handle = bpy.types.SpaceView3D.draw_handler_add(
           draw_text_callback,
           (self, context),
           'WINDOW', 'POST_PIXEL')

@staticmethod
def handle_remove(context):
    _handle = VIEW3D_OT_ADH_display_text._handle
    if _handle != None:
        bpy.types.SpaceView3D.draw_handler_remove(_handle, 'WINDOW')
    VIEW3D_OT_ADH_display_text._handle = None

def invoke(self, context, event):
    if context.window_manager.show_text.enabled == False:
        context.window_manager.show_text.enabled = True
        VIEW3D_OT_ADH_display_text.handle_add(self, context)

        return {'RUNNING_MODAL'}
    else:
        context.window_manager.show_text.enabled = False
        VIEW3D_OT_ADH_display_text.handle_remove(context)

        return {'CANCELLED'}

    return {'CANCELLED'}

Is it possible to draw my text without modal operator and update it with:

bpy.app.handlers.scene_update_post

when my mesh is updated please ?

You don't need the modal operator to draw things to the viewport. Calling bpy.types.SpaceView3D.draw_handler_add is all you need. Instead of (self, context) you could pass an arbitray object and alter its attributes to modify the drawing. I.e.

class foo:
    def __init__(self, prop):
        self.prop = prop

def draw_text_callback(data):
    #...
    blf.draw(data.prop)

data = foo("Test")

handle = bpy.types.SpaceView3D.draw_handler_add(
           draw_text_callback,
           (data,),
           'WINDOW', 'POST_PIXEL')


inconsistent AttributeError when modifying frame_current I am using this script to render animations because of this issue. It was doing it's job in older blender but now it works well only until I switch viewport shade to rendered. Then after few frames saved I get:

  AttributeError: Writing to ID classes in this context is not allowed: Scene, Scene datablock, error setting Scene.frame_current

Btw I would like also to ask is there a way to capture viewport content or rendered border only?

render_time = 3
import bpy, os, time, threading
bpy.context.scene.frame_current=bpy.context.scene.frame_start
class ScriptThread (threading.Thread):
    def init(self, threadID, name):
        threading.Thread.init(self)
        self.threadID = threadID
        self.name = name
    def run(self):
        is_running = True
        tick = time.time()
        while is_running is True:
            if time.time() >= tick+render_time:
                tick = time.time()
                time.sleep(render_time)
                if bpy.context.scene.frame_current >= bpy.context.scene.frame_end:
                    is_running = False
                else:
                    os.system('mkdir render')
                    path='render/'+str(bpy.context.scene.frame_current)+'.jpg'
                    os.system('import -window root '+path)                      # linux
                    os.system('nircmd.exe savescreenshot '+path)                # win
                    bpy.context.scene.frame_current+=1
            else:
                continue

thread = ScriptThread(1, "thread")
thread.start()

Here is an approach using the modal timer operator template.  The modal timer will wait 30 seconds, take screenshot bpy.ops.screen.screenshot() (increment frame).  Stop it with Esc or with a right click.  Change to suit.

import bpy

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

    _timer = None
    # make delay a scene property can be changed in UI
    delay = 30 # wait 30 between screenshots
    count = 0
    frame = 1

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

        if event.type == 'TIMER':
            if self.count == 0:
                scene.frame_set(self.frame)
                self.frame += 1
                self.count = 1
            elif self.count < self.delay:
                self.count += 1
            else:
                self.count = 0
                print("rendering /tmp/%04d.png" % scene.frame_current)
                bpy.ops.screen.screenshot(filepath="/tmp/%04d.png" % scene.frame_current)
        return {'PASS_THROUGH'}

    def execute(self, context):
        scene = context.scene
        self.frame = scene.frame_current
        # for all in range
        #scene.frame_set(scene.frame_start)
        wm = context.window_manager
        # make the timer tick every second
        self._timer = wm.event_timer_add(1, context.window)
        wm.modal_handler_add(self)
        return {'RUNNING_MODAL'}

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

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

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

if __name__ == "__main__":
    register()

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

Pretty much emulating bpy.ops.screen.screencast(...).


Anyway To Material Paint This Complex Geometry? So what I want to do is material paint this middle part for a diffrent look, but the geometry is very complex, and I want to make it circular, and able to change in keyframes, so that way I can animate it.

Edit: I realized that I could just use a spot light and it works pretty well, so that is settled.

It looks like you're doing this in edit mode. In which case, this script (it's not free though) might be what you're looking for- it's the only one like it I've seen: https://blendermarket.com/products/accent-pro-edit-mode-layers

Otherwise, you can edit it without if you very carefully select faces you want to apply a material or paint, invert the selection, and use "H" to hide the selection you don't want to paint.

As far as key-framing the textures to change, unless someone answers it first, I'll look into that...

You'll have to be more specific about what you mean when you say you want it to be circular and change materials. Do you want to animate the mesh or the textures on the mesh?


How to render a matte with Eevee? How can I render a matte (white on black or white on transparent) using Eevee ?

What I ask is a type of render that would render faster than a regular one.
I just need the "shapes", not the materials / reflections / colors.

If it exists, I would like to be able to "switch" to the matte render without having to change every material.

Currently, what I do is that I disable all the lamps and objects I don't need, set the world to black color, and set film > alpha > transparent in the render panel.
It works but I guess that there might be a better solution.

Possible ?

Thanks !

If you've already set the World to 'Transparent' then you shouldn't need to disable the lamps or set the world to black - just use the Alpha channel of the output as your matte - it will be 1.0 wherever it hits an object and will be 0.0 wherever it does not. In Eevee, transparent objects will produce alpha of 1.0 (as transparency is only simulated in Eevee).

For a faster render you could switch off unnecessary features (that don't affect the Alpha render) such as Screen Space Reflections, etc.


mask not showing completely when rendering I have created and animated a mask to add to a video clip in the compositor.
This is frame 147, looks as expected. The cropped image on the foreground and the window on the background.

The problem is in the next frame (148). It look like this

As you can see, it shows only a part of the window.
So, there is 179 frames in the video but one frame has a problem with the mask. It doesn't render completely.
I have deleted all the other masks in case is there a hidden duplicate but still no solution.
Please somebody help me to fix this. Thanks in advance.

I found a temporary solution but if somebody knows how to fix it definitely would be awesome.
I copied the splines of the frame 147, created a new mask and paste to render frame 148 and it works.
Once the mask is created go on the node compositer and change the name of the previos mask for the new one. As it is copied for the previous frame you may need to do minimal position changes.

It doesn't work by just changing the mask. It is necesary to unplug the mask node, change the name of the mask and then plug it again.

Save the rendered image as a PNG file, separated from the rest and add it later to the image sequence to create the video clip.


I'm getting these weird spots on my Mechanical arm? I'm getting these weird spots on the fingers of my mechanical arm and I'm not sure why. Does anyone have any experience with this???

I do have an image texture for the scrapes, but I have no idea why these weird dots are showing up with it. I tried disconnecting the normal and roughness map, but that didn't seem to help. Here are my nodes:

And here is a LINK for a copy of the Blender file with the texture.

Those spots are due to the voronoi that is feeding your leftmost principled's roughness.  You're getting random-ish circles from that texture that your color ramp is then quantizing into 0 or 1.  If you don't want it to look like that, don't do that to its roughness.  (The normal of the leftmost principled is also a function of that voronoi, so you probably want to change that as well, but it's subtle, whereas your roughness is anything but.)
While it's not responsible for the problems shown, what you're doing with the normal input on your rightmost principled also doesn't make any sense.  A "normal" output is a (world space) vector-- 3 components.  Do not feed it into a math node or a colorramp or anything else that expects single component values.  And you shouldn't output the color from a normal map directly into a normal input, or use a bump node without any height input, or use a bump node with a distance of 23.5 when your entire mesh is about 4 units tall.


Armature bends object but makes one side bump out I added armature to a TV model and everything was fine, but now when I bend its foot, the side of the TV bumps out.

Any idea what this could be?

Very new to Blender, but have been searching videos and posts, but no answer found yet.

Much appreciated.

Views with and without the armature. Circled part is the issue, the arrow pointing to the foot is just to show it's in a pose.

It looks like a Weight Paint issue. Sometimes weights can be applied accidentally and even a .01 influence will affect the mesh. There are two ways to check for that.

A) In Edit mode, scroll down the Properties panel on the 3D window (right panel, press N if hidden). Click on the vertices where the bump is and you will see a section called Vertex Weights". There you can see what bones are affecting the selected vertex. Press X to remove unwanted influences and fix the remaining weights.

B) In Weight Paint mode, go to the Options tab, find "Show Zero Weights" and press the Active button. The blue mesh now turns black and you are able to see if bones have an influence of less than .1. Use the Subtract brush to paint them out and then go to Tools>Weight Tools>Clean


Playback skips and plays frames slowly with new audio? I have a video in 1080p and inserted audio. When I play this back, the video preview window is lagging and skipping frames. The audio however sounds normal. This problem does not happen when I only play the initial audio.

My computer has not had this problem when I previously replaced the audio in Blender and I tried restarting my computer with the same problems.

Make sure that you have enabled AV Sync in the timeline window (different from VSE window)

This will tell Blender to skip video frames in order to play at the project frame rate.


How can I add/subtract/multiply/divide properties in the Game Engine? I am creating a Random Math Engine using the BGE and I am wondering how I can do mathematical operations between two properties. Example: "Property 1 + Property 2" and then it would output the answer in text when you hit "A". But I don't know how to add/subtract/multiply/divide properties together.

Adding, Subtracting, Multiplying, or Dividing properties can be done very easily - you simply need a third property, which you can assign the result to.

You can use logic like this to perform mathematical operations on any type of object. If you want to display the result as a text object, the easiest way is like this:

In this case, the result is stored as a "Text Game Property" - This is a special type of property for text objects, which will display the value as text in game.


Change face instance orientation I'm trying to use the face instancing workflow, but I would like to rotate the instance orientation for some of the instancer faces.
Using Alt+N (flip) will rotate the instance orientation 90 degrees, but I'd like to be able to rotate the instances on this face 180 degrees in this instance.
Is there a way to explicitly set or edit face instance orientation?
Thank you!

As far as I understand the manual, when a face is created, its vertices are indexed on a per-face basis (not the same as the vertex indices for the whole mesh).
Contrarily to the mesh-wide vertex indices, These are not accessible or modifiable.
In other words, your only solution is to rotate each face by whatever multiple of 90° and then use the modeling tools to get back the original shape and ratio of the face.
Or, as suggested in the manual, restart your modeling and use face duplication instead of edge extrusion or some other operator in order to get more predictable results, and display the instances while modeling so you don't get surprised later.


My skinned model gets smaller and deform badly, when I rotate its bone in Z-axis I made a model and skinned it to an armature. But when I try to deform it with a bone rotation, model doesn't just rotate, also it gets smaller.

First I thought that its because of the armature, but when I put another model, this problem doesn't occur.

Here's the .blend file: http://pasteall.org/blend/26762

Try to rotate bone "joint5" in Z-axis.

Before rotation

1 http://imgim.com/2755incix2686812.jpg

After rotation

2 http://imgim.com/8460incih5544599.jpg

You haven't weight painted your model

From the Wiki
Weight Paint in a nutshell

Weight Painted Vertex Group

  You enter Weight Paint mode from the Mode Menu Ctrl-Tab). The selected Mesh Object is displayed
  slightly shaded with a rainbow color spectrum.
  The color visualizes the weights associated to each vertex in the active Vertex Group. Blue means unweighted; Red means fully weighted.


I can't see my background image in the 3D view I try to set up an image as background for a basic blender tutorial,
but it isn't visible.

This is the image I try to have as background:

#Background images will only be displayed in:

Camera Prespective view (Numpad 0)

Any of the preset Orthographic views:

Front/Back (Numpad 1 or Crl Numpad 1)

Right /Left (Numpad 3 or Crl Numpad 3)

Top/Bottom (Numpad 7 or Crl Numpad 7)

You're in perspective mode instead of orthographic mode  (see the upper left hand corner, it has the abbreviation "persp"). Toggle into orthographic view by pressing numpad 5.
Also, the view information at the top left shows you are in right view, and the background image settings at bottom right show that the image is set to appear only in left view. For that, hit CTRLnumpad 3 to go to left view or change the background image axis to Right to make the background image appear in right view.
The image used must be in a format that Blender supports. For example, a .gif file will not be displayed.


Fluid domain stretched to boundary after baked This is actually a duplicate of this SO question, but since my problem is still not solved I thought this is the correct way to find a solution for my problem:

I have a fluid domain (cube) and a fluid object (uv sphere) inside it (guess that is the standard). Without having changed anything big my fluid object or rather just the fluid is being stretched to one side of the domain boundary. Take a look at the picture:

In the other post the accepted answer is"The normals of the inflow object are inverted. Flip or recalculate them."
which I tried but that did not help. Unfortunately I am a super beginner and after hours of trying don't know how I could solve this myself. Thanks.

Here is the .blend file.

Your inflow sphere has a negative scale.

Use Ctrl+A to apply the scale,

The scale is applied but we can see the normals have changed (reversed because of the negative scaling).

To fix them, enter edit mode with Tab, select all with A and Ctrl+N

Now you can bake your bath :


2.8 how to move 3d curser like a normal object? i really like that for moving a object i just press G and then x to snap the movement to the X axisis. i use this feature all the time and would like to be able to simply move the 3d curser along an axisis. drag and drop and by numbers would both be great.

i want to be able to quickly but precisely set the pivot point like that.
the closet i can come to this is create a single dot ... move it where i want it and set 3d curser to selection. is there any better way?

You could use the cursor tool on your toolbar, drag it and then press x,y or z to move it along an axis.


Animation Nodes Rotation Swing/Ticker I am no programmer by any means but have managed to get a bunch of gears to run on AN(Animation Nodes) and I would like to add a ticker with a swing as per the GIFF attached.
Any direction would be greatly appreciated.
I thought of using a some math nodes that would rotate the object once the input object gets to a certain rotation.

For a simple setup you can do something like this:


Materials not rendering properly I'm a noob, so I'm probably messing this up somehow, but can anyone tell me why the materials preview looks nothing like the render? Below, I have two screenshots to illustrate this (the better looking one is the material preview). Using Cycles fixes it, but I'm curious as to why it's not working properly in eevee. Thanks for any help!

The material preview uses a built in HDRI to provide lighting and reflection information. You can add your own in the shading tab under "World" (highlighted below), by adding it as an Environment Texture. You can use any HDRI you want, but the ones that come built in with blender are in the blender folder at ../2.83/datafiles/studiolights/world.

If you want the reflections and lighting without the visible background, there are a few ways to accomplish this. The method I prefer is to connect the texture to two separate Background Nodes, and then combine them through a Mix Shader, using the "Is Camera Ray" output of a Light Path node as a mix factor. Doing it this way allows you to control the brightness/strength of the both the lighting and the background image independently (I set the background image to 0 in my example).


Collapsing Verts without creating triangles enter image description hereI have modeled this fork and have no idea how to finish this end.
I would love to have the curvature just continue without ending where all the verts are.
If I collapse the verts, I create lots of triangles and this causes further problems especially with modifiers.
Maybe somebody has an idea.
Thanks!

enter image description here

You could simply add some perpendicular edges.
That will keep the geometry even along the whole edge.


Run blender Still rendering from command line with external Python script first of all, thanks for the help you have provided me indirectly through this forum.

I am trying to generate still pictures using blender. I have the python script and the model which are both functioning well but i would like to take the script out of the blender file to be able to generate it with an external macro.

I can currently generate the picture by running the python script from the GUI. I am also able to generate the picture from the command line if I call the script saved within the blender file (Internal_Script.py is inside the blender file).:
"C:\Program Files\Blender Foundation\Blender\blender.exe" --background model.blend --python Internal_Script.py  -f 1

however, if I take the content of this script and copy it in a file alongside the blend file, it doesn't work any more (External_Script.py is a separate file now).
"C:\Program Files\Blender Foundation\Blender\blender.exe" --background model.blend --python External_Script.py  -f 1

the python script is definitely being read as i get an error if I misspell the filename.

Error: Cannot render, no camera

This is quite strange as there is definitely a camera and the script works just fine if it's saved in the blender file.

Would you have any idea about what's going on?

Check that bpy.context.scene.camera is set to your newly added camera. That property determines which camera is used for rendering, and if it's still None it won't work.


Face behavior not equal after loop cut I've been using blender for a while now - mainly just messing around. So all things being equal - this is a beginners question. (I tried searching, but only found the standard loop cut and slide questions)

If you take the default cube, and use loop-cuts to split it @ 50% (so all your faces are slit into 4 equal ones). Then if you grab a vertex in the middle of those 4 faces and move it perpendicular to the face (creating a pointed face) - why do some of the adjoining faces come out different than the others?

Either one of the two is OK with me, but i dislike that all equal faces do not have the same behavior.

Maybe someone can shed some light on this for me?

This is because you have created non-planar faces.

A non-planar face is a face with vertices which are not aligned in a plane in any direction.

Under the hood everything is represented in triangles (at least for drawing purposes), so blender must decide how to cut the quads. It can cut them two different ways:

Which way is used appears to be decided more or less at random.

To avoid this undefined behavior, you can split non-planar faces manually to match what you want (J works well for this). You can also press 3D view > Header > Clean up > Split non-planar faces to automatically split all non-planar faces automatically:


Why are my objects in all layers? I have the same objects in all 20 layers.
If I delete one of them, the objects in all twenty layers are deleted, not the single one.

I would like the have my object in the first layer only.
Any solutions?

Try selecting the object and pressing M to move between layers. If all the layers are selected in the dialog which subsequently appears, press 1 (or click on the first layer in the dialog with  LMB) to move the object to just that layer.


Create a grid with specific indices I need a Mesh (640x480) with vertex-indices for 0 to 639 in the first row, 640 to 1279 in the second row, and so on.... I will try to show what I mean in the picture:

First, I tried to use a Plane and subdivide it, but by doing that it destroy any useful indices of the Vertices. In my second attempt I use:

bpy.ops.mesh.primitive_grid_add(radius=1, view_align=False, enter_editmode=False, location=(0, -0, layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))

to create a Grid with bpy. It creates a 10x10 Mesh (9 faces a row), with indices like I need. Now it just have to be bigger. Does someone know a command to create a Grid like I need with the 640x480 vertices?

You can just add the x and y subdivisions argument:

bpy.ops.mesh.primitive_grid_add(x_subdivisions=640, y_subdivisions=480, radius=1, view_align=False, enter_editmode=False, location=(0, 0, 0), layers=(True, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False, False))


Hotkey for selecting transform manipulator type Is there a hotkey or shortcut to change the type of the active transform manipulator?

This site lists

CtrlAltG for translate
CtrlAltR for rotation
CtrlAltS for scale

none of which work for me. Are these the correct current shortcuts?

First what you linked to is for blender version 2.37 not 2.73, so the shortcuts are wrong.

To add a shortcut to switch the manipulator type; open up the user preferences.
Under the Input tab add a new shortcut under 3D View > 3D View (Global). Type view3d.enable_manipulator in to the identifier field, then just check one of the grayed out boxes for Translate, Scale, and Rotate. The only hard part will be finding 3 unused shortcuts to use for the new transform manipulator shortcuts.

Other transform manipulator shortcuts:
Ctrlspace is the default shortcut to toggle on and of the transform manipulator.
Altspace open a menu to change the orientation type.
When using the buttons in the 3D view header, holding Shift allows for more then one  manipulator type to be active at a time.


understanding uv maps, materials and textures I have made a very basic room. I am trying to make game assets for using in Unity.

In the past Ive made some uv maps but I remember struggling, and this is actually more of a complex shape that I had before.

For now I just want to assign a texture to the wall (I'm happy assigning the texture in Unity if thats easier, I dont need to render anything in Blender)

I've drawn a 'Seam' around one wall. Also, earlier than that I have selected every face on the wall and assigned a second material to it.

(Note: I already imported it to Unity and the two materials appear there, but when I assign a texture as the material it just comes out as a solid colour.)

Is it correct that I can mark a square seam as pictured, and then assign a texture to it? And if so how do I do this, is there any simple tutorials just showing this? Thanks

You have to add a texture to the material in the texture tab next to materials. Then select the mesh you want textured and bring up UV/Image Editor. To select the texture in UV/Image Editor you have to click the little picture button to bring up the drop down menu and then select the texture from there, while in edit mode, while the mesh you want textured is selected (not the object).

It's a little weird at first.


Set vertex normal in a stable manner with python I wanted to set normals from a script, using this code (in a class method):

for face in modelMesh.polygons:
    face.use_smooth = True  # normals have effect only if smooth shading
for i in range(len(self.vertices)):  # set normals here because they seem to be lost in some calulations
    if self.normals[i] is not None:
        modelMesh.vertices[i].normal = Vector(self.normals[i])
for loop in modelMesh.loops:
    loop.normal = Vector(self.normals[loop.vertex_index])

however, if this sets the normals to the mesh's vertices, they are reset after using 'modelMesh.update()' or switching edit mode on and off
(and btw it seems that the loop normals stay 'Vector((0,0,0))' whatever I try, even '.normal[:] = Vector((1,0,0))' and '.normal[:] = (1,0,0)')

is there a way so set vertex normals permanently using python?
thanks in advance

I found it by observing two mesh importing add-ons, but I didn't understand how exactly it worked.

What I know is that it can only affect loop normals, not face nor vertex normals (so that won't help you if you have faces with "front" and "back" part swapped)

mesh.create_normals_split()

for face in mesh.polygons:
    face.use_smooth = True  # loop normals have effect only if smooth shading ?

# <set normals (mesh.loops[ ? ].normal= ? )>

# create custom data to write normals correctly?
mesh.validate(clean_customdata=False)  # important to not remove loop normals here!
mesh.update()

clnors = array.array('f', [0.0] * (len(mesh.loops) * 3))
mesh.loops.foreach_get("normal", clnors)

mesh.polygons.foreach_set("use_smooth", [True] * len(mesh.polygons))

mesh.normals_split_custom_set(tuple(zip(*(iter(clnors),) * 3)))
mesh.use_auto_smooth = True
mesh.show_edge_sharp = True  # optionnal


Simulating an egg on a conveyor belt getting smashed I have a short animation of an egg shape (solid w/o liquid) and the egg is on a conveyor belt (follows directional movement of belt via driver) then was supposed to have the egg get smashed by a large fist.

I've successfully gotten the egg to follow the track but I can't figure out how to use something like cell fracture without being able to follow the track and stay in one piece.

I wanted the egg shape to be able to collide and fall apart with the fist.
Fist and belt are both passive.

Here's a link to what I have so far for the blend file.

Any help would be greatly appreciated, thanks.

I have solved this with the help of the Fracture Modifier Build of blender.
You can find more info and download it here:

http://graphicall.org/1148

I also included the steps in a text file inside the modified blend. Open this blend only in the Fracture Modifier Build or you may experience crashes and data loss in the blend.

Steps to reproduce:

delete the cell fracture objects
put fracture modifier on original egg, 250 shards, execute fracture
egg becomes convexhull, active, animated, triggered
fist becomes convexhull, active, animated, trigger
belt becomes passive animated, mesh, final, deforming (so it can
move the egg shards too)
scene / rigidbodyworld: enable split impulse (less velocity on shards on
on fist impact, basically) and steps per second to 600 (so shards dont fall
so much thru the belt)
optionally: in FM enable Fracture Utilties -> Fix Normals and refracture
with Execute fracture, set Autohide distance to 0.001 and automerge distance
to 0.1 and enable perform merge, to hide the cracks in the smoothed egg
shell
optionally: add edgesplit and subsurf for a nicer looking egg surface


How to make weight paint mode use x-ray selecting Basically I want to make all weight painting for a single bone gone on a certain part of the mesh, because moving the arm makes the head mode slightly. I wanted to remove ALL of the paint, so I was wondering if I can do something similar to in edit mode where you go into wire frame mode and box select?

Yes, you can do that in weight paint mode:

Select the bone
Activate 'vertex selection masking' (or face selection masking with the button next to the left)
Now you can select vertices like in edit mode, using A or box selection or circle selection
Also you can use (if you need) Z to select behind/non visible parts (like toggling mesh/solid in edit mode, or like enabling/disabling 'limit selection to visible')


Box Select Tool does not disappear Not sure if this is a bug or feature.

I was using the box select tool to join a couple of objects together. Suddenly a box froze and did not select anything, I could keep using that tool but that box would not disappear.

How can I get rid of thar box? Reloading the file, or even closing blender and running it again does not make it go away! Thanks for the time.

The red box is your render border (what you want to render) This helps reduce render time if you just want to see what part of your scene will look like. Instead of rendering the entire scene everytime.

To get rid of it: press Ctrl+Alt+B.

More info can be found here: Render just part of a final image from Cycles?