text:
How to filter multiple file-extensions to limit which files display in an operator's file-selector?
I'm creating an image file importer based off the operator_file_import template. I want to set script so that it recognizes image files, because right now it's only recognizing text. How do I go about defining a list of extensions that show up in the file browser when I launch the script? Right now, based on the starting template, the only thing I can import is a .txt file.
Here is the code - The generic comments are still there and anything that I changed is indicated by a comment/CHANGED tag.
import bpy
from bpy.types import Operator
import collections
import os
from bpy.props import (
        StringProperty,
        BoolProperty,
        EnumProperty,
        IntProperty,
        FloatProperty,
        CollectionProperty,
        )
from bpy_extras.io_utils import ImportHelper
from bpy.types import Operator

#CHANGED read definition to class name
def read_pbr_textures(context, filepath, use_some_setting):
    print("running read_pbr_textures..")
    f = open(filepath, 'r', encoding='utf-8')
    data = f.read()
    f.close()

    # would normally load the data here
    print(data)

    return {'FINISHED'}

#CHANGED class name
class ImportPbrTextures(Operator, ImportHelper):
    """This appears in the tooltip of the operator and in the generated docs"""
    bl_idname = "import_test.pbr_textures"  # important since its how bpy.ops.import_test.some_data is constructed
    bl_label = "Import PBR Textures"

#CHANGED filename_ext to png
    # ImportHelper mixin class uses this
    filename_ext = "*.png"

    filter_glob = StringProperty(
            default="*.png",
            options={'HIDDEN'},
            maxlen=255,  # Max internal buffer length, longer would be clamped.
            )

    # List of operator properties, the attributes will be assigned
    # to the class instance from the operator settings before calling.
    use_setting = BoolProperty(
            name="Example Boolean",
            description="Example Tooltip",
            default=True,
            )

    type = EnumProperty(
            name="Example Enum",
            description="Choose between two items",
            items=(('OPT_A', "First Option", "Description one"),
                   ('OPT_B', "Second Option", "Description two")),
            default='OPT_A',
            )

    def execute(self, context):
        return read_some_data(context, self.filepath, self.use_setting)

# Only needed if you want to add into a dynamic menu
def menu_func_import(self, context):
    self.layout.operator(ImportPbrTextures.bl_idname, text="Text Import Operator")

#CHANGED class registration to ImportPbrTextures class
def register():
    bpy.utils.register_class(ImportPbrTextures)
    bpy.types.INFO_MT_file_import.append(menu_func_import)

def unregister():
    bpy.utils.unregister_class(ImportPbrTextures)
    bpy.types.INFO_MT_file_import.remove(menu_func_import)

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.import_test.pbr_textures('INVOKE_DEFAULT')

This question isn't spesific to image importing, its just about extensions.

The script doesn't run AttributeError: Calling operator "bpy.ops.import_test.some_data" error, could not be found

The code works, ie only shows png files,  however you are test calling import_test.some_data rather than import_test.pbr_textures ... perhaps the former still had ".txt" as a glob.

script now works and points to .png files. Problem was as batFINGER said, bpy.ops.import_test.some_data needed to be changed to import_test.pbr_textures

All this code does is point to the image files now. Upon trying to load and read the images, I am met with this error: line 64, in execute NameError: name 'read_some_data' is not defined
How do I define the script to read these files? Or more specifically, how can I make this script load the image into a texture node?

You have changed the method name to read_pbr_textures

Your question has been edited and now asks about UnicodeDecodeError. Reverted those edits. Please as a different question for further queries. If you run into multiple issues developing your script, just ask multiple separate questions, instead of editing once the first is solved.

In the operator's filter_glob property, (which you've already defined), you can define multiple extensions using the ; separator, eg:
filter_glob = StringProperty(
        default="*.png;*.jpg;*.jpeg;*.bmp;*.exr",
        options={'HIDDEN'},
        )

If you want to make a list of all extensions Blender supports you can use. bpy.path.extensions_image eg:
"*" + ";*".join(bpy.path.extensions_image)

works properly! File importer script now points to multiple extensions

@lvxejay  bpy.path.extesions_image is a set of all image formats supported (by extension)

@ideasman42 Where are these operator's properties documented. I cannot to seem to find any description of them besides in Blender source.

Here is an example from http://web.purplefrog.com/~thoth/blender/python-cookbook/image-to-material-node.html :
def image_for(fname):
    candidates = [ img for img in bpy.data.images if img.filepath == fname]
    if len(candidates)<1:
        return bpy.data.images.load(fname)
    else:
        return candidates[0]

def node_of_type(nodes, type):
    for node in nodes:
        if node.type == type:
            return node

def mission1(fname):

    mat = bpy.data.materials.get("material")
    if mat is None:
        mat = bpy.data.materials.new("material")

    mat.use_nodes = True
    nodes = mat.node_tree.nodes

    n1 = node_of_type(nodes, "TEX_IMAGE")
    if n1 is None:
        n1 = nodes.new("ShaderNodeTexImage")

    n1.location = (-200,0)
    n1.image = image_for(fname)

    bsdf = node_of_type(nodes, 'BSDF_DIFFUSE')

    mat.node_tree.links.new(bsdf.inputs[0], n1.outputs[0])

    coord = node_of_type(nodes, 'TEX_COORD')
    if coord is None:
        coord = nodes.new('ShaderNodeTexCoord')
    coord.location = (-400,0)

    mat.node_tree.links.new(n1.inputs['Vector'], coord.outputs['UV'])

    return mat

mat = mission1("/home/thoth/art/dancing-bear/bear384.png")
bpy.context.active_object.data.materials[0] = mat

authors: Алістер Кроуленко


text:
How could a lightsabers bright core be maintained when motion blurred?
Without motion blur it looks like this:

With motion blur and shutter 1.0
The core dissolves:

The compositing is similar to Post-processing Lightsabers in Blender

Maybe you can use a trick: The particle info node has properties for velocity and angular velocity. Maybe you can render the blade of the light saber as a single particle attatched to the handle and use the velocity to scale the brightness.

@maddin45 thanks for you suggestion, I indeed tried already to use a single hair particle, also a disc-segment with controlled by a shape key but couldn't find out how to drive shape key. Particle info node seems promising, but a bit much research for (this ;-) afternoon.

The id mask with motion blur is rather pixelated in cycles. What about blur/dilate the mask then fill in more colour to solidify the centre a bit more?

@sambler Thanks, I will try it I will take a while since I'm new to compositing.

Your core is not bright enough, give the core emission strength between 500 and 1000 and then it should be bright with shutter at 1.0. Do the soft red glow in postpro also.

source: Stack Exchange

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

sort: votes


text:
How can a text object be created with non ASCII characters?
After enabling international fonts I was expecting that I could create a text object like: 咏春拳.
It seems that a different font is used for the text object.

The Outliner shows a font Bfont

Can this be changed?

Text font can be changed from the Object Data panel.

@Leon do you mean Object Font?

Yes. I think you are going to create something like this?

Fonts for creating Text objects are set in the Text Data panel.

Blender uses droidsans_final_fixed.ttf (font name: DejaVuSans) as the detault i18n font, but just for UI text display, located in blender folder ..//2.69\datafiles\fonts\. There also another font called bmonofont-i18n.ttf (font name: BlenderMonoI18n) In the same folder. You can use it as the font for the Text object if you didn't have any other unicode or asian fonts in hand. Ortherwise, you have to use other system or non-system fonts to create the solid text mesh.
As for the builtin Bfont.ttf, it uses standard encoding, and less than 200KB. I don't think it is possible to include the large number of non-ascii charset.

I used arialuni.ttf from \Windows\Fonts it has 22MB and seems to contain everything.

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


text:
Using cycles volumetrics to make planet's atmosphere
I have seen the tutorials involving the use of the compositor to produce an atmosphere, but I wanted to be more authentic.
Since Cycles now has volumetrics support, I have tried using the sphere gradient texture connected to a color ramp (knowing that black is 0 density and white is 1) to get an accurate density falloff (a factor of 10 every 10 kilometers), but the volume density still reaches the outer edges of the mesh.
Any way of doing this?

Related: http://blender.stackexchange.com/q/7509/599

I don't really know how the gradient texture node works so I usually make my own gradient texture using the generated coordinates and a Seperate XYZ node.
Here is what I have come up with for a homemade 3-dimensional linear falloff spherical gradient texture (plugged into a volumetric emission shader to visualize).

The object this material is applied to is actually a cube.
Here is the node setup:

Click to enlarge
It works by calculating the distance from every point to the point (0.5, 0.5, 0.5) in the object's bounding box (using generated coordinates).  This creates a gradient from 0 to 0.5 (going out from the center of the bounding box), but a gradient from 1 to 0 would be much more useful so this value gets multiplied by 2 and inverted by subtracting from 1.  (Ignore the math node labeled "clamp to [0,1]", it's accidentally left over from an earlier version.)
You can then plug this value into an RGB curves node (or through a few math nodes if you want to be more precise) to create whatever kind of falloff you want.
Here is the .blend so you don't have to manually copy all those math nodes!

I may have an answer to your question. I love space and I use Blender. So I know how to do a planet atmosphere shader in Cycles Render.
Here, I've three spheres : The planet surface, the clouds, and the atmosphere
But if we go closer to the surface, we can see some differences.
Of course, it's based on a volumetric node material
So here I have the atmosphere node material.
----
So I added two volume scatter nodes. The first is the color of the atmosphere, and the second is for the sun's reflection. The first math node is the sun's reflection density factor. The second is for the atmosphere density. This one depend of two color ramp parameters.
the first color ramp node is for the atmosphere falloff factor at ground level.
The second is for the ground level's start radius, in function of the atmosphere's mesh size.
The limit of the atmosphere is the size of the atmosphere's sphere.
That might take a little bit of time to render a good picture, but the density factor must be higher than ten to get a blue sky.

Wow... I'm loving the result you've shared! Definitely gonna use this!

I'm a bit of a noob at volumetric effects, but what I do is by using the Layer Weight node. Here's an example -

Here's the node setup -
You can render your sphere and then a mask so that you can overlay your sphere on top of the glow in the Compositor. Very good for animation since it is authentic in the 3d space

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


text:
Altering size of emission object without messing up brightness of light in scene
To create a light source using Cycles, I create a plane (or other mesh shape) and set the strength until it looks good.  When I scale that light source, say make it three times bigger, the total amount of light increases.  Highlights blow out and the scene sometimes goes almost all white. So, I reduce the emission shader's strength.
It seems that the strength is interpreted as luminous watts per square meter.  Is this how it works? Wouldn't it be better to be able to alter a luminous object, to control softness and depth of shadows, without changing the overall brightness contributed by that source to the scene. Is this possible to do this easily, and am I understanding what is happening correctly?

Actually it is working this way becuse the nature of ray-tracing. When a ray hits an emission, the it "takes the strength back to the ray source". Rays from a material will hit the light source more probable when the visible surface is bigger. So more rays from that material will "bring light back". It would cost much calculation, and would not be natural to do this precisely on the level of the renderer.

Set the emission using a driver

See this answer for the basics of setting up a driver.
Result

What is the rationale for the expression you have for the strength in the driver? Róbert's formula seems more logical to me. (Strength / scale ^ 2)

@hjaarnio, Purely artistic — I set up the animation and then tweaked the expression for desired result.

I am not sure, I cannot check it from this machine, but I think, it may be able to do it using nodes. When all the three coords are scaled with the same amout, then theoretically the same total light amount comes out when you set the emission to:
desired strength / scale square
Where desired strength is what you like when scale is
one. So in case you can acces the scale from the nodes,
you are saved. I will check this when I get home.
I did not Find a node for scale. But you can use the method Aldrik suggested, with the equation I have written, and your result will be the desired: Scaleing the light source will only change the shadows blur but not the lights total strength.


text:
UV painting within Blender?
I basically want to create this in Blender
But I have some trouble creating the textures for it. I have created an UV map for it which looks like this.

Now I just want to paint on the UV map. But I am not sure how I would paint those textures. I need some some masking tools, for example I only want to paint on a specific face and not on the whole texture.
I also need some tools like the fill tool and the ability to draw lines because as you can see it is not hand drawn.
Can I do this in Blender itself or do I need to use an 3rd party tools like Photoshop/GIMP?

I would recommend exporting the UV layout to Photoshop/GIMP/inkscape/external tool of choice. Blender does have painting tools, but they are designed for painting, whereas the effects you seem to be looking for are probably easiest to get in an external tool.

Can you limit the scope of your question a little? Like: "How can I mask in texture paint", etc.

I would suggest a 2 step process.
In edit mode select all the faces you want of one color. Then in texture pain mode. click the button in between the layers and the shading mode buttons. Its tool tip says Face selection masking for painting That will limit the area allowed to be painted, to only what is selected.
Then after you have the base colors down. Open the newly painted image in gimp/photoshop and paint in all your shading and details.


text:
How can I get the Solidify modifier to apply after a texture displacement?
I'm working on the center cup part of a daffodil, and this is my current setup. I have textures that are mapped such that they displace the geometry the way I want it. I then have a Solidify modifier to prevent the mesh from being "single-sided". This is the result:

However, the problem I'm having is that the textures seems to displace the geometry after the Solidify modifier has been applied, but I want the textures to displace the geometry before the Solidify modifier. I know there's a Displace modifier, but that doesn't give me the fine-tuning control I need and have within the Texture panel. As the textures displace according to the normal, the result is that the edge is thick when I want it to have the same thickness as the rest.
How can I force the Solidify modifier to take place last? Is there another way to achieve the same result?

What exactly can't you do with displace modifier that you can do with the texture panel? as far as I know, the displace modifier can use any texture made in the texture panel..

@gandalf3: In the texture panel, I've set the projection to Tube, the mapping is X: X, Y: Y, Z: None, and on the X-axis, the texture repeats 6 times.

I see.. you could use three different displace modifiers (one each fore X, Y, and Z) and the displace does seem to take into account the repeating.
As far as I know, there is no way to do this with the Texture panel displace, as the displacement is done at rendertime on the already solidified mesh.

@gandalf3: Just tried that. Doesn't work. The entire mesh moves in one direction or the other, which indicates that it's being applied uniformly in one direction, despite the fact that I set texture coordinates to UV. Also, using the Displace modifier doesn't allow me to use the multiple-output feature of texture nodes.

Displace Modifier
Using this modifier before Solidify is the easiest option.

Since you seem to have tried this, I'll include the blend file for you to inspect.

You can use the "Material Index Offset" setting of the Solidify modifier to apply a material with a inverted displacement to the generated faces.


text:
How to offset multiple smoke instances by time?
I want to use pre-simulated smoke simulation assets from a library to avoid having to re-bake each time. For example, a large open scene with several smoke stacks rising off of a ground plane, I would simulate one smoke stack, bake the cache to an external file and then in my new scene file link same-sized cubes to the pre-baked caches and move and rotate them around to duplicate that particular smoke simulation. Is it possible to offset these by time so they're not exactly the same, or is it only possible with separate caches for each?

ahhh... blender still has no this feature :(

If you look at the point cache files, the default filename follows the format: [identifier]_[frame]_[index].bphys. Unfortunately, the [frame] in the filename doesn't actually correspond to the cache's actual frame number.
That means, the only way to offset a cache's frames is by parsing the contents of each file (e.g. writing a python script). Apparently, modifying the contents is not that straightforward. This page explains a little (towards the bottom). Glancing at the blender source code, it looks like you'll need to edit the points time, dietime, and lifetime; some cache files may also store the previous cache point's time data too.
If you know C, It may be easier to just write a patch for Blender to add the feature. That way, you can make use of the read/write methods from Blender's source. You could also request the feature; perhaps there is a developer who is familiar with the code who can easily add it.


text:
How to quickly find sound assets
I can easily find and edit all image assets in the image editor, but I was wondering how can it be done with sound assets.

You can see all the sounds that are being used by the blend file by using the 'Outliner'.
Change the display mode of the 'Outliner' by changing the dropdown box from 'All Scenes' to either 'Sequence', 'Blend File' or 'Data Blocks'.

'Blend file' and 'Datablocks' each have a 'Sounds' section which lists all the sound files that are in use in the current blend file. The 'Sequence' view will only show audio files in use in the Video Sequence Editor and not in other sections of blender.
To further filter the results in 'Sequence' view for just audio and not video or images type the extension of the audio files, in this case '.mp3' into the search box.

Each of these views only lists audio files that have been loaded into blender and not a direct way to edit the audio file.

are in those files the files used by logic bricks?

@rraallvv I had forgotten that sounds could be used by logic bricks, I have updated my answer to include a way to view sounds used by them.


text:
SVG Model falling through the ground?
I'm trying to work with physics using an imported .SVG file (tried several files).
Steps followed:

Imported an .svg
Extruded the .svg
Converted curve (svg file) to mesh
Created a plane.
Applied 'rigid body tools' to plane -> Passive
Applied 'rigid body tools' to svg -> active
Created and applied 'rigid body tools' to cube (for reference/test purpose).

The result is this: https://www.youtube.com/watch?v=AAHoA264mW8
Why doesn't the imported .svg collide correctly?

can you upload the svg or blend file?

It looks like there's an issue with the normals (and possible face overlapping) on your model. Can you post the blend file on http://pasteall.org/blend/ like @Vader suggested?

Also is the collision shape convex hull or mesh? maybe enable collision margin or increase the thickness a bit.

Thank for your replies. I upload my test file: http://pasteall.org/blend/27768

@sambler: after enabling collision margin (0.001 or more), the .svg collides with the surface without trespassing it, but in a very unnatural way..... http://youtu.be/8UV31rhwtoc

There are several problems in your file:

All the objects have un-applied scale, which can cause rigid-body simulations to behave strangely. Apply the scale to the objects mesh data with CtrlA>Scale.
The SVG/star object's origin is not centered. The origin is used to determine the center of mass, so if it's in an odd place (as in this case), it will cause strange behavior. Center the origin with CtrlShiftAltC> Origin to Center of Mass.
The SVG mesh has some strange topology/overlapping faces:
The SVG mesh is a little messy, with non-manifold geometry and overlapping faces:

Try deleting all the faces and then adding loop cuts at the intersections to get a mesh like this (click for slower speed):

Optimizations:
There are few minor optimizations you can make too:

Make the floor solid. Rigid-body simulation likes manifold meshes more than non-manifold meshes (such as a plane).
Another advantage to using a floor with thickness is you can use the Box collision shape for it, which tends to be faster and more stable than the Mesh option.
Use the Box option for the cube. It's always better to use the primitive collision shapes where possible.
Use the mesh collision shape on the SVG. Because the SVG has concave parts, only mesh will allow it to collide accurately.

Result

Example .blend

I'm speechless. Thanks for your perfect explanation. Also tanks to all others guys helped me solve this problem!


text:
Visual programming with Blender Python
Does anyone know if there is some sort of visual programming software for Blender?
I know there is one called "visual bpy". I watched a demonstration of it. It looks quite promising and should save us a lot of time when writing a GUI in Blender.
Unfortunately, I can't find link to obtain this software even though I've been searching for it diligently.
Any help would be appreciated.

The download link is in the video description of the demonstration. https://www.youtube.com/watch?v=7DKxgw24u0o

a simple youtube or google search could have also yielded an answer.

I 've did this search over and over and overtime. I wouldn't have posted this without doing any effort!!!!!

HI Aldrik, thanks for the link. Unfortunately, I am in the region that can't let me see the youtube. If you can post the actual link(but not the blender file of the rig) for the program, that will be very kind of you.

@Patrick Here is the link Aldrik was referring to: http://www.mediafire.com/download/s2vvlqofv3heqt6/VisualBPY.zip

Here is a direct download link for the script. It was in the description of the demo… there is also a small youtube playlist dedicated to it and the rig used is available on BlendSwap.

CharlesL, you are great!

Hi CharlesL, not sure you tried it or not. This verison can't let us your the buttons. It prompted "Button features are not available for this version".

Hmmm... that's weird. That was the version he linked to in the description.

What OS are you on?

Windows 7 64 bit


text:
Rigid or soft body dummy legs?
I have a little floating robot character, it's just a sphere with an eye and 4 little "nub" sort of feet legs that extend from it's bottom. I want to do keyframe animation on the sphere, and have the little legs swing and bounce around (within limits on their movement), while attached to the sphere.
I have some limit rotation constraints set up on them but I decided I want to just simulate them like a puppet's feet or something, instead of manually animating them. How can I achieve this? The sphere is not yet rigged and neither are the legs, will I need to rig them to do this? Or can I handle the little feet with physics and constraints alone?
I've tried rigid and soft body and setting their parent empty as a constraint target but the feet just fall down infinitely when I bake the simulation. I've never tried to do simulations so I'm not sure where I should be looking to do this. Also at the base of my little feet I have a small colored ring from which they extend, this is animated using a lattice so that when the feet move, this little "rubbery" part deforms a bit as well, and if possible I'd like to preserve that in any simulation, though it's not that important and I could do without it. I should note that I've done a simple character similar to this before but that was without needing any physics.

I think what you are looking for is called "ragdoll rigging" which uses Rigid Body Dynamics. Blender Cookie recently had a tutorial and you can find several on youtube
Start with the body. You want the body to be a Passive object that is animated, this will allow you to animate the position of the body and have the legs follow.

Then add a leg which will be an active object.

Next you add an empty to be the pivot point. Locate the empty at the top of the leg at the point where you want it to rotate. Make the empty a rigid body constraint, set type to generic with one object being the body and the other being the leg, turn off disable collisions and turn on the x,y,z axis limits and set all to zero.

You will want to setup the parenting to help keep them together. Select the leg then Shift select the empty and press CtrlP, select the empty and shift select the body and press CtrlP.
Adjust the other rigid body properties so that they behave the way you want them to.
Repeat this for each leg.

Ahh this sounds like what I'm looking for, I'll give it a try thanks!

I think you mean you want the children objects (i.e. the legs) to follow the parent in a delayed way like this:

To do so:

Parent the feet to the body.
Under Relations Extras in the Object Settings, check the Slow Parent checkbox and set the Offset to 10.0

This next step is optional, but if you want to prevent the feet from ever getting farther than a few units away from the body, you can add a Limit Distance constraint. Go to the constraints tab, add a Limit Distance constraint, set the distance to something around 4.0 units and set the target to the parent object:

Thats very close to what I want but not quite, the feet are attached to the sphere so I don't want them to move around from their locations, I just want them to rotate as if on a loose ball joint from their current locations


text:
How to invert a brush texture?
I want to invert the colors of a texture brush. How can I do that in Blender without using an external program?

You can use Texture node, which is supported by the texture paint system, too. Actually, it can be much more powerful than just inverting colors.

Open a Node Editor. In the header, switch the Node Type to Texture, and the Data Type to Brush;
Add an existing Texture or Image node, link it to an Invert node before Output. As shown below.

Hi, many thanks for this answer, very helpfull. Now i tried this: paint a stone soil as uv-texture and save this texture. Then i wanted to use this saved texture as inverted Mask Texture. To do this, i tried to create a new paint brush, open node editor for texture brushes, create texture input and select this texture. Unfortunately i cannot find this texture in the selection list of texture input. I wanted to use this whole texture to invert it, then to use as as mask for texture painting. Otherwise the mask texture will not meet the painted whole texture. How can i realize this?

@grenzfrequence You may want to ask a separate question for that (with screenshots etc.)


text:
How to render a ball into an 360° image

Hey, I want to render the ball shown in the image as a 360° image.
My Plan is to have the camera like a cylinder facing inwards.
So any objects on top of the ball, are also being included (like the cube)
Does anyone know how to do this?
Any help would be appreciated.

Very similar goal:  https://blender.stackexchange.com/q/89719/45359

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


text:
UV Map Region Scaling - "Disco Ball" Problem
I am UV unwrapping a set of squares, each separated by a small margin between them in a tessellation (consider the individual mirrors on a disco ball). I want to be able to do accurate AO and material bakes on the margin regions between the squares, so I want those regions to be "thicker" in the UV map.
How do I make the margin between the squares "thicker" in the UV Map, while retaining the same total area?
Starting UV Map:

With the interior squares scaled down by individual origins:

Scaling the "margin" between individual squares up by individual origins does not work as I intend:

A drawing of what I am hoping to achieve:

Thanks!

I'm a little confused... I am assuming that the grey squares are your texture and that you wish each of your unwrapped squares to fit, individually, into each of those squares?  Can we see the model please?

Thanks for the reply! unfortunately I can't send the model, but hopefully I can provide a bit more context.
Another example to describe the model in this region would be the tiles + grout in your bathroom and kitchen. While the tiles are close to being tessellated perfectly, there is a thin line of grout between each tile.
In the model, I want to keep those "grout lines" very thin, but in the UV unwrap I want to shrink the "tiles" by their own origins, and fill the resulting empty UV grid space by making the "grout lines" thicker.


text:
How should I handle a large number of objects?
I am working on updating an importer for Structure Synth and I am realizing that it might actually not be practical. In structure synth, you can create thousands and thousands of objects, each of which will be exported. Consequently, you would need to make a material for each one as the color variations can be infinite as well, in other words a slightly variation of color for each one. Now, the exporter does this well, however it seems to me the scene becomes unwieldy very fast. Managing 1000 objects and their corresponding materials is basically impossible.
Right now all I can get out of SS is a translation matrix and RGB values for each object, sphere or cube which I make an ico sphere or cube out of in Blender and then assign a material with RGB value.
Is there anyway to instance the objects and materials but retain the all the different colors without having to have all of those objects and materials?
Thanks in advance.

There is a tutorial that I found invaluable in understanding this topic available on BlendTuts.com How to Organize Your Scene You should be able to apply this information to your situation.

Blender supports Object Color to override the Material RGB Diffuse.

Object properties, set a color there (also possible via Python)
Link all Objects/Meshes with a single Material, with option Object Color set.

This looks like what I'm after. I'm gunna give this a try right now and get back to you guys in a jiffy

This is gunna do it. Just having trouble not making a mat for each object. Should hopefully have an alpha release this week

It can be achieved by having all cube shaped objects sharing the cube mesh (similarly for the sphere shaped objects). When you perform the steps above, the user count for the mesh data block will be more than one per object type. Even if you delete an object, the mesh data block user count will reduce by one. When user count reaches zero (and no fake user flag is set) the memory allocated for the mesh will be reclaimed (garbage collected or deallocated) of closing he session or quitting Blender.
http://wiki.blender.org/index.php/Doc:2.6/Manual/Modeling/Objects/Duplication
As for the materials, create a material slot and and attach a material to the object (not the object data, which is the default). Some material slots can have materials attached to the object data and some to object (common materials can be attached to the object data and unique ones to the object)
http://wiki.blender.org/index.php/Doc:2.6/Manual/Materials/Options
This way memory usage can be tamed and you will have color variation as well.

OP can also see http://blender.stackexchange.com/questions/510/how-can-i-duplicate-a-mesh-along-a-curve

nono. over the global options there's something like "Scene simplify" it has a goal where you set the number of neperian reductions to the meshes working mainly to the Editor interface not sure. like 10 for a million vertexes you will only have to deal with 99 thousand vertexes which is way more adapted for the GUI interface and will save hundreds of wait cursors


text:
Lock Axis on Force Fields
my goal is that the cursors follow the button and always point to the button with the index finger.
The button should move with keyframes and be a rigid body just like the fingers so that it collides. The button should attract the cursors with a force field. The cursors have a track-to constraint to the cursor.
Since I want to achieve a 2D look, the objects may only rotate on the axis that is parallel to the camera. (x-Axis)
In the object properties, I have blocked rotation on the y and z axes. The same applies to the position on the x-axis. So that the objects only move and rotate on one plane if possible.
Unfortunately, the force field on the button causes the cursors to rotate around the other axes as well. In addition, the cursors jump around after the collision.
How could I proceed so that the 2D look is retained and the locked axes remain locked despite the force field?
Settings on Cursor:
Physics:

Rigid Body
Type: Active
Mass: 1kg
Dynamic: true; Animated: false
Collisions: Shape: Mesh; Source: Deform; Deforming: false
Object Constraint: Track To; Target: Button

Button:
Physics:
Rigid Body

Passive
Settings: Animated
Collisions: Box
Force Fields
Type: Force
Shape Point
Strength: -500
Flow: 10

sorry, but i don't want to rebuild everything manually just to help you. So either you provide a blend file so we can check it out or....yeah good luck!

@Chris – Sorry man.. that's my first question in this forum. I will provide the blend file for the next question. I've rebuilt it my self. As long as I didn't go crazy with the force field it worked.

What is the final effect you are looking for  ? Cursors attracted, then bouncing off. or something like that? I think an opening sentence with a description of that would really help, here.

@RobinBetts I made this https://www.instagram.com/reel/C6O4VlVMHFl/?utm_source=ig_web_button_share_sheet&igsh=MzRlODBiNWFlZA==
I don't really know how i fixed it. I just wanted to play with Rigid Body Physics and wanted to find out why they "explode" sometimes.

Hehe.. :) Can we take it this question is fixed without needing an answer, then?

Yes I guess so.


text:
Glass Dispersion Shader with blurred sides
I'm wondering how I could create that kind of shader (screenshot) in which only the sides are "blurred" or "rough", but the front and back are kind of clear.

My node setup for disperssed glass looks like this:

Thank you for any tips! :)

Hello, I think the effect you want is called tilt-shift or camera depth of field and if you want it custom (by default if its physically based it depends on the distance to your camera and the properties of your camera) you might want to do the effect in post-processing inside the compositor workspace with a gresycale mask and a blur node.

I don't think this is a shader thing... because the shader will not make the boundaries of your object blurred as they are in the reference image. I would agree with @Gorgious that this is most likely a tilt-shift effect.

@Gorgious Thank you for your answer. Maybe I didn't say it correctly. I'm talking about the roughness on the sides. Because I feel like the front of the object has less roughness but the sides have more roughness. Am I right?

Do you mean Roughness as in the input from your different BSDFs ?

@Gorgious Yes, indeed. Don't you feel like that the sides of the object are rougher than the front glass which seems to be clearer? Or is it just an illusion.

I think it's not the roughness but refraction artifacts, the light rays from the lower face come in the camera at a direct angle while the light rays from the sides bounce a few times before going into the camera which tends to scatter the light


text:
Create faces (fill) between multiple vertices
I would like to create a face at the selected edge. I don't really know how it works because "F" creates the bad face on the right side.
Does anybody have an idea?
My goal is to make the middle part of the robot arm in this picture.

My mesh looks like this: Left: Create a face here. Right: That's not what I want..

This is my blend file: https://we.tl/t-jGWOEGogYD
Don't know how to attach it here, sorry!
Thank you in advance!

did u try just press F instead of bridge edge loops?

@Chris Yes, that was the only thing i tried.

You should work with less vertices, it would make it simpler to modify.
First thing select all and press ShiftN to recalculate the normals (because half of them are inverted), then fill with F and inset twice with i. As the inner face is coplanar with the adjacent faces, there won't be bad shading:

Bevel the edge if you want it sharper:

Thank you so much! Do you know a smart way to reduce vertices?
What made my normals that bad and what consequence does it have if I recalculate them? Thank you!

You had inverted normals (open the Viewport Overlays panel, activate the Face Orientation option and you will see them), you can't reduce the amount of faces with a Ctrl E > Un-Subdivide because it will mess up the topology so I guess you need to do it manually, it's always better to work on a low-poly mesh if possible, and give it a Subdivision Surface modifier to make it rounder, apply the modifier at the end if it's really necessary


text:
Rotate instances on a every other column of a grid / cylinder
here is my project: https://we.tl/t-oGBvzlGcwf
This is my goal. I managed to do everything but the mirroring of every 2nd "column".
Now in a grid there are columns but in my case I used a cylinder to get that "rounded" grid so I don't have real columns which I can select with every 2nd index.
How can I only rotate the instances of every 2nd column?

This is what I have so far:

And this is my current node tree:

is that what you wanna achieve? [1]: https://i.sstatic.net/TaM5WdJj.png

@Chris – Holy moly. I love the internet, the community and YOU! :D Thank you so much! I'll try it out. Can't comprehend why there are people out there who are THAT helpful! Feels great, thank you!

you are welcome, if my answer helped you, pls click on the checkmark left of my answer. thx.

@Chris – I already clicked on it because I thought it will for sure help me but sadly this is pretty complex for me so I can't really figure everything out although your documentation is great. Could you please share a screenshot with the full node tree so I can try to better understand what you explained and how it is working? Can't really combine the screenshots, I'm sorry. I will for sure checkmark it!

Man, you humiliated me on a different level, haha! I don't know how i bring the path accumulation and the path with the points to curve together... @Chris And also I don't know whats REALLY happening.

i added the full node tree to my answer

Thank you very much! @Chris That helps a lot!

if you enable attribute text (i am using Blender 4.3 alpha) ...

and use a viewer node, you can see the indices of your points:

As you can see, they are already ordered "right" by y position.
You can easily achieve that, by the points to curve node and using the y-value of your positions as sorting:

what we know want to achieve, is the same value for each column like this:

we can get that, by

compare the next position with the current position y value like this:

accumulate all these "not equal" like this:

now we got a number for each column:

now use a 2nd accumulate node to fill all numbers so you get the "real" column value for each point:

store that info:

Now all you have to do is compare these column values and rotate/mirror as you like:

result:

full node tree:

Did you change anything before adding the viewer node? Because it looks different for me. It's not sorted by those lines. There's a different logic.

of course: i used the "mesh to curves" node as you can see in the third image. There you can see how i connected the viewer node

I would recommend watching Erindale's geometry node videos (he is a master of explaining that) to learn GN and get familiar with it. The other thing to quickly learn is using the viewer node and connect it wherever you don't know what's happening to see the results. Mute all nodes you don't understand, than mute it one by one and watch carefully what's happening - especially with the viewer node and the results in the spreadsheet. Honestly: i am still learning the accumulate node myself and just use it for "easy" cases. Its very powerful!

Thank you! I will check him out! :)

It doesn't work sadly.. Do I have to type "column" in the Named Attribute and Store Name Attribute by hand? I can't see the mistake.. :( https://snipboard.io/sTX5mh.jpg

pls provide your blend file (which doesn't work) then i can check it out. thx.


text:
How can a Script be periodically invoked from the BGE?
In a script I try to get the coordinates of a head tracker and to change the current scenes camera. The script is wired as shown in this image:

Unfortunatly the script is only called once. How can I setup the Sensor/Controller to invoke it periodically (preferably after a frame has been rendered)?

You could use the delay sensor with the repeat setting checked:

and the default delay is 60 per seconds, cool

I had to click the small button (highlighted) and set the frequency to 1.
The option is called bpy.types.Sensor.use_pulse_true_level


text:
How can animated shape keys be used in the NLA when a character is linked from another .blend?
The character's file has some actions to control a rig (rigify) this works fine in the NLA but shape keys need to be controlled by a mesh. A setup like this:

Even the offset (start keyframe) can be adjusted.
The scene which links to the character's .blend has a proxy for the rig, actions work fine. But I don't get the key-track from the above image.
When I add another proxy this time for the mesh instead of the rig another instance of the character is shown. The 2nd instance isn't animated by the rig but shows the shape key animation!
What is the correct way to get a key-track in the NLA?
(This is a follow up of: How can shape keys of a linked object be controlled? but after some reading I focus on the NLA tracks.)

The idea of adding another proxy for the mesh seems to be correct, it should be noticed that only the instance of rig-proxy performs the bone-based-animation. But both instances do the shape-key animation. The other mesh-proxy instance can be hidden. Both rig and shape-key animation will be displayed .

I created a .blend file start with the default cube.  I gave it a relative shape key and shrunk one of the faces.  I then added keyframes at 1 and 31 with influence 0 and 1.0 respectively.  That makes the face shrink over time.
I then duplicated the cube with alt-d.  Since both cubes have the same mesh, the action is on both of them.  I made a single-user copy of the mesh by clicking the [2] button next to the mesh's name.
It still had a link to the action datablock.  While there are probably easier ways to do this I went into the NLA editor and used the vv icon to move the action into a track, then I deleted the track.
Now I have one cube with the action, and another cube with no action.  I think I am at the point where I can answer your question.
I took the cube that has no action and in the NLA editor I used the menu Add > Add Track to put an NLA track on it.  Then I use Add > Add Action Strip and select the KeyAction.  This causes the action to be added as a strip in the track starting at the current frame of the timeline (I had my time cursor at 31).
Now I have two cubes, each with its own mesh datablock (although they have identical shape keys) and those shape keys are animated by the same action, but the action occurs at different times, because the strip is offsetted.
Although this may not be exactly what you want to accomplish, maybe it shines light on the relationships between the datablocks and guides you to your answer.

Thanks this was my bad, I didn't point out that the characters file is linked from another .blend, within one file it works flawless.

aw nuts.  http://wiki.blender.org/index.php/Doc:2.6/Manual/Data_System/Linked_Libraries#Proxy_Objects actually mentions shape keys in meshes.  When I started experimenting with linked objects, I ran into the same problem you did.

I was able to kludge up something by rigging a driver from an armature
In the library .blend you have to create the mesh with the shape key and have its value driven from an attribute of a bone in an armature (I used the local Z coordinate of the bone, but this is a matter of taste).
Then you link the mesh and the armature from the library .blend.  I'm pretty sure you have to turn the armature into a proxy.  After that you can pose the bone and the shape key should adjust.  (just understand that bone coordinates are really screwy and to alter its Z coordinate, you might end up animating the Y data_path.)
This technique is derived from one of the animation techniques used to correct for pinching of skin when bones are rotated "too far".


text:
Is there a way to batch render multiple scenes?
I have animations in 4 different scenes in my Blender file that I would like to batch render.
Is there a way to batch render all the scenes, instead of only the scene I am working in?

Try creating multiple copies of the blender application! Worked for me. My computer hates my for it though... Just make sure you open the file through Blender or your file browser will get mixed up.

Yes, you can use
blender -b file_name.blend -x 1 -o //file -F AVI_JPEG -s 001 -e 250 -S scene_name -a

-b: tells blender to run in background
-x: is used to add an extension to the movie
-o: sets the directory + Target image file
-F: sets the output image type
-s: 001 -e 250 -a set the start frame to 001 and end frame to 250. Important: You can use -s or -e, but if they're not in order, they'll not work!
-S: sets the scene name to render (spaces in the name are not supported)
-a: renders the animation
The above command should render whatever scene name you specify to -S. To avoid certain problems where similar files can get overwritten, its best to use a script to render each scene on a different line. For example:
batch_render.sh / .bat
blender -b file_name.blend -x 1 -S scene_name001 -o //file -F AVI_JPEG -s 1 -e 250 -a
blender -b file_name.blend -x 1 -S scene_name002 -o //file -F AVI_JPEG -s 1 -e 250 -a

You could also do this in one command - as follows:
blender -b file_name.blend -x 1 \
    -S scene_name001 -o //file -F AVI_JPEG -s 1 -e 250 -a \
    -S scene_name002 -o //file -F AVI_JPEG -s 1 -e 250 -a

However launching blender isn't typically a bottleneck, so it may end up being less trouble to run a new blender instance for each scene.
To get a better understanding of the parameters, you can see the wiki.

There is in fact no reason need to run blender multiple times. You can do: blender file_name.blend -b -S Scene1 -s 1 -e 250 -a -S Scene2 -s 10 -e 50 -a -S Scene3 -s 5 -e 10 -a Just remember arguments are executed in order given, so change scene, set frame then render.

@ideasman42 ah, the -s was the part I forgot when I tested it, the second scene would overwrite the first, please edit as necessary. Thanks.

Does this work with any render engine?

as of blender 2.80, available arguments for -F — TGA, RAWTGA, JPEG, IRIS, IRIZ, AVIRAW, AVIJPEG, PNG, BMP — https://docs.blender.org/manual/en/dev/advanced/command_line/arguments.html

Warning : I think the arguments given in this answer are in the wrong order. It should be -b -S -s -e -x -o -a (not sure where the -F goes). Otherwise some parameters will be overridden by the file's content and you won't get the expected output. It's all explained in --help.

Also, spaces in the scene name are supported. You just need to add "quotes" around it.

As iKlsR wrote, you can use command-line options to render scenes in batch.  If you have saved all the necessary settings such as the start and end frames, the output format, and the output file names in your blend file and all you want is just render the animations in specific scenes, then you do not have to specify many command-line options and you can do it with just
blender -b file.blend -S Scene1 -a -S Scene2 -a

This means:

-b: Run Blender in the batch mode (do not open a window).
file.blend: Open a file called file.blend.
-S Scene1: Switch to Scene1.
-a: Execute the Render > Render Animation command.
-S Scene2: Switch to Scene2.
-a: Execute the Render > Render Animation command.

Make sure you set the output directories and the file names of each scene correctly in the blend file so that the render result from one scene will not be overwritten by the render result from another scene.
Note that a file name just means “open this file.”  You can also render scenes in different files in one batch by using a command line like:
blender -b A.blend -S A1 -a -S A2 -a B.blend -S B1 -a -S B2 -a

This renders the animations in four scenes in total: scenes A1 and A2 in file A.blend and scenes B1 and B2 in file B.blend.

Command-line
blender -b one.blend -a two.blend -a

Run blender -h (or man blender) to list of options with descriptions.
Video sequencer

(If in separate files) link the desired scenes.
Add scene strips to the VSE.
Render.

(Distributed) rendering manager

Distriblend
DrQueue
Loki Render
Yadra
CGRU (Afanasy)
Brender
Netrender

The answers above worked for me (on Windows 10) but only after I did some research. For those like me who have no idea how to take what is written above and make it work for your project, here is what I did:
cd "C:\Program Files\Blender Foundation\Blender"
blender -b "E:\Project Folder\03_projects\Blend Files\Render Me.blend" -S Scene_1 -a -S Scene_2 -a

First, and yes it took some trial and error to figure out, you need to launch Command Prompt for Windows to run this batch operation. It isn't supposed to be run from the command line within Blender. Launch Command Prompt in Windows by hitting the 'Windows' key, typing "Command" or "cmd", then hitting enter.
The explanations above didn't include that you need to navigate your Command Prompt session to see the folder that your blender.exe file is in. It won't just 'know' where to look. cd is the change directory command that I used.
You'll need to use " " to contain the folder structure (I assume because the folder names have spaces in them).
You also need to point Command Prompt to the location of the .blend file you want to render. You'll need to use " " for this too, and you'll want to include the .blend file within the quotations.

I hope this helps someone. There's bound to be others who don't know anything about command line, lol.
Happy Googling


text:
How to scale an image with python
I'm writing an addon and I want to save two sizes of every rendered image. One is the original size which blender saves anyway. The other one is a scaled down version of that image.
How do I scale an image with the Python API (possibly with a specific interpolation filter like linear, cubic, ...)?

You can use the Python Image Library (PIL) for instance, there's a Python 3k port:
https://github.com/gpolo/pil-py3k and https://github.com/sloonz/pil-py3k
or Pillow, which is also a PIL fork:
https://pypi.python.org/pypi/Pillow/2.2.1
Example code (for original PIL though):
http://www.daniweb.com/software-development/python/code/216637/resize-an-image-python
As PIL supported differnt interpolation techniques, all of the above should offer the same (or more).
You could also try without any extra modules, by saving the image in blender to another file using Image.save_render(). Note that this method can be used on any image, it doesn't save the rendered image only (render stands for render settings, the render settings of the given scene will be used to save the file. It ignores the resolution settings however. To change scale, you needed to import the saved image again (so that .pixels isn't empty, which is the case for render results), then call Image.scale() and save again. But you can't specify an interpolation mode.

One could also create a "File Output" node preceeded by a "Scale" node using scripting. This doesn't provide filter options either, though.
Of course this only works with nodes postprocessing turned on.
Blender Wiki Cookbook example


text:
How can I duplicate a mesh along a curve?
I want to outline a curve in the form of text with a mesh (UV-sphere, cube etc.). How can I do that while saving mesh geometry without using the Curve modifier?

That's what the curve modifier does. You can't really do anything.

@Paul see what CharlesL said above, the curve modifier is supposed to deform the mesh, It is possible you are intending this for something else. Can you explain what you are trying to create or do?

I want to make outline of text with mesh (UV-sphere,cube etc.). How can I do that saving mesh geometry without Curve modifier?

@Paul If I understand you want to duplicate spheres along a curve?

That's my idea.I want to create a text outlined with lamps like an old billboard on casino )

For Blender 2.8+, here's how: https://www.versluis.com/2019/07/duplicating-an-object-along-a-path-in-blender-2-8/

This helped a lot, @JohanWalles. Thank you!

Based on what you explained in the comments above, I think what you want are Dupliframes. My answer is based on the example in the wiki.
In short, you add a curve to the scene and in the Curve menu under Path Animation, you enable Follow. (You should also set the frames to a more reasonable number as needed such as 10 or so)

Then add the object and in the Object tab in the Properties Editor under Duplication enable Frames and disable Speed.

Then parent the object to the curve or path, first select the object then the curve (so that the curve is the active object) and use Ctrl + P and Set Parent to Object. After, you can select the object and use Alt + O to reset its origin.
Finally, you can now change the orientation of the object by either rotating it (either in Edit mode or Object mode). The arrangement of objects can, of course, be further enhanced by editing the curve. (Shaping it into text etc)

Additionally from the same manual page linked above:

There are many alternatives to Dupliframes. Which tool to use depends
  on context.

To use a small curve as a profile and a larger curve as a
  path, simply use the former as a Bevel Object to the latter.
To arrange objects along a curve, combining an Array Modifier and a Curve
  Modifier is often useful.
Dupliverts can be used to arrange objects, for example, along a circle or across a subdivided plane.

Additionally, its worth noting that the additional objects are instances and not real objects, this will reduce the load of your scene and also allow you to be more flexible when adding more objects. Alternatively, you can Make Duplicates Real with Ctrl + Shift + A. All objects will now be real objects, but still linked copies. To change this, go to Object → Make Single User → Object & Data and choose All.

By the way. The solution you offered less loads Blender. Before I used an array to duplicate the meshes and Blender worked hardly...

Yes, iKlsR. Reduces. Now working with many meshes more comfortable )

@Paul yeah it should, the duplicates are instances and not real objects. In layman's terms the duplicate objects vertices don't really count towards the total scene size, it's pretty much visual.

Kind of annoying how unpolished this workflow still is 5 years later. You'd imagine there would just be toggle in curve modifier to only transform the origins instead of the meshes but nope. This is a good answer, though, albeit sadly I get pretty.. Interesting.. results at times when editing the curve.

@3Rton I'd daresay there might be a newer better way to do this. I'll poke around.

If you do find one I'm definitely all ears. I know you could definitely do it with something like Animation Nodes but default Blender wise this (Answer) is what I ended up doing. (My use case was using curves to place around circles to block out buttons placements. Array-Curve just never seemed NOT to deform the first circle. This method works well enough with simple curve, but complex curves the circles start going to pretty weird places instead of sticking to the curve.)

@3Rton That would be great as an answer as well!

No no I meant I couldn't find anything better than this workflow your answer outlined.
Also, for my loss, it seems like they removed curve instancing on frames in last weeks nightly build..... Soooo yeahhh

Are dupliframes obsolete as of 2.8?

Doesn't work in 2.8. This does: https://www.versluis.com/2019/07/duplicating-an-object-along-a-path-in-blender-2-8/


text:
How to merge all scene geometry into a single mesh?
I would like to have all the geometry of a scene merged in one mesh. It should include curves, fonts, group instances, particles, with applied modifiers, etc...
obj.to_mesh doesn't work for group instances for example.

Is this a question about scripting? you mention obj.to_mesh but don't include scripting in your tags.

Yes it was actually about scripting, but your answer on how to do it in viewport is also interesting for other people I guess. I add the Python tag

in that case I think there are better ways to do this then, also interested why you would need to do this?

The modifier stack has some limitation regarding order. I'm trying to shrinkwrap a mesh on another mesh that has an animated boolean and particles. Problem is the shrinkwrap applies after the boolean and gives strange/messy results as there is nothing to shrinkwrap on (2 modifier stacks, so...). Also particles disappear instantly too being spawned or not but in no way disappearing slowly like the rest. I guess the modifier Stack has to be changed to allow user to choose the order in which modifiers apply. In the meantime I didn't found another way (memory and time consuming but it works)

better than a long test, the file (without particles as my PC crash if I try to add one system to the displaced mesh): http://www.pasteall.org/blend/27520

First make all duplis real, then convert all to mesh and join.

Object -> Apply -> Make Duplicates Real
Object -> Convert to -> Mesh (This applies mesh modifiers too)
Select the base object to join into (Shift+RMB)
Object -> Join

Shorthand: Ctrl+Shift+A -> Alt+C, M -> Shift+RMB -> Ctrl+J.

Note, You might want to first un-hide all objects, view all layers and make any linked data local too, thats if you want to apply to the entire scene and not just what you see.

Works well, thanks for the Shorthand, like that :) @ideasman42 After usage of the method in real case, here are some remarks: Make duplicate real must sometime be done twice (dupligroups of objects with particles for example). Duplicates with lots of instances (1 000 000 of small spheres for example) won't convert in acceptable timeframe. Maybe add a warning (it may freeze the computer/crash Blender) in the answer until Blender get's better support of many objects.

Select all objects with A,A then press CtrlJ to join into one mesh.


text:
Getting pynodes geometric node to work
I downloaded the geometric node from git, and copied it in the addon folder of blender 2.67. Tried with 2.67b and a self-compiled svn version, in both, I can't enable it in the user preferences. Does anyone know how to get it to work ? I didn't find any readme.
Edit, more info :

I downloaded geometry_nodes from https://www.gitorious.org/blender-trunk/addons/trees/geometry_nodes/py/scripts/addons/geometry_nodes
Extracted the folder geometry_nodes in my ~/.config/blender/2.67/scripts/addons/ folder
it appears in user preferences under add-ons but I can't activate it. Launching Blender from the command-line doesn't give any help (no error given in output)
Trying to launch init.py gives following error in the console :

.config/blender/2.67/scripts/addons/geometry_nodes/parameter.py", line
  433, in register_mod_pass
      from geometry_nodes import modifiers
  ImportError: cannot import name modifiers

I get the following error from geometry_nodes import modifiers  ImportError: cannot import name modifiers do you?

Can you add more info to your question.

@zeffi : yes. CharlesL : updated question with all I could get.

The first time I run it, this error also shows: File "...\addons\geometry_nodes\modifiers.py", line 47, in __init__ raise TypeError("Expected TypeSpec datatype")

Alot of people are having this problem it seems http://blenderartists.org/forum/showthread.php?283098-Blender-2-67-Pynodes

Zeffi : yes I also had that problem.

I had a look to the forum link, yes indeed I think nobody managed to get it to work. Problem is, it's in the official doc (the add-on) but there is nowhere any explanation on how it works and it doesn't even work with the official release (tested 2.67a and b). Could someone with contact to the programmer (Brecht ?) ask him how it is supposed to work ? I mean, it's a really powerfull feature, it did cost a nice amount of money to the blender foundation, would be a shame to let it fall in ruin,  or just use 10% of it's potential with only renderer.

Lukas Tönne implemented this, you can contact him. But do note that this is just a proof of concept to show pynodes work, I doubt it's intended to ever make it into Blender in this form.

Should this be considered off topic? - if we have questions about random branches on github from users wanting to test... at some point this could be nonconstructive. See: http://meta.blender.stackexchange.com/questions/1/what-questions-should-be-definitely-off-topic

This is about blender as it's one of the only link to an example in the official doc of 2.67. Most programmer can't get their feet wet in a new API with just the API Doc. I think the python programmer community should get support too, even if we are not pro.

The version of geometry_nodes as of commit edbdbc8fea539 does a small check that isn't actually really used yet. This looks to be part of a work-in-progress that is as of yet uncompleted. To get these nodes running you'll have to modify modifiers.py and comment out or remove lines 46 and 47:
#if not isinstance(datatype, TypeSpec):
#    raise TypeError("Expected TypeSpec datatype")

After this (re-)start blender, enable the addon and play with the geometry nodes :)
Note that as of this writing the above mentioned commit is the latest and the only one in 24 days. Looks very much like current development is on hold.
A small screenshot of geometry nodes in the node editor:

Confirmed. This works. https://i.sstatic.net/ODGMd.png

Hmm, but as expected, not everything works properly yet, as geometry nodes are very much in development still :) But you can add the nodes!
Any further fixes should be really handled as part of the development process :)

yes, see brecht's comment on the question above. It is very shaky but it works. :)

@zeffii tried in 2.66 and 2.67a and works

this system won't allow me to award the bounty for another 8 hours, but I can now load that addon too.

It doesn't appear possible to add the geometry node itself to the NodeTree, but perhaps ideasman42 is right this is a little off topic and maybe even too localized at this stage. Either way, exciting stuff.


text:
Can you use multiple rigs in Blender
I'm new to blender, and am trying to make a Minecraft animation. I can get a single character in, but don't know how to have multiple rigs in a single animation.
How do you have multiple characters?

It's fairly simple, really. If you're using a good rig, it should be in a group and you can import it easily.
First, find whatever file you plan on animating with (I'm using a blank one):

Then, go to File>Append...

Find the rig you want add to your animation...

Open it and select "Group..."

Select the group...

There it is! The rig is there. Press Ctrl+Alt+G to get rid of that pesky green outline.

Now, if the rig creator hasn't already put it in a group, then it's up to you to do that, which is fortunately quite trivial.
First, open the original rig file and select everything that's a part of the rig.

Then, press Ctrl+G to put everything you've selected into a single group.

Now, repeat to import the rig!
Optional step: press F6 to bring up the Action Properties panel. You can then specify a name for the group, which is especially useful if there are multiple rigs in one file.

You can have as many rigs as you like it is pretty much the same as adding objects. You might be confused when you started your animation in the Timeline. You will only see the keyframes of the selected object.
I would recommend to learn about Actions ( parts of an animation like: walk, jump etc.) and the NLA-editor this allows you to reuse already created actions to assemble an animation from actions.

Yes, as you said, you havemultiple rigs!
you must have 2 characters , and the only way to do this is by making separate animations for each rig ( Make each rig have its own couple of animations like shown in the video ) . Then , you select the animation for both rigs that correspond to each other , so when you render it will play the animation that you want to play
if that makes sense

I made this video , And it might come in handy for exactly what you need!
https://www.youtube.com/watch?v=E-8K1yG6uyE&list=UU28bfUuaupS-1mzytSUmlrw


text:
How to use Node Editor for the Video Sequencer?
How can I use the VSE with the node editor? I've tested about two addons and one script, and nothing has worked out.
The best result was to use the VSE Compositor Node proxy, but it is only affecting the "Viewer Node" in the node editor. When I want to render an animation,
it renders pure VSE sequence without compositing.
Can someone tell me about a good working addon like this for Blender 2.72 or at least try the script I mentioned themself on Blender 2.72 to see if it's working? (maybe I'm doing something wrong, and it's not about the new Blender version)

Have you tried using the scene strip? Its found under Add->Scene

Yes, I tried, maybe I set up something wrong:
http://pbrd.co/1J6mDcL
As you see, the cube from 3d world is blurred, but not the video clip ; ((( Can you tried the script from link that I wrote in the main question? Is it working for you in B2.72?

Make sure that you add the composited scene back to the sequencer or VSE, then check that the VSE scene has the render properties Post > Sequencer ticked.

is there an easy way to do this for, say, 10 clips at once? And what about the audio, do I hvae to manually add the Movie clpi every time, delete the video, and line up the audio section with the scene??!


text:
Is it possible to change operator's bl_label on the fly?
I'd like to update the label of an operator when it's called. But this :
def execute(self,context):
    self.bl_label = "good night"

... apparently doesn't work if the bl_label property has already been defined. Am I wrong ?

Manipulating an operator type once registered isn't supported. *
Your options are:

override the label when drawing the interface. eg:layout.operator("some.op", text=label_override)
Modify the class, then re-register the operator(unregister() & register())

Hint, if you want to do a conditional override, Python can do this by passing a dictionary...
keyword_args = {}
if some_test:
    keyword_args["text"] = label_override
layout.operator("some.op", **keyword_args)

* (unless you modify the memory directly, which is possible but outside the scope of Blender/Python API).


text:
Deselect all objects (also on hidden layers)
How can I deselect all object on all layers? Key A only works for current layer.
I have 20 layers, with different game buildings and before exporting I need to select what to export. If I forgot to deselect on different layer it will get exported too.

You can press ` which is usually found immediately to the left of the 1 and directly above TAB.
This will make every layer visible so now using a will function as you would like it to.
Or you could just select something using a mouse/pen click, this will also release any hidden layer selections.

Any luck? The answer is still there. :)

That comment was based on a brain-fart, I've erased it.  For some reason I temporarily started hovering the cursor over the layers panel while pressing ~ and that's why I mistakenly thought the feature stopped working.  The cursor must be over the 3D Viewport.

On a localized keyboard this key is often only accessible with a modifier like Shift. If it doesn't work as described by Marc check the settings in the User Preferences:

Note that this key can be configured separately for the different modes. In other modes than 3D-View it defaults to Ctrl-'.


text:
How to enable internationalization? (translations)
I would like to know if there is a German translation of Blender.


text:
How can I copy or duplicate several objects in one step?
I am building a tenement. After I have built one course of bricks I want to duplicate them to form an adjacent course, but with a negative scale, in the X axis.
When a story has been completed I want to duplicate this collection of courses and bricks, to create several stories.
I thought that parenting the first course of bricks to an empty would let me do this but it doesn’t.
How can I do it?

Can you show a screenshot of what your getting at?

Normal a wall would simply be created using a plane and repeating brick material. If you actually needed individually bricks (eg. for an animation) see this question.

I was about to answer "Array modifier", but your case may be more complex. My way to accomplish this:

I make a separate scene just for one component (e.g. a window frame to be duplicated, or in your case, one full story), and model it there.
After I'm done, I group it as one component.
Lastly, in the main scene, I instanced the group (Shift-A -> Group Instance) as many as I
needed. Each instances are free to be transformed.

Here's an example from a building I modeled, the original repeatable objects are collected in a scene for easy measurement control:

What I like about this approach, is that we can always modify the base component in its own scene, and all instances in the main scene will be updated. And unlike linked-duplicates, we can add as many object to the group as needed.

What if you want to make multiple instances of the group, and then want to modify something in just one of those instances? You can't do that with this method, can you?

Yes, you can! Shift+ctrl+A will turn your group instance into a real group of objects, and then you can edit as you please.

Actually, I couldn't get it to work on 2.7.2. It should say ctrl+shift+A, but that doesn't seem to work either.


text:
how stop water pass through a cup when i throw ice cubes in it?

I want to create an animation of ice cubes being thrown into a cup, but the water molecules pass through the walls of the cup.

Maybe try thickening your glass obstacle ? You can use another version of your glass object only for physics and not rendered, to achieve satisfactory thickness.


text:
Mixamo - Y up vs Z up
I just started experimenting with Mixamo in Blender and the up/forward orientations confuse me.
I added the Mixamo Control Rig to the character. If I look at the transforms, changing the Y location moves a control up and down. But in the viewport GZ moves the control up and down, so the viewport is using Z up.
I tried changing the fbx import settings to change the up axis, but that didn't help.
Am I missing something obvious?
Thanks for any tips.

yeah I have noticed that about .fbx files ..... have you found a work around ...have you tried correcting the origin and scale ... i did manage you use a character with auto rig pro ...


text:
Object location in render determined by offset to it's origin point
I am only able to successfully translate a change in location in the viewport to the render, either by moving the object in edit mode, thereby not affecting it's origin point, or by resetting it's origin point to world origin.
The render is interpreting the object's origin point as the world origin, so when setting the origin point to geometry it is locked to the world origin.
This happens both in EEVEE and in Cycles. I am using Blender 4.1.1 on Windows 11 23H2.

Is there an animation keyframe which resets the location of the object? When you move it in the viewport and do nothing else, it will stay in the new position without re-evaluating the keyframe. However when you render it will always use the keyframed position. Other possible option: do you have any modifier on the object which is disabled in viewport but enabled for render? It would really help if you would at least show a screenshot of what you have there or even better, upload your file to https://blend-exchange.com and follow the instructions there to edit it into your question.

Yes! The object seemed to have an animation keyframe. I just cleared all animation data and it solved the issue.


text:
Mix shader is not working with an emission node
I want to be able to animate a change in material using a mix shader node and keyframing the factor. I am mixing a glass BSDF and an emissions node to create a screen.
I want to be able to lead an image into the emissions node, but also want to be able to alter the image, as it is going to be animated. I am trying to change the image using a mix shader node but this does not work. Neither image is showing up. It only works when leading them directly into the mix shader with the Glass BSDF.

The color of the sockets gives a hint. You try to plug something yellow into something green and then from green into yellow again... Yes, some socket types are interchangeable, but the red connection line notifies you that there is something wrong. The thing is, you can plug the color outputs of the Image Texture nodes into the Mix Shader node, because it can convert the colors into surface shading information. The problem is, this shading information cannot be converted back to simple color information by the Emission node which it needs for the color input.

Mix Shader node is for mixing shaders. Mix Color node is for mixing colors and images.

The clue is the red connecting noodle between the Mix Shader and Emission nodes which indicates an error! https://blender.stackexchange.com/questions/146493/red-line-from-shader-node-to-color-ramp

The problem is not even mixing the colors in the Mix Shader node - it converts the colors to shading information. The problem is, the color input of the Emission node cannot use it.


text:
How to physically bind an object

I have a static object and an object with a cloth modifier. How do I link the selected sides so that the cloth doesn't fall off completely, but the selected side is snapped to the parent?
.blend

Create a vertex group where you want the cloth object to stick to the other one, select this vertex group in the Cloth panel > Shape > Pin Group?

@moonboots It only sees groups of vertices of the “fabric object” itself, and not a static object


text:
How can I use a Python script to get the transformation of an object?
How can I use a Python script to obtain the exact coordinates of an object?
I have not been able to find out how to do this in the documentation.

Background: The object location (in fact transformation - so location/scale/rotation) is defined by initial values which are used to calculate the final transformation.

initial transform (as set by the user and possibly set by animation FCurves and Drivers).as a tool author, to manipulate data this is what you'll want to access typically
final transform (with parenting, constraints, and rigid body physics applied).when writing exporters or reading, typically this is what you will want to access since its whats displayed in the view (but you can't directly manipulate it)

To get the input location you can simply do:
loc = bpy.context.object.location... or via its matrixbpy.context.object.matrix_local.to_translation()
To get the output transformation you can only do this by accessing the worldspace matrix.
loc = bpy.context.object.matrix_world.to_translation()
You may want to get the loc/rotation/scale, in that case:
loc, rot, scale = bpy.context.object.matrix_world.decompose()

If you want to test the location for example, you can set the cursor position.
from bpy import context
context.scene.cursor_location = context.object.matrix_world.to_translation()

Or you can create a new empty:
import bpy
from bpy import context
obj = bpy.data.objects.new("Empty", None)
context.scene.objects.link(obj)
obj.matrix_world  = context.object.matrix_world

... note, if the matrix contains shear, you wont see this in the empty, for that try the MathVis addons.

What would be the best way for me to test the above code? The Blender-Python integration tutorials I have completed have been based around graphical results.

Added notes on viewing the transformation.


text:
Can Blender run headless on an ARM processor?
Was wondering if anyone knows of a way to run Blender in a non graphical mode to use as a render node?
I'm thinking of setting up a small farm using raspberry pi's or another of the mini, efficient, low cost computers to use as a node to process everything.

Does Blender run on ARM and can it be used as a render node?

Just seen the odroid which may be more suitable... any ideas?

I'm pretty sure that Raspberry Pi's aren't powerful enough to farm like that. If you're looking for cost-effective, maybe you'd be better off renting cloud time?

@ajwood the question asks if its possible, Not if its the best option.

@Shugs81, asking for product/hardware suggestions if off topic for this site, see: http://www.slant.co/topics/1629/~what-are-the-best-single-board-computers

I have run Blender on an ARMv7 CPU somewhat similar to the one the Raspberry Pi 2 model B uses, so I think Blender has no problems running on this architecture.
In practice, the problem would be processing power. On my Google Nexus 4, which has a quad-core 1.5 GHz Qualcomm Krait CPU, it took well over an hour to render Mike Pan's BMW scene:

This table on Wikipedia seems to show that the Krait in my phone would perform about the same as, or perhaps a bit better than, the Cortex A7 in the Raspberry Pi 2. Additionally, the Pi runs at 0.9 rather than 1.5 GHz. Would a setup with CPUs like these be able to render images? Almost certainly. Would you want to wait for them to do it? Personally, I think you wouldn't.

How long did it take to render that scene on a PC?

@immibis About 1 minute with GTX 770, about 10 minutes with Athlon II x4

Yes Blender can run on the ARM architecture.
And if you only want to use this for rendering, you don't have to be concerned with OpenGL driver issues.
Blender runs on ARM, MIPS, PPC, SPARC,... and other architectures.See Debian package details https://packages.debian.org/search?keywords=blender
But note that official blender.org releases aren't provided for the ARM architecture. So you'll typically need to use a package manager (with Linux).

Is there any instruction anywhere for those of us who have the blender source code and wanna build targeting Arm architecture? Those builds in the package manager was built targeting arm, so any how-to anywhere on the steps involved?

Just follow regular instructions for building Blender - https://wiki.blender.org/index.php/Dev:Doc/Building_Blender

I have followed the regular instructions for building Blender to build Blender for my Ubuntu. Works fine! However, I couldn't find any guide on there about targeting the Arm architecture.

@Rexford Blender won't cross compile (not easily at least - because of code generation - makesdna, makesrna), you can use an emulator (qemu for eg) to build Blender on ARM. Note that it may be possible to run ARM code generators, see: https://stackoverflow.com/questions/37912290/arm-linux-executable-mysteriously-runs-on-x86-64 but I never tried this and you'd probably need to tweak CMake files. Building on ARM should work without messing about.

Thanks for the clarification. Will try the qemu and see.

Blender can run on ARM under Ubuntu, but the hardware may not meet the minimal requirements (depending on the configuration).
Even if it worked Raspberry Pi's, Odroid's, BeagleBoards etc. are actually very pricy for the power they offer. I run OpenCV algorithms on them and they barely get 10fps on some basic SIFT extraction.
Such boards also have very limited memory which would limit your scene's and textures.
For the money a farm of boards (that could actually render something in your lifetime) would cost you buy an Nvidia card with CUDA and stuff it in some cheap system with 1x PCI 16x that meets the requirements. You will get infinitely more performance out of it.

Thanks for the response! Idudoes actually make sense what you are saying now... it was more a case the location I would be setting up at only has 1 socket in the whole room... but I've spotted a deal xenon server on ebay for cheaper than a pi so i'll probs go for that!!! :D

Supposed to say it does.... damn phone!

I'm running Blender 2.76b on KitKat Galaxy Tab 3 lite
8GB internal 1GB Ram
A little slow but ok for simple design.
STEP 1: Go to Google Play Store and install GNURoot Debian. You can download apk. Just make sure your internal memory free about 850MB to install.
STEP 2: Install Hacker's Keyboard
STEP 3: Launch Virtual Machine (computer button)
STEP 4: Touch the 3 dots button and switch to Input Track pad mode.
STEP 5: Install blender by click the terminal and type: apt-get install blender
STEP 6: type: Y
STEP 7: When the terminal back to receive input state (install completed) click at the wall screen and select exit
STEP 8: Launch virtual machine then click main screen and go to App -> Graphic -> Blender
STEP 9: Wait until it display frame placing, just click and wait until it in.
If nothing happen after install blender and reboot the machine, or can't boot the virtual machine, you can uninstall and install agian (sometimes got unknown error)
You can install inkscape by type: apt-get install inkscape


text:
Changing material in a non active scene from python (BGE)
I have two scenes, sceneA and sceneB, which I run in game mode. While I am running sceneA, I would like to change a material in sceneB (but only at a later stage move to sceneB).
I can access the objects in sceneA while in A by
    scene = bge.logic.getCurrentScene()
    print(scene.objects)

Is their a way how I could access the objects in sceneB, while in A?
    scenelist = getSceneList()

only returns scene A as that is the one who is active and
    sceneB.objects

gives an error of name 'sceneB' is not defined.
All help is appreciated.

you have to load scene B  so you can access it, see this answer http://blender.stackexchange.com/a/28920/5113


text:
How to monitor render process in a thread-safe manner?
I'm currently writing an addon, the purpose of which requires it to render several parts of active scene sequentially, preferably with UI-responsiveness intact. The problem is the UI freezes if I just directly call bpy.ops.render.render(animation=True). I get UI-responsiveness by changing the execution context to "INVOKE_DEFAULT", but then the code won't wait until a render process finished before executing the next one.
Using threading Module
Looking for an alternative, I then use Python's threading.Thread object to encapsulate render function, like this:
def _init_render_thread(self):
    self._render_thread = threading.Thread(
        target=bpy.ops.render.render, kwargs={'animation':True})

... and check the thread object's is_alive method at interval set by a Timer object. Unfortunately it's prone to occasional random crashing, as any thread-related bugs are, so I'm still stuck with this method.
Chaining Handlers
Based on jesterKing's answer, I then chain the render execution using a scene-global property and render handlers with the following code. By chaining, the operator no longer needs to be modal. It's finishing early, then leaving completion to these handlers:
@persistent
def render_pre_handler(dummy):
    props = bpy.context.scene.oha_layout_tools

    if props.render_marker_infos:
        rmi = props.render_marker_infos.pop(0)
        marker_scene_settings(bpy.context, rmi)

@persistent
def render_complete_handler(dummy):
    props = bpy.context.scene.oha_layout_tools

    if props.render_marker_infos:
        rmi = props.render_marker_infos.pop(0)
        marker_scene_settings(bpy.context, rmi)

        bpy.ops.render.render('INVOKE_DEFAULT', animation=True)
    else:
        bpy.app.handlers.render_pre.remove(render_pre_handler)
        bpy.app.handlers.render_complete.remove(render_complete_handler)
        props.marker_infos.clear()
        props.render_marker_infos.clear()

It still doesn't work. The render_complete handler promptly executes even while the render thread itself is still in progress.
Is there any thread-safe way to monitor render process, other than spawning new Blender process?

You should check http://blender.stackexchange.com/a/445/97 . The modal operator + python timer events is the way to go (as I posted in the comment to this answer)

Um, I already done that, modal operator and timer object. As stated in my question.

I see. modal operators are still the way to go. I posted my answer with handler usage.

Looking at your code, in order for you to use a modal operator the way @jesterKing is suggesting, you would actually have to have two modal operator classes (one for your script as a whole like you have it now, and one just for the render threading)

Maybe there's some mistake in it, but I did wrote two modal operators in a previous commit. The crash occurences were just as frequent and random...

Maybe use a macro like shown here?
http://blender.stackexchange.com/a/3037/1363

@CoDEmanX: I succeeded using it for several other needs, but still fails for this one. It just won't wait for INVOKEd operator to finish.

You can add handlers for render complete process: http://www.blender.org/documentation/blender_python_api_2_67b_release/bpy.app.handlers.html#bpy.app.handlers.render_complete
Use that to flip a flag that you can check in your main code that can check when the current render is ready before starting a new one.
Check also render_post (and render_pre) for usage in your add-on.

I still fail to use this. I need custom property to sequentialize render processes, but each modification to the property in an operator can't be seen outside that operator (including render_post handler), as if it never change. Maybe the monitoring must be done entirely within the modal operator, but I don't know how yet.

My current solution to this problem, ugly as it is, is to have a modal operator watch output file's size at interval. Size doesn't change = render is finished, which works here because I'm only rendering audio files, so the process should be fast enough. Here's the relevant chunk of the code:
def check_render_file(self, context):

    # ... initialization ...

    if not self.prev_stat:
        self.prev_stat = os.stat(context.scene.render.filepath)

        return {'PASS_THROUGH'}

    cur_stat = os.stat(context.scene.render.filepath)

    if self.prev_stat.st_size != cur_stat.st_size:
        self.prev_stat = cur_stat

        return {'PASS_THROUGH'}

    # ... cleanup, next render ...

    return {'FINISHED'}

def modal(self, context, event):
    if event.type == 'TIMER':
        return self.check_render_file(context)

    return {'PASS_THROUGH'}

Your handlers look fine, but you definitely need to look into other ways to run multiple processes than using the threading module. Python's threading module is not fully compatible with how Blender operates and is a guaranteed way to generate lots of ugly errors farther down the road.
Other options you should consider:

Blender's Modal Operators: These are not the same as the threading module, but are instead essentially Blender's own implementation of threading. Look at the Operator Modal template file in Blender's Text Editor for an example of how to use this. This is the recommended way of multithreading in Blender!
The multiprocessing module: Allows you to utilize multiple GPU/CPU cores for your rendering. This can have the additional advantage of allowing you to greatly speed up your rendering times by rendering multiple images in parallel.
The subprocess module: This is by far the simplest way to thread, but only supports command-line operations. If you are willing to do command-line rendering, this should work.
The concurrent.futures module: This module is a high-level way of operating parallel threads, that essentially allows you to "queue" jobs to be completed. I haven't used this yet, since it's new in Python 3.x, but I recommend you take a look at it to see if it does what you're looking for.

I used subprocess to spawn Blender processes to render in the background, an old solution to another addon. IMHO it's horrible from user interaction standpoint, but I think I'll use this if all else fails. The addon must work, elegant or not...

@Gwenn Isn't threading not recommended for CPU-bound processes because of python's Global Interpreter Lock? and multiprocessing also not recommended because it will create multiple instances of blender?


text:
How to access an objects DupliGroup instances from Python?
I'm improving my AC3D exporter. Right now, a linked group (displayed and treated as an empty) will not have any children (unless I parent a local object to them) despite holding many objects (from the linked file). Is there a way to get a list of children from a linked group?

You need to create a dupli-list. eg:
def object_derived_get(ob, scene):
    if ob.dupli_type != 'NONE'
        ob.dupli_list_create(scene)
        ob_matrix_pairs = [(dob.object, dob.matrix.copy()) for dob in ob.dupli_list]
        ob.dupli_list_clear()
    else:
        ob_matrix_pairs = [(ob, ob.matrix_world.copy())]

    return ob_matrix_pairs

# example
import bpy
from bpy import context
for ob, matrix in dupli_list_create(context.object, context.scene):
    print(ob, matrix)

Seealso:

http://www.blender.org/api/blender_python_api_2_74_release/bpy.types.DupliObject.html
http://www.blender.org/api/blender_python_api_2_74_release/bpy.types.Object.html#bpy.types.Object.dupli_list


text:
Simplify Blender GUI using Python
I want to use Blender for a specific task where the user (not me) is just presented with a limited set of tools and nothing else.
Using the usual possibilities configuring the GUI lead my quite close to my target.
Beside that I want the toolbar only contain my tools/buttons. Editing space_view3d_toolbar.py gave me an empty toolbar which I then populate with my own tools.
However I would like to NOT alter Blenders core files and just use a script registered in my startup.blend which does the cleaning.

So my question is:
How to iterate through the existing Panels (for all modes) on the toolbar and remove them?

Please ask Q2 as a separate question

To remove panels, you can simply unregister the classes.
Here we remove all View 3D Panels:
import bpy
for pt in bpy.types.Panel.__subclasses__():
    if pt.bl_space_type == 'VIEW_3D':
        bpy.utils.unregister_class(pt)

Of course you may want to do some other checks to only remove some of the panels... try use the Python console to inspect the panel types and see which members are useful to check (__name__ for example)
Note that __subclasses__ is a standard Python method.
This works for other areas too, operators, menu's, (any class which can be registered).

To run Multiple times you need to check if the class has a specific RNA attribute:
import bpy
for pt in bpy.types.Panel.__subclasses__():
    if pt.bl_space_type == 'VIEW_3D':
        if "bl_rna" in pt.__dict__:   # <-- check if we already removed!
            bpy.utils.unregister_class(pt)

Note that this making use of an internal attribute and is not a documented part of the Python API, its used for Blender's own tracking of classes.

It works the first time. Also in my registered script but then I get this error: read blend: G:\GUI10.blend
...
<class 'Toolbar.VIEW3D_PT_LayoutDemoPanel'>
Traceback (most recent call last):
File "G:\GUI10.blend\Toolbar.py", line 156, in
File "G:\GUI10.blend\Toolbar.py", line 143, in register
RuntimeError: unregister_class(...):, missing bl_rna attribute from 'RNAMeta' instance (may not be registered)

these comments are quite short, am I supposed to edit my original Q when I have to say more?

It seems that it only works on a "clean" file (blender just started). After unregister a class they are still in the namespace(?) and it fails. Still struggeling with my script, even after a fresh Blender start only SOME classes are unregistered before the error.

me again: catching the error now with a try: Not sure if this is a good idea...

@CarstenWartmann - updated the answer so you can re-run without exceptions.

@ideasman42 Thank you very much for your answer, very helpful. Could you please have a look at my question here: http://blender.stackexchange.com/questions/64747/very-simple-gui-for-non-blender-users-with-python


text:
How to show render-stamp for arbitrary values?
Is it possible to take arbitrary properties and display them in the render stamp as some other software do.

(Click the image for larger version)

While Blender has no build-in support for this feature. You can do this using Python:
Add a script into your file, call it stamp_init.py (for example).

Press Run Script (only need to do once)
Enable the Register option in the text editor (so it runs automatically)

Here is a sample script.
import bpy

def stamp_set(scene):
    note =    "Samples: "         + str(scene.cycles.samples)
    note += ", ApertireBlades: "  + str(scene.camera.data.cycles.aperture_blades)
    note += ", Version: "         + bpy.app.version_string
    scene.render.stamp_note_text = note

bpy.app.handlers.render_pre.append(stamp_set)

To add more settings you can find the data-paths to them by right clicking and selecting Copy Data-Path.

Global Stamp (applies to any file you render)
Having to define a script in every-file could be tedious, if you want to use these extra stamp options in all your files, you can make this a persistent handler.
If you want to have the same stamp notes apply to all your renders (where the Note is enabled). You can add the same script into your startup file and
@bpy.app.handlers.persistent
def stamp_set(scene):
    .... same as before ...

String Formatting (further reading if you're new to Python)
Python has some clever ways you can format strings, see Python docs.
This uses the format method which some people may prefer.
def stamp_set(scene):
    scene.render.stamp_note_text = \
        "Samples: {samples}, Blades: {blades}, Version: {ver}".format(
        samples=scene.cycles.samples,
        blades=scene.camera.data.cycles.aperture_blades,
        ver=bpy.app.version_string,
        )

New Lines
As of 2.77 the note will be wrapped onto new lines, you can also add in explicit \n newline characters to format the text yourself.

Floating point numbers
A lot could be written on this, just a quick hint, if you have unwanted precision removed, eg:2.514000002324 displayed as 2.51, there are a few ways to go about it.

If you used "Text " + str(some.number) you can use round, eg:"Text " + str(round(some.number, 2))
If you use the format() method you can replace:{myvar} with {myvar:.2f}.

For more details see https://stackoverflow.com/a/455634/432509

Thanks for the information!
Is it possible to reduce the amount of digits for example Aperture Size (scene.camera.data.cycles.aperture_size) string returns? -
Because number 0.55 in the DOF panel returns 0.5499997735023499

Added hint on reducing excess precision.

Is there a way to do this for values that change over time? For instance, the Lens stamp setting don't update when I change the focal length of the camera. What if I wanted to have a custom note that includes the camera's focal length and change it over time? Would that be possible?

Have a look at the different handlers, after changing the frame might be a good time to run this.

But the stamp_note_text is capped at 767 characters?  What kind of weird limitation is this?  I could understand a 256 char limit back in 1986, but in the 21st century we get cut off at 3x an 8-bit limit?  I'm gonna have to go to the C source to research this bizarre fact...

For Blender 2.8+
Note that the aforementioned solutions do not seem to work in newer versions of Blender (I'm using 2.92.0, but I imagine the changes are from 2.8+).
Herewith a working solution:
import bpy

cycles = bpy.context.scene.cycles
view_settings = bpy.context.scene.view_settings

def stamp_set(scene):
    note = "-------------\nCustom data\n-------------"
    note += "\nSamples: "         + str(cycles.aa_samples)
    note += "\nLook: "            + str(view_settings.look)
    note += "\nExposure: "        + str(round(view_settings.exposure, 2))

    scene.render.stamp_note_text = note

bpy.app.handlers.render_pre.append(stamp_set)

This solution:

Works in latest versions of Blender
Incorporates number rounding and newlines as per comment by ideasman42
Allows you to add new lines of data just by duplicating any of the note += ...  lines

Sample output:

I know this is an old post, but I found out that in newer versions of Blender you can do exactly that.
In the Output Properties tab  you can burn the metadata into your output image, using the Burn into image tick.

Maybe this could help someone looking for an answer.