Using scenes and render layers to composite an object isolated on white background with shadow I composite 3 individually rendered and saved files to achieve the look of an object isolated on white with a proper shadow:

image file of object floating with alpha background
image file of a render of the empty background plane
image file of the background plane containing the object with the object's camera visibility unchecked (so it's an empty plane that also has the object's shadow)

I use the compositor to divide the shadowed plane by the empty plane to get a white image containing only the shadow, then alpha over the object with the transparent background

This is not ideal, because I'd rather not have to open a new blend file just to do a simple divide and alpha over. I would prefer to build this functionality into the original blend file using scenes and render layers. Yet every time I try this, as described in the wiki here, I misunderstand and configure my multiple scenes/render settings improperly.

How do I setup my scenes and render layers properly to achieve the above image without having to save separate files?

Cycles

Here is an example file for you to inspect.

The wiki page for Renderlayers in cycles:

  Render layers are used to render different objects in the scene into different images. This way they can, for example, be color corrected
  or otherwise manipulated separately and then recomposed in compositing
  later.

  Which objects contribute to which render layers are defined by these
  layer settings:

  Scene Layers: only objects on these layers will contribute to the image.
  Camera Layers: objects on these layers are directly visible to the camera. When an object is in the scene layers but not camera layers,
  it will still cast shadows or be visible in reflections, so it's still
  indirectly visible. This is equivalent to disabling the Camera in the
  Ray Visibility panel for the object. The way this works may be
  somewhat confusing at first, but it's designed such that render layers
  can be recomposed to give the full render, without any missing shadows
  or reflections.
  Mask Layers: objects on these will mask out other objects appearing behind them. This is equivalent to assigning a Holdout
  shader for camera rays to the objects on such layers.
  Exclude Layers: scene layers are shared between all render layers; however sometimes it's useful to leave out some object influence for a
  particular render layer. That's what this option allows you to do.

The object is on Scene layer 2, the lights are on Scenelayer 3, and the background is on Scene layer 4.

Transparent is enabled in Properties > Film:

And RGBA is enabled in Output:

The settings for each Renderlayer:

For the Renderlayer to result in only the object, we need to include the lights and the object layers, and disable the background layer (we don't want to exclude entirely, because we want the bounce lighting on the bottom of the object):

For the Background, the lights and background layers are enabled, and we exclude the object layer entirely, as we do not want shadows:

This one is the same as BG, except we don't exclude the object layer, so shadows cast by our object will be visible:

Compositing

Replace the image inputs in your setup with the appropriate Renderlayers:

Result:


How to animate particle size (Newtonian Physics) I'm making an animation of water droplets disappearing/drying up. I figured the best way to do this was to create a simple particle system and then animate the size so that towards the end of the animation, the particles "disappear".

I've created a keyframe on the first frame, but when I go to create the second keyframe, it will not allow me to change the value...it snaps back to the original value of .04.

Any help would be greatly appreciated.

If you go to the Physics>size tab under Newtonian, and either hover your mouse over the input box, and press  RMB>insert keyframe, or just press  I while hovering over the input box after setting the particles to the size you need for your scene. Do the same thing to set the scaling down at your later frame. In my example, it is 30 frames using a sphere as a dupli object.


Automatic weights not working ( bone heat weighting failed on 1 or more bones) I am editing a sonic model that I'm working on for importing it to VR chat. Is there a way I can fix this? I even tried decreasing the polycount of this model.

Welcome to Blender Stack Exchange! You've come to the right place.

Blender's automatic weighting system has some known limitations. That's not to say it's bad, it just has a few things that you have to keep in mind. The main thing that it struggles with is overlapping/intersecting geometry. In your model, there are a lot of small intersecting components. This isn't bad, it will just take a few more steps.

Blender can easily separate one object into a few, parent those, then merge them back into one object. That is what I would suggest here.

I did some quick testing on your model, using L to select sections then P to separate them. I started with the main body sections (torso, head, hands, feet, etc.) and separated them into a new object. That parented just fine, so the issue isn't there. I kept going, removing a few meshes at a time, typically in the same area (ex. wrist, scarf, mouth) until I found a group that failed. It appears to be that the 3 upper band on each leg cause issues, as do the straps on his feet. It is possible that other areas cause issues, and my selection order avoided them.

I would suggest doing exactly what I did. Select a few parts at a time, separate them, parent them, then join them again once they've been separated. If the separated objects still fail, separate them further. In the case of the leg bands, separating the middle band worked fine. Just keep going until it works. It doesn't appear that any mesh sections themselves have any issues. If they do (as in you cannot separate them any further without breaking individual parts), scale up the rig and the part by the same factor, say 10, then try parenting again. The automatic weighting system also has issues with vertices that are close together. Once it works, scale it back down by the same amount (up by 10 would be down by .1 for example) and it should be fine.


Creating Inky-looking characters in Blender I'm involved in a project to do with ink animation and experimentation. I found this incredible piece of animation:

Chinese Ink Style Animation

I originally thought this was some sort of After Effects compositing (is it even possible in AE?!), but found out that this particular animation was created in 3DS Max with Krakatoa and FumeFX. I'm just wonder if a similar effect is doable with Blender's smoke simulator.

There are various YouTube videos that have pretty decent results of ink renders from Blender, but I can't seem to find anything of a similar sort of movement animation. Just blobs floating around!
The closest thing I found was this animation of a

Rigged Character Using Blender Smoke Sim

but again I can't seem to replicate this. The smoke just doesn't seem to follow my character's animation.
Any help with this would be greatly appreciated.
Thanks.

If I understand correctly, your question is essentially asking how to emit smoke from a rigged and animated character.
This should work just fine, as long as the smoke modifier is after the armature modifier on the character mesh:

Example (click for a smoother video):

I found using the mesh directly as the smoke emitter provided a smoother, less lumpy result without requiring huge numbers of particles.
Smoke settings
All these settings are just stylizations on my part, they are not supposed to look like real ink in water :P
I used a fairly high resolution domain with only 1 high resolution subdivision, dissolve (though perhaps I made it dissolve a little on the fast side), and low vorticity:

For the emitter I used subframes and enabled initial velocity so that the smoke inherits the velocity of the part of the mesh it's emitted from (in the example render the smoke is actually "flung" by the mesh twice as fast as it technically should be, but I rather liked the effect). I also used a negative temperature difference so that the smoke drifts down over time, however I think I might have over done it a bit (the smoke falls a little fast for my taste).


Blender 2.91.2: Rendering looks pixelated in Blender's image view (rendering is not pixelated!) The rendered image, in Blender, looks very pixelated.
But, when I save the image and open it paint.net, the image is as clear as it gets.
You can see that in the following images. Best image is the third one. All images are at the same zoom level as in Blender (1:1).
Any ideas, hints and "duh"s are appreciated.
This is in Blender:

Same image stored and opened in paint.net:

Side by side:

Left image, sharp as it gets viewed in paint.net. Right: Pixelated image in Blender image view.

After a day, the problem went away. Maybe a reboot was required?! Anyways, the problem is gone and I don't know what it was.


Can particle object instances act as obstacles in a fluid simulation? I'm trying to use a particle emitter in a fluid simulation, where the particles (based on an object instance I've linked the emitter to) cause splashes each time they hit the fluid they hit.
I've tried making both the particle emitter an obstacle in the fluid simulation and also the object instance the particles are based on (and that object is within the domain of the fluid simulation) but after I bake the fluid sim, I don't see the particles interacting with the fluid at all. Any ideas on how to make the particles cause splashes in the fluid? (BTW my original object that the particles are based on will interact as expected with the fluid if I deliberately crash it into the fluid). I imagine I'm doing something dumb, I just can't see what...
Any advice gratefully received!

That will not work with the current release, since the (now old) fluid simulation in Blender is not designed to interact with non-fluid physics systems. I haven't checked, but maybe this will work with the new Mantaflow simulation that was added to the master branch recently. This will be in the next official Blender release.


Why do my particles disappear when changing their physics to 'None'? I've got a problem with particles: Particles flying around

When I change the physics settings to 'none', particles immediately disappear:

When the physics are set to 'Newtonian' particles are flying around the icing instead of laying on it.

What's wrong?

Okay, so I fixed it by myself, just by deleting previous object 'sphere' and creating new one. Here are the settings which work good:

So I don't know why it wasn't working with previous object, but the solution is to replace it with a new one :)


How can I get the x,y location of an object at each frame of animation? How do I get the X/Y locations and the height/width of an object (in pixels) for every frame of animation and is it possible to export it to a text file?

I did find something similar to this but didn't work properly when the object was not in the center of the frame.

This is code that I found that almost works:
from https://blender.stackexchange.com/a/7203/15543

import bpy
from mathutils import Vector

class Box:

    dim_x = 1
    dim_y = 1

    def __init__(self, min_x, min_y, max_x, max_y, dim_x=dim_x, dim_y=dim_y):
        self.min_x = min_x
        self.min_y = min_y
        self.max_x = max_x
        self.max_y = max_y
        self.dim_x = dim_x
        self.dim_y = dim_y

    @property
    def x(self):
        return round(self.min_x * self.dim_x)

    @property
    def y(self):
        return round(self.dim_y - self.max_y * self.dim_y)

    @property
    def width(self):
        return round((self.max_x - self.min_x) * self.dim_x)

    @property
    def height(self):
        return round((self.max_y - self.min_y) * self.dim_y)

    def __str__(self):
        return "<Box, x=%i, y=%i, width=%i, height=%i>" % \
               (self.x, self.y, self.width, self.height)

    def to_tuple(self):
        if self.width == 0 or self.height == 0:
            return (0, 0, 0, 0)
        return (self.x, self.y, self.width, self.height)

def camera_view_bounds_2d(scene, cam_ob, me_ob):
    """
    Returns camera space bounding box of mesh object.

    Negative 'z' value means the point is behind the camera.

    Takes shift-x/y, lens angle and sensor size into account
    as well as perspective/ortho projections.

    :arg scene: Scene to use for frame size.
    :type scene: :class:`bpy.types.Scene`
    :arg obj: Camera object.
    :type obj: :class:`bpy.types.Object`
    :arg me: Untransformed Mesh.
    :type me: :class:`bpy.types.Mesh´
    :return: a Box object (call its to_tuple() method to get x, y, width and height)
    :rtype: :class:`Box`
    """

    mat = cam_ob.matrix_world.normalized().inverted()
    me = me_ob.to_mesh(scene, True, 'PREVIEW')
    me.transform(me_ob.matrix_world)
    me.transform(mat)

    camera = cam_ob.data
    frame = [-v for v in camera.view_frame(scene=scene)[:3]]
    camera_persp = camera.type != 'ORTHO'

    lx = []
    ly = []

    for v in me.vertices:
        co_local = v.co
        z = -co_local.z

        if camera_persp:
            if z == 0.0:
                lx.append(0.5)
                ly.append(0.5)
            # Does it make any sense to drop these?
            #if z <= 0.0:
            #    continue
            else:
                frame = [(v / (v.z / z)) for v in frame]

        min_x, max_x = frame[1].x, frame[2].x
        min_y, max_y = frame[0].y, frame[1].y

        x = (co_local.x - min_x) / (max_x - min_x)
        y = (co_local.y - min_y) / (max_y - min_y)

        lx.append(x)
        ly.append(y)

    min_x = clamp(min(lx), 0.0, 1.0)
    max_x = clamp(max(lx), 0.0, 1.0)
    min_y = clamp(min(ly), 0.0, 1.0)
    max_y = clamp(max(ly), 0.0, 1.0)

    bpy.data.meshes.remove(me)

    r = scene.render
    fac = r.resolution_percentage * 0.01
    dim_x = r.resolution_x * fac
    dim_y = r.resolution_y * fac

    return Box(min_x, min_y, max_x, max_y, dim_x, dim_y)

def clamp(x, minimum, maximum):
    return max(minimum, min(x, maximum))

def write_bounds_2d(filepath, scene, cam_ob, me_ob, frame_start, frame_end):

    with open(filepath, "w") as file:
        for frame in range(frame_start, frame_end + 1):
            bpy.context.scene.frame_set(frame)
            file.write("%i %i %i %i\n" % camera_view_bounds_2d(scene, cam_ob, me_ob).to_tuple())

def main(context):

    filepath = r"D:\temp\bounds_2d.txt"

    scene = context.scene
    cam_ob = scene.camera
    me_ob = context.object

    frame_current = scene.frame_current
    frame_start = scene.frame_start
    frame_end = scene.frame_end

    write_bounds_2d(filepath, scene, cam_ob, me_ob, frame_start, frame_end)

    scene.frame_set(frame_current)

main(bpy.context)

Here is the code from https://blender.stackexchange.com/a/14746/15543 slightly modified to make the region and region_3d global and put the area into camera view.

import bpy

from bpy_extras.view3d_utils import location_3d_to_region_2d

def view3d_find():
    # returns first 3d view, normally we get from context
    for area in bpy.context.window.screen.areas:
        if area.type == 'VIEW_3D':
            v3d = area.spaces[0]
            rv3d = v3d.region_3d
            for region in area.regions:
                if region.type == 'WINDOW':
                    return region, rv3d
    return None, None

region, rv3d = view3d_find()
# put the region into camera perspective
rv3d.view_perspective = 'CAMERA'

def view3d_camera_border(scene):
    obj = scene.camera
    cam = obj.data
    frame = cam.view_frame(scene)
    # move into object space
    frame = [obj.matrix_world * v for v in frame]
    # move into pixelspace
    frame_px = [location_3d_to_region_2d(region, rv3d, v) for v in frame]
    return frame_px

frame_px = view3d_camera_border(bpy.context.scene)
print("Camera frame:", frame_px)

This gives us the 2d region coordinates of what will be the rendered scene.
If we take out the smallest of these coords we are mapping to "region camera coords" only vectors in (0, 0) to max(cambounds) will be in rendered image.

# this is the camera bounds
blc = min(frame_px)
cambounds = [v - blc for v in frame_px]
print("camera is on screen as :", max(cambounds))

I get as a test case: my render resolution (scene.render.resolution_x, .. resolution_y) is  1920 x 1080 (the ratio x/y = 1.777)

  camera is on screen as : <Vector (328.3195, 184.6790)>

ie the camera rectangle you see in view3d window has size 328 x 184 which has the same ratio.  So all vectors below, like for instance objloc can be multiplied by (1920 / 328.3195) to return them as pixel coords of the rendered image. (nb not taking into account resolution_percentage and non square pixels)

Similarly for object location.

# object location
obj = bpy.context.object # the context object.
objloc = location_3d_to_region_2d(
                      region,
                      rv3d,
                      obj.matrix_world.to_translation()) - blc
print(objloc)

And a quick object bounds using bounding box, get the 2d coords from the 8 3d corners of the bounding box.

bounding_box = [v[:] for v in obj.bound_box]
bbox_px = [location_3d_to_region_2d(region, rv3d, v)
                         - blc for v in bounding_box]

min_x = min(v.x for v in bbox_px)
max_x = max(v.x for v in bbox_px)
bbox_width = max_x - min_x

#... etc to get the coords of bbox.

or this could be done by looping thru the verts of the object

mw = obj.matrix_world
#global vert locs
verts = [mw * v.co for v in obj.data.vertices]
# vert locations in "region camera coords"
verts_px = [location_3d_to_region_2d(region, rv3d, v)
                         - blc for v in verts]

and finding the min max for x, y as above for bounding box.

Note haven't put in code to loop thru frames and write to output file as that is trivial, it's the camera bounds that is difficult, but fortunately handed to us via ideasman42's answer.


Adjusting Velocity Of Object So I'm making a small game on Blender Game Engine and its racing. What i want is so that when a player presses w the car starts moving and slowly gains velocity. I know about the controller's that make an object move but i want to know how to make it BUILD speed as it progresses.(the reason i tagged this as python is because i am assuming this will take some python. Do i use Python for this)?

Actually, it doesn't require python. It requires the ... servo motion actuator:

Use the LinearVelocity to set the maximum speed, and the force limits to set the maximum acceleration.

For anything more complex than this, yes, you will need python.


Model geometry messed up after applying limited dissolve See this was a neat structure having too many vertices and after applying limited dissolve its vertices got a little less but its geometry messed up inside the messh. it looks the same from the outside but the there are no formation of vertice connection. i once saw a rearrange or meshing function by someone i cant remember that correct this. Kindly help me with this

Tried "remove doubles"?
Go to the edit mode, select the whole mesh press W and select remove doubles.
If these vertices are making N-gon, try (Face split) an option in vertex dissolve.


Animation won't render to file; When I'm in blender and play the animation, it plays fine. But when I render the animation, it just shows a frame or two when i play it.

If there is physics animation, you need to bake it before rendering.
Here's the guide that explain everything about baking a physics animations: https://docs.blender.org/manual/en/latest/physics/baking.html
I can confirm that baking the animation is the correct solution.
Please follow these steps:

go to "scene properties"
open "rigid body world" settings
go under "cache"
change end frame from 250 to 70 (no need to simulate further your timeline)
delete all bakes (just to be sure that if there is something in cache you'll erase it)
press "bake all dynamics" to cache your simulation (wait few seconds)
render your animation (you can render it frame by frame or render directly the MOV/AVI)


Knife project not working In some simple cases such using the default Monkey as the object to project, the resulting cut looks nothing like the monkey. Note the selected cube only has only been cut around the monkey's eyes, not the entire object.

Trying with other primitives results in this error

  No Other selected objects found to use for projection

I know that I have both objects selected.

This is because knife project only uses wire or boundary edges:

  Knife projection is a non-interactive tool where you can use objects
  to cookie-cut into the mesh rather than hand drawing the line.

  This works by using the outlines of other selected objects in
  edit-mode to cut into the mesh, resulting geometry inside the cutters
  outline will be selected.

  Outlines can be wire or boundary edges.

  To use Knife Project, in 'object' mode select the "cutting object"
  first then shift select the "object to be cut". Now tab into edit mode
  and press "knife project".

emphasis mine

A boundary edge is an edge with nothing connected on one side, e.g.:

The primitives, being manifold objects, do not have wire or boundary edges.

Suzanne partially works because it is non-manifold (the eyes are disconnected). The two circles that you get by projecting Suzanne are the boundary edges around the eyes.

The error message is a little bit strange though.


Smoke viewport Display in 2.81a Just started to play with smoke in Blender 2.81a, I did not use the Quick Smoke, but start from scratch.

Here are the steps I took:

Create a sphere as Flow object
Create a Cube as Domain (sphere is inside Domain)
Create a Principled Volume Shader and link it to the volume of the sphere

Then press Space to run the simulation.

In Layout tab, I can see the sim only in Wireframe or Shade Mode, but not in Material Preview nor Render Mode.

In Blender 2.81a volumetrics seem to be ON by default in the Render Properties, so I don't know why I can't see it in Render Mode.

OK I got it, you need to put the shader on the Domain, not the flow object.


Why is my Cycles scene so bright even with no lights? Apparently cycles has some kind of built insane glow that causes everything to be brightly lit in a scene even with no lights at all and all light sources removed. How do I turn this insanity off?

I tried setting World > Surface > Color to fully black, but it does nothing at all. I also turned off Ambient Occlusion under "World" but no change either. Of course every single light in the scene is deleted but it still renders bright as a floodlight shining directly in your face. >:(

What am I missing here?

Most likely Ambient Occlusion is enabled. Go to Properties > World and just turn it off:

From the manual:

  Ambient occlusion is a lighting method based on how much a point on a surface is occluded by nearby surfaces. It simulates soft global illumination shadows by faking darkness perceived in corners and at mesh intersections, creases, and cracks, where ambient light is occluded, or blocked. This is a trick that is not physically accurate, but it is useful to emphasize the shapes of surfaces, or as a cheap way to get an effect that looks a bit like indirect lighting.


Create a file that contains object *and* movement data that can be imported to Blender I'm experimenting (outside of Blender) with some algorithms that place balls in a larger box, then incrementally move these balls to optimize positions until they reach an optimal state. Now, i would like to use Blender to visualize these algorithms, once to present the results to some audience, but also to find problems in the algorithms, as well as implementation bugs, as it's much easier to spot a wrong movement in a visualization than in a huge table of coordinates.

So what i would like to do is

After each step of my algorithm, create a file that can be imported into Blender and contains the X/Y/Z coordinates of each of those balls
Create a kind of motion description, like "File0 is the list of ball positions at 0 seconds, File1 is the list of positions after one second; i want a movie that moves each ball from its 1st position to the 2nd one"

I know how to solve part 1), as writing STL files is not very difficult, and Blender has an import feature. I will need to create a mesh of triangles around each center point, but i'm not afraid of that either.

The part where i don't have a clue how to do it is 2). Ideally, i'd like to create a file that i can import that contains all coordinate sets at all frame positions, but if that's not possible, i could import each STL file at its designated frame manually. However, i still have no clue how to tell blender "file 2 contains the same objects as file 1, just at a different point of time", and i don't want to "connect" every single vertext manually.

Is there a file format that can specify object positions as well as position changes over time, that's not too hard to create, that can be imported into Blender?

My first option would be to use python to implement your algorithm and run it directly in blender to position the balls directly.

Another option would be to read the first file to create and position the balls then keyframe the positions. Then read the next file using the data to move each corresponding ball to the new location and keyframe. Repeat. You would only need a text file with 3 values per line, these would be absolute coordinates in the first file but could be absolute or distances moved for following files.

Blender has an importer/exporter for MDD files (Lightwaves MotionDesigner format). It is only about 100 lines for the exporter so shouldn't be hard to follow. There is also a mesh cache modifier that can use the MDD file to alter a mesh object. While this format is designed for mesh deformation data per frame, you could define a mesh with a vertex at the location of each sphere, then use dupliverts to place a sphere at the location of each vertex in blender.


How to bevel this simple edge? I need to bevel the edge inside the red square to make it round maintaining the top edge flat. It's very simple geometry but I don't get it. Can someone help me with this?

Thanks.

After beveling (Ctrl+B) select the top vertex of the n-gon, enable the snapping tool (Vertex) and snap it verticaly to create a straight line.

Clean up the mesh a bit using dissolve option and remesh it. Note, that the topology pictured below is just an example. You have to think how to arrange it to make the subsurf modifier work properly.


Object wobbling and shaking while camera following a path I have a cube object and I'm trying to move the camera in a spiral and then render the video. When seen from the camera view, the cube object seems to wobble a lot along the z axis. I have seen this question here but that option is not showing up in my Blender. I'm attaching my blend file here. I'm not sure if it is happening just to me or is it some problem with the camera path?

The problem is that the resolution of the path is too small. This results in the path being made up of a series of straight lines that are much longer than the steps of your animated 'follow path', resulting in the jitter.

You can re-create the curve with a higher resolution or you can edit your existing curve to add resolution by selecting the curve and enter Edit mode (Tab). Select all vertices (A), click 'Subdivide' in the tool shelf (T) - this will divide each section of the curve, although they will still form straight lines. Once you have enough additional points, click Smooth (again, in the toolshelf, just below Subdivide) a few times - this will round off the edges, effectively shaving the corners off the curve and making it smooth again.

The result should be a smoothed curve with higher resolution that should no longer cause the jittering.

Edit : Another way is to change the Spline Type of your curve - you currently have this set to 'Poly' (ie, lines). Changing it to Bezier or NURBS will produce a curved path without having to add additional control points. To achieve this, simply enter Edit mode and select all (as above) and then click Set Spline Type in the tool shelf (it's shown at the top of the above image). Select NURBS and your path should be smooth and track with no jitter.


How to add multiple cubes in a collection? Setup : Blender 2.82

I want to add multiple cubes in a specific collection but i want them to dissapear from the other collections.

import bpy

collection = bpy.data.collections.new(name="COLLECTION GOOD") #create new coll in data

for i in range(0,2):
  bpy.ops.mesh.primitive_cube_add(location=(i, i, i))
  bpy.context.active_object.name = 'cube'
  cube = bpy.context.object

  obj_old_coll = cube.users_collection #list of all collection the obj is in
  bpy.context.scene.collection.children.link(collection) #add new coll to the scene
  collection.objects.link(cube) #link obj to scene

  cube.remove(cube["cube"], True)
  for ob in obj_old_coll: #unlink from all  precedent obj collections
     ob.objects.unlink(cube)

I would expect to have a collection named collection good with 2 cubes at different locations. However this is adding only 1 cube in the collection and 1 outside of it.

The script fails at two steps:

  bpy.context.scene.collection.children.link(collection) #add new coll to the scene

is done inside of the loop, so it fails the second time.

  cube.remove(cube["cube"], True)

does not exist: no remove method in cube.

That's why it stops before moving the second object to the new collection.

So this works:

import bpy

collection = bpy.data.collections.new(name="COLLECTION GOOD") #create new coll in data

bpy.context.scene.collection.children.link(collection) #add new coll to the scene

for i in range(0,2):
  bpy.ops.mesh.primitive_cube_add(location=(i, i, i))
  bpy.context.active_object.name = 'cube'
  cube = bpy.context.object

  obj_old_coll = cube.users_collection #list of all collection the obj is in
  collection.objects.link(cube) #link obj to scene

  #cube.remove(cube["cube"], True)
  for ob in obj_old_coll: #unlink from all  precedent obj collections
     ob.objects.unlink(cube)

And you can simplify a bit:

import bpy

collection = bpy.data.collections.new(name="COLLECTION GOOD") #create new coll in data

bpy.context.scene.collection.children.link(collection) #add new coll to the scene

for i in range(0,2):
  bpy.ops.mesh.primitive_cube_add(location=(i, i, i))
  bpy.context.active_object.name = 'cube'
  cube = bpy.context.object

  for ob in cube.users_collection[:]: #unlink from all  precedent obj collections
     ob.objects.unlink(cube)

  collection.objects.link(cube) #link obj to scene


Meshes won't go away In this project: https://www.file-upload.net/download-12514827/broken.blend.html

there are a lot of meshes which won't go away by selecting them and pressing X, aren't selected after selecting by Type and don't even get removed by my program. Why? My only bet atm is to manually rightclick them and delete them one by one, but that can't be the only way, right?

Btw this was the program which hadn't worked:

for ob in scene.objects:
    ob.select = ob.name.startswith("VBar")
bpy.ops.object.delete()

Your meshes are on different Layer. Select it or add it (the Layer)
by Shift+MouseClick and you will be able to select them.
If you don't see them - as they are just simple lines; press Z to go to Wireframe Mode.
For Python solution go here: Get the list of objects on a layer in python


Connect a folding door with an armature without deforming the door panels I am building a horizontal folding door with segments that open like a concertina.
Method:

I first select the door segments then the armature.
Cntrl + P
"set parent to" / Armature deform/ with automatic weights
or with bones?? bones relative??

The attachment works! But when I operate/ opens the armature the door segments are pushed skew and off centre from the bones.  What am I doing wrong?

Any suggestions?

You could rig this sort of bus door arrangement without bones:

.. a series of hinges, each parented to the previous hinge.
Every hinge has its Z rotation driven by the zero'th, 'master' hinge.. ('Rot Master'). The odd-numbered hinges have -2 * the Z rotation of the master:

and the even-numbered hinges have +2 * the Z rotation of the master. The drivers can be cut-and-pasted; with care, pairs of doors can be duplicated along with their drivers.
The master's Z rotation is driven by the handle, thus:

.. where the '20' in the expression is the distance from the handle to the master when fully extended. The handle should have a Limit Location constraint to prevent it going off-axis, below 0, or beyond full extension.
The master and the handle can both be parented to a Root object (The big cube at the left) so the whole rig can be moved around. Doors, or whatever, can be parented to their respective hinges.

..sort of a cheap, limited, home-made IK.


Is there a way to move the pivot point directly of any selection Is there any way to move the pivot/scaling point of a selection (not an object) directly? I've moved from Maya and the closest equivilent I can find is the 3d cursor, which requires a lot of extra steps compared to Maya which lets you detach and move the pivot point like it's own object.
Thanks.

There is an option for that, it's a bit hidden:

upper right of the Viewport.
That would change the actual origin, though. If you want to temporarily do that, parenting and the 3D cursor are the only options I can think of. What exactly are you trying to do?


Black artifacts when looking through many transparent objects? Using v2.73, cycles and a very simple scene: an array of cubes, no big deal.

If I set the shader's material to transparent, the cubes in the foreground do become transparent but those far away in the back do not disappear completely and this strange dark things appear (visible in rendered mode and in final renders)

I've played with the clipping distance on the viewport and camera, but I can't figure out how to make those ghosts go away...

Go to Light Paths under the Render Tab and turn up the Max amount of transparent bounces until you have enough for every cube.

For 2.8* set the Transmission bounces in the Render section>Light Paths>Max Bounces


How to get user preferences path from blender How can I get the the user preferences path from blender, on windows system the path is %appdata%\Blender Foundation\Blender\2.74\config I want to get this path from blender using python on any system.

Using: bpy.utils.resource_path('USER')

eg:

import os
import bpy

user_path = bpy.utils.resource_path('USER')
config_path = os.path.join(user_path, "config")

Or on Linux:/home/user_name/.config/blender/2.74
On ms-windows will return:C:\Users\user_name\AppData\Roaming\Blender Foundation\Blender\2.74

See: bpy.utils.resource_path api docs


Texture Paint not applying 2.78 I followed several tutorials on how to paint my model with texture paint.
I've unwrapped the model and made sure I have a material and a texture. I have a node to place my new texture image on my mesh, and I placed that image on my UV map as well.

I have no idea what I've done wrong, but painting on the mesh and the UV map doesn't work.

I suffered from this same problem, When you select TexDraw as your brush it automatically selects a texture to draw with, in which case is usually the new black texture you made to paint on so everything is black and will never be anything but.  Just clear the texture from the TexDraw brush and you're in business.


Best way to export scene objects to external program? Lets' say I have this scene:

The columns, floor, center pieces, etc., are all individual objects but all reside in the same Blender file. I wish to rebuild this scene in Unity3D, like I did here already:

I did this by saving the assembled scene in a blend file called "SceneAssembled". Then I would delete ALL objects EXCEPT the one I wants, say the pedestal in the middle. I would go File -> Save As "Pedestal", then I would close that file and re-open "SceneAssembled" and do that for every object, then re-assemble in Unity.

Is this a good way of doing this or are there better workflows?

Thanks.

Export as an .fbx or .obj with "only selected" enabled...if you try to use .blend files in Unity you will run into all sorts of problems (bugs, only works if a compatible version of Blender is installed).

Select your objects that you want exported, then choose to export as .fbx or .obj. FBX supports animation, OBJ does not. If you just need a simple static mesh, you can use .obj, but I personally prefer to only use .fbx format for simplicity.

Finally, you don't need to export specific objects if you would rather not. If you need to export the entire scene (and will only want to export the entire scene in the future), just use this tool with all desired objects selected, and Unity will import it just fine. When it gets into Unity, the objects are still separate once you pull them into your scene...


armature disappears when importing a skinned character in obj, format? armature present before importing

[

Obj format that supports only geometry and does not support rigs or animations.

  The OBJ file format is a simple data-format that represents 3D geometry alone — namely, the position of each vertex, the UV position of each texture coordinate vertex, vertex normals, and the faces that make each polygon defined as a list of vertices, and texture vertices. -wikipedia

For animations you should use some other format. Fbx for example is supported by most 3d software and popular game engines Unity and Unreal.


Translation is stuck in increments, how do I set back to free movement? I am a beginner.

I am trying to translate in the Z axis, the problem is that I only want to translate less than a square but when I move the mouse, it translate 1 full square.

How I can deactivate the option, to move the object free?

You enabled snap. You can disable it with this small magnet button:


Can't undo subdivision surface modifier After I was done modelling almost all the parts, I increased the view count in subdivision surface modifier and applied to all of the meshes. Now when I toggle to the edit mode, there are thousands of faces on the mesh. Anyone knows how to solve it? thanks in advance. (UNDOs not available)

It is true that you probably don't need 3 million triangles for such a simple object (You should try to avoid excessive subdivisions read: Blender render crash when using subsurf modifiers.).

Did you actually apply the modifier, or just added the modifier to the object? In other words, did you make the subdivision permanent by hitting the Apply box on the modifier?

If you didn't apply, the modification is still editable, and you can just dial down the number of subdivisions in the modifiers.

If you actually applied the modifier, you can use the decimate modifier with the option to Un-Subdivide. Move the number of iterations to the number of subdivisions you want to get rid of.

Modifiers are designed so that you can work in a non-destructive way, so that you can make some operations without making them permanent. Unless you have a compelling reason to Apply the modifier, you can keep them as modifiers.

Another sometimes overlooked feature of modifiers is the ability to turn them off so that you can continue editing the object:

Modifiers have a few switches to control them:

The Camera icon enables or disables rendering using the modifier.

The Eye icon toggles visibility on the 3D viewport.

The Dotted Square (or Box) toggles visibility in Edit mode.

The Triangle, when enabled,  will show the final modified geometry in Edit Mode and can be edited directly. (This last option can only be used when visibility in Edit mode has been enabled)

To learn about all of the other options for modifiers please read:

https://www.blender.org/manual/modeling/modifiers/introduction.html#interface


Display text on screen - relative to launched command? I was thinking yesterday that it might be useful to see some text displayed somewhere on the screen when you execute certain commands in Blender. For example if you enter "Keep Uv and edit mesh mode selection in sync" mode Blender could display a text that says "Sync Mode - On" on your screen, have anyone seen any script that has this function? Is this day dreaming on my part or is it possible?

In the past there was a screen cast add on.
Here is some history.

http://www.blendernation.com/2014/07/02/screencast-keys-addon-is-removed-b3d/

The info window type shows user operations.  The default vertical size of the window was increased to see the contents.

Python Script Software writers find this useful.


Blender Freestyle Brushes So far I am only allowed to use the pin brush in Freestyle .Were are the other brushes? Do I have to download them ? If so could someone point me to the site that has them .

Try using latest Blender 2.71 where you can specify your own brush texture image.  The Freestyle section of the Blender 2.71 release notes will be a useful information source about textured strokes.

http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.71/Freestyle

There are two types of brush texture images: textures with and without tips.  Textures with tips need to be prepared in a specific arrangement of brush parts.  See the info graphics below which shows you what textures with tips look like.

http://blendernpr.org/freestyle-new-features-info-graphics/

I personally have never seen the Blender version in the screen capture of your post, although I am the main developer of Freestyle for Blender (:


Align curve control point tilt with snapping target Is it possible to extrude control points of a curve along the surface of an object and have the tilt of each point automatically align with the normal of the face that it snaps to?
EDIT
I want the beveled shaped to automatically stay normal to the surface I am snapping to without having to manually adjust the tilt for each control point. It starts off right.

But then the tilt changes dynamically as each control point is extruded.

EDIT, still have not found a solution. I have tried using sverchok to make a node tree that would find that closest face of the target object and adjust each control point tilt on the curve to make it normal to the surface but I could not get it to work.

I don't know if this is what you're looking for but you may enable the project individual elements on the surface of other objects option (with the snapping tool (Face) enabled also).


Making sense of hair_key coordinates I am trying to convert hair_key.co_local to world coordinates. As I understand it, every hair particle has a bunch of hair_keys (type:ParticleHairKey) that represent strand segments. The ParticleHairKey type has two coordinate fields:

co - always (0,0,0) on read; writing does nothing
co_local - read produces non-zero vectors; write DOES have some sort of
an effect

So my guess is, co field is not implemented  / supported and I have to work with co_local instead.

according to the docs ParticleHairKey co_local is "Location of the hair key in its local coordinate system, relative to the emitting face". and there is co_object method that returns key location (I assume in object coordinates). No matter what I tried however, the resulting coordinate doesn't seem to map to world coordinates in any meaningful way.

For example, I have a single strand of hair with 3 segments. particle.location here is already interpretable - if I put 3d cursor at that position, it matches particle location in the viewport (see pic).

obj = bpy.data.objects["gen82"]
psMod = (obj.modifiers)[1]
ps = obj.particle_systems["ParticleSettings"]

for m, particle in enumerate(ps.particles):
    print("particle location", particle.location)
    bpy.context.scene.cursor.location = particle.location
    for k in range(0, len(particle.hair_keys)):
            print(f"key {k}", particle.hair_keys[k].co_local)

Moves 3d cursor as expected.

and produces following console output

particle location <Vector (0.0953, -3.7172, -0.6447)>
key 0 <Vector (0.0000, 0.0000, 0.0000)>
key 1 <Vector (-0.0036, 0.0030, 0.1666)>
key 2 <Vector (-0.0073, 0.0060, 0.3332)>
key 3 <Vector (-0.0109, 0.0090, 0.4998)>

As you can see, hair_key.co_local seems to match description from the docs - it gets progressively farther from (0,0,0) as key index increases. But I have real difficulty working with those values. I tried calling co_object and transforming to world coordinates, tried offsetting by particle.location etc. - nothing produced world coordinates. Is there a way of transforming this coordinate to object or world coordinates ?

Use evaluated object in 2.8+

Example for 2.8+ adds an empty at each hair key location. Note: since it adds an empty via op, test on an object with lowish hair count

import bpy

context = bpy.context
dg = context.evaluated_depsgraph_get()
# evaluated object
ob = context.object.evaluated_get(dg)
mw = ob.matrix_world

for p in ob.particle_systems[0].particles:
    for k in p.hair_keys:
        bpy.ops.object.empty_add(location=mw @ k.co)


leg move in pose mode moves other leg in my blender i created a character and his armature with bones assigning with automathic weights to the body, dont ask me hard questions cause im newbie, i got some problems with my character first i tryed to assign evertying to 1 object so i can move the entire object in animation, not working cause i did part of my character without scalling, so when i move all the body the other part stays there, second when i try to move a leg the other leg moves to and it becomes kinda buggy, i already tryed to create the bones again and again but nothing works, and i need to end this really fast if i can get some help i put the file in upload and send the link here

  Here is the blend file that i uploaded in the website

you need to weightpaint your model. in pose mode you need to hold shift and right click your model. after that go to weight paint mode. then click a specific bone and paint on the mesh its influence. red means this face is affected 100% by the bone. blue means zero. if this is too complex, you should watch one of the many tutorials on youtube :)


Use pen to drag slider bar is there a set up where I can use my pen to drag a slider such as brush radius?

When I click on the slider I have to enter values and I would prefer to use the pen to slide the value. I know I can use f but would like to make use of the slider. thank you

If you use your pen with a fast click on a slider you can enter a value, but if you put (with the pen) your cursor on the slider and slide, the slider acts as .... a slider! (At least, this is what happens with my Wacom Intuos on 2.8 in sculpt mode).


Animation is not properly renderd I have created this Blend of a Tornado in cycles. Im done with it as far as it goes, but if i want to render the animation it is only showing the 2 particle emitting circles. There must be an issue in my render setting. I have no clue what it could be.
I hope someone can help me.
Thank you already <3

Actually it also shows the smoke but it's hidden by your emitter. As explained here, "you can actually just turn off render visibility on the emitter. It’s the domain object that actually renders. " So disable the emitter's visibility.


How do you create a mesh made up of mutliple objects within each other? I am taking part in a 3D printing project, where I am aiming to print a model, made up of three/four cup-shaped objects within each other (like a russian doll essentially).They would be held in place at the top with bridges so they don't move relative to each other.

Does anyone know how I could create a mesh like this in blender?

If I understand correctly what you're trying to make, you can duplicate mesh with Shift+D. Then S to scale inner part to the required size and G to grab and move it.
To connect them you could select 2 edges and press F (only one edge at the time) or use Bridge Edge Loops tool to select two face loops from both meshes and bridge them with faces.
To preview what you're doing use wireframe shading mode (with Z). To have control over meshes, use Mask modifier to toggle their visibility;  Knife tool to cut half of the cup and mirror another part with Mirror modifier; store different meshes on different 3D layers among other tools.


Can the sequencer strip view follow the scrubbing/playback bar? When viewing a sequencer, and playing back using the timeline, the scrubber bar tracks the playback, but will run off the sequencer view. I can manually scroll to catch-up. Is there any way to set the UI so the scrubber bar is always in the sequence view when playing back?

A feature very similar to this was added quite recently (about an hour ago
at the time of writing).

  Animation play: Follow feature. Enabled from playback menu in the
  timeline.

  When enabled, ipo, dopesheet, NLA, timeline, clip and sequence editors
  will follow the current frame during animation. When the cursor
  reaches the end of the screen, then the next range of frames of the
  same width is displayed.

To use it you'll have to grab a recent development build. This feature should be in 2.74.
This feature is now available in timeline panel -> playback (next to the start frame field) -> follow.


Cutting Diagonal Lines Ok I need to cut two diagonal lines into a plane essentially creating an X. Problem is blender has no easy to use tool for this so I chose to triangulate the plane and this only creates one diagonal line going from the top left vertex to the bottom right how do I make that second diagonal line from the top right to bottom left?

What you are looking for is the Poke Faces operation.

In Edit Mode, with your plane selected, press AltP. This operation creates a node at the face's center, and then triangulates the face around that central vertex.


How to get better anti-aliasing in blender internal? I'm having problem with antialiasing (I think this is the problem...). As you can see from the picture, far object and reflected object are still to rough (see the red arrows).
On the right you can appreciate my antialiasing settings.

Is it a problem of antialiasing? I'm quite new to the blender and the 3D graphics world, so I'd like to understand what is happening.

Thanx in advance !

Addition
Using cycles rendering, I get this:

Why? I lost all the material settings???

I think anti-aliasing doesn't have anything to do with this.

I can't see very well, but I think the problem with "rough" reflection in the first image is due to a low amount of reflection raytracing samples. Try increasing the sample amount in the material's "Reflections" tab.

Cycles and Blender Internal rendering engines are defining materials differently, you can't quite switch from one to another every moment and expect to see similar visual results. Setting up object materials for Cycles is a completely different process. When you set up your materials for Blender internal rendered and then switched to Cycles, Blender actually tries to create similar materials, but it's a very basic approximation, this is where there's no reflection on the floor. Also setting up lighting for Cycles is different.

The basic difference is that Blender Internal is a scanline rendering engine, while Cycles is a raytracer. The latter provides much more realism at the cost of much higher computational cost. Blender internal is however very useful for non-realistic renders where advanced light simulation is not needed and we can work with the different tools for "faking" these effects.

For instance: Cycles will calculate how light propagates and reflects from surfaces and what image it will produce when reaching the scene's camera. All the bells and whistles are a part of the simulation of how light behaves in the 3D scene. Blender Internal however uses different tricks to fake these effects like shadow maps, raytraced reflections, bumpmapping, volumetric shadows... in Blender Internal it's all kind of "fake" and approximate and it doesn't look that real when compared to Cycles, which actually is simulating how photons bounce around. The downside of Cycles is the amount of noise you get from fast renders - it's a bit like getting too little exposure time for taking a picture in a dark environment - it's gonna be noisy. The same is with cycles. The more samples you give it to calculate, the less noise you're gonna have (but it can be very time-consuming).


Dynamic paint with particles I have a particle emitter. It emits spheres and an object set as brush... let's call it a "paint ball".

I have a canvas. The original "paint ball" I have created as a brush does exactly what I want, if I move it over the canvas it paints the surface during animation, but non of the generated particles do.

I went as far as making the emitter a brush, hoping the particles emitted, would inherit it's properties, but that did not help either.

I know I am doing something stupid wrong but can't for the love of God figure it out.

Any help is appreciated.

In order to have the particles act as a brush, you need to set the emitter to be a brush. Then change the type to a particle system.

This tells the dynamic paint to use the particles as the brushes, not the actual object.
The particles will then paint the canvas as expected.


How to use an opacity mask in a material in Blender Cycles? Following a tutorial about creating a stylised tree, I ran into a problem. The tutorial is for Maya instead of Blender and Substance Designer. I modelled on Blender.

In the tutorial for Maya they manage to insert the basic color map and the opacity mask well, which I can't do in Blender. I have attached images with the problem. I tried to search on the net but I can't achieve showing only the leaves and the branches as it happens in the tutorial.

there are some wrong inputs in your image
basic mask setup in blender:


When I render it I got a fully black image I am trying to make a 360degree photo. I just do such i saw in some you tube tutorials. I change blender render to cyclic render and change camera to panoramic .But when I render it I got a fully black image. How i can solve this.(hopping you can understand. Because my English is very bad)

This is my blender file:
https://drive.google.com/file/d/0B4E2Wd62ZA0Yc1J3ZFBFLThaRWM/view?usp=drivesdk

Can you just render it to image and show me it

Because I think it may be problem of my system.

My project

Camera view

Rendering window

Black or blank output has been covered before. Look here.

You need to add a lamp to your scene. There is no source of light, and therefore the render is black. To add a lamp hit Shift+A while your mouse is in the 3d window, and select any lamp type as shown in the screenshot below:

While the default position it is placed in might not be ideal, you could move the lamp after adding it. The render right after inserting the lamp will look like this:


How to make a rectangular coil shape I have seen this video

I want to make this coil curve shape but in rectangular shape

In the video its shown in the circle way. But i want to make in the rectangular way. I want my mesh to go in the rectangular way with the curve edge at corners. How can i spin im not getting it.

With the reference video i tried to make but fail to make that shape. Is there a way with a quick way i can make it. Any suggestion or help. Thanks

You could start with a spiral and stretch it to a rectangle.


Cell fracture producing warped faces I have a plane that I have been trying to fracture (similar to the way glass can break).  I used the grease pencil and solidify modifier with the default settings.

For some reason, when I use cell fracture it causes the faces of the shards to have convex surfaces rather than flat like the plane had.  How do I get them to look flat?  I tried using the debug boolean option which produced the look I want, but the shards seemed to disappear into thin air when I apply active physics to them.

Here's the pic of my results:

These are my settings:

Any help would be greatly appreciated!

Here is the .blend:

You could try out the Fracture Modifier Build.
Make sure to use the "latest development build", or just use the more recent graphicall build.
I also had to edit 3 points or so of the greasepencil strokes, because the FM (fracture modifier) created some holes in the mesh there (points were too close to each other)
For the simulation I made the bullet a trigger and the plane animated and triggered. Furthermore I played a bit around with constraints.
If you have further questions, please post either here on stackexchange or here :
https://blenderartists.org/forum/showthread.php?343637-Custom-Build-Blender-Fracture-Modifier


Is there a way to bake ambient occlusion map as strong as in viewport shading ambient occlusion? Every time I bake AO map, I get this kind of intensity:

Whereas I'd like to get this kind of strength:

I am not really sure how to make it stronger because every time I change settings, nothing really changes (in blender render).

The viewport AO uses different engine than the bake AO function (Blender Internal or Cycles in 2.79 Blender), so the settings for the viewport AO are not used in the Bake.

The viewport AO is multiplied by 5, so if you take your baked AO into Photoshop or another editor and you play with the levels of the image (or you multiply 5 these images on top of each other) you get similar result.

Selected to Active does not have impact on the strength of AO, only from which object it will get calculated.


Optimizing Mesh to Quads only Often when I model objects with circular areas, I run into trouble converting ngons and tris into quads. The selected face is a quad, but it has this "open" vert, and those often causes problems when e.g. beveling. Any tips on dealing with such tricky situations? I'm pretty fresh 3D user. All help appreciated!

I could make this one, big ngon face, but I really want to get into good modeling habits.

solid view of the model

Link provided by Duarte Farrajota Ramos is great place to find topology tips (I'm using it by myself) but sometimes you can't find technical aspects of how to create particular topology.

Before I start I want to encourage you to look for good topology without focusing on specific app. Good topology is good, no matter which software was used.

You can achieve it in several ways, I'll show you the quickest one I've found, possible with LoopTools addon (you can find it in User Preferences) wich is shipped with Blender.

Final result:

Quick method:

Press W > Subdivide to subdivide a Plane.
Delete center Vertex.
Select Edge Loop.
E to Extrude then S to Scale it.
W > LoopTools > Circle.
Add Subdivision Modifier.
(Optional as needed) Use Bevel or Mean Crease on edges.

In my example I've used Bevel with 3 segments on inner circle edge and corner edges of shape, also I've used Mirror modifier. Everything was made from simple Plane.

Extension (technique without addon):

I've thought that maybe for some reason you don't want to use any addons so here is a method without it.

  1-4 steps are the same as in first method.

Press Alt+M > At Center.
Press Ctrl+Shift+B to Bevel only Vertex and scale it as needed.
X > Only Faces to delete central face.


How to disable a strange white circle around the cursor in UV editing mode? How to disable a strange white circle around the cursor in UV editing mode? it is distorting  everything once I try to move or rotate a UV island. It sometimes moves all of them at once, despite the fact that only one of them is selected (red). Also I have the impression, that all the UV islands are distorted as if they were fitted onto a globe. I must have accidentally switched something. I never had such a strange problem and I haven't come across anything like this on the Net. I would really appreciate your help, since the way it is now it's absolutely impossible to work:) I am rather new to Blender, I am mostly unwrapping couches and sofas.

You might have proportional editing enabled. This can be toggled with O

It can also be found under Mesh > Proportional Editing


Matrix math to translate, rotate, scale with respect to a pivot point in Object mode So i need to need to replicate translate, rotate & scale with 3d cursor as pivot point action using Matrix or bmesh in a script.
i read Rotate objects around their origin along a global axis (scripted) without bpy.ops and after changing the matrix order the object was rotating around 0,0,0 but i was unable to change this pivot position.(mainly cause I'm blindly copy pasting code without understanding it).
What is the correct way to set a custom pivot point ?(example: (1,2,0))
I found a way to perform this using bmesh+matrix but the results are transformed in edit mode so the origins stay at the same place. Since the object I'll be rotating has many child objects, i would like to perform the rotation in Object mode and avoid having to merge everything into one object.
Here's the function which is used to rotate or scale with 3d cursor as pivot in edit mode
For blender 2.83
import bpy
import bmesh
from mathutils import Matrix
from math import radians

# Rotate or scale with pivot point

def rotate_or_scale(tr_mode, obj, value,axis_value):
    bpy.ops.object.select_all(action='DESELECT')
    obj.select_set(True)
    bpy.context.view_layer.objects.active = obj
    bpy.ops.object.mode_set(mode='EDIT')
    bpy.ops.mesh.select_all(action='SELECT')
    context = bpy.context
    scene = context.scene
    pivot_point = bpy.context.scene.cursor.location

    ob = context.edit_object
    mesh_dat = ob.data
    bm = bmesh.from_edit_mesh(mesh_dat)
    S = ob.matrix_world.copy()
    S.translation -= pivot_point

     if tr_mode == 'rotate':
        translation_matrix = Matrix.Rotation(radians(value), 3, axis_or_value)
    elif tr_mode == 'scale':
        translation_matrix = Matrix.Diagonal(axis_or_value)
    else:
        bpy.ops.object.mode_set(mode='OBJECT')
        return

    bmesh.ops.rotate(bm,
            matrix=translation_matrix,
            verts=[v for v in bm.verts if v.select],
            space=S)

    bmesh.update_edit_mesh(mesh_dat)
    bpy.ops.object.mode_set(mode='OBJECT')

rotate_or_scale('scale',bpy.context.selected_objects[0],0,(1,1,1.1)) #scale z by 1.1
rotate_or_scale('rotate',bpy.context.selected_objects[0],45,(0,0,1)) #rotate 45deg on zaxis

Object mode global rotation / scale around global axis thru scene cursor.
To rotate or scale about a non origin pivot point we need to change the space of our object such that its origin is the pivot point.
Can do both the scale and the rotation in one fell swoop. To just rotate set scale_factor to 1, or to just scale set the angle to zero, for either case the matrix becomes Identity.
Notice the way M is made in the reverse order, ie translates by negative pivot point to move pivot point to origin, then rotates, scales (its uniform scale), then moves the pivot point back.
import bpy
from mathutils import Matrix
from math import radians

context = bpy.context
scale_factor = 1.1
angle = 45
axis = (0, 0, 1)

scene = context.scene
pivot = scene.cursor.location

for ob in context.selected_objects:
    M = (
        Matrix.Translation(pivot) @
        Matrix.Diagonal((scale_factor,) * 3).to_4x4() @
        Matrix.Rotation(radians(angle), 4, axis) @
        Matrix.Translation(-pivot)
        )
    ob.matrix_world = M @ ob.matrix_world


How come I can't see my bones in orthographic view? i'm trying to model a rig using x mirror but I can't see the bones even though i'm in editmode. i want to extrude a bone on x axis so that two bones extrue using x-mirror. it donest work in persp view and in tutorials they use ortho view.

x-mirror is not view dependent, and is dependent on the bone names (i.e. ending with .L, .R)
+1 screenshots or .blend


How do you calculate Array Modifier with Relative Offset? The pillar at center's width is 0.2

So I added 0.2 to basic 1.0 value of Array Modifier offeset

but it didn't work as I expected.

How do you calculate this to close the gap?

As, i said, use constant offset instead relative, it's much easier:

"Relative" doesn't mean "length of object plus something", this means "length of object multiply by given number". Relative offset is a factor, that multiply with length of the object. In your case is 1.25 for top block and 1 for others.

If want to calculate it, lets try:

Offset in m is 1.45 (1.25+0.2) relative unit is 1.25. So to get offset you need to divide 1.45 by 1.25

1.45/1.25=1.16

So, 1.16 is offset in relative units.

For bottom blocks with 1m length  relative units will be different (block has 1m length), so offset will be 1.45 / 1 = 1.45


How to view without vertices Hi there, so I've been sculpting a face and I wanted to pull back and take a look at it, but I realized I have no idea how to turn off all the vertices and edges, someone please help me out.

You might have checked "Wireframe" in the Viewport Overlays menu by accident. Seeing that you are already in object mode and have switched to solid view, this could be the problem.


Recognize bridging faces of splits at a plane I've got a plane with multiple splits. Unfortunately there are undeleted vertices bridging these splits. Is there a way to automatically recognizing these bridges and selecting the faces of them?

One not always working way is to select similar vertices by amount of connected edges with increasing selection after that.

Start by selecting one vertex located in the corner between one of those "bridged faces" and main plane.
Press Shift+G to access Select Similar menu and choose Amount of connected edges. This will select some of vertices of desired part.
Increase selection by pressing Ctrl+Numpad + to select more.
Switch to Face Selection mode and decrease selection by pressing Ctrl+Numpad -.

This won't work when part of plane between these "bridged faces" is less than 4 polygons. Then on step 3 you'll end up with more selected faces you could deselect in step 4; i.e. the deselection won't work that accurate.


(Animation nodes) Is there a way to instance objects inside a subprogram? I'm working on a recursive fractal where a hand splits into 5 new hands, much like this:

but my node setup looks like this:

each of the 2 huge groups on the bottom is for just 1 level of recursion. Since the addon seemingly doesn't allow objects to be instanced inside subprograms, you can see at the top I have to output each new hand, instance it outside the group and pass it to the next level. That means, if I wanted to add another level, I would have to output all 25 individual hands, and exponentially more each level. Please, someone tell me there's an easier way to do this.
Here's the .blend file if you want to take a closer look:

www.mediafire.com/?vso1h3wk68jjmpt (just copy-paste it, my rep isn't high enough for >2 links in 1 post)

You can use a script as workaround, so that AN cannot see that you create object instances in a subprogram:

Using scripts is the same way as all subprograms in AN. For script:

Add a text
Write the script, identifying the variables that will be inputs and output
Set these parameters adequately in the script node

But, a big warning: be careful about the frame changes as it could generate a lot of objects.

If this is happening, you can use some script to apply in Python console, like:

for m in [m for m in bpy.data.meshes if m.users == 0]: bpy.data.meshes.remove(m)


Transform mesh to line up with empties, based on other child empties This is a bit of a difficult one to explain, but I'll try my best. Essentially I have a mesh, generated by photogrammetry. I also have a 3D tracked camera exported from After Effects. Along with the 3D tracked camera from AE I also have some reference points I've put in the world in AE.

I need to line up the photogrammetry mesh so that the position, rotation and scale matches the original footage relative to the tracked camera. The only way I can think to do this is to put reference points on the tracked footage in AE (which get imported as empties in Blender), create empties at the same places on the photogrammetry mesh and then attempt to manually rotate, scale and position the mesh so that its child empties line up with the reference empties.

Here's a simulated picture for reference. On the left, the sphere represents my photogrammetry mesh with the empties added. On the right are the reference points added in AE:

And then when the process is complete, this is how it would look:

The problem is, doing this manually is extremely difficult and time-consuming. For one, the scale of both photogrammetry (using Meshroom) and AE's tracking is arbitrary, so the scales tend to be vastly different. It's also just straight up really hard to get everything lined up by hand.

So my question is this. Is there a way to do this automatically? Obviously the relative positions of the empties that I place by hand on the photogrammetry mesh, and the empties that come from the nulls I've added in After Effects won't be exactly the same, so any automatic solution would have to be a "best fit" sort of thing. But does this exist? Or is there perhaps a simpler way to achieve the same thing?

In the end I decided to just learn how Blender's scripting works and wrote a script. I know there would be simpler ways to calculate the transformations but I'm no maths expert and I wanted to spend my time debugging my logic errors rather my maths errors.

Basically what this script does is take 3 input points (in the form of empties) relative to the photogrammetry mesh and 3 input points in the same position relative to the tracking data, then attempts to line them up with each other, bringing the photogrammetry mesh along with it. This actually works pretty well in my testing. It's obviously not the fastest workflow but it does work and that's the important part.

import bpy
import bmesh
from mathutils import Matrix

#####################################
# TO USE:
#
# 1) create empties at three easily-identified positions in tracking data, called ea1, ea2 and ea3
# 2) create empties at the same three positions but in photogrammetry data, called eb1, eb2 and eb3
#    NOTE: eb1, eb2 and eb3 must be positioned IN THE SAME ORDER as ea1, ea2 and ea3!
# 3) name the photogrammetry mesh "photogrammetry"
# 4) run the script and be amazed
#
#####################################

# from https://blender.stackexchange.com/a/118783/41192
def createLookRotation(forward, up):
    rot = Matrix.Identity(3)
    rot[0] = up                 # x
    rot[1] = forward.cross(up)  # y
    rot[2] = forward            # z
    rot = rot.transposed()
    return rot.to_quaternion()

def doMeshThing(obj, mesh, empty1, empty2, empty3):
    bm = bmesh.new()
    bm.verts.new(empty1.location)
    bm.verts.new(empty2.location)
    bm.verts.new(empty3.location)
    bm.verts.ensure_lookup_table()
    bm.faces.new([bm.verts[0], bm.verts[1], bm.verts[2]])
    bm.normal_update()
    bm.to_mesh(mesh)
    bpy.ops.object.select_all(action='DESELECT')
    obj.select = True
    bpy.ops.object.origin_set(type='ORIGIN_GEOMETRY')
    bm.faces.ensure_lookup_table()
    normal = bm.faces[0].normal
    guide = empty2.location - empty1.location
    quatRot = createLookRotation(normal, guide)
    obj.rotation_mode = 'QUATERNION'
    obj.rotation_quaternion = quatRot.inverted()
    bpy.ops.object.transform_apply(location=False, rotation=True, scale=False)
    obj.rotation_quaternion = quatRot
    bm.free()

ea1 = bpy.data.objects['ea1']
ea2 = bpy.data.objects['ea2']
ea3 = bpy.data.objects['ea3']
eb1 = bpy.data.objects['eb1']
eb2 = bpy.data.objects['eb2']
eb3 = bpy.data.objects['eb3']

mesha = bpy.data.meshes.new('mesha')
meshb = bpy.data.meshes.new('meshb')

obja = bpy.data.objects.new('obja', mesha)
objb = bpy.data.objects.new('objb', meshb)

scene = bpy.context.scene
scene.objects.link(obja)
scene.objects.link(objb)

doMeshThing(obja, mesha, ea1, ea2, ea3)
doMeshThing(objb, meshb, eb1, eb2, eb3)

bpy.context.scene.update()

# position and rotate objb (photogrammetry) to match position and rotation of obja (tracking)
photogrammetryMesh = bpy.data.objects['photogrammetry']
photogrammetryMesh.parent = objb
photogrammetryMesh.matrix_parent_inverse = objb.matrix_world.inverted()

objb.location = obja.location
objb.rotation_quaternion = obja.rotation_quaternion

# calculate average dimension difference here and scale
scaleDiffX = obja.dimensions.x / objb.dimensions.x
scaleDiffY = obja.dimensions.y / objb.dimensions.y
scaleDiffZ = obja.dimensions.z / objb.dimensions.z
#averageScaleDiff = (scaleDiffX + scaleDiffY + scaleDiffZ) / 3
averageScaleDiff = (scaleDiffX + scaleDiffY) / 2 # seems to be in local space, so z is useless
objb.scale.x = averageScaleDiff
objb.scale.y = averageScaleDiff
objb.scale.z = averageScaleDiff

bpy.context.scene.update()

parented_wm = photogrammetryMesh.matrix_world.copy()
photogrammetryMesh.parent = None
photogrammetryMesh.matrix_world = parented_wm

bpy.ops.object.select_all(action='DESELECT')
obja.select = True
bpy.ops.object.delete()
bpy.ops.object.select_all(action='DESELECT')
objb.select = True
bpy.ops.object.delete()


How do I "shift select" from object A to object B in outliner? An action i would do with SHIFT in many apps , here doesnt work...whats the right shortcut ?

Thank you  !

You can border select (B and  LMB drag) the items. If you want to select the in the 3D View as well, do a  RMB click and choose Select.


images as sequence in image texture node doesn't work I created 3 different oceans with ocean modifier with different displacement and used linear extrapolation to animate it.
I then baked the 3 simulations.
After that i created a new plane and applied the baked ocean sims as texture to animate it and apply the displacement. the problem is only one frame out of the 150 is being applied instead of the entire animation even though i use image as sequence option in image texture. Also in the blend file if u unhide the displacement collection you can see the different oceans.

Check if you have auto update enabled in the image sequence node. If it's disabled it won't update the frame in the viewport when you play or scrub the timeline. But even it's disabled it should play correctly when rendering.
If you want the texture to loop, also enable "cyclic" or the texture will pause on the last frame. And for good measure check if the 'Frames' number is correct (this number should be the number of frames in your image sequence).


What does this do: fps = scene.render.fps / scene.render.fps_base? In blender python what does fps = scene.render.fps / scene.render.fps_base exactly do? I understand that it gives frames per second but how does that work. What is scene.render.fps_blender?

In command
fps = scene.render.fps / scene.render.fps_base
fps is a variable that is given the value of the actual framerate of the scene.
scene.render.fps is the framerate but can only hold integer values. If you want non-integer framerates this value has to be divided by some value. Default is 24.
scene.render.fps_base is a way to get non-integer framerates. The type is a Float and the default is 1.0.
scene.render.fps_blender doesn't exist and will give you an error.
Examples:

60.0 = 60/1.0

20.5 = 41/2.0

29.75 = 30/1.008


Having problems with add-ons: missing add-ons and incorrect warnings? In the Bleder scripts page for Add Curve Extra Objects:

Installation
This script is in Blender 2.79 Add-Ons menu.

Shift selected all supported levels then I typed "add" in the Add-ons search, no listing for "Add Curve Extra Objects"

Then I typed "curve" in the Add-ons search, no listing for "Add Curve Extra Objects"

Then I typed "add curve" in the Add-ons search, no listing for "Add Curve Extra Objects"

Then I typed "extra" in the Add-ons search, now it shows up.

Also while typing "add" I came across Camera: Add Camera Rigs
Warning: ! Enable Auto Run Python Scripts in User...
Checked, it already was checked to be enabled long ago.

Do I bug report this? Or am I not getting something about Blender?

The reason it doesn't show up is that the "Add Curve" part of the name of the addon is simply the category in which it is located. If you search the rest of the name "Extra Objects" it will show up.

As far as I know, the warnings for needing other settings show up whether they are necessary or not. Not necessarily a bug, but it could be improved in the future to disappear if everything is in order.


New Blender 2.8 Subdivision Surface UV Smooth isnt working UV Smooth option isnt working for me in new blender.
I checked "Smooth,keep corners"
My mesh does not have creased edges

Ok, in order to make it work now  you have to get rid of ngon


Not all polygons are reflecting the environmental texture, ideas? I've been for the life of me trying to figure this out, but can't seem to figure it out.

I want to make something that looks similar to this:
So, This is what I've done.
a) Gone into cycles, created a mesh, subdivided it (i.e., 10x), did a bit of fractal geometry (i.e., 0.25), and so I get a wavy mesh
b) I then apply a glossy shader, add an environmental HDRI image texture

and the problem is, I get something that looks like this:

It's not "bad" - but not all the surfaces are reflected. "Some" of the surfaces are properly reflected (the environmental world map) - but other polygons are just SOLID colors.

Any idea how to "fix" the solid colors and make them properly reflect too? I've tried adding other planes to reflect against, but it doesn't seem I can get them all to have a reflected surface.

Thanks!

Mostly likely you need to smooth all the faces, some materials works with the geometry, like reflections or refractions. Then to get the desired shape and highlights, I would inset all the faces individually (I+I hotkey) to get the desired hard edges.

If you want you can bevel the edges but you will get some artifacts depending on your topology. And that black edge on top can be another material, give enough subdivisions, you can select the corner faces and apply a darker material, will look really close to what you want.

Hope it helps,


Viewport perspective not indicating what view I'm in Even though i know the viewports and what num.keys they correspond to by heart blender is not showing what perspective i'm on in the top left corner, even if a start a new scene. The only way i been able to get it display is to load factory settings which means i have to activate all my add-ons again.

In the user preferences (located in 'File' menu in 2.79), go to 'Interface' tab and change 'View Name'.

For 2.8, I think this is no more in the preferences but in the 'Viewport Overlays':


ray_cast function not able to select all the vertices in camera view The aim of the below code using ray_cast function (thanks to @lemon) is to find all the visible vertices present in the camera view (previous post's Link). It does find some of the vertices of a mesh in the camera view, however, some of the vertices are missed as shown in Figure 1 and 2. But, for my work, I need all the vertices as shown in figure 3 and 4.

import bpy
from mathutils import Vector
from mathutils.bvhtree import BVHTree
from bpy_extras.object_utils import world_to_camera_view

# Create a BVH tree and return bvh and vertices in world coordinates
def BVHTreeAndVerticesInWorldFromObj( obj ):
    mWorld = obj.matrix_world
    vertsInWorld = [mWorld * v.co for v in obj.data.vertices]

    bvh = BVHTree.FromPolygons( vertsInWorld, [p.vertices for p in obj.data.polygons] )

    return bvh, vertsInWorld

# Deselect mesh polygons and vertices
def DeselectEdgesAndPolygons( obj ):
    for p in obj.data.polygons:
        p.select = False
    for e in obj.data.edges:
        e.select = False

# Get context elements: scene, camera and mesh
scene = bpy.context.scene
cam = bpy.data.objects['Camera']
obj = bpy.data.objects['Cube']

# Threshold to test if ray cast corresponds to the original vertex
limit = 0.0001

# Deselect mesh elements
DeselectEdgesAndPolygons( obj )

# In world coordinates, get a bvh tree and vertices
bvh, vertices = BVHTreeAndVerticesInWorldFromObj( obj )

print( '-------------------' )

for i, v in enumerate( vertices ):
    # Get the 2D projection of the vertex
    co2D = world_to_camera_view( scene, cam, v )

    # By default, deselect it
    obj.data.vertices[i].select = False

    # If inside the camera view
    if 0.0 <= co2D.x <= 1.0 and 0.0 <= co2D.y <= 1.0:
        # Try a ray cast, in order to test the vertex visibility from the camera
        location, normal, index, distance = bvh.ray_cast( cam.location, (v - cam.location).normalized() )
        # If the ray hits something and if this hit is close to the vertex, we assume this is the vertex
        if location and (v - location).length < limit:
            obj.data.vertices[i].select = True

del bvh

I've modified the above code a bit just to test the behaviour of normal scene.ray_cast function (not the bvh.ray_cast). However, the results are same.

import bpy
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view

# Deselect mesh polygons and vertices
def DeselectEdgesAndPolygons( obj ):
    for p in obj.data.polygons:
        p.select = False
    for e in obj.data.edges:
        e.select = False

# Get context elements: scene, camera and mesh
scene = bpy.context.scene
cam = bpy.data.objects['Camera']
obj = bpy.data.objects['Cube']

# Threshold to test if ray cast corresponds to the original vertex
limit = 0.0001

# Deselect mesh elements
DeselectEdgesAndPolygons( obj )

# In world coordinates, get vertices
mWorld = obj.matrix_world
vertices = [mWorld * v.co for v in obj.data.vertices]

print( '-------------------' )

for i, v in enumerate( vertices ):
    # Get the 2D projection of the vertex
    co2D = world_to_camera_view( scene, cam, v )

    # By default, deselect it
    obj.data.vertices[i].select = False

    # If inside the camera view
    if 0.0 <= co2D.x <= 1.0 and 0.0 <= co2D.y <= 1.0:
        # Try a ray cast, in order to test the vertex visibility from the camera
        ray= obj.ray_cast( cam.location, (v - cam.location).normalized() )
        # If the ray hits something and if this hit is close to the vertex, we assume this is the vertex
        if ray[0] and (v - ray[1]).length < limit:
            obj.data.vertices[i].select = True

Hence, I'm wondering whether there is some error with the ray_cast functions or something I'm doing wrong.

The modified code!:
import bpy
from mathutils import Vector
from bpy_extras.object_utils import world_to_camera_view

# Deselect mesh polygons and vertices
def DeselectEdgesAndPolygons( obj ):
    for p in obj.data.polygons:
        p.select = False
    for e in obj.data.edges:
        e.select = False

# Get context elements: scene, camera and mesh
scene = bpy.context.scene
cam = bpy.data.objects['Camera']
obj = bpy.data.objects['Cube']

# Threshold to test if ray cast corresponds to the original vertex
limit = 0.1

# Deselect mesh elements
DeselectEdgesAndPolygons( obj )

# In world coordinates, get a bvh tree and vertices
mWorld = obj.matrix_world
vertices = [mWorld @ v.co for v in obj.data.vertices]

print( '-------------------' )

for i, v in enumerate( vertices ):
    # Get the 2D projection of the vertex
    co2D = world_to_camera_view( scene, cam, v )

    bpy.ops.mesh.primitive_cube_add(location=(v))
    bpy.ops.transform.resize(value=(0.01, 0.01, 0.01))

    # By default, deselect it
    obj.data.vertices[i].select = False

    # If inside the camera view
    if 0.0 <= co2D.x <= 1.0 and 0.0 <= co2D.y <= 1.0 and co2D.z >0:
        # Try a ray cast, in order to test the vertex visibility from the camera
        location= scene.ray_cast(bpy.context.window.view_layer, cam.location, (v - cam.location).normalized() )
        # If the ray hits something and if this hit is close to the vertex, we assume this is the vertex
        if location[0] and (v - location[1]).length < limit:
            obj.data.vertices[i].select = True


Move object using coordinates from other objects Is it possible to move an object using coordinates from other objects?
Example (see screenshot): Is it easily possible to move the blue cube in x-direction using the distance from the upper right corner of the green cube and the upper right corner of the right cube?
I currently measure the distance with snapping and add the number manually to the x-position of the blue cube in the location panel.

you might want to have a look at this addon. It lets you do all kinds of things that are usually very simple in more CAD based platforms
https://github.com/s-leger/blender_cad_transforms


Which graphics card would permit eGPU rendering in Cycles with iMac? My iMac specs:

3.6 GHz Intel Core i9
40 GB 2667 MHz DDR4
Radeon Pro Vega 48 8 GB

My graphics card does not seem to be compatible for GPU rendering with the Cycles engine.
I even tried the AMD Radeon ProRender option but it does not seem to work. Some files won't display as I get errors.
Can someone please suggest which graphics card and eGPU would be compatible with Blender 2.8 in Mojave?
Any feedback is much appreciated.

Blender has stopped OpenCL (the API AMD uses) support for Mac because the compiler on macOS is very buggy. Apple also hasn't shown any effort to fix it, and instead favored their own API called Metal (which Blender does not support).
Blender does, however, support CUDA on MacOS meaning that if you have an Nvidia GPU that is CUDA capable and has a compute capability of 3.0+, you would be able to render with that card. However, recent macs do not use Nvidia cards anymore, so the only way would be to use an eGPU with an Nvidia card installed. You can also install Windows on your mac and just use the AMD card you have as window's OpenCL compiler has no big issues and is supported by Blender.


Find the size of an object in camera frame for bounding box creation What I am trying to do is extract the bounding box location of a spherical object in the camera frame, in terms of pixels. Using the function:
world_to_camera = bpy_extras.object_utils.world_to_camera_view(scene, camera, tracked_actual_location)

The outputs of this function are:
world_to_camera[0] -> X-location from 0-1
world_to_camera[1] -> Y-location from 0-1
world_to_camera[2] -> Depth on the view axis

My first question that I can't verify is: Is world_to_camera[2] the actual distance between the camera plane and the tracked_object plane? If so, the following code calculates what I want:
apparent_size = (actual_size * focal_length)/world_to_camera[2]
x_resolution = scene.render.resolution_x
pixel_pitch_x = focal_length/x_resolution
width_in_pixels = apparent_size/pixel_pitch_x

I have reason to believe it is not correct because for my object configuration I am getting a result of width_in_pixels = 0.83, whereas zooming at the rendered image it has a width and height of 3 pixels. Any clarification will be appreciated.

Ok, I think I found my mistake. The output from world_to_camera[2] is the actual planar distance that should be used for the calculation. However, instead of using the focal length of the camera to calculate the pixel pitch, the camera sensor width should be used instead such that:
sensor_width = camera.data.sensor_width/1000
pixel_pitch_x = sensor_width/x_resolution # [m]

The output for my previous configuration is now 1.006 pixels, which also explains why the rendered image fills 3 pixels. The way I see it, the resolution of the camera is not fine enough and therefore it interpolates the 0.006/2 pixels in each direction by filing them with a lower pixel intensity value.
The link to the reference that got me to use the sensor width instead of the focal length:
http://www.robsphotography.co.nz/crop-factor-advantage-appendix-2.html


Why is the texture section empty I'm following this tutorial, and at 35:05 when he moves from the materials to the textures section there's loads of stuff in there, but on my screen there's nothing, it's completely empty.

What am I doing wrong? I can't find any manuals or tutorials in Blender 2.70a (what I'm using) cause it's really new, so is this a difference between versions? He's obviously using something older than 2.7 in the tutorial, but it doesn't look that different and I've been able to work out any problems until now. So how do I fix this?

Link to blend file

You had the properties panel pinned.

Pinning will make the panel display the properties of a specific object (the active object when the pin icon was pressed), instead of displaying the properties of the currently active object.

Click the little pin icon, and it should appear as expected:


Link : Use ojects and baked simulation in another .blend I made a simulation with a bunch of objects and rigid body constraints in file1.blend.
I would like to use it in another file (file2.blend).

I guess I need to link the object and the baked simulation. ( Note that I couldn't find the bake options in my 2.82 version, for instance the Use Library Path option ).

I could use some help ...

Thanks !

You can use Collection Instances for that.

Put all your simulation objects inside a Collection
Link that Collection into another file (using File > Link). That will create an Instance.
Move your linked Collection Instance as one object

Linked simulation from another file then behaves like one object.


Bevel only on edge, not vertices I wish to apply a bevel modifier to one edge, and not its two vertices.
Here is an exemple :

The bevel is fine on the edge (blue), but it also smoothen the vertices (in red).
How can I avoid that ?
Thanks for any help.
EDIT :
Here is an approximation of what i want :

The goal is to have a quick and clean process for this.

I don't think you can avoid this triangulation with the bevel tool. But you can add edges with knife, or, easier, with a simple subdivision: il will keep your edges parallel, you'll just have to guess the good distance between them when you'll slide them:


Global rotation of child bone? How can I get the global rotation of a bone from the Blender editor? I want to constrain a bone to have only that rotation, regardless of its parent. I want it in pose mode.

Create an IK bone directly at the root of your hand.
Constraint lower arm to the IK bone.
Make sure inhert rotation for the IK bone is turned on.


Bezier curve not changing animation movement? Here is something I made:

The animation is very jagged and I want to make it fluid. I tried changing the interpolation mode in the graph mode to bezier but it didn't change anything :(

Thanks!

Here is the graph view!

Suggestion.

Reduce the number of keyframes.  You have not shown your frames per second.

Consider having a IK target to have a [Follow Path Constraint].  Paths can be infinitely smooth ... only limited by your frames per second. Insert Keyframes beginning with 2 only. Search Follow Path Constraint here at BSE.

See the addon Simplify Curves.

Do one of 2 actions to archive your current keyframes.

Archive your file. Copy the file.
Create a scene which is a copy of the first scene.

Move your keyframes further down the timeline beginning at frame 50. You can also delete the current set of keyframes to live dangerously.

The result should be no keyframes between frame 1 and frame 40.

Next insert 2 keyframes only at frame 1 and frame 40 and judge whether or not it looks choppy.  Consider adding two more  keyframes and again judge whether it looks choppy.  Slowly increase your number of keyframes to see the tension between controlled movement and an excess of keyframes.  If you have both the new and improved keyframes and the old keyframes you can compare them in the playback.

Only you can judge whether or not something is smooth and fluid, at least with your Blender Animation.  We do not know whether the animation is intended to be karate or the Balshoi Ballet.

Know that IK Inverse Kinematics can sometimes produces a sudden rotation. Poles are meant to control this.


How to move a curve without evaluating it in Sverchok? I obviously can't use matrix apply or move nodes, because curve before evaluation isn't defined by positions of vertexes (I think it's represented as a function). I tried curve offset and cast curve, but all those are distorting the curve, not just moving it.
Edit: I am using a "Curve Mapper" to create the curve. I tried changing clipping (min Y to -1 and max Y to 0), but it doesn't let me edit the curve (all points can be only moved to Y = 0).
I am stuck, why isn't there any "Move Curve" node? From my limited perspective, it renders a lot of other nodes useless (e.g. "Concat Curve" - I want to move one curve bellow the other curve and then do the join, otherwise it results in nonsense).

You can use Apply Vector Field to Curve node. Pass a vector or a matrix to it's Field input.


Getting Horrible spots on textures I cant simply paint on certain surfaces and i am getting some weird spots on the surfaces that i can paint. Does anyone have a fix???

You need to look at zooming in closer to your paint surface, or maybe switch to the Fill tool since you are using Face Select Masking it might be easier to drop the color in that way.

The main reason is that 3d painting uses projection, and being far from the target can cause it miss. Smaller brush sometimes helps also.


Duplicate particle system (not linked) I want to duplicate particle system(shift D), and make different Render objects. But after i change Object, it makes the same change in both particle systems ( original and duplicated). Somehow it's still linked.. ?

I think i found solution. It's enough to click on this icon near Particle Settings, and it makes particle different from others.


how can I make a 3D object appear behind an object in a video I'm considering making a VFX video with Blender and I want a 3D mesh in Blender to render partly behind a wall in the 2D video footage.

How can I do this?

There are a couple of ways you can do this, off the top of my head:

1: MASKING - you can setup a simple box mask to remove/hide the part of the 3D object so that it appears to be "hidden" partially behind the wall in the video even though it is a layer sitting on top of the video.

2: PROJECTION MAPPING - this way is more complicated. You recreate the video scene in the 3D viewport, apply the video as textures to each object, set lighting, then position your 3D object and animate as necessary. This gives more accurate results in terms of shadows from the 3D animated object moving within the actual/recreated scene.

Depending on the end result that you're looking for, these are just a couple of ways to get there.


Blender 2.8 - default tab is empty i recently started using blender 2.8 (was previously using 2.79), and out of the sudden my default tab goes empty. i can't find my objects anywhere. however, if i go any other tab - animation, uv editing... - it's all there! i've already tried deleting the Blender Foundation folder, but had no luck. anyone knows what i did wrong and how i can fix this? thanks!

Sounds like the view has gotten lost in space somehow. You can try pressing Home to zoom the view to the currently visible objects (where "visible" means not hidden or in a hidden collection), or you could use A and Numpad . to select everything and then zoom the view on the selection.


Can you put Multiple physics simulations in one scene simultaneously? Trying to add multiple smoke simulations running at the same time in 2.8. but only one will render at a time

In your physics settings, go to the cache tab and choose free all bakes

Once you have done that choose Bake all dynamics. That should do what you need.

FYI: If you want your smoke simulations to interact, the easiest method is to have them in one simulation, else it becomes tricky. Someone else may have a way to do so but this is the best method I can think of.

Good luck with your project and I hope I helped,

BFB


Get path of my script file How to find out the file path I dropped my Python script from?
I want to call an external application for image post-processing from a Python script and I want the application to be in the same folder as the script. And I want Blender to automatically find that application.

I know about this question:
"How do I get the path my script is running in?"
but it's not the same

bpy.context.space_data will give you the current text editor when you click run script, where you can access the text block.

print(bpy.context.space_data.text.filepath)

For an unsaved text block this is empty. For a file dropped onto the text editor or opened by using the Text->Open Text Block menu item you will still get an empty filepath.

Blender doesn't appear to fill in the filepath property of a text block unless you save the text block to disk, meaning you need to open the text block and then save as to get a filepath. Once it has a filepath you can save, close and re-open the blend file and it will keep the filepath.

__file__ will give you the path to the text block inside the blend file. That is the path of the blend file with the text block name added as if the blend file was a directory. This applies even if the file is saved to disk.

For your own use you can setup the blend file with the script. If you want to share this then you probably want to make it an addon with AddonPreferences to save the path to the utility. On registration you might search a few possible paths to get the initial setting and have the user set it as needed, or you can tarball the script and utility so that it is next to the addon script when the user installs it.


Python Diffuse Color How do you select diffuse_color in python

Select object then use (for texture sort 0, after create texture):

bpy.context.object.active_material.texture_slots[0].use_map_color_diffuse = True


Hair Sticking Simulation I have a hair particle system. I would like the hairs to be attracted to a nearby mesh based on its proximity, not unlike how human hair reacts to a statically charged balloon.

This would be enormously useful for a number of animated effects, from the aforementioned balloon hair, to chaotic alien tentacle walking, to a plasma ball.

I feel like force field physics might be key here, but so far I've not found much in the way of results here.

How might I achieve this?

As you guessed, you can accomplish this using Force Fields, which by default interact with hair particles that have Hair Dynamics enabled.

I recommend trying the generic Force, which tends to well for most cases that need a uniform radial force. To have the field attract hair instead of repel, you need to set the Strength to a negative value.