text:
Adjust random seed of displacement textures
How can I adjust the random seed used for the textures in the Displacement modifier?
For example, I have a Displacement modifier using a Voronoi-Minkowski 4 texture that creates a nice look for a rock. However, I want to have multiple "random" variants of this rock. When I duplicate the rock and the texture, the pattern is identical:

I can adjust the pattern by setting the texture space to Global in the Displacement modifier settings. However, this seems like a clumsy/hackish solution. What really makes sense is just a Seed property in the texture.
I have tried translating and scaling the texture space with ShiftT, but this does nothing (surprisingly).
What is the best way to accomplish this?

I think it's really the only way right now (object coordinates work too, but that's basically the same workaround as global coordinates). Would indeed be good to change that.

Using object coordinates is not quite the same as using global coordinates, because it does not depend on the location of the object being displaced, only that of the displace object. So it's a lot more like a seed, and you can have different displace objects per modifier.

How about using the UV coordinates? You could randomize those with a script.

good way of doing it: http://blender.stackexchange.com/questions/1795/random-maps-in-cycles

@krivar I wish, but textures aren't node-based. This is a displacement texture, not a Cycles texture.

@WChargin Texture nodes support for modifiers is on the TODO list but will not be much help as you need to transform the coordinates not the texture. Cycles supports displacment so that is another option.

To get the equivalent of translating and scaling the texture space, you will need to use Object coordinates for the displace modifier.

This allows for displacement independent of the location of the object being displaced.
For example, using Global coordinates, let's say you want a rock to be in a certain location, but it is not being displaced in the way you want.
using global coordinates the rock can only be displaced in one way per location.
Using Object coordinates, you can adjust the displacement by moving the object being used as Texture coordinates without moving the actual rock.
If you then decide to move the rock but want to keep the way it is displaced, all you have to do is move both the rock and the Texture coordinate object.

The trick to random variations is to use drivers for the desired value.
To start, create a new text block in the text editor. Give the text block a name ending in .py (this allows you to register the script so that it will be automatically run on opening the blend file).
Fill the script with the following text -

After running the script you will have access to the specified functions within your driver expressions.
Right click on a value and Add Driver (or press D with cursor over value). Within the graph editor you can modify the driver expression to suit your needs.

Credit goes to Dave Miller for his drivers tutorial which contains more info.

I'm not sure I understand completely. Where would one plug this driver in, to act as a displacement seed?

Any value that alters the appearance of the displacement. Most likely this will be values within the texture used to displace. You can add a driver to the colour and location of stops within a colour ramp, the brightness/contrast, Basis, even the texture type.

I don't think that's a good solution because 1) changing any of those inputs changes the characteristics of the texture, rather than making it another version of the same texture. When you've found a set of texture settings that do what you want, you REALLY don't want to change the fundamental values (bright, contrast, color, etc), you just want another one that doesn't look identical. 2) the texture will not look "different," just modified. E.g. changing the contrast will leave the hills and valleys (lights and darks) in the same place, they'll just be more or less extreme.

I often encounter this same problem, but I solve it a different way.
Firstly, as @gandalf3 suggests in his comment on the first answer, I don't think it's possible to modify the seed of the texture, with or without a driver.
I usually add a mapping node for each texture that I want to be different. I'll give each one some different x, y, and/or z translation. This uses a different part of the texture without affecting its scale or other characteristics, and doesn't require another object to keep track of.

Yes, this would work for Cycles textures, but this is a texture for a displacement modifier.

You can still use the node editor to create the texture, IIRC there's a texture output node? Something like that? Sorry, not sure. Or you can just adjust the mapping in the texture panel, for each texture.

It sounds like you want to be using UV coordinates. If you don't want to modify them directly you can use a UV Warp modifier before your displacement.

UV Warp uses 2 objects to define a transformation which is applied to the UV coordinates.


text:
Missing the circle brush in sculpt mode using Blender 2.8
When I open a new sculpt scene it works perfectly, but as I was editing my own model I must have pressed something by mistake and now it's disappeared. The green arrows are pointing to the diamater/radius/sculpt circle thingy that I'm talking about.

Also, if anyone knows the official name of that pinkish colored circle that would be very helpful, I might be able to simply find it in the UI myself if I knew what it was named... I'm calling it brush circle which is not an accurate description. :)

OK This could be a little bit issue from Users from 2.7 to 2.8
If the sculpt Brush cursor is not visible just go here.
You only need to Brush Settings and Activate the Cursor option on.
This option is in the side bar.
But it also avaliable in the header of Blender.

I had the same problem. Go back into object mode and again into sculpt mode. It reappears.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/

sort: votes


text:
Rope Physics Causing Issues
I've read through a few questions, watched at least 5 videos and I'm getting stuck on this. Hoping more experienced users can help me out.
In the attached Blend file, I've got a mortar board I've created and I'm in the process of trying to get the first strand ready. I'm talking about the cord that connects from the pin at the top of the hat to the brass or metal piece before all the strands.
I finally seem to have some of the settings right because the string is pinned where I want it. However, it's like the hat doesn't exist. I have collision turned on. Can someone give me an idea of what I'm doing wrong? Or if you have one, an easier way to go about these next steps?
I'm trying to get this project finished by tomorrow (or the weekend). Any tips would be greatly appreciated!

First, you need to fix the normals on the hat.  They're pointing the wrong direction.  This can often cause issues with physics, which can use normals to decide inside/outside-- what's solid and what's not.
But that's not the only issue.  The other issue is that you're colliding simple, low-vert-density strings of verts-- remember, your skin modifier isn't even being evaluated until after the physics-- and so there are only a few places on the mesh that are even being checked for collision with the hat.
By default, soft body physics like you're using uses virtual balls centered on each vertex of the mesh to test for collision.  And if you play that animation, after fixing normals, you'll notice that none of your vertices ever go through your hat.  The collision is working!  It's just that it looks wrong, because even though the verts collide properly, the edges still go through the hat.
One thing you can do is, just make more verts.  This will create more places along your string for Blender to test for collision with the hat.  Subdivide your strings to create 3 or 4 times as many verts.  Do this in edit mode: modifiers won't be evaluated until after your soft body physics have run.  You'll probably have to tweak your physics settings afterwards: more verts means more freedom of motion, which usually needs to be compensated for by strengthening soft body edge forces.
Another option is to use edge collision instead of vertex collision.  In properties/physics/soft body/edges, you'll see a checkmark for "collision edge".  If you enable this, Blender will try to use the edges of the mesh for collision.  I think you'll see that you'll still want more vertices than you have right now though.

Nathan and Chris, thank you both! I appreciate your time, advice and visuals.

Nathan answer is totally right, but i don't know whether it if easy to understand for beginners, although he is totally right with everything he wrote.
To sum it up for a beginner:
1.) Fix your normals: select your hat, press tab for edit mode, then mesh -> normals -> recalculate outside then tab again for object mode

2.) select your rope -> check "collision edge"

3.) if you play your animation now, it works, but looks horrible

that is because you do not have enough subdivision in your ropes, so select your rope, press tab for edit mode, A to select all, right mouse click -> subdivide -> enter 5 in number of cuts in the left bottom menu which appears and you will get:

Nathan and Chris, thank you both! I appreciate your time, advice and visuals.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Can’t change fire color to black?
I am trying to make an image with black fire against a white background but whenever I change the color ramp to black the fire just disappears, any help is appreciated.!
This is the node set up I have for the color (https://i.sstatic.net/qWJcw.jpg)

Emission with black color doesn't work in Cycles as far as I'm aware. That would be physically implausible, something that's pure black wouldn't emit light.

Try this node setup.  It's from Blender guru's fire tutorial.  I tested it out for you and it made black fire, so there you go.
I suggest watching the fire tutorial.  It gives a lot of good information on how to create good looking fire.  The video is titled How to "Render Fire in Cycles".


text:
Strange curved topology edge when merging vertices

the spots that this happened is where two verts of the surfaces were merged together.

Check faces orientations.

Try to disable the subsurf modifier when modelling because it can lead to mangled mesh topology

It looks to me like you're merging vertices from two "sheets" of the surface -- the sheets separate as you move to the right. It also looks like you have a Subsurf modifier on, right? Then here's my thought: Each of the vertices you merged had four edges attached. When you merged them, the merged vertex had somewhere between five and eight edges (depending on whether you also merged some of the adjoining edges; since the surfaces are still separating on the right, you probably didn't merge all of them). But Subsurf works well on quads and four-edge vertices; it gets confused on n-gons and poles (vertices with more or fewer than four edges), often causing "pinching" effects.
You won't be able to fix it entirely, but adding edge loops near the poles can make the pinching effect smaller.


text:
I'm not sure where to go from here in my uv mapping!
I'm new to blender and was wondering what would be the steps to resolve the artifacts I'm seeing in this texture. The texture is supposed to be a lampshade. I'm unsure what to do to the uv map in order to fix this issue.

That's kinda weird looking (the shading artifacts, not the model). Maybe you have some extra faces in the model you need to delete?
Assuming that's not the case, first remember that lamp shades don't have tops (unless you want this one to), so you can delete that face if you like.
If you still need them, they will cause you problems if you have faces with more than 4 sides. The fix for that is to select each n-gon ("circular"-looking face with many sides) in the modeling view and go to face -> poke faces. This will create a triangle fan pattern but leave your current UV's intact.
Now, a feature of UV mapping you might not be aware of is called "seams", as in seams on pieces of cloth that get stitched together to make clothes. In the modeling view, select all the edges that indicate separate pieces of the model (those would be the edge loops that separate the top of the lampshade from the cylindrical side, and the cylindrical side from the bottom. With those selected do Edges -> Mark Seams. You will get red highlights on those edges.  You will also need to select an edge that runs down the lampshade so it can be folded flat, like a cylinder being unfolded on a table. Choose Edges -> Mark seams for that too.
Now choose UV --> Unwrap and your model should be almost perfectly unwrapped for you without any manual adjustments needed.

I suspect double faces:
- select all verts
- alt m
- select by distance
That may or may not mess up your uv's but it's not that hard of an object to unwrap
Another thing that could definitely be causing the problem is that the normal map needs to be changed from Color to Non-Color in the drop down below the file slot.


text:
How can panels be rearranged / order be changed?
To avoid the need of scrolling I'd like to move MHX Layers between Transform and Grease Pencil. Once I saw a video tutorial where this was done but I can't remember which one it was.

The panel list can be re-arranged by dragging the top-right corner of each panel (the little triangle-like area with three small backslashes), then drop it after moving up or down.

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
How to access number in Enum Property?
I want to set sub surf value by reading number from the Enum Property
How do i do that ?
import bpy
def SubSurfSet(self, context):
    print(self.value)
    #bpy.context.object.modifiers["Subsurf"].render_levels = 2

bpy.types.PoseBone.SubSurfEnum = bpy.props.EnumProperty(
            #(identifier, name, description, icon, number)
    items = [('None','No Smooth','','',0),
             ('Smooth','Smooth','','',1),
             ('Smoother','Smoother','','',2),
             ('Smoothest','Smoothest','','',4)],
    name = "Mask the MESH",
    default = 'None',
    update = SubSurfSet)

bpy.data.objects["Frog rig"].pose.bones["root.dummy"].SubSurfEnum = 'None'

Note that you do not need the second '' for each item, as the last value will be registered as the number if no icon is provided. https://docs.blender.org/api/current/bpy.props.html#bpy.props.EnumProperty

What I would do is design the items of Enum property like this:
items = [('0','No Smooth',''),
         ('1','Smooth',''),
         ('2','Smoother',''),
         ('4','Smoothest','')]

Then you just need to cast it to int.
bpy.context.object.modifiers["Subsurf"].render_levels = int(self.SubSurfEnum )

When you change this Enum property and the subsurf levels you don't have to change any dictionary.

I am already using this method, but need to know the use of assigning number in #(identifier, name, description, icon, number)

@ashwin The three first elements of the items are mandatory (identifier, name, description). The identifier is used for python access and other values are used for the interface only. The forth optional one is either the (unique!) number id of the item or, if followed by a fifth element (which must be the number id), an icon string identifier.

Self.value dose not exist. Self.SubSuefEnum gets the identifier. So dippending on identifier i have to check and assign values! In this case int helped

@zeffi you are righ

Just for the record, it's also possible to access the enum items via bpy.types to look up all their properties:
items = bpy.types.PoseBone.bl_rna.properties['SubSurfEnum'].enum_items

pbone = bpy.context.selected_pose_bones[0] # some PoseBone
number = items[pbone.SubSurfEnum].value
# or access another property:    .icon
#                                .identifier
#                                .description

It's much more complicated if multiple items use the same identifier / name with different values however, because you can't lookup the right entry (I believe it will always pick the first with that name).

does this also work for enum props that have a dynamic item list via a callback function? I tried it and it didn't seem to work.
Is there a way to get identifiere,value,icon for enum properties with a dynamic item list?

It might not be possible to access dynamic enums this way, but I guess you could call that callback function yourself to retrieve all entries.

import bpy

bpy.types.Object.SubSurfEnum = bpy.props.EnumProperty(
            #(identifier, name, description, icon, number)
    items = [('None','No Smooth','','',0),
             ('Smooth','Smooth','','',1),
             ('Smoother','Smoother','','',2),
             ('Smoothest','Smoothest','','',4)],
    name = "Mask the MESH",
    default = 'None')

bpy.data.objects[0].SubSurfEnum = 'Smooth' # You have to assign something to this value first
print(bpy.data.objects[0].SubSurfEnum) # this print 'Smooth'
print(bpy.data.objects[0]['SubSurfEnum']) # this print 1 <---- ANSWER

Note that You have to assign something to this value first, or else You get
KeyError: 'bpy_struct[key]: key "SubSurfEnum1" not found'

In combination with CoDEmanX's answer default =  ob.bl_rna.properties['SubSurfEnum'].default is  "None"  default_value = ob.bl_rna.properties['SubSurfEnum'].enum_items[default].value is zero, and from your answer ob.get("SubSurfEnum", default_value) will give you the int value without having to set it first.

A simple way is to use a dict.. to map from the string value to an int
def SubSurfSet(self, context):
    remap = dict(NoSmooth=0, Smooth=1, Smoother=2, Smoothest=4)
    val = remap.get(self.SubSurfEnum)
    bpy.context.object.modifiers["Subsurf"].render_levels = val

Though, admittedly, this looks a little repetitive. Warning: I use 'NoSmooth' instead of 'None', to avoid confusion.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
Slide edges with absolute values
I have a cylinder I wish to adjust the length of. This is simple when aligned to one of the three axes, as I'd just grab the end edges, set the axis, and type the distance to move by. However, this is not aligned to any axis, thus making this a little more complicated. While I can rotate the whole mesh to align with an axis and follow the aforementioned method, doing this for multiple objects would be time consuming, and I'm wondering if there is a better method.
According to the 2.79 manual, there are vertex and edge slide tools. However, the edge slide shifts the selection by a percentage, not an absolute value. The vertex slide supposedly has a way to set an absolute value by pressing E, then entering your value, but I haven't had much success with it. Both edge and vertex sliding seems to have the same effect, whether I've pressed E or not.
What am I doing wrong here? Alternatively, is there any other way to achieve the desired results?

https://blender.stackexchange.com/questions/38955/how-to-use-absolute-value-in-loopcut-and-edge-slide https://blender.stackexchange.com/questions/74634/slide-two-edge-loops-away-from-each-other/74635#74635

Well, the first link is a step in the right direction. It's certainly faster to do than my idea of aligning to axes. My only issue with it is that the edge length information might not be completely precise. It should do for now. No way to switch proportional to absolute, then?

The quickest way would depend, not on whether the cylinder-object is aligned to the world axes, but on whether the cylinder's mesh is aligned to its own Object (Local) axes.
If the cylinder is aligned to its own axes:

For an absolute length, you can set its size in that dimension in the 'Dimensions' panel of the properties region of the 3D View, in Object Mode. Beware. This will scale the object's transform matrix. It's probably desirable to  CtrlA > Apply the scale, to bake it into the mesh.
To move one end by a numerically entered amount in Edit Mode, you can just set your Transform Orientation to 'Local' , and (supposing the cylinder was created with Z along its length) hit  GZZ [the number].

If the cylinder is not aligned to its own axes:

You can create a Custom Orientation from a longitudinal edge. Select the edge, and hit CtrlAltSpace.  (I usually check 'Use after Creation' and 'Overwrite Previous'.) Now any translation or scale you make with GYY or SYY will be in that edge's direction, and will accept numerical entries.

For absolute transforms, you can always create a jig. Just duplicate, for example,  a single vertex at a known zero point, then transform it to the full extent numerically in the desired Transform Orientation, and use it as a snap target for translation, scale, or rotation, before deleting it.


text:
Where can I find remaining time for preview render completion in 2.8?
In 2.79, running a preview render would let me see how long it would take for me to complete a certain number of samples. This was useful for me as I would often times set my preview samples to a number that is approximately equal to how long I'll be away from the computer for, or for me to gauge how long a particular scene might render on a certain sample setting.
Now in 2.8, I only see this:

How do I get back that indicator?

Change the way the render will be displayed in Render (Blender's header) > Display Mode > Image Editor.

Render again. Now see if a status bar appears inside Image Editor with the information you need.

To preview in Render Preview (Rendered Viewport Shading), enable Overlays and check the Text Info checkbox. Now the remaining samples will probably appear.

No change. Keep in mind, this is for a preview render, not a full render. That is, when you select Rendered for Viewport Shading. The full render already shows the correct information.


text:
Can a mesh be used as a guide for hair?
I'm my experiments with hair in the particles feature, I've seen certain ways one can shape hair, such as the manual and tedious usage of the particle edit mode functions, to using bezier curves as hair guides.
While curves do make the process significantly easier, it still seems limited. From what I've tried, it makes the hair take on a noodle-like shape. This got me wondering. If a curve could be used as a way to guide hair into a desired shape, why not a mesh?
Naturally, I tried to recreate the steps of using a curve guide, but with a mesh, but nothing happened. Is it not possible, or am I just not doing it correctly?
To clarify, the curve guide method is to create a curve, enable the curve's force field physics and set it to curve guide.
Running 2.8

Try using Vertex Groups options (like Density) in the Particle System's settings.

I'm not sure I understand. How am I meant to use those options? And on what? The emitter? The mesh guide? Something else? And how does density, or any other vertex group setting work as a guide?

I love curves. To make it look less noodle like, go to the curve circle and edit the shape of it. To give it more of a stand like appearance just copy some of the vertices in the circle detached from the original circle. It turns out beautifully, but don't be afraid to copy a lot of detached vertices. Also, another thing is the curve. That is what makes it thick and thin. I hope this was helpful.


text:
Keeping group instances visible while hiding originals
After creating several group instances, I've found that the original objects I used in their creation will show up during a render.
I thought I could fix this by selecting the original objects, going to the Object context, and under Visibility, deselect Show in Renders. However, while this does stop the object from being rendered, it also stops every other grouped object of its kind from being rendered as well.
How can I hide these original objects, while keeping their group instances visible?
Version 2.8

I'm not very familiar yet with the 2.8's Outliner, but I think it's not called groups anymore, only collections. Also, if you uncheck the Exclude From View Layer box of the original collection, it won't appear in the render, so you'll get what you want...

Yeah, I'm still getting used to the 2.8 interface. I haven't found the Exclude option, but what I've tried to do is to move the original assets into a separate collection, so I have a Main collection for rendering, and an Assets collection for things to be grouped. I can then disable them from being visible. However, I get this odd clutter in my outliner. The assets are shown in their new collection, but they are also still present in the main collection, and the lines connecting them in the hierarchy tree are dashed instead of solid.

the Exclude option is the box that you tick, it works fine if you use this method: https://zupimages.net/up/19/34/jnh7.jpg

actually even in 2.79 I didn't use group instances, linked-duplications are much more convenient in my opinion, but you may have reasons to use group instances?

Linked duplications increase the number of vertices etc.
@LeClerical_Error's answer below does the trick.

there's actually a pretty simple workaround for this. All you need to do is put your collection into a collection, and make the highest collection non-rendered while keeping the baseline set to renderable


text:
Setting transparency on mesh from inside, but not outside
Horrible title, I know. I doubt transparency is even what I need. Hopefully I can clarify what I'm trying to experiment with:
Two ico spheres share the same position, subdivisions, and rotations. Only difference between them are their scales, so one is inside the other. Outer sphere has an opaque material applied. Is there a material, or effect I could apply to the inner sphere, that would allow a camera object at the centre to see outside of the two spheres?
Only thing I can think of is to put a camera object at the normal of each face on the external sphere, then assign individual materials to the corresponding inner sphere faces which would display the camera views. However, that seems like a time intensive task, and a nightmare to organise. Wondering if there's a more elegant way to achieve the same effect.

maybe the Input > Geometry node > Backfacing output socket is what you're looking for? Once plugged into the factor of a Mix Shader it allows you to create 2 different materials for each side of a face, in your case it would be opaque/transparent

That would work, if I was only working with the external sphere. The inner sphere would block visibility to the outer sphere's faces, though.

Still unclear, to me... could you illustrate (however roughly) the desired end effect?

Yeah, that's the problem with this experiment. Best analogy I can come up with is to think of each face of the inner sphere as an individual TV screen, and each screen displays what is seen by a camera on each face of the outer sphere. So if you were inside the inner sphere, you should see an X-ray effect applied only to the inner and outer spheres, but if you viewed the outer sphere from the outside, you should see the material assigned to it.

I want to thank you for this question because I learned something in researching the answer.
Things have changed. Here's how you can do this easily in 2.8.
There is a backface culling option when in Edit Mode from the Viewport Shading Menu pulldown, BUT this is NOT what you want. Leave it alone. :)

THere is another backface culling option in the Materials tab of the Properties Panel. THIS is what you want. Make sure it is checked.

Your camera will now render what is on the outside of any object with this material assigned to it, but not what is on the inside of it.
It feels good to have finally learned how this works just now. :)

I didn't find that setting in Cycles, but it did lead me to a workaround that mimics the setting over here: https://www.katsbits.com/codex/backface-culling/ - That seems to have achieved the intended effect. Cheers.

Sorry about that. I forgot to check which renderer I was using. But now I know that this too is something to take into account. And thanks for the link.


text:
Getting to a file easily/quickly in blender's file browser
I have become used to the convenience of the following when searching for and opening a file in Windows (7)

Start typing the name of the file into an edit box and have files beginning with the same characters start showing up as a list underneath
Type part of the file name wrapped in asterisks (like *orange_tex*), press enter, and have the list of files filtered based on that wildcard.

But I find that Blender's file browsing page (the page you're on if your loading a texture into your scene, for example) is difficult to use if you're in a directory with a large number of files in it.  You kind of have to know the full name of the file or sort by file name alphabetically and scan visually for it.
So I am wondering if there is actually something built into this file browser that I'm not aware of that will make it easier to find a particular file quickly within a large list.   Does anyone know of such a thing?

Blender's file selector doesn't support this kind of filtering, but since you ask this question, here is some related functionality.

You can use Tab to auto-complete when typing a file name as you would in a shell..
You can also filter files by typing wildcards into the filename field *. followed by an extension eg foo*.blend, project*.*. When you press Enter, this will highlight all files with the extension in the current directory. (you can use A to clear the highlighting).
When opening files, you can use the filters available in the header to help narrow your search etc..

Search (Addon)
There is an addon that can further help you when searching for files called File Browser Search. It presents you with a list of results that matched your query.

Thanks. That file browser plugin works well.  I'll just have to remember to use it when I open files :)

I actually made a feature request for this very functionality (I did know about the add-on, but it would be nicer IMO to just start typing and have stuff highlighted..  I also found the tab completion rather limited.. only seems to work with more than two characters? And only completes if there are enough characters typed in to have only one possible match. (instead of display a list or cycling through matches.)

@gandalf3 See http://developer.blender.org/rB9c5fb7b2e7ecb0271371cd729808da44c3bc1bc3

@iKlsR I know. I reported the bug report which resulted in that commit :)

Note: The link for "File Browser Search" add-on doesn't work anymore. Results in a 404 error

@WhovianBron3 the addon or the link? This answer is pretty dated and it looks like it was made for 2.74.

the blender.org link for the addon, not the link here. And oh wow I see, yeah that probably explains it

@WhovianBron3 Oh, I see what you mean now. Try http://studio.allblue.pl/wiki/wikis/blender/file-browser-search/ or https://blenderaddonlist.blogspot.com/2013/11/addon-file-browser-search.html


text:
How do I use the "Setup Tracking Scene" feature with Cycles?
I'm trying to use the Setup Tracking Scene button(in the Movie Clip Editor) with Cycles. While it works fine in Blender Internal, when I switch it to Cycles, I don't get shading or shadows. Is the setup for compositing in Cycles different from Blender Internal?

Would you mind adding a screenshot of the Cycles render?

Yes it is different. I believe that for cycles you don't have directly a "shadow only" material. You have to do some tricks in material settings(with the node editor).

perhaps you would like to elaborate on these tricks?

You may be able to use some of the stuff in properties>object>ray visibility


text:
How to scale unconnected edges using individual origins in python?
I want to scale each selected edge individually along it. To do it I first duplicate each selected edge and then try to scale it using bmesh.ops.scale. Unfortunately it scales using origin/median pivot point. How to do it in python so that edges are scaled using individual origins? How can I use different pivot types from python?
Here is my script:
import bpy
import bmesh

def getDupliEdges(edges):
    dupEdges = []
    for e in edges:
        retOneEdge = bmesh.ops.duplicate(
                bm,
                geom=[e])

        dupGeom = retOneEdge["geom"]
        dupEdge = [ ele for ele in dupGeom if isinstance(ele, bmesh.types.BMEdge)]
        dupEdges.append(dupEdge[0])
    return dupEdges

def scaleEdges(dupEdges,factor):
    for e in dupEdges:
        verts = e.verts
        bmesh.ops.scale(
            bm,
            vec = factor,
            verts = verts)

obj = bpy.context.edit_object
mesh = obj.data
bm = bmesh.from_edit_mesh(mesh)
bm.faces.active = None

edges = [e for e in bm.edges if e.select == True]

view3dList = [ele for ele in bpy.context.screen.areas if isinstance(ele.spaces[0],bpy.types.SpaceView3D)]
view3d = view3dList[0]
view3d.spaces[0].pivot_point='INDIVIDUAL_ORIGINS'

dupEdges = getDupliEdges(edges)

scaleEdges(dupEdges, [2.0, 2.0, 2.0])

bmesh.update_edit_mesh(mesh, True)

Here is an image to illustrate the question.
On the left - initial selection - 3 edges;
In the middle - effect of my script;
On the right - how I would like it to work.

Thanks for any tips on that :)

clone the selected edges,  separate them from each other, then scale the clones using the individual origins.

You might do something like:
import bpy
import bmesh

obj = bpy.context.edit_object
bm = bmesh.from_edit_mesh(obj.data)

# current selection
edges = [e for e in bm.edges if e.select]

for e in edges:
    v1 = e.verts[0].co
    v2 = e.verts[1].co
    origin = (v1+v2) * 0.5  # edge origin
    bmv1 = bm.verts.new(((v1-origin) * 2) + origin)
    bmv2 = bm.verts.new(((v2-origin) * 2) + origin)
    bme = bm.edges.new([bmv1, bmv2])

bmesh.update_edit_mesh(obj.data, True)

I may be mistaken but I don't think at present the pivot point has any influence on bmesh.ops. So a slight modification of your original code gives a matrix to each new edge to scale: https://gist.github.com/zeffii/71862f5b1cad1bf1d2c1

Cool It works:) Thanks a lot for this answer Zeffi. It answers my main question. However I am still a bit puzzled why setting up the pivot did not work in my script. If I wanted to scale these edges along 3DCursor pivot (or others) I still do not know how to do it from python. If you can explain why this line: view3d.spaces[0].pivot_point='INDIVIDUAL_ORIGINS' does not work with bmesh.ops.scale I would really appreciate it. I simply want to uderstand Blender python :) Thanks a lot!

@komi3D since it works, could you please mark the answer as accepted (by clicking the check mark).

@komi3D your script does separate the edges and makes them individual, (tested by commenting out scaleEdges function) in theory that should work, I guess this hasn't been much help then :)

@komi3D i'll have a look later, it should be easy


text:
How do I print an exact scale of a render?
I'm unsure if I'm not following instructions correctly, or if a tablet computer just lacks the processing capability to do this without crashing every time, but I have a mesh I would like to turn into 1:1 scale PDFs (or some kind of format I can simply print without tweaking additional printer settings).
I've attempted to use the Paper Model add-on, but it throws up a warning about island sizes, due to the mesh being larger than a single A4 paper size. If I try to manually render with large pixel dimensions, the system just locks up and crashes.
The test file is linked here:
In the linked file, the round meshes are what I would like to print. I've added in a tile of A4 sized meshes for reference only.

"Simply print without tweaking additional printer settings" not a very reasonable expectation. You always have to set the settings before printing since printers cannot guess what kind or size of paper you are using, what quality or size you want to print, how you want to order printed pages and so on and so on. There are hundreds of choices with most printers that cannot be done automatically, because printers cannot read your mind...

Paper Model add-on
Paper Model add-on takes care of everything automatically and you do not need to do anything unusual for this to work. You simply need to disable Automatic Scale and leave the default value of 1 to make it 1:1 size.

The addon saves a PDF file in the chosen standard size that you can then print. The file has exact standard dimensions so if its A4 for example, it's 2480x3508px or 209.97x297.01mm in 300DPI resolution. When printing, you have to make sure printer prints at actual size without fitting content to page, because it would shrink the document to fit within margins that are needed for most printers.
It looks different in various printing dialogs of various different software, but you need to look for some scale setting and set it to actual or 100% instead of Fit to Page. If I wanted to print a PDF file that I opened in Chrome browser, that would look like this:

Printing scene size
If you wanted to print something 1:1 size as in your 3d scene, that's also possible. For real scale to make sense in a render, you need an orthographic camera, and set it's scale to the scale of the bigger dimension of your render resolution. So let's say I want to print A4 size. I need to set render resolution to it's pixel dimensions at my desired DPI resolution and set the camera scale to 297.01 mm:

The resolution of rendered image is 72 DPI by default so one also needs to fix that in some other program like Photoshop before printing since the dimensions in pixels are for 300DPI.

The settings provided above give me an error about the mesh being larger than the render area. If I follow the plug-in suggestions of downscaling the mesh, it reduces the size saved on the PDF. I've gone with the other suggestion of manually cutting up the mesh to fit enough into the render area, then moving the camera one A4 paper's width or height to the next section.Though tedious, this seems to work, but the issue I run into is that the output file is in a random orientation. I won't be able to print out all 17 pages, and line them up square beside each other. Any way to stop that?


text:
Select all meshes with similar dimensions
I have a large number of meshes similar in overall shape, but with slightly different dimensions, and completely different orientations and locations. For this example, do the following (or enough of it to get the idea, as it is tedious):

Create an icosphere, subdivided at least 2 times
In edit mode, select an edge, and separate it
Repeat for every edge

If you enable viewing edge lengths you'll find that the edges are not all the same lengths. Some are longer/shorter than others, but you'll find that there are groups of edges that have the same length.
In my project, I have done something similar, except I had created the sphere, inset all faces and removed the centre triangles, then selected the two faces to either side of the sphere's original edge lines, extruded outwards, then separated each edge. Basically made the edges 3D instead of just lines.
Given that every mesh is oriented differently, and that there are almost 500 individual meshes, is there a way for me to select one mesh, then find all other meshes that have the exact same dimensions? Essentially, I want to select all similar meshes so I can group them and count how many of each mesh there are. For example, I'd find that there are 100 of a 2.0 x 0.1 x 0.1 m mesh, 50 of a 2.1 x 0.1 x 0.1 m mesh, 75 of a 1.9 x 0.1 x 0.1 m mesh, and so on.
I'm hoping my need isn't too obscure for a tool or add on to exist for

What you could do is select all the elements and go to Edit Mode, now just select all edges or vertices of one of the repeating meshes, then click on menu above Select > Select Similar > Area.


text:
MagicTexture - how to customize colors?
Instead of having all the psychedelic colors of the magic texture feature, I'd like to have 2 or 3 of my own custom colors but in the same swirly pattern. Is that possible?


text:
Reset multiple shape key values back to 0?
If I have a bunch of shapekeys active at varying values, is there a faster way to reset every shape key's value back to 0 rather than do it one by one?

Yes, just click on the X button near the value field.
2.7:

and 2.8:

I can't believe I missed this, thanks.

I don't know what's worse. The fact that I have never even noticed this button's functionality before, or that its icon and position always made me think it would delete the selected shapekey.... Definitely not the best UX there!

You can run this line in the Python console to reset all shape key values of the active object to 0.0:
[setattr(x, 'value', 0) for x in bpy.context.object.data.shape_keys.key_blocks]

Basically, all shape keys of an object are accessible via the myObject.data.shape_keys.key_blocks list. From there you can manipulate all of the properties. The one-liner above is just an abbreviated way of writing the code below in the Script Editor of Blender and executing it:
import bpy

for skey in bpy.context.object.data.shape_keys.key_blocks:
    skey.value = 0.0


text:
Is there a way to lock a bone layer?
I know bones can be arranged by layers in the armature properties. Is it possible to somehow "lock" a layer so that all bones in that layer cannot be selected?

As far as I know, this function does not exist. Generally all collections, objects and bones can be set to non-selectable with the outliner filter Selectable which looks like an arrowhead. Manual

The filter acts on both modes at once - pose and editmode. Unfortunately you have to navigate through the armature hierarchy to find all the bones of one a layer and set the selectability individually.
You may want to give the following script a chance. It adds a menu to the skeleton panel on top of the layer field that allows to lock and unlock all or just the bones of the active layer(s).

import bpy
from bpy.types import Menu, Operator

# special menu
class DATA_MT_skeleton_specials(Menu):
    bl_idname = "DATA_MT_skeleton_specials"
    bl_label = "Armature Layer Specials"

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

        layout.label(text="Selectable Bones")

        op = layout.operator('data.skeleton_specials_op', text="Lock All", icon='RESTRICT_SELECT_ON')
        op.do = "lock_all"
        op.descript = "Make all Bones non-selectable"

        op = layout.operator('data.skeleton_specials_op', text="Lock Layer", icon='RESTRICT_SELECT_ON')
        op.do = "lock_layer"
        op.descript = "Make Bones in active layer(s) non-selectable"

        op = layout.operator('data.skeleton_specials_op', text="Unlock All", icon='RESTRICT_SELECT_OFF')
        op.do = "unlock_all"
        op.descript = "Make all Bones selectable"

        op = layout.operator('data.skeleton_specials_op', text="Unlock Layer", icon='RESTRICT_SELECT_OFF')
        op.do = "unlock_layer"
        op.descript = "Make Bones in active layer(s) selectable"

# special op
class DATA_OT_skeleton_specials(Operator):
    bl_idname = 'data.skeleton_specials_op'
    bl_label = ""
    do : bpy.props.StringProperty(default="")
    descript : bpy.props.StringProperty()

    def execute(self, context):
        if context.mode == 'EDIT_ARMATURE':
            bone_data = context.armature.edit_bones
        else:
            bone_data = context.armature.bones

        bones = []
        layers = []

        set = False
        if self.do.startswith('lock'):
            set = True

        if self.do.endswith('all'):
            bones = bone_data

        else:
            for idx, layer in enumerate(context.armature.layers):
                if layer:
                    layers.append(idx)

            for bone in bone_data:
                for layer in layers:
                    if bone.layers[layer]:
                        bones.append(bone)

        for bone in bones:
            bone_data[bone.name].hide_select = set

        return {'FINISHED'}

    @classmethod
    def description(cls, context, properties):
        return properties.descript

### REGISTRY

def register():

    skeleton_draw_old = bpy.types.DATA_PT_skeleton.draw # store original

    bpy.utils.register_class(DATA_MT_skeleton_specials)
    bpy.utils.register_class(DATA_OT_skeleton_specials)

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

        arm = context.armature

        layout.row().prop(arm, "pose_position", expand=True)

        col = layout.column()
        row = col.row()
        row.label(text="Layers:")
        row.menu('DATA_MT_skeleton_specials', text="", icon='DOWNARROW_HLT')
        col.prop(arm, "layers", text="")
        col.label(text="Protected Layers:")
        col.prop(arm, "layers_protected", text="")

    bpy.types.DATA_PT_skeleton.draw = skeleton_draw_new   # replace draw

def unregister():
    bpy.utils.unregister_class(DATA_MT_skeleton_specials)
    bpy.utils.unregister_class(DATA_OT_skeleton_specials)
    bpy.types.DATA_PT_skeleton.draw = skeleton_draw_old   # restore draw

if __name__ == "__main__":
    register()

Open a new text block in Scripting workspace, copy the whole script into it and press Run. The script is stored with the blenderfile but needs to be run again.

(tested in 2.93, 3.32, 3.51)


text:
Blender 4.0 - Move Keyframe Precision?
In Blender 3.6 I used to be able to precision move keyframes by holding the CTRL key while moving them. This doesn't seem to be the case in 4.0.
How do I do this in 4.0?

Don't know about your Blender, but in my 3.6.5 I do this with the Shift key like in all previous versions. And it works in my Blender 4.0 as well.

Open Status bar to review that hotkeys are suggested by Blender:

If you are not happy this the key, you can change it in Transform modal map in user settings:

That's weird. It's telling me its shift and yet nothing happens when I hold it.

Check keymap, maybe something is overriding shift

I've tried that and even changing the hotkey to something else and it doesn't seem to work. It's weird cause 3.6 it works just fine and I imported my settings of it when I installed 4.0 so it should work too.


text:
Where is the auto changing workspace setting?
When I change the Workspace tab to "Modeling", the object mode switches to Edit mode. When I change the workspace tab to "Sculpt", the object mode switches to Sculpt mode.
I would like to make the "weight paint" mode of that.

You will find the solution here: Changing Workspace Without Going Into Edit Mode if you just want to know how you make the automatic mode switch. Or do you need assistance for creating a custom workspace in general?


text:
How can I replicate this raised letter effect?
I thought this would look interesting with other forms.
I know I could eventually accomplish something like this completely manually—but true workflows are what get my gears grinding.
I imagine there must be a way to take a mesh and have it relate to the displacement? Could this be animated? That would be so cool.
If anyone has any insight I’d love to hear it.
John

As an alternative to the existing answers, you could also use a shrink wrap modifier with mode set to Project and a 3D letter object.

Thank you so much :)

You can use displacement.

Open a movie or image file.

Create a cuboid, stretched along its X-Axis and add an array modifier, duplicating it along the Y-Axis. I choose a relative offset off 2 in the array modifier, this creates gaps between the stripes. In edit mode add a lot of loopcuts along the longest axis, in my case X.

Apply the modifier.
Unwrap it from the top view by pressing U (Unwrap) and choosing Project From View (Bounds). This will unwrap the image exactly as you are currently seeing it in the 3D View. Go to the UV editor and select all. Press . and choose Individual Origins as the Pivot Point. The scale SY the individual islands along Y towards 0. During the scale operation you can type 0 and confirm with ⏎ Enter.

Finally, add a displacement modifier to the arrayed cuboids. Choose Z as the displacement axis and UV for the coordinates.

This results in the displaced geometry.

Consider blurring the movie or image file as a preprocessing step to create smoother transitions.

Thank you for such a detailed and clear answer. I will definitely be playing around with this method.

Leander's Answer is great.
This is my attempt with a mesh and not with an image:
I created a 60 subdivided plane, made it cloth (silk preset with augmented mass at 5 Kg, let it drop over the R letter (a mesh with collision phisic attribute).

Then I created another subdivided plane, shrinkwrapped it over the cloth, deleted every other line of vertices (so to obtain a serie of evenly spaced lines, extruded in Z axis, added a solidify modifier and a subsurf.

Another great method, thank you so much :)

To do what I have done here.

Make a few 2-4 loop cuts (Depends on what you want to do)
Loop cut inside of those
Select the vertexes you want to be the highest (Get both top and bottom)
Enable proportional editing smooth setting
Press G then Z to drag up use the scroll wheel to change influence on other Vertexes

You can do this with individual vertexes but make sure there is enough geometry when doing it.


text:
Blender 2.79, how to install Khronos Group gltf exporter?

I downloaded the KhronosGroup addon from https://github.com/KhronosGroup/glTF-Blender-Exporter
I read install instructions, but those were for Windows.
I tried copying the addon under ~/.blender/2.79/scripts/addons/io_scene_gltf2 but Blender shows nothing
I tried to install via "install from file" and selecting the exporter .py file directly but nothing happens.
I checked version, I am sitting in 2.79 Blender and the script is for 2.78. I tried to fool Blender by changing the scripts version in to 2.79 but no luck.

Any way to get this thing to work on Linux and on this Blender version?

Copying io_scene_gltf2 into scripts/addons as per the readme worked fine for me in 2.79b under Archlinux. Have you tried refreshing Blender?

To which exact path did you copy the file into if I may ask? Also, what do you mean by refreshing? Restarted many times if that's it.

I copied glTF-Blender-Exporter/scripts/addons/io_scene_gltf2 to ~/.config/blender/2.79/scripts/addons/io_scene_gltf2. Restarting Blender would certainly do it; there's also a refresh button in the bottom right corner of the addon list

For those that have arrived here in the year 2022 just go to File > Export > glTF 2.0 in Blender.

Thank you gandalf3. My mistake was the path.
I tried ~/.blender folder when in fact I had to copy the addon under ~/.config/blender/..
Works now, thank you again!


text:
Apply particle system (Beta 2.80)
I have a particle system on a sphere. The particles are another object (small spikes). I supposed that convert in the modifier panel would apply it to my object. But when I export as an .fbx or .obj and import it again the particles on the sphere are missing …
So either I am doing something wrong or the convert button doesn’t work.
Can someone help me?

@JaroslavJerrynoNovotny The modifier convert doesn’t work

I see, tried it and you are right, the function does nothing. It's probably not yet implemented, the beta is still buggy. You can use the Help>Report A Bug option in the 2.8 menus to let developers know if they are not aware and get it fixed.


text:
Unable to convert SVG into a mesh
I am trying to convert a simple logo from SVG into a blender mesh without any success.
My logo contains a simple shape and Text.
I converted the logo into SVG using both Inkscape and Adobe Illustrator. Both SVG files are imported fine into Blender. But neither can be converted into a mesh no matter how I tried.
I am very new to Blender. Can someone provide some guidance?
Jing

My SVG file can be downloaded here.
https://drive.google.com/file/d/1bUKh3SxEcaCMzHHVZctJgZxXJamNmA2A/view?usp=sharing
Thank you so much for your help.
Jing

could you please share your svg file? https://blend-exchange.giantcowfilms.com/

"But neither can be converted into a mesh" Why not? What happens when you try?

There isn't any problem with the SVG (you may just need to increase the size). I hope you know the convert to mesh option (invoked by pressing space bar in 3d view / object mode) to convert the SVG paths to a mesh.
Just in case you haven't done this, you need to select the imported object first.

I tried to hit Alt C or try to access it via the Object -> Convert To. But the option is totally grayed out for me. Do you have any idea what my problem is? Jing

You need to first selected the imported path. See the edit.

This is what I got.

This is what I got. https://youtu.be/z06t1VIli58

That's because both the objects are selected. Go to 'Select', then 'Deselect All' and then just select one object at a time by right clicking it.

@JingGu if this answered your question plese mark the answer as correct, so this question gets closed. If it didnt pleas keep explaining your problem

This answer should be accepted. It solved my issues. Why he never accepted an answer I have no idea. Kind of ungrateful.

It is possible to convert all the curves.
After importing the file from File -> Import -> SVG
As soon as you import the curve option is disable if Press Alt+C.
So just select an object and then press A twice to select all and then Press Alt+C.


text:
How to Get only Shadows from a Collection in 2.8 EEVEE?
I want to know is there a way to render Shadows only in Blender's new EEVEE Render Engine.
I want my objects in a separate collection and a ground plane on a separate collection(to receive shadows from the objects collection).I want to render the shadows only and not the objects.

Can you put a higher size pic ,its hard to see the nodes detail.

As far as I know Collection won't behave like Render Layers in Cycles but you can use material as below to hide your mesh and show only shadows in EEVEE.

Similar to this right? https://blender.stackexchange.com/questions/122830/how-to-hide-object-but-keep-shadow-in-eevee

Yeah that is close but when I said only shadow it mean only shadow.
I don't even want to render the plane,

Create some render layers.
Subtract shadow from alpha.
Play with it.


text:
Can I triangulate complex or non-manifold geometry in a consistent pattern?
I need help, I'm trying to make a Model like Hyrule Field of TLoZ OoT, but I don't have idea to make that triangles like in the picture, I tried to create a grid and press Ctrl + T, but it doesn't look like this.

I'd like to think it's more likely the map maker(s) started with a subdivided and triangulated plane instead of triangulating after or you can manually select the "clean" flat parts and work forward. Would also like to point out that unless you're going for a specific lowpoly material look, this is pointless as a game engine will triangulate the model and if rendering normally this won't be noticed much if at all.

So, if I use squares, it's basically the same if I use triangles?

See my answer here Why is the view header showing triangle count when my mesh is all quads? and yes, triangles are difficult to work with also.


text:
glTF exporter with images
I'm currently trying to import an exported .gltf into my program. I'm now at the point where I need the information of the image. But in the .gltf is no 'image' or 'texture' section, even if I check 'Embed images'.
In my test model I took just the default cube, unwrapped an uv map and painted the model. After all, I saved the image.
Am I completely mistaken in my procedure?
Ask me about any information you need, I'm not really familiar with blender, I'm just scratching its possibilities to create basic objects.
Thanks for your help!

For a while there was a known issue in the original glTF exporter where it wouldn't export "packed" images (ones that exist only in Blender, not on disk, such as resulting from texture painting as you describe).  This is fixed in the newer glTF-Blender-IO project, that ships with Blender 2.80 Beta.


text:
What's that crosshair in the 3D View?
I'd like to know how to get rid of that crosshair that interferes with selection; it's so annoying.

related: http://blender.stackexchange.com/a/3447/3710

@poor thanks. that was helpful, but I don't see a way to disable that 3d cursor alltogether, is there?

Google 3D cursor, it's one of Blender's most essential tools, when you understand it's role, you wont be asking how to disable it.

Possible duplicate of How do I select an object in the 3D viewport?

Once you understand the principle, you will fall in love with it... Further reading: http://blender.stackexchange.com/questions/24787/uses-of-the-3d-cursor

Your second question should be posted as... a second question.

@Georges This is a tough case since the questions are actually not duplicates, on the answer cross applies. The current police on SE would be to leave this question open. (There are advantages including better search indexing).

@GiantCowFilms I asked few questions before that are marked as duplicates and are still open, this helps finding more answers about the topic, I totally agree.

Firstly, the 3D cursor doesn't interfere with selection.
By default LMB places the cursor, RMB selects.
The crosshair is the 3D Cursor, it is like a cursor in a text-editor it shows where Blender will put stuff and also where the center of some operations can be set to be performed from, such as scaling, rotating, the pivot point when bending, the depth grease pencil is drawn and a point you can use to snap the selection to.
While it may seem strange at first, when you start using Blender but it becomes an indispensable tool when you get more experienced.
Here is a link to the blender manual describing the 3D cursor. https://www.blender.org/manual/editors/3dview/3d_cursor.html
Here is a quick video that will help you better understand how it works. https://www.youtube.com/watch?v=Nlk28Ex9jVQ

The 3D cursor is one of the most used tools in blender. I can not figure out why you would want to disable it, other than it looks ugly and is interfering with your view port.
Compare:

In this picture, the view port is cluttered with lamps, empties, bounding boxes, and that ugly 3D cursor! However, you can hide all of this easily.
Simply press N in the 3D view to toggle open a sidebar. In it, locate the display section and check "only render"

Now only your pretty view port preview is showing!

This should be a comment but for visibility I will post as an answer. As pointed out above, this is very useful when modeling. However if you find it getting in your way you can hide it without losing any other viewport markers by zooming out and then left clicking somewhere in a corner of your view, (since this is positioned in 3d space it will stay there respective of where you're located) then focus back your object ShiftC.

Or we could model a missile, load it with the 3D cursor, and send it off into to 3D space!


text:
Blender 2.8 - where is Multiple Importance Sampling?
I am working on  my render and I have an hdr word background, I am trying to activate Multiple Importance Sampling like in previous Blender and I can't find it. Anyone knows where is it or what changed? thanks alot in advance.

It is under the Properties Window > World Settings > Surface change Sampling from Auto to Manual.
Multiple importance sampling is only available for volumes, under Volume > Sampling change from Equiangular to Multiple Importance.

Hi, thanks a lot for your answer, yes but it doesn't have the check box for " Multiple Importance Sampling" does it comes activated by default? what has changed? is not clear

Before you only had the checkbox option, now you have the "Distance", "Equiangular" and "Multiple Importance" options.

thanks a lot guys! now I have to learn what the new options do.
is there any documentation on this?
cheers!

Here is the Blender 2.80 Reference Manual https://docs.blender.org/manual/en/dev/


text:
How to create a lattice and link all objects to it procedurally?
I've been trying to do that but have got some problems:

I was not able to retrieve the reference to a recently created object with bpy.ops.object.add().I had to use bpy.ops.lattice.select_all(), but that sounds inelegant.
While I was able to create a lattice for each object with bpy.ops.object.modifier_add(type='LATTICE'), I was not able to link it - mostly because the command to link a lattice modifier to the lattice object won't show on the info window. (Also, this needs the object to be selected...)

What is the proper way to do it?

The proper way is to not use operators:
import bpy

scene = bpy.context.scene

lattice = bpy.data.lattices.new("Lattice")
lattice_ob = bpy.data.objects.new("Lattice", lattice)
lattice_ob.scale = (5, 5, 5)

for ob in scene.objects:
    if ob.type == 'MESH':
        mod = ob.modifiers.new("Lattice", 'LATTICE')
        mod.object = lattice_ob

scene.objects.link(lattice_ob)
scene.update()

The .new() methods return object references to be used for subsequent method calls and property assignments in contrast to operators, which run isolated and only return a status (e.g. {'FINISHED'}). Some methods also take objects (the second parameter of objects.new()), whereas operators don't support objects/pointers, but only references by name (StringProperty).
//update: For Blender 2.8 and above, I believe you would do it like this:
import bpy

collection = bpy.context.collection

lattice = bpy.data.lattices.new("Lattice")
lattice_ob = bpy.data.objects.new("Lattice", lattice)
lattice_ob.scale = (5, 5, 5)

for ob in collection.objects:
    if ob.type == 'MESH':
        mod = ob.modifiers.new("Lattice", 'LATTICE')
        mod.object = lattice_ob

collection.objects.link(lattice_ob)

insightful, thank you. Hopefully knowing that option will make it easier next time. Thanks.

This didn't work on 2.90 .... :((
AttributeError: 'bpy_prop_collection' object has no attribute 'link'
Can it be updated?

Added a possible solution for Blender 2.8+, but I don't know whether this is the canonical way to go about it. At least it seems like no update() call is needed anymore. Maybe object_data_add() from bpy_extras.object_utils would be better and includes a layer update.

bpy.data.collections['Collection'].objects.link(lattice_ob) add that line after setting the scale.


text:
Bezier-Spline with Python adds unwanted point
I have a list of points, and want to add a Bezier-spline using these points.
Following is my code:
import bpy

name = "MyCurve"
numPoints = 4
points = [ [1,1,1], [-1,1,1], [-1,-1,1], [1,-1,-1] ]

curvedata = bpy.data.curves.new(name=name,type='CURVE')
curvedata.dimensions = '3D'
curvedata.fill_mode = 'FULL'
curvedata.bevel_depth = 0.045

ob = bpy.data.objects.new(name+"Obj", curvedata)
bpy.context.scene.objects.link(ob)

polyline = curvedata.splines.new('BEZIER')
polyline.bezier_points.add(numPoints)
for num in range(numPoints):
    polyline.bezier_points[num].co = points[num]
polyline.resolution_u = 1

print( len(polyline.bezier_points))

Now my problem is, that this code adds another point. The printed value will be 5 not as I expected 4. The added point is after the other points and is the point (0, 0, 0). This is unwanted behavior.
What is wrong with my code?
My Blender version is 2.70 built 2014-03-19.

A new splines starts with a single point, it is not empty:
import bpy

curvedata = bpy.data.curves.new(name="Curve", type='CURVE')
ob = bpy.data.objects.new("CurveObj", curvedata)
bpy.context.scene.objects.link(ob)

spline = curvedata.splines.new('BEZIER')
print(len(spline.bezier_points))
# Output: 1

The bezier spline has already a point, so you need to
.add() number of points you want to add minus 1.
polyline.bezier_points.add(len(points)-1)

By the way - you can assign the coordinates more efficiently like this:
from bpy_extras.io_utils import unpack_list
# ...
polyline.bezier_points.foreach_set("co", unpack_list(points))

Thanks. Worked perfectly. Do you have a quick reference/tutorial for the suggested assignment method for me?

foreach_set(): http://www.blender.org/documentation/blender_python_api_2_70a_release/bpy.types.bpy_prop_collection.html?highlight=foreach_set#bpy.types.bpy_prop_collection.foreach_set and for unpack_list() see the actual python script in Blender/2.xx/scripts/modules/bpy_extras/io_utils.py.


text:
Custom Properties converted to integers and driver links lost after restart
I have made API defined custom RNA Properties in my Scene automatically added to a selected Object (not the Mesh).
But when I save the scene and restart Blender, they are already visible but the boolean properties where converted to integers and they are no more linked to the drivers where I defined them for.
Example for adding a driver target (property link to driver):
#Define a new Driver Target
SubsurfViewTar = SubsurfViewVar.targets[0]
#Define a new Driver id Type
SubsurfViewTar.id_type = 'OBJECT'
#Define the Object which contains the custom property which drives the Property
SubsurfViewTar.id = bpy.data.objects[GrpName]
#Define the Custom Property of the object
SubsurfViewTar.data_path = "View_Resolution"

You will need to share your blend file for someone to see what is happening. Driver issues are often from auto-run python scripts being disabled.

autorun python scripts is not the problem as i know now... and the drivers exist like before but they are all set to 0 and no more linked to the properties


text:
How do I reload a linked blender file?
How do I reload a linked blender file?
I linked a .blend file into another. After I update the linked file (say change the material color), how do I make the project I imported it into update?

Navigate to Outliner
Change type to Blender File
Right click on the .blend you want to reload
Hit Reload

Then you can reload the lastly reloaded file by pressing Space and writing down Reload Library

Why to -1? This is built-in method how to reload a linked .blend file. It should work.

I voted up, actually that was the best answer in my case :)

This was the best for my workflow as well.

When I do this in Blender 2.9 the linked character just desappear in viewport after hit reload. and it is not Reload Library in search menu :(

There is also a great addon, written by Pablo Vazquez, called "Amaranth", which include a little feature (among others) : "Save and reload"
http://www.pablovazquez.org/amaranth/ (see the bottom of this page)
After installing it, you'll just have to hit CTRL SHIFT W (or go into File menu), to save and reload the current file. It should update all linked data as well.

Try saving and reloading the file.

Press CtrlS to save.
Press CtrlShiftO to open the recent files menu, then select the top entry or press 1.

Another great add-on that will allow you to easily edit your linked object from your scene and then switch back to your scene containing the linked item is called Edit Linked Library.
Edit Linked Library is simple to use and you can find usage instructions at http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Object/Edit_Linked_Library

File - Revert - that's easy ;)

This works! Of course, if the current file has unsaved changes you want to keep, press ctrl+s to save first!


text:
Can python be used to edit a Text Object?
That is, can python code replace, for example, a single letter in a Text Object or insert a letter or string into a Text Object.
Note that I'm not talking about replacing a Text Object with some updated string, such as, object.text = "new string". I'm thinking more about having access to the Text cursor (not the mouse cursor) and positioning it on some letter that I'd like to replace.
In other words, I'd like to have the same capability during BGE play that I have when altering a Text Object in the edit mode.

As ideasman42 pointed out, you must replace it with a new string since strings are immutable in Python.  But here's a workaround.
Delete single character
This will delete the third character
cursor = 2
ob = bpy.context.scene.objects['Text']
text = ob.data.body
ob.data.body = text[:cursor] + text[cursor+1:]

where I've used slicing.
Insert single character
This will insert 'z' after second character
cursor = 2
new_char = 'z'
ob = bpy.context.scene.objects['Text']
text = ob.data.body
ob.data.body = text[:cursor] + new_char + text[cursor:]

Just thought I'd update this. You can actually just change the ob.data.body like this:
ob.data.body = 'whatever you want'

No this isnt supported, you have to replace the string with a new one each time.

@dragonbyte In python itself string cannot be changed, they are immutable. You can use several python functions for strings though.

It's possible using operators.  Here's a simple example,
import bpy
bpy.ops.object.editmode_toggle()
bpy.ops.font.move(type='PREVIOUS_CHARACTER')
bpy.ops.font.delete(type='PREVIOUS_OR_SELECTION')
bpy.ops.font.text_insert(text="s", accent=False)
bpy.ops.font.move(type='NEXT_CHARACTER')
bpy.ops.object.editmode_toggle()

Running this on the default text object changes "Text" to "Test".
Edit: I just saw this is for the game engine, I'm not sure if this code will work there.

Since you are working in the BGE, may I suggest:
from bge import logic, events

def editText(cursorPos):
    own = logic.getCurrentController().owner

    txt = list(own['Text'])

    if (logic.keyboard[events.BACKSPACEKEY] == logic.KX_INPUT_JUST_ACTIVATED):
        txt.pop(cursorPos)
    else:
       txt[cursorPos] = events.EventToCharacter(logic.keyboard[0], False)

####
# This text block will only change characters of the string in a certain position.
# Other than that you will need to do some more complex coding.


text:
Rigging a pixar lamp

I am rigging a Pixar lamp as shown in the screenshot above. The lamp bone is tracking 'bulbtarget' and the neck bone is copying the rotation of 'rotateneck'.
I want the rotation of lamp bone to be around the joint between rod and lamp like this:

I added an empty object at that joint and changed the pivot point of lamp, but this isn't working well. How can I make both parts move together without any gap?
If I connect the bones without all the fuss then the problem goes away, but the lamp object won't point towards the target, it will move at some offset angle.

  This big lamp bone won't do much good there because it's root is in a place where the lamp doesn't have any joints.
  I would solve that with two Locked Track constraints. The first one is for looking up and down. Parented to that is the second bone with another Locked Track to handle looking from left to right. Both are tracking the same target.

Here's the setup from Haunt's trick bag:

Bone 1 is the boss. It has a Locked Track with Z locked and -x tracking bone 3. It can only move up and down. The blue joint is parented to that.
Bone 2 is parented to bone 1. It has a Locked Track with X locked and Y pointing to 3. It can only move left and right. The red part of the lamp is parented to that bone. It doesn't matter at all how high bone 2 sits as long as it sits on the axis of the neck. It only rotates around the neck axis anyway.
Bone 3 is the target. One and two point there.
Bone 4 is there for convenience purposes. The root of bone 1 can't be in the middle of the lamp's head (bone 2 could be, but who cares, you'll hide them anyway), so there's an offset. Bone 4 has a Copy Location Constraint to bone 3 and a Copy Rotation Constraint to bone 1, so the tip of bone 4 is where the lamp is looking. You can make bone 4 unselectable in the outliner. That way you can't miss the target bone.

  In the end, you'll only have two bones visible, possibly with customs shapes: bone 4, so you see the exact focus of your lamp and bone 3, so you can animate the head. Btw, Luxo's neck seems to be perpendicular to his head which makes things a little easier regarding his focus.

Thanks for your time,but it seems like whole mesh rotates about the base of bones 1 (2) ...the assembly is like that of neck and head rig of a human. lamp and rod  has to rotate separately. Head has to point at something and track it , and neck should be able to rotate.

I added a gif showing the functionality. Please describe what you mean since my rig is physically correct and as far as I know equals the Luxo functionality.

Luxo functionality is that....but
What I want is for it to work like human head rig. I want red part(Head)and below rod (Neck) to move separately.

Then you need to show that in your modelling. If you don't model a ball joint or something similar, your neck CAN only rotate like mine does or it will look unconvincing. Our two lamps are similar, only I put the up/down joint at the bottom where the neck connects with the rest of the lamp. If you want the pivot where neck and Lamp meet, just build it with the roots of bone one and two where you want the joint to be. That's the most fundamental advice. Put the roots where the pivot points of your joints are.


text:
Assigning different wire or halo materials to different parts of a mesh
This is a follow-up question to Stephen's Add different materials to different parts of a mesh? As explained there, it is possible to assign different surface materials to different faces of a mesh.  However, the same method does not seem to work when the materials involved are not surface materials.
For example, suppose a cube mesh has two materials and both are wire materials.  If I assign the second material to everything (enter the Edit Mode, select all vertices [A], select the second material in the Properties panel > Materials tab, and click the Assign button), the cube is still rendered with the first material.  I have the same problem with two halo materials.
How do you assign different wire materials to different edges of a mesh? How do you assign different halo materials to different vertices of a mesh?

As brecht explains, this is not possible, however, if you are working with hard surface models, say something as simple as cube for example, one quick workaround you could use is to separate it into different pieces (retaining the original positions of course) and apply the materials separately, then after doing this, you could parent all the mesh to an empty to move and scale it easier etc. Select the part(s) you want to have a unique material, hit P and choose Selection.
Here is a 'cube' with a normal surface, a halo and wire material.

Thank you for describing the alternative method.  This is what I did to work around this issue.

Alternatively, if you have already assigned the materials to the faces, simply hit P > By Material to separate.

It's not possible, you can only use a single wire or halo material and this will be applied to the entire mesh.
Part of the reason is that materials are set per face, and wires and halos are for edges and vertices so there is no exact way to map them. But it's mostly just something that was never implemented.

I was afraid that might be the case.  Thank you for the confirmation.


text:
How to batch import Wavefront OBJ files?
Is it possible to batch import Wavefront .obj to blender? I'm working on 2.69.
If I select multiple .obj files, only one gets imported. Also if I hit A on file selection window to select all files (.obj and .mtl) I get an error, nothing gets imported. I have to import several hundreds of .obj into the blender file, is this possible?

Unfortunately, this is not possible by default with Blender 2.5x+ it seems. In 2.49, you could hold Shift then press the Import Obj button and it would prompt you to select a directory with the sequence.
In 2.69 - and at least until 2.82 - you can do the same with a script — it could be converted into a more usable utility but it works.
import os
import bpy

# put the location to the folder where the objs are located here in this fashion
# this line will only work on windows ie C:\objects
path_to_obj_dir = os.path.join('C:\\', 'objects')

# get list of all files in directory
file_list = sorted(os.listdir(path_to_obj_dir))

# get a list of files ending in 'obj'
obj_list = [item for item in file_list if item.endswith('.obj')]

# loop through the strings in obj_list and add the files to the scene
for item in obj_list:
    path_to_file = os.path.join(path_to_obj_dir, item)
    bpy.ops.import_scene.obj(filepath = path_to_file, use_split_objects=False, use_split_groups=False)

For unix machines the direct path should look like:
# location of obj folder
path_to_obj_dir = '/home/user/Desktop/objects/'

To use the script, simply paste it into Blender's text editor, edit the path on the 5th line and press Alt + P or Run.

Thank you so much, works like a charm, but I had to do some research and trial error with my very poor knowledge of python. I had to change the extension to OBJ because by using print(obj_list) I noticed that it wasn't seeing the objs that had an uppercase extension, checked it with print(file_list) and then changed to OBJ and it worked!

@akzash rejected your suggested edit re removing objects from windwos path. Your error would be in that you don't have an objects folder in c drive.

@iKlsR I am importing many .obj files sequentially. Very quickly, import time increases significantly to the point that it takes minutes for each object to get imported. Could you please take a look at my question here and see if you can offer a solution?  Appreciate it.

FWIW the same bpy.ops.import_scene.obj() method will also work in Blender 2.82.

The following Add-on allows to import multiple Wavefront OBJ files at once. By using the file browser the import process is platform independent. Also all the usual options like Forward Axis, Up Axis or Clamp Size are available.
Repository: github.com/p2or/blender-batch-import-wavefront-obj

io_batch_import_objs.py (updated for 3.5+)
# ##### BEGIN GPL LICENSE BLOCK #####
#
#  This program is free software; you can redistribute it and/or
#  modify it under the terms of the GNU General Public License
#  as published by the Free Software Foundation; either version 2
#  of the License, or (at your option) any later version.
#
#  This program is distributed in the hope that it will be useful,
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#  GNU General Public License for more details.
#
#  You should have received a copy of the GNU General Public License
#  along with this program; if not, write to the Free Software Foundation,
#  Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>

bl_info = {
    "name": "Batch Import Wavefront (.obj)",
    "author": "p2or",
    "version": (0, 7, 0),
    "blender": (3, 5, 0),
    "location": "File > Import-Export",
    "description": "Import multiple OBJ files, UV's and their materials",
    "doc_url": "https://github.com/p2or/blender-batch-import-wavefront-obj",
    "tracker_url": "https://github.com/p2or/blender-batch-import-wavefront-obj",
    "category": "Import-Export"}

import bpy
from pathlib import Path

from bpy_extras.io_utils import ImportHelper

from bpy.props import (BoolProperty,
                       FloatProperty,
                       StringProperty,
                       EnumProperty,
                       CollectionProperty)

class WM_OT_batchWavefront(bpy.types.Operator, ImportHelper):
    """Batch Import Wavefront"""
    bl_idname = "wm.obj_import_batch"
    bl_label = "Import multiple OBJ's"
    bl_options = {'PRESET', 'UNDO'}

    filename_ext = ".obj"

    filter_glob = StringProperty(
            default="*.obj",
            options={'HIDDEN'})

    files: CollectionProperty(type=bpy.types.PropertyGroup)

    global_scale_setting: FloatProperty(
            name="Scale",
            description="Value by which to enlarge or shrink" \
                    "the objects with respect to the world origin",
            min=0.0001, max=10000.0,
            soft_min=0.01, soft_max=1000.0,
            default=1.0)

    clamp_size_setting: FloatProperty(
            name="Clamp Bounding Box",
            description="Resize the objects to keep bounding box" \
                    "under this value. Value 0 diables clamping",
            min=0.0, max=1000.0,
            soft_min=0.0, soft_max=1000.0,
            default=0.0)

    axis_forward_setting: EnumProperty(
            name="Forward Axis",
            items=(('X', "X", ""),
                   ('Y', "Y", ""),
                   ('Z', "Z", ""),
                   ('NEGATIVE_X', "-X", ""),
                   ('NEGATIVE_Y', "-Y", ""),
                   ('NEGATIVE_Z', "-Z", ""),
                   ),
            default='NEGATIVE_Z')

    axis_up_setting: EnumProperty(
            name="Up Axis",
            items=(('X', "X", ""),
                   ('Y', "Y", ""),
                   ('Z', "Z", ""),
                   ('NEGATIVE_X', "-X", ""),
                   ('NEGATIVE_Y', "-Y", ""),
                   ('NEGATIVE_Z', "-Z", ""),
                   ),
            default='Y')

    validate_setting: BoolProperty(
            name="Validate Meshes",
            description="Check imported mesh objects for invalid data")

    vgroup_setting: BoolProperty(
            name="Vertex Groups",
            description="Import OBJ groups as vertex groups")

    use_split_objects_setting: BoolProperty(
            name="Split By Object",
            default=True,
            description="Import each OBJ 'o' as a separate object")

    use_split_groups_setting: BoolProperty(
            name="Split By Group",
            description="Import each OBJ 'o' as a separate object")

    def draw(self, context):
        layout = self.layout
        layout.use_property_split = True
        layout.use_property_decorate = False  # No animation.

        box = layout.box()
        box.label(text="Transform", icon='OBJECT_DATA')
        col = box.column()
        col.prop(self, "global_scale_setting")
        col.prop(self, "clamp_size_setting")
        col.separator()
        col.row().prop(self, "axis_forward_setting", expand=True)
        col.separator(factor=0.5)
        col.row().prop(self, "axis_up_setting", expand=True)
        col.separator()

        box = layout.box()
        box.label(text="Options", icon='EXPORT')
        col = box.column()
        col.prop(self, "use_split_objects_setting")
        col.prop(self, "use_split_groups_setting")
        col.prop(self, "vgroup_setting")
        col.prop(self, "validate_setting")

    def execute(self, context):
        folder = Path(self.filepath)
        for selection in self.files:
            fp = Path(folder.parent, selection.name)
            if fp.suffix == '.obj':
                bpy.ops.wm.obj_import(
                                filepath = str(fp),
                                global_scale = self.global_scale_setting,
                                clamp_size = self.clamp_size_setting,
                                forward_axis = self.axis_forward_setting,
                                up_axis = self.axis_up_setting,
                                use_split_objects = self.use_split_objects_setting,
                                use_split_groups = self.use_split_groups_setting,
                                import_vertex_groups = self.vgroup_setting,
                                validate_meshes = self.validate_setting
                                )
        return {'FINISHED'}

def menu_func_import(self, context):
    self.layout.operator(
                WM_OT_batchWavefront.bl_idname,
                text="Wavefront Batch (.obj)")

def register():
    bpy.utils.register_class(WM_OT_batchWavefront)
    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)

def unregister():
    bpy.utils.unregister_class(WM_OT_batchWavefront)
    bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)

if __name__ == "__main__":
    register()

    # test call
    #bpy.ops.wm.obj_import_batch('INVOKE_DEFAULT')

Note: It is basically just a quick and dirty wrapper of wm.obj_import or import_scene.obj operator in versions prior to Blender 3.2.0 until batch import is supported. To batch export scene objects, see: Export multiple objects to .obj?
Versions
To keep track of all the changes over the years I decided to create a dedicated repository instead of posting each version here, which makes it easier to download as well:

Blender
Addon Version
Release

Blender 2.65+
0.1.0
Download

Blender 2.80+
0.2.0
Download

Blender 2.92+
0.3.0
Download

Blender 3.2+
0.4.0
Download

Blender 3.3+
0.5.0
Download

Blender 3.4+
0.6.1
Download

Blender 3.5+
0.7.0
Download

@JuhaW added a Scale setting to 0.2.0, you can download the latest version from here.

Many thanks poor, works with Blender 2.76.11.

@JuhaW For collaborative work I thought it's a good idea to create a gist, instead of updating the answer continuously. I hope you like it. Thanks again.

How did you manage to offset the loaded OBJs? I can't see it in the example code. I could need it for importing an OBJ to a custom position and parent it.

@RayKoopa There is none, it's just an example for demo purposes. For parenting, read: http://blender.stackexchange.com/a/28762/3710 But why not simply asking a new question on this?

@poor I originally wondered how you'd access an object created by an operator. I solved it by just giving them unique names in the operator of the other add-on to find them when being back in my add-on.

You can access the respective imported object with context.selected_objects[0]. For demonstration purposes I added a parent property to the interface: https://gist.github.com/p2or/d4956ed05af4618fab0b7f931c50f990. If it's enabled it will create an empty as parent for all imported objects automatically. I hope this is what you want @RayKoopa, right?

But that requires those objects were selected by the operator, my operator in the other add-on doesn't do that at the moment =3

@RayKoopa This happens automatically, after calling the operator. Please test and read my example carefully. Do a print(obj_list) after bpy.ops.import_scene.obj in the Add-on and you'll see that this will work

Yes, but I'm using my own import operator in my own add-on which I want to call in from another add-on I write; and my add-on doesn't select it. The OBJ one does. Anyway, I could solve my problem.

sweet, 2.92+ works on 3.0.1, which is awesome


text:
Alternative for old ika in Blender
Blender had once upon a time such IKA systems i miss. I Used the IKA to animate pneumatic pump.
I realy try to switch to armatures but stuck on it since years, they are very complex.
The way i did it in the version 1.80a was to:

add two sticks (big, small).
add an ika in both sticks
parenting the sticks to the ikas.
parenting the ika to each other ika.

The Armatures-Objects looks like a much more complex feature than i need.
Any idea how to construct this is a new blender version?

does ika have anything to do with inverse kinematics (a-something)?

Without using an armature you can use parenting and constraints.

Starting with two cylinders, add two empties. The empties should be located at opposing ends of each cylinder.
Select a cylinder then Shift select the matching empty and parent them with ⎈ CtrlP -> Object. Repeat for other cylinder and empty.
Select a cylinder and add a TrackTo constraint. Set the target to be the empty of the opposing piston and set the axis to suit. Repeat for other cylinder.

Now as you move one of the empties the two pistons will always point towards each other. If you position one of the empties at the outer edge of a disc and parent the empty to the disc it will rotate around with it and the cylinders will follow.

Here is a sample file to look at.


text:
What is Ambient Occlusion?
What is Ambient Occlusion and what are some of it's uses? I see it is used in creating what might be called "shadow catchers" in the following node tree setup:

Per definition

Ambient occlusion is an approximation of global illumination that
emulates the complex interactions between the diffuse
inter-reflections of objects. While not physically accurate (for that
use full global illumination)

What is it?:
It is a way to make objects in a scene look more realistic. Ambient occlusion casts shadows where objects are close to each other. Note that it will also cast light where they are not. Ambient Occlusion is a fake light.

Note that in Cycles there is also an Ambient Occlusion Shader:

The ambient occlusion node gives per-material control for the amount
of AO. When AO is enabled in the world, it affects all diffuse BSDFs
in the scene. With this option it's possible to let only some
materials be affected by AO, or to let it influence some materials
more or less than others.

Ambient Occlusion enabled in the world panel.

Ambient Occlusion can make a big difference especially in the Blender Internal Render Engine. In cycles enabling Ambient Occlusion does not make a big difference in terms of realism because Cycles is already rendering with Global Illumination, which is physically correct Ambient Occlusion. So in cycles there often is no need for it whereas in the Blender Internal render engine it is very useful.

From wikipedia:

In computer graphics, ambient occlusion is used to represent how
exposed each point in a scene is to ambient lighting. So the enclosed
inside of a tube is typically more occluded (and hence darker) than
the exposed outer surfaces; and deeper inside the tube, the more
occluded (and darker) it becomes. The result is diffuse,
non-directional lighting throughout the scene, casting no clear
shadows, but with enclosed and sheltered areas darkened. In this way,
it attempts to approximate the way light radiates in real life,
especially off what are normally considered non-reflective surfaces.

Basically, the closer some geometry is to other geometry, the darker it is rendered. Angle also seems to have an effect; nearby surfaces facing towards each other will render darker than nearby perpendicular surfaces (look closely at the first and second spheres).

Uses
It's often baked into a texture. This is especially useful for game assets, as AO does not take light sources into account (only proximity and angle of nearby geometry), and so remains more consistent as the object (or objects around it) is/are moving.

It's also useful in rendering/compositing to help add a little more depth/contrast:
Without AO:

With AO:

I've attached an image that shows a model(in grey) and visualization(arrows and blue balls) for ray-casting to show how an ambient occlusion algorithm can be constructed.
The little blue spheres indicate the current area that is being tested.  For each pixel of the texture map there would be one little blue sphere.  The red arrows that are shooting of the blue spheres represent ray-trace tests.
Rays(red) are shot off in several directions from every pixel(blue), and for each ray that makes contact with the surface of the model; the pixel at that point will be darkened a little bit.
So basically; areas that are concave will have lots of ray intersections with the model and areas that are convex will have very few hits and this gives a lighting cue that helps the model to look more 3D.
If you hold up your hand with your fingers together, you will see that the areas between your fingers are darker than the surrounding areas.  This is basically one of the things that AO, cavity, dirt mapping are all meant to simulate.
Also, they can be used to simulate dirt and corrosion that accumulates in recessed areas.
There are many ways to calculate this effect and basically the author of the particular method in question gets to name it and this is why you will see different names like AO, Cavity Mapping, Dirt Mapping.
They are all meant to give depth to a model, whether it be a lighting cue or dirt accumulation.
PS:  Vertex Paint mode's Dirty Vertex Colors is probably not ray-tracing.  It's likely a slope calculation which uses nearby vertices, if you want to know for sure then you'd have to look at the code or ask someone who has.

I think in vertex mode the AO get calculated per vertex, the area in between is interpolated linearly.

Yeah, From the way it looks, it seems like a slope calculation which uses nearby vertices to determine whether an area is concave or convex.  The more sharp the slope is on concave areas; the darker it becomes.  The more sharp the slope is for convex areas; the lighter it becomes.
That's how I'd start if I were going to try and code something like that.  But as I said, I have not looked at the code so I'm only making an educated guess.  It may be something totally different from this.

Ambient occlusion in Blender render makes the shadows more transparent and look like it was rendered in cycles. -From my experience.

what, am I wrong? You can clearly see the shadows get more transparent and it looks like cycles. Unless im blind or something.


text:
How can I get a .MTL file to show on an .OBJ model I imported in Cycles?
I've downloaded & imported several .OBJ models into Blender but they don't always import with the textures automatically in place, even though the model came with them. Here's an example:
https://drive.google.com/file/d/0B_yQeQQ8ImENWWYyb0oxYWZMVjQ/edit?usp=sharing
I assume this is due to the presence of an .MTL file, but I don't know for sure.

If you are using the Blender Internal render engine your model will import with the texture already applied.

If you are using Cycles you will not get any textures applied to the mesh whatsoever. In this case you will need to manually assign the textures to your shader.

Is that still the case? Is it a bug in Cycles? I find it easier to use Cycles for some tasks, but it is impossible to work with if it does not import the material.

Cycles still does not import the material.

Here is the link to the add-on. Unzip it in your add-ons folder and use it in blender. You might have to run blender as administrator.
http://blenderartists.org/forum/showthread.php?394600-Materials-Specials-amp-conversion


text:
What is the name of this item and how to get it back?
I think I pressed an unintended keyboard shortcut and this cursor thing

in 3D view disappeared. What is the name of it and how to get it back?
I am already in object mode, not in edit mode.
Edit
From the comment, it seems that it is called "manipulator". However, pressing Ctrl+Space does not show it.

Ctrl + Space is the shortcut for hiding and showing the manipulator

You can turn it on and off from the UI as well:
http://www.blender.org/manual/getting_started/basics/transformations/transform_control/manipulators.html

Pros call it widget or just thingy ;)

@Jerryno lol, pros don't know the name because they  don't use it. It just gets in the way of what you're trying to click on, and keyboard shortcuts are faster. :-p But back in the day it helped me understand the concept of a selection's Median Point.

It looks like I have disabled all manipulators like this:

in which case pressing Ctrl+Space does not have an effect.
Turning on at least one of them like this:

brings the manipulator back.
Hovering over the item does not show a keyboard shortcut, so it must have been a mis-Shift-click instead of an unintended keyboard shortcut.


text:
How to spread out keyframes parabolically
I would like to create an animation in which something blows up, starting at a normal speed, slows down to a stop, and then reforms. I know I can manually spread out the keyframes in the dope sheet editor (by spreading the keyframes farther and farther apart and then pasting a copy in reverse), but is there a way to do this automatically?
Example of distances between keyframes: 1,1,1,1,2,4,8,16,32 || 32,16,8,4,2,1,1,1,1
Where || is where the new keyframes end and I paste a copy in reverse order.
Doing it manually works when the speed change happens over a few frames, but if I want the process to extend over 60-120 frames, the process becomes both harder to correctly guess the distance, and it takes substantially more time. Is there something such as a way to edit keyframe distance in the NLA editor?
Any help is greatly appreciated. Please comment if anything is unclear.

@SixthOfFour essentially, yes. So ie. Distances: 1,1,1,1,2,4,8,16,32 || 32,16,8,4,2,1,1,1,1
Where || is where the new keyframes end and I paste a copy in reverse order. I have updated the post.

@cegaton I'm afraid that only deals with interpoliating keyframes; not the distance between them.

I can't seem to figure out how to use the graph editor with the cycle modifyer to gradually spread the keyframes. Are there any tutorials relating the graph editor to this?

have a look at this solution, it may help you.

This addon works great, from that solution:
click here

I made both a slow-down addon and a reverse addon. A combination of those two may be helpful?
How can I slow down or animate time?
How to reverse an animation?
EDIT
This is designed to help you with the result you are looking for, which is not necessarily parabolic.


text:
How to set set Screen type with python
Found nothing in Python API to set Screen type (other than "Default").
Is it possible?
My need is to set it programmatically, with python script !

bpy.context.screen is a shorthand, but read-only.
You can set a screen via the Window object, which actually holds the screen reference:
bpy.context.window.screen = bpy.data.screens['UV Editing']

http://www.blender.org/documentation/blender_python_api_2_70_release/bpy.types.Window.html#bpy.types.Window.screen
There's also an operator to change screen by a number, relative to the currently active screen:
bpy.ops.screen.screen_set(delta=1) # select screen after current from list

This is what CtrlLeft and CtrlRight trigger (with a delta of -1 or 1 respectively).

You can use bpy.context.window.screen = bpy.data.screens['screen_name']. To see all your screen types, run:
for screen in bpy.data.screens:
    print(screen.name)