text:
Get UV coordinates of a 3D point , without actually applying a texture
I want to get the UV coordinates of a plane in 3D, for use in some algorithm. How do I get that via python script, when my plane is untextured. The UV coordinates will be the same as the UV-mapping done when applying a texture to a plane, but I don't want to do the texture; just need the coordinates.
There are projection techniques that I can use to get UV coordinates, but I'm not keen on getting into the math of all that..Is there a direct way of getting the UV coordinates of an untextured object (a plane, for simplicity)?

Is your mesh uv-unwrapped? It's required.

No, I haven't done that.. how do I do that?

Go into edit mode of your object and press A until everything is selected , Press U and click "Smart UV project" , But it is better UV unwrap manually

And how can I get the UV coords for the mesh after the mesh was uv-unwrapped in python?


text:
Blender cloud for speeding up physics simulation
I am working on cloth simulation, and I have a lot of test-and-edit cycles to do. But on my machine the test cycles - where the simulation is baked - takes too much time.
It's a simple simulation, but there are lots of frames to bake, with a highly subdivided mesh. I don't need distributed computing. I just need more processing power and RAM - so basically just blender running on a high performance server; and I don't own a server space (yet). I'd also prefer not to edit my scripts or change the work process in some other way. If need be, I can do it though.
Is there any such online/cloud based solution for blender? Blender Cloud seems to offer something else entirely.

I think maybe the data transfer between computers would then become your bottleneck.  Also, baking simulations writes a lot of data to the hard-drive does it not?  I think it does... Anyways, if that's what is slowing you down, a faster processor and more RAM may not help much, you would need faster HD access.   Hard-drive access is usually going to be at least 200 times slower than the computer's main system bus, it's a huge bottleneck when reading and writing assets.  Well, good-luck. :)

@MarcClintDion My bake cache is entirely in RAM actually, because I think writing it to disk will be much slower. There won't be any data transfer. The baking and caching can happen on the server, using server's resources - processor, RAM/Disk etc . I can then do what I want with the cache. I can download the cache and do the rendering on my machine or somewhere else. The slowest part is the baking, and that has no interaction with user. So that can happen on some server...

@MarcClintDion In most cases baking is so expensive you don't need to worry about anything else becoming a bigger bottle neck..

@sanjeevmk We've decided that questions asking for blender-related resources are off-topic of the most part: http://meta.blender.stackexchange.com/q/341/599

source: Stack Exchange

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

sort: votes


text:
Create custom physics for an object with python
Blender has physics options which we can enable for our objects - cloth , fluid etc. Is there a way I can add a custom physical behavior to my objects, where this behavior is modeled as a python script. For example, I'd like to add a new button to the physics tab like "My Physics", and when it is attached as a modifier to objects , the objects follow the behavior as modeled in the script.
Basically, I want to test some physics algorithms and want to use blender for that. So I'd be relying on blender to do the rendering and other things, but the physics will be provided by my code.
Is something like this possible?

Use blender game engine. In the logic bricks, you select "always" with positive pulse, the "and" goes in the center, then add "python". In there you can manipulate objects positions etc via your own python scripts.

Yes it is possible, there are 2 ways of doing this, but there are also 2 big drawbacks for both methods:

method 1: You can script your own modifier in c++, here is how to start. The drawback is you need to build your own Blender version yourself. Modifiers cannot be add with python or addons. If your modifier gets approved it can be added in the trunk (official release).
method 2: You can add your physics simulation code in the app handlers. This way your code gets executed for example every frame change. You can manipulate objects, change mesh etc. This will work from addon but the code will be very slow and you will unlikely get real-time fps.

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


text:
Geometry nodes: shift index start
Hi geometry nodes friends.
I have a index field with instance values, sampled by an "Sample Index" node. I would like to "shift" the starting index like this:
Let's say I have a index field with values like this (Index, Value):
0 = 2
1 = 4
2 = 6
3 = 8

Now I want to shift the values to get a new field with this:
0 = 4
1 = 6
2 = 8
3 = ...

Well, the exact setup might differ from how you obtain the values stored per index and so it might differ from how you transfer it to a different position. For example, if these values were position data, you might change them by using a Set Position node. I'm just using an example where I store an attribute along with the instance index and try to "pass it on" to the lower index.
So let's say I multiply and convert Z positions of cubes to integers just to get some arbitrary numbers and use a Store Named Attribute node to assign these to the attribute "values" with the cube instances, this is the initial situation:

The values are stored automatically in index order from 0 to 4. What you now need to do is sample the Named Attribute "values" from the index + 1 via Sample Index node and overwrite the attribute by using another Store Named Attribute node with the same name - since the values are stored in order starting at index 0 you have shifted the values by 1.

Only problem here is, on the last index 4 this would need a value from index 4 + 1 = 5 which does not exist so it gets the value 0. If you instead want a cyclic shift with the last index getting the original value of index 0 (which is not clear in your question because the series ends with an ellipsis), you can fix this with a slight modification.
Instead of sampling the Named Attribute at index + 1, plug the index + 1 into a Math node set to Modulo and the Count of a Domain Size node set to Instances into the second input. This way the last index will be set to 0 instead of 5 and you store the original attribute of the first index.

This works because the index count is 5, but the indices are numbered 0 to 4. So for the modulo of index + 1 with a count of 5 you get:

(0 + 1) mod 5 = 1
(1 + 1) mod 5 = 2
(2 + 1) mod 5 = 3
(3 + 1) mod 5 = 4
(4 + 1) mod 5 = 0

By the way, I used these random values because I don't know how in your example the values were obtained, but since they could have been easily calculated by using 2 * (index + 1), one could argue a complex setup with real shifting would not have been necessary, you could have simply stored 2 * (index + 2) instead. So I used random values to make sure they were unconnected to the index and had to be shifted in some way.

Thank you a lot for your time, Gordon. I guess, being an artist, I've to dive deep into your example first, before understanding what you're actually doing here.... :)

@ChristophWerner Maybe I could have been more specific regarding your problem if I knew what those values are which you have there, how you got them, where they are stored and where you want to transfer them to. But the shifting process should be usable for other values as well.

All is fine. I expected a global easy way to shift indexes of fields.

@ChristophWerner Well, not really since fields themselves have no indices. The parts of geometry like vertices, faces, instances etc. have indices - everything that is on the left in the Spreadsheet has indices. All these parts can hold multiple values and fields, either inherent ones like position, scale and so on or attributes assigned to them. But the indices belong to the geometry.

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


text:
How to get individual curve point positions in Geometry Nodes?
I have created a curve by using the Curve line node in Geometry Nodes.
Now I would like to get the point positions of curve points.
Actually I need the vector position of the first point of the curve and the last one.
The curve shape is changing and I would like to know the dynamic vertex positions.
Thank you!

Best answers by Eric. You can found him at Mastodon: https://mstdn.social/@3d_eric@mas.to
"Sadly you can´t simply use the 'attribute statistic' node to get the start and end location. The vector that you get will be the minimum and maximum coordinates in world space. I have a bent curve in my example. As you can see, the objects are placed in the global lower left and upper right corner of the curve object, but not at the endpoints."

The best way:
"You can use a 'sample curve' node to pick the location, normal and tangent of a specific curve point. To sample the start of a curve you choose the 'curve factor' of 0. For the end you set it to 1. The curve factor is a value from 0 to 1 that runs along the whole curve.
I often instance stuff, thats why i like to use the 'Endpoint Selection' method. Its the second screenshot. The integer value in the selection defines how many points you select from each side of the curve."

I found the answer myself and prepared you a shot, how to do it by using the Sample Index node.

Here is an alternative way to get global point positions in objects, like curves or mesh lines:

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


text:
Geometry nodes: Is it possible to "ignore" the modifier stack and use always the source mesh?
If you add more than one geometry node tree to a single object, the whole modifier stack is used as the mesh source. Can we use just the very first version: the source mesh and ignore the followed used modifiers?
Example: Lets say you've distributed instances on an object, then the next distribution will use the result and distribute new instances on itself. But I want to use just the souce mesh for a specific geometry nodes modifier if needed.
I've tried to use a geometry switch and the Self Object node, but it didn't work and I get the error: "Geometry cannot be retrieved from the modifier object.".
Is it possible to ignore the modifier stack in geometry nodes and always use the geometry source to be used for new modifiers?

why don't you just use object info? or you can use one GN modifier and use node groups. Why do you wanna have more than one GN modifier? maybe your "end goal" would help us understand why or what you wanna do...

Hello, I don't think you can. But you can ALT - D to link-duplicate the base object and use that modifier-less version in your modifier stack. But AFAIK you can't pick&choose which modifiers are applied to an object at runtime in a GN modifier. It's always the evaluated object. You get the error because you can't use self object on the instancer and the instanced objects, that would cause an infinite loop.

Imagine u want to use a gn modifier to distribute grass on a ground field & then flowers on the same object & some bushes etc. As much as you want. All with individual values. I would like to use the same modifier to be used for every nature object. So you have a grass-modifer, flower-modifer, bushes-modifer on one ground object.
The only alternative is to add a object slot into the modifier & place the modifier on a seperate controller/container object & choose the ground object then. I guess this is the only solution. I thought I don't need a seperate controller object to do this.

"The only alternative is to add a object slot into the modifier & place the modifier on a seperate controller/container object & choose the ground object then."  In terms of workflow, this is how I'd recommend approaching the problem.  You can do what Quellenform describes, but you're better off having each particle system be its own object.  You end up with much finer control of parameters (can assign flowers to one collection, bushes to another, ground plane to a third, for example.)  You can easily parent all of your particle objects to the ground plane if you want.

For this you could use the node Separate Components. ...if you really want to do it all in one modifier stack.
Since the base mesh always remains a mesh (unless you change that on purpose) and the objects you instantiate always remain instances (unless you also change that on purpose), you can easily separate the base mesh from the instantiated objects.
In this example, I always use the same Geometry Nodes modifier repeatedly and instantiate different objects (from Collections) on the same base mesh each time:

Regarding your question in the comments:
The only way to solve this is to use an additional modifier at the end that removes the base mesh specifically. Unfortunately, you have no other option here, because what reaches at the output is also displayed.
(Blender 3.6+)

Thank you. The problem is, you have to add the mesh name manually. Or is the attribute "Added" always representing the base mesh? If so, where are this kind of global variables stored?

@ChristophWerner No, you don't have to enter anything manually here, because it behaves the other way around: The identifier "Added" is added to the geometry that is added. ;-) ...Also note that I am using the output "Inverted" here.

Ow... I've overseen the "inverted" option.

Is it also possible to hide the emitter without loosing the results?

@ChristophWerner ...you can always disable a part of the geometry with a Switch node ...or am I misunderstanding something?

I've another question for this topic: https://blender.stackexchange.com/questions/317398/geometry-nodes-how-to-delete-a-source-mesh-in-a-stack-with-same-modifiers

I've tested Quellenforms solution and it seem there's even no need to store the attribute:

In this case, there will definitely be duplicates, and you will also instantiate objects on the surfaces of the added objects. Take a close look at what the spread sheet says.

Actually there're no instances on the added objects...

I've checked the spread sheet. My versoin isn't different to yours. The instance amount is always the same like yours with inverted and store attributes node. Or do I oversee something?


text:
Geometry node pattern Diamond
I need some advice here on how to simply re-create the picture bellow in geometry node.

1/ choosing the size and number of the diamond
2/ choosing the spacing gradually
3/ adding some thickness and bevel
How would you proceed to apply this to any surfaces ?
Many thanks

What have you tried? Were are you stuck? If you want to apply it to any surfaces I would use the image as displacement map. If you want to create the geometry with GN I would start with a 45° grid and instance diamonds on the points. Then scale them along the Y-axis.

Or you can start with a plane and turn it into a rectangle with half the height. Then add a Subdivision Surface modifier and a Decimate modifier. They will create the diamond 45° grid. Then instance the diamonds on it with Geometry Nodes. I used scaled cubes in this example: https://i.sstatic.net/UDHA81XE.jpg (it's not perfect, but it gives you an idea)

I would approach this by the following way:
Use grid node with which you can control the size and number of your instanced object. Connect it to mesh to points node to distribute points on which the instances will be. From its drop down menu -> edges (that will grant the diagonal distribution of the points). That goes into Instances on points in the points socket.
Since i'm not aware of a way to bevel a shape inside Geonodes i have used simple plane which i scaled along one axis in edit mode (the axis depend entirely from you) since after you can rotate it as much as you wish -> after this little extrusion and bevel modifier.
With object info node you can bring your shape into the existing Geonode tree by drag and drop it from the Scene collection panel or by adding it manually with ctr+A. Then Object info node is connected to a transform node in which you can modify the scale of your instances. all this go in to Instances on point in the instance socket.
For the fall off from small to big i have used proximity node controlled by an empty object placed in the Scale socket of the instances on points node for further tweaking you can add map range or color ramp between Proximity and instance on points. I hope this helps!

Here is one approach where a single mesh line is instanced on itself two times:


text:
Rename and use multiple "Animation Nodes Object Containers"?
When you use a "Separate Text Object" node, the resulting characters/objects are grouped together using a parent empty object, always named "Animation Nodes Object Container".
Is there a way to change that object's name without "breaking" the animation node?
That would be very useful for organizing the objects in a scene.
Which leads to another linked question: is it possible to use more than one "Container" ?

No sorry, this is currently not supported. Maybe it will be in the future but I'm not sure.
You can however disable the parenting at all in the advanced settings in the node and parent them manually to an object. (Note: you'll have to do this again when you click the update button)

I don't know the development history of animation nodes, but i know nowaday it works like this:

and then you get the result in different collections which is pretty helpful.
I LOVE animation nodes ;)


text:
How to make a cone UV projection?
I can't figure out how to make a UV Projection with a Cone. I tried Sphere, Cube and Cylinder projection too. Can somebody help?

What do you mean by a cone projection?  Do you mean how to unwrap a cone?

If the bottom Ngon of cone isn't important for texturing you can enter Top VIew and use Project From View from Unwrap menu.

In "Edit Mode" select The bottom vertices and one edge and mark them as a seam by pressing CTRL + "E" and selecting mark seam from the drop down menu. Then in the UV Editor while in "Edit Mode" select all of the vertices
and unwrap them by pressing "U" and selecting Unwrap from the drop down menu.


text:
Rigify rig main properties and rig layers disappeared
Rigify rig main properties and rig layers disappeared in N panel
so, the worse part, is cannot switch from IK and FK... how can I restore it and if I cannot, how can switch from IK and FK without the Rig Properties tab?
Thanks

Open a Text Editor and see if there is rig_ui.py file there.

If there is click Run Script and check also Register. Your controls in N panel should reappear. Also make sure for future that you have Auto Run Python Scripts enabled in User Preferences under File tab (so the registered scripts are run automatically when you open blend file).
If you linked the rig into a new file, look in the original file if there is one. Both the rig and it's script need to be linked.
If there is none script to find anywhere, you need to make a new one. Create another blend file, create some rigify rig there and copy the script.
There is however a complication, each Rigify generated rig has a unique id, that matches with the script file, so the script we took will have some new random id and won't work with the original rig. Making these codes to match solves it:

Additional info: this happened to me when I linked in the rig from another file.  The solution was to link rig_ui.py from the same file, then proceed as above.

in general it's recommended to change the    rig_ui.py    file name after rigify generates the rig (or even beforehand in rigify advanced settings), specially if you're going to use multiple characters in the same file.

@AhmedAli the script name has no power here, it's all in the id codes. I edited the answer, it was incomplete. When these id codes break (multiple characters or not), not even the nicest script names will help.. But I agree that naming things nicely should go as common sense to organize things.

You need to turn on a layer, and when that layer is turned on only then does my rig main properties show up or else not


text:
Any way of serializing Blender cycles materials data?
I am searching of ways to serialize Blender Cycles materials to files using Python. But as of now I've found no such ways.
Maybe by writing the data of the materials to files but how can I do that? Even the slightest of contributions are appreciated.
If only there was a way to serialize materials to JSON/Binary/XML.
Perhaps someone here can lead me to light.
Maybe in the way Blender stores the materials?

To read the values and connections this should be a great starting point.

There's a node exporter if i recall correctly.try to look it up

@Chebhou This one: http://blenderartists.org/forum/showthread.php?346359-Addon-Export-node-groups?

Meanwhile, I have found one way, but that's not what I asked in the question - To save the materials in a blender file and write an add-on to import only the materials from it. But I do hope someone pops with a better script only way

I can serialize and deserialize any Blender material configuration in JSON. It is possible for me to save my materials in a FreeCAD file and restore all these materials in Blender from this FreeCAD file. for more information see this thread on the FreeCAD forum

There is the rna_xml module, which produces pretty verbose xml
from rna_xml import rna2xml

rna2xml(root_node="MyRootName",
        root_rna=bpy.data.materials['Material'].node_tree)

produces (not full output).  There is also an rna2xml routine.  To output to a file use rna2xml(fw=f.write, ...) where f is a file.
<MyRootName>
  <inputs>
  </inputs>
  <links>
    <NodeLink is_valid="TRUE"
              from_node="ShaderNodeBsdfDiffuse::Diffuse BSDF"
              to_node="ShaderNodeOutputMaterial::Material Output"
              is_hidden="FALSE">
      <from_socket>
        <NodeSocketShader name="BSDF"
                          identifier="BSDF"
                          is_output="TRUE"
                          hide="FALSE"
                          enabled="TRUE"
                          link_limit="4095"
                          is_linked="TRUE"
                          show_expanded="FALSE"
                          hide_value="FALSE"
                          node="ShaderNodeBsdfDiffuse::Diffuse BSDF"
                          type="SHADER"
                          bl_idname="NodeSocketShader">
        </NodeSocketShader>
      </from_socket>
      <to_socket>
        <NodeSocketShader name="Surface"
                          identifier="Surface"
                          is_output="FALSE"
                          hide="FALSE"
                          enabled="TRUE"
                          link_limit="1"
                          is_linked="TRUE"
                          show_expanded="FALSE"
                          hide_value="FALSE"
                          node="ShaderNodeOutputMaterial::Material Output"
                          type="SHADER"
                          bl_idname="NodeSocketShader">
        </NodeSocketShader>
      </to_socket>
    </NodeLink>
  </links>
  <nodes>
    <ShaderNodeOutputMaterial type="OUTPUT_MATERIAL"
                              location="300 300"
                              width="140"
                              width_hidden="42"
                              height="100"
                              dimensions="178.889 116.333"
                              name="Material Output"
                              label=""
                              parent="NONE"
                              use_custom_color="FALSE"
                              color="0.608 0.608 0.608"
                              select="TRUE"
                              show_options="TRUE"
                              show_preview="FALSE"
                              hide="FALSE"
                              mute="FALSE"
                              show_texture="FALSE"
                              shading_compatibility="{NEW_SHADING}"
                              bl_idname="ShaderNodeOutputMaterial"
                              bl_label="Material Output"
                              bl_description=""
                              bl_icon="NONE"
                              bl_static_type="OUTPUT_MATERIAL"
                              bl_width_default="140"
                              bl_width_min="100"
                              bl_width_max="320"
                              bl_height_default="100"
                              bl_height_min="30"
                              bl_height_max="30"
                              is_active_output="TRUE">
      <inputs>
        <NodeSocketShader name="Surface"
                          identifier="Surface"
                          is_output="FALSE"
                          hide="FALSE"

Warning: You can't currently use xml2rna to deserialize most materials because of this bug

I can serialize and deserialize any Blender material configuration in JSON. It is possible for me to save my materials in a FreeCAD file and restore all these materials in Blender from this FreeCAD file.
Serialize:
    # browse all materiels in the Blender scene
    for bmat in bpy.data.materials:
        if not bmat.use_nodes:
            continue
            msg = f"Blender material: {bmat.name}, don't use node, skipped...\n"
            warnings.append(msg)
            App.Console.PrintMessage(msg)
            continue
        if bmat.name in materials and materials[bmat.name].Material.get(root):
            msg = f"FreeCAD material: {bmat.name}, already has a Blender configuration, skipped...\n"
            warnings.append(msg)
            App.Console.PrintMessage(msg)
            continue

        matdata = {}
        for node in bmat.node_tree.nodes:
            links = {}
            inputs = {}
            outputs = {}
            sockets = {}

            if node.inputs:
                link, input = _getInputData(warnings, bmat, node)
                links.update(link)
                inputs.update(input)

            if node.outputs:
                output = _getOutputs(warnings, bmat, node)
                outputs.update(output)

            sockets = _getSocketProperties(warnings, node, bmat.name, node.name, [])

            matdata[node.name] = {'Type':     node.__class__.__name__,
                                  'Sockets':  sockets,
                                  'Link':     links,
                                  'Inputs':   inputs,
                                  'Outputs':  outputs}

        if matdata:
            if bmat.name in materials:
                mat = materials[bmat.name]
            else:
                mat = makeMaterial(bmat.name)
                materials[bmat.name] = mat
            temp = mat.Material.copy()
            temp[root] = json.dumps(tuple(matdata.keys()))
            for node, data in matdata.items():
                temp[root + '.' + node] = json.dumps(data)
            mat.Material = temp

def _getInputData(warnings, bmat, node):
    links = {}
    inputs = {}
    for input in node.inputs:
        for link in input.links:
            links[input.name] = (link.from_node.name, link.from_socket.name)
        if input.type == 'VALUE':
            v = input.default_value
            value = v
        elif input.type == 'VECTOR':
            v = input.default_value
            value = (v[0], v[1], v[2])
        elif input.type == 'RGBA':
            v = input.default_value
            value = (v[0], v[1], v[2], v[3])
        elif input.type == 'SHADER':
            continue
        else:
            msg = f"FreeCAD material {bmat.name} on node {node.name} can't read input: {input.name} type {input.type} is not supported, skipping...\n"
            warnings.append(msg)
            App.Console.PrintMessage(msg)
            continue
        App.Console.PrintMessage(f"Material Name: {bmat.name} Node: {node.name} Input: {input.name} - Value: {value}\n")
        inputs[input.name] = value
    return links, inputs

def _getOutputs(warnings, bmat, node):
    outputs = {}
    for output in node.outputs:
        if output.type == 'VALUE':
            v = output.default_value
            value = v
        elif output.type == 'VECTOR':
            v = output.default_value
            value = (v[0], v[1], v[2])
        elif output.type == 'RGBA':
            v = output.default_value
            value = (v[0], v[1], v[2], v[3])
        elif output.type == 'SHADER':
            continue
        else:
            msg = f"FreeCAD material {bmat.name} on node {node.name} can't read output: {output.name} type {output.type} is not supported, skipping...\n"
            warnings.append(msg)
            App.Console.PrintMessage(msg)
            continue
        App.Console.PrintMessage(f"Material Name: {bmat.name} Node: {node.name} output: {output.name} - Value: {value}\n")
        outputs[output.name] = value
    return outputs

def _getSocketProperties(warnings, obj, mat, node, properties):
    data = {}
    skipping = ('rna_type', 'inputs', 'outputs', 'dimensions', 'type',
                'is_hidden', 'from_node', 'from_socket', 'to_node', 'to_socket')
    for p in dir(obj):
        if p not in skipping and not (p.startswith('_') or p.startswith('bl_')):
            v = getattr(obj, p)
            if v is None or isinstance(v, bpy.types.bpy_func):
                continue
            elif isinstance(v, (str, int, float, bool)):
                value = v
            elif isinstance(v, mathutils.Color):
                value = {'r': v.r, 'g': v.g, 'b': v.b}
            elif isinstance(v, mathutils.Euler):
                value = {'x': v.x, 'y': v.y, 'z': v.z, 'order': v.order}
            elif isinstance(v, mathutils.Vector):
                if len(v) == 2:
                    value = {'x': v.x, 'y': v.y}
                elif len(v) == 3:
                    value = {'x': v.x, 'y': v.y, 'z': v.z}
                elif len(v) == 4:
                    value = {'x': v.x, 'y': v.y, 'z': v.z, 'w': v.w}
            elif isinstance(v, bpy.types.bpy_prop_array):
                value = []
                for d in v:
                    value.append(d)
            elif isinstance(v, bpy.types.bpy_prop_collection):
                value = {}
                properties.append(p)
                for k, d in v.items():
                    value[k] = _getSocketProperties(warnings, d, mat, node, properties)
            elif isinstance(v, bpy.types.TexMapping):
                properties.append(p)
                value = _getSocketProperties(warnings, v, mat, node, properties)
            elif isinstance(v, bpy.types.ColorRamp):
                properties.append(p)
                value = _getSocketProperties(warnings, v, mat, node, properties)
            elif isinstance(v, bpy.types.ColorMapping):
                properties.append(p)
                value = _getSocketProperties(warnings, v, mat, node, properties)
            else:
                msg = f"FreeCAD material {mat} on node {node} can't read property: {p} type {type(v)} is not supported, skipping...\n"
                warnings.append(msg)
                App.Console.PrintMessage(msg)
                continue
            data[p] = value
            properties.append(p)
            App.Console.PrintMessage(f"Node socket: {node} property: {'.'.join(properties)} value: {str(value)}\n")
    return data

Deserialize:
def _setMaterialNodes(bmat, mat, root):
    links = {}
    sockets = {}
    inputs = {}
    outputs = {}
    data = mat.Material.get(root)
    print("_setMaterialNodes() 1 data: %s" % data)
    if data:
        nodes = json.loads(data)
        for name in nodes:
            link, socket, input, output = _createNode(bmat, mat, root, name)
            links.update(link)
            sockets.update(socket)
            inputs.update(input)
            outputs.update(output)
        for node, link in links.items():
            bnode = bmat.node_tree.nodes[node]
            _setLinks(bmat, bnode, link)
        for node, socket in sockets.items():
            bnode = bmat.node_tree.nodes[node]
            _setSockets(bnode, socket)
        for node, input in inputs.items():
            bnode = bmat.node_tree.nodes[node]
            _setInputs(bnode, input)
        for node, output in outputs.items():
            bnode = bmat.node_tree.nodes[node]
            _setOutputs(bnode, output)

def _createNode(bmat, mat, root, name):
    links = {}
    sockets = {}
    inputs = {}
    outputs = {}
    data = mat.Material.get(root + '.' + name)
    if data:
        node = json.loads(data)
        print(f"Create Node socket {name} of type {node['Type']}")
        bnode = bmat.node_tree.nodes.new(type=node['Type'])
        bnode.name = name
        links[bnode.name] = node['Link']
        sockets[bnode.name] = node['Sockets']
        inputs[bnode.name] = node['Inputs']
        outputs[bnode.name] = node['Outputs']
    return links, sockets, inputs, outputs

def _setLinks(bmat, bnode, links):
    for input, outputs in links.items():
        _setLink(bmat, bnode, input, *outputs)

def _setLink(bmat, bnode, input, node2, output):
    bmat.node_tree.links.new(bmat.node_tree.nodes[node2].outputs[output],
                             bnode.inputs[input])

def _setSockets(obj, sockets):
    for property, value in sockets.items():
        if isinstance(value, dict):
            if property.isnumeric():
                _setSockets(obj[int(property)], value)
            else:
                _setSockets(getattr(obj, property), value)
        else:
            setattr(obj, property, value)

def _setInputs(bnode, inputs):
    for input, value in inputs.items():
        binput = bnode.inputs.get(input)
        if binput:
            binput.default_value = value
        else:
            print("_setInputs() ERROR *********************************************")

def _setOutputs(bnode, outputs):
    for output, value in outputs.items():
        boutput = bnode.outputs.get(output)
        if boutput:
            boutput.default_value = value
        else:
            print("_setOutputs() ERROR *********************************************")

As mentioned by @batFINGER you can use rna2xml to serialize node trees to an xml file. Then if you want to deserialize the node tree you can use rna2xml.xml2rna function.
Here is a snippet of code describing the whole procedure.Be aware though that you might get Read-only attributes error when importing the xml, in that case you can simply delete the attributes of the root node that pose a problem.
Cheers
EDIT: Actually this blender module is useful to serialize structures that have a pre-determined content but it is in no way useful to serialize whole materials and node trees from scratch. One easy way to get around that issue is to have another scene in the same .blend file with all the materials. Those can be accessed across all scenes with bpy.data.materials[<key>]. One could decide to augment the RNA serializer offered by Blender but I decided that it would take too much time for my current project.


text:
Keep bottom pointed objects from falling over in Blender Game Engine
I want to simulate cricket stumps in Blender Game Engine. So far, I have completed modeling the stumps and bails. But I am having trouble figuring out how I can keep the stumps steady before I (sort of) launch an object on to it. Just in case you don't know, a set of stumps looks like this:
Click to see image.
Their bottoms are pointed. So how do I keep them standing at first?
I know how to launch an object and make the stumps active rigid bodies. I just want to know how to keep them from falling down.

You can use the logic node editor like this on each stump:

Explanation:
At start (Delay node without repeat, Delay = 0) you suspend dynamics (Edit object/Dynamics/Suspend Dynamics)
Then set up a collision node. You must specify the same property for it and the colliding objects! It will activate the restore dynamics and set mass actuators.
So Blender will not calculate dynamics for your stumps until collision. It is a very good performance optimization too. So recommended technique for larger games.

And what do I put all this logic in? What is Cube.003? On Each Stump?

Yes on each stamp, and for the ball add a property, mine is "bullet" you can name it by choice, but it must be the same as the collision sensor node property.


text:
Is there a low level alternative for bpy.ops.object.origin_set()
When i want to move the Origin of an object by script, then i can do this as follows:
my_location   = [0,0,0]
active        = scene.objects.active
cursor        = scene.cursor_location.copy()

scene.objects.active  = obj
scene.cursor_location = my_location

bpy.ops.object.origin_set(type='ORIGIN_CURSOR')

scene.cursor_location = cursor
scene.objects.active = active

Is there an efficient alternative which works without need to backup/restore the active object and the current cursor location ? If not, is it missing or is there a reason ?

WARNING: in Blender 1.79 this operator (origin_set()) works on all the selected objects, and not on the active object. Thus you need to store the collection of the selected objects, you need to deselect all (bpy.ops.object.select_all(action='DESELECT') ) and you need to set obj.selected = True. And afterwards, you need to iterate over your stored previous selection and restore the selected state

Set the object location to the target location and translate the mesh vertices in the reverse direction (the negated vector of the difference between start location and target location of the origin = start minus target).
Note that Mesh.transform() is not supported in Edit Mode, you need to use a wrapped BMesh instead.
If you use blender 2.79 change bpy.context.scene.cursor.location to bpy.context.scene.cursor_location
import bpy
import bmesh
from mathutils import Matrix

ob = bpy.context.object
cursor_world_loc = bpy.context.scene.cursor.location
cursor_local_loc = ob.matrix_world.inverted() @ cursor_world_loc

mat = Matrix.Translation(-cursor_local_loc)

me = ob.data
if me.is_editmode:
    bm = bmesh.from_edit_mesh(me)
    bm.transform(mat)
    bmesh.update_edit_mesh(me, False, False)
else:
    me.transform(mat)

me.update()

ob.matrix_world.translation = cursor_world_loc

@Gaia, you would need to make some tweaks for non-mesh objects. (e.g Curves and Armatures). Namely update() and conversion to bmesh.

This is only for mesh Objects. Would it make sense to propose a general function? Something similar to bpy.context.object.transform_origin(location,type) with type like what the operator has ?


text:
How to set world sky environment for use in libgdx?
I'm making a game using libgdx.
I have to set a sky to my game , using models or another way.
I looking how to make sky in blender .... I'm so confused. I need help.
For example I've made a sky using a sphere, and applied a skydome image. But in libgdx it is only visible from the outside, when I go into sphere it appears black. I mean the only outside picture seems

I guess, the is nobody here interested or using libgdx :)

Well this is Blender SE, not libGDX SE ;)

You would need to flip the normals, they are pointing outward, go to Edit Mode with your sphere selected. Select all A, from the mesh menu select Normals / Flip Normals

After that you normals should look like (display of normals can be activated by the highlighted button):

Actually, i tried it. But i will try again now


text:
Inverted Solid OpenGL lights?
When i opened up my blender file it suddenly inverted all the lightings of the Solid OpenGl lights and whatsoever. I tried to fix it up but it still wouldn't..!
-- Added Explanation as to my reply to someone's comment below:
I'm new to blender so i can't explain much what's going on. When we make a model from scratch, it becomes all gray cause that's the basic color right? Awhile ago when i opened up my blender file it suddenly turned black.. I tried to ignore it and made the leg part, the leg is now gray but the head is still black. When i tried to move the direction lights, the head became gray and the leg became black.. ( I don't know if that made any sense)

Not quite sure what you mean.. Could you explain what is going on in the screenshot?

Are the normals of the model facing outside?

@gandalf3 sorry if it isn't clear. I'm new to blender so i can't explain much what's going on. When we make a model from scratch, it becomes all gray cause that's the basic color right? Awhile ago when i opened up my blender file it suddenly turned black.. I tried to ignore it and made the leg part, the leg is now gray but the head is still black. When i tried to move the direction lights, the head became gray and the leg became black.. ( I don't know if that made any sense)

@user2859 i'm sure the normals are facing outside o-o.

Try to select all vertices with A in edit mode and hit Ctrl N.

@user2859 whoa! Thank you! that worked! What is Ctrl N for?

@CaptainYang It recalculates the normals, ensuring that they are all pointing consistently outwards if possible.

@gandalf3 Ohh! I see! Thanks for the help :D

@user2859 Ohhh! Okay! Thanks for the help :D


text:
Strange shadows in Solid mode
I made a scene of two wine glasses on a flat surface, with an overhead light source. For some reason, when I'm viewing the objects as solids, there are strange shading artifacts that appear on all the objects. The planes do not always show the issue; you can see on the perspective on the left, the overhead plane looks normal, but in the perspective on the right it's entirely black (side note, it's an emission plane). These shadows do not appear in other object viewing modes (wire frame, materials). I'm running Blender 2.71 on a MacBook Pro with OSX Mavericks. This is my home computer, and at my work computer, which runs Windows XP, I don't have this issue ever. I'm very new to Blender, so it may be a simple fix, but I don't understand the program enough to understand what's happening and where to look to make the fix. Any suggestions would be greatly appreciated!

It looks like a normals issue, but if the same file works fine on another computer, then it sounds more like a hardware/platform specific bug.

I haven't tried the same file on my work computer, that might be a good way to check though, thanks!

There are 2 possible reasons:
Flipped normals
The repair of this is simple: select "bad" object, enter edit mode, press tab, and select all vertex A and recalculate normals, ctrl N.
Something bad in options
The easiest repair is just wipe the options. (file -> load factory settings)

The normals repair fixed it, thanks! Is there a way to make sure this doesn't happen again in the future? Like a default option to set or something?

@grrothman Nope, this occurs in all 3d, as long as you manipulate mesh data, there exists the chance that faces and normals will get flipped etc. You should incorporate Ctrl + N into your workflow. (something I do as often as saving). See the answers on the duplicate post for more info.


text:
How to Add and Render Many Columns
I would like to render many buildings (say, about 50000) as simple columns on a flat plain in Blender.  I have values for location (X,Y) and a height value.  However, if I try to add more than a couple of thousand columns, I run out of memory.
I think that I want to use the particle / hair system since each building is not independent.  they are all simple 4 sided columns, so they can use the same textures, etc.  I can add 50,000 columns, using the techniques discussed in the video  http://www.youtube.com/watch?v=mCEQYyesxLg.  However, I need to be able to set the location and scale of each one based on my data.  How can I do this?
The end result should be something like:  http://ekisto.sq.ro/  which is a beautiful visualization of stack overflow data.
Update:  I'm close!  The following updates my particle locations and scales:
scalesize = 10
scalexy = 50

object = bpy.context.object
cols = object.particle_systems[0].particles

def setColumn(index, name, xval, yval, heightval):
    cols[index].location.x = float(xval) / scalexy
    cols[index].location.y = float(yval) / scalexy
    cols[index].location.z = 0
    cols[index].size = float(heightval) / scalesize

ii = 0
f = open('input.data', 'r')
for line in f:
    values = line.split()
    setColumn(ii, values[0], values[1], values[2], values[3])
    ii = ii + 1
f.close()

However, when I hit 'F12' to do the render, the particle system updates all the locations and un-does the setting of the locations.  How do I tell the particle system to not update?

Related: http://blender.stackexchange.com/q/7581/599. Try adding the columns all inside a single object (there is a difference between 50000 individual objects and 50000 cubes inside the same mesh). Also try instancing (dupli objects) or linked data.

Thanks Gandalf3.  the link has a number of good suggestions, as does http://blender.stackexchange.com/questions/7358.

I was unable do this using the technique above, because I could not figure out how to prevent re-setting of the location.  Therefore, I used the following technique:  create a single object, copy it with ob.copy, put copies into scene object list, and then update the scene.
bpy.ops.mesh.primitive_cylinder_add(vertices=numVertices, radius=columnSize,
    depth=height,location=loc)
ob = bpy.context.object
obs = []
sce = bpy.context.scene

f = open('input.data', 'r')
for line in f:
    values = line.split()

    x = float(values[1]) / scaleXY
    y = float(values[2]) / scaleXY
    height = float(values[3]) / scaleHeight

    copy = ob.copy()
    copy.location += Vector((x,y, 0))
    # copy.data = copy.data.copy()
    copy.scale.x = copy.scale.x * height / 2
    copy.scale.y = copy.scale.y * height / 2
    copy.scale.z = copy.scale.z * height
    obs.append(copy)

for ob in obs:
    sce.objects.link(ob)

sce.update()


text:
Is there better way to rig this mechanical object?
I have an object consisting of 4 tubes and 4 pivot points.

I'd like to be able to "skew" the object like this (it can only skew left/right, not in the third dimension):

I managed to get it working, but it seems hacky:

Parented top_pivot.L and bot_pivot.L to tube.L
Parented top_pivot.R and bot_pivot.R to tube.R
Added copy rotation to tube.R (copy from tube.L)
Added copy location to tube.bot (copy from bot_pivot.L)
Added copy location to tube.top (copy from top_pivot.L)
Finally offset tube.top and tube.bot middle points (over the pivots.L)
optionally limit the rotation of tube.L to prevent the top and bot tubes from intersecting

So when tube.L rotates, the whole thing skews because of the constraints.
The problems start when I try and parent tube.L and tube.R to other objects, or when I try and move/rotate pieces.
Can this whole thing be done with armature/bones?
Update an example of a problem when using the object as part of a bigger one:
Attaching the base and linking to tube.L:

rotating the base causes the child objects to rotate in an unwanted way:

Can you describe a little bit more about the parenting arrangements with other objects that are giving you problems?


text:
Geometry nodes: How to check object type
Hi Geometry Nodes friends.
Is there a way to check the object type in geometry nodes?
For example: I would like to check an object if it's a curve or a mesh and do things then.
I've an edges path and would like to convert it to a curve, but if it's already a curve I would like to do other things within the same geometry nodes tree.
Important: Of course, I know how to convert an edge to a curve etc. But I would like to know how to check the object type before doing something.
Is that possible?
Best wishes
Chris

the separate components node is probably what you are looking for. By using it, you can split the objects of your scene depending on their type

Much better :)..

In a recent answer, I used this hack to check geometry type, by checking for the existence of the curve_type named attribute:

In that case, taking the sum over the geometry, to drive a Switch. To be honest, I'm not very comfortable with it.

Interesting. Did it work with the other types, too?

Not by itself, I don't think.. you could cascade tests? But the whole thing is  bit janky.. like OO downcasting.

@ChristophWerner Well, what does "work with the other types" mean? Other types like cameras, lights, empties? What would be working then? Those objects have no geometry, they are not meshes and cannot be converted to meshes, and therefore cannot be converted into curves... so the output would always be empty, no matter if there is a switch or not. Like in my slightly simpler answer, of course you can plug in other object types, but they will not produce any output because they cannot.

@Gordon Brinkmann Basically you're right. But there're arguments for having this. If I want to do something with an edge or a curve, and a get a same result, it makes sense to check for the type. Example: You create a gn fence. The user can be free in creating a curve object or a edges mesh. In this case you need just one tree to create a fence.

@ChristophWerner I'm not questioning checking for edges or curves - that's what my answer is for, too... but you said "working with the other types"... what other types do you mean? Edges are meshes as well, so checking if it is a curve or a mesh works for edges, too. That's no different type, that's why I was asking if you mean cameras, empties etc.

@GordonBrinkmann et al. Points, Instances?  I feel that testing for type ought to be a little alarm-bell that there might be a design problem. But Blender kind of introduces that by silently converting curves to their sampled mesh approximations for various operations.. (As far as I can see, the maths to maintain the curve definition would often be even more gnarled up )

@RobinBetts I hear that alarm-bell, too... anyway, instances wouldn't be a problem - you could always plug a Realize Instances before the whole Mesh to Curve and Switch part, because (contrary to the Mesh to Curve node which has an empty output if plug other than a mesh into it) a Realize Instances node lets geometry that's not an instance simply pass through. For other things like points etc. you'd probably have to create more switches to detect all types and react to them... but as you said, that would be a design problem. Why make a nodetree like: throw all in to get a curve out?

@Gordon OK. Sorry for the misunderstanding... "German guy has problems understanding English, sometimes..." ;) Maybe I'm thinking to complex. You're right. Every other type, than a curve or a mesh would make no sence and ended in no results, what would be ok in this case.

@ChristophWerner Kein Problem, bin auch ein "German guy". Dann schau einfach welche Antwort dir besser gefällt.

The way you could do it is with a Curve Length node and a Math node set to Compare if Greater Than 0. Of course this method has a flaw, if you plug in a curve with a length of 0, but I assume you do not use such an object. But the comparison is not necessary, depending on what you want to do next.
Because the practical setup depends on what "doing something" with the curve means. If you just want to make sure something is a curve to avoid having no output from the Mesh to Curve node, you can do it with a Switch node that uses the Curve Length for the Selection: a mesh will produce a False result, a curve will be interpreted as True if Curve Length > 0, so only the False branch needs the Mesh to Curve conversion:


text:
Asset Browser: How to save an armature pose including custom properties values?
I have a character rig. Some bones includes custom properties, that appears at the side bar and can be adjusted in the Item tab to control some extras.
When I create a pose for my asset library, the custom properties values are not saved, just the bone poses.
Is this basically impossible or is it my mistake?
Thank you

Hello, maybe you want to save the entire collection as an asset instead ? If you just mark the armature as an asset I think it will only serialize its own custom properties, not the bone childs custom props.

My intention was to switch a pose inside the scene as a variation. Saving the whole collection is a global solution to share between scenes or users, but it doesn't fulfill my needs to switch the pose quickly inside the project scene.


text:
Python: What is the fastest way to change the 3DView shading type in Blender Python?
Is there a way in Blender Python to change the 3D Viewport space shading.type or the shading.color_type directly?
I mean: without parsing all the screen areas for the 'VIEW_3D' type and change it then?
Here's the code I'm currently using:
for area in bpy.context.screen.areas:
            if area.type == 'VIEW_3D':
                space = area.spaces.active
                space.shading.type = 'SOLID'
                space.shading.color_type = 'MATERIAL'

Thank you!

That is the standard way to do it. There is no other way.

"There is no other way" —— Not quite so. You can avoid loops if you invoke your code as an operator (from a 3D Viewport). More details in my answer.

Since there can be multiple 3D views with different shading types, you inherently have to have some way to pick which one you want to change.

Agreed, both of the solutions presented in the Questions and Answer are valid, either you have to loop over all areas to find the ones you want, or you already know which one you're dealing with since you clicked a button in its layout interface

@Yaroslav yes ofcourse but I think the OP wanted a simple way to directly execute this without operator and needing a mouse hovered over the specific space, just like you can directly access bpy.context.active_object where Blender already knows that the context is no other space but 3D view. However with shading type it can be displayed differently for every 3D View area thus you inherently have to pick which one.

Thank you all for describing the current state in detail. Harry is right. I was interested in a way to change the shading type without having the mouse pointer over a specific viewport. Because I use a button for my function, the source area containing the button can also be in a different area.

Well.. in Blender you should to determine a context (one way or another)
If your mouse is hovering over a 3D Viewport - that counts as setting the context as 'VIEW_3D'.
So if you invoke your python code while your mouse is over a 3D Viewport - it would be enough just these 2 lines:
bpy.context.space_data.shading.type = 'SOLID'
bpy.context.space_data.shading.color_type = 'MATERIAL'

But to invoke the code from a Viewport you should firstly register your code as an operator and then either:

add it to some menu

or just use F3.

You can learn more about operators from this video: =link=


text:
Geometry Nodes Simulation: Create a simple explosion
I would like to know how to create a simple basic explosion effect in Geometry Nodes using the simulation area.
Example: I press play and all instances move away along the normal directions of the emitter surface.
I tried this in version 4.2 but have no idea how to do it. All instances rotate during the animation, but I don't know how to also move them away from the surface.
Thank you.
Here's my progress so far:

I figured it out, and I think this works for me as a starting point. See my example below.
If you have another idea for a simpler or more elegant way, please post it here.


text:
How to reproduce missing Specular functionality in Blender 4.2?
Some important shader functions to control special values were removed in Blender 4.2. The transmission roughness for example. There is no way to reproduce it. This is important, if you update old peojects or expand them by new client wishes. You have always move back to the old Blender version.
Another functions differ from older versions and can result in trouble. One of those functions is the "Specular" option in the Principled Shader. It got new but lost also some functionality.
Question: Do someone know how how to reproduce the Specularity behavior that is known in old blender versions? See my example in Blender 3.6.5. How to reproduce the samespecularity in a metalness shader in Blender 4.2?
Blender 4.2:

Blender 3.6.x. Basically the same values, but different result.

You are a bit late to the party, the Principled BSDF has already been re-worked for 4.0, it is not new in 4.2, but I do not have an answer for you. But I actually never tried to find an answer as for most of the time I did not need the Specular setting. But actually the Specular reflection should only work on dielectric (non-metallic) materials, but it did work on metallic in the old material and this was removed to make it more physically accurate.. If you set the Metallic value to 0, then the Specular value behaves the same in both versions. Metallic reflection ≠ specularity.

Take a look at this and see if it helps https://developer.blender.org/docs/release_notes/4.2/eevee_migration/#materials

@Emir The changes from old to new Eevee in 4.2 have nothing to do with the 4.0 reworked version of the Principled BSDF (which is not an Eevee-specific shader either).

By the way, the settings are not the same: the old Principled BSDF, had the Specular Tint which you could set from 0 to 1 as a percentage how much the reflection should be tinted by the base color. In your screenshot it is 1, so 100% the base color blue. In the new version you can set a Specular Tint color instead of a factor. By default it is white, like yours. But to get a comparison to the old version it should have the same blue as the base color. Still the result is not exactly the same, but as I said it was reworked to be more realistic in terms of energy conservation etc.

Thank you. I'm asking for a friend. There are a some situations, where the old settings have sence and are important. The problem is: If you are working professional you haven't always the time to support the actual development bacuse of client jobs. Myself I am in the same situation like you Gordon. I don't use the specular values or very rare.


text:
How to solve normals artifacts?
I tried to model something like a cog. I created one tenth of the cog, mirror modified on 2 axes and added a circular array modifier to get the final result, using the merge option.
When I import the final model in Substance Painter, it looks as if the normals were off on the big flat surface. At least that's how I interpret it:

Any ideas what could be wrong here?
I checked, and all of the selected vertices below are on the exact same Z. Not their median, but the individual values.

If I simply create a circle mesh and fill it, I get a perfectly flat mirror surface:

EDIT:
Shading entirely smooth or flat doesn't seem to influence this issue:

Is the shading set to smooth (of the problem faces)?

@MrZak Should be flat. I added two images to my question. Once is shaded entirely flat, the other smooth. The artifacts are visible on both.

Try selecting all vertices and removing doubles ( W --> Remove doubles ). Seems to me you might have created quite a few doubles by modeling with the array modifier.

It seems to be an UV issue. I mapped identical parts of the cog to identical areas on the UV map. Substance Painter doesn't seem to like that. Unreal Engine doesn't seem to have this issue. I now applied all modifiers and smart UV unwrapped and I'm finally having no artifacts.

Based on the other answer I created a Blender add-on for this exact purpose called TiNA which allows you to more easily transfer normals between objects. TiNA basically turns the somewhat overwhelming Data Transfer Modifier into a set of more comprehensible operations.
There's a special branch for those using Blender 2.80 beta.

 Hotkey           | Operation
------------------|-------------------------------------------------------------------
 Alt+N            | Transfer Normals from selection to active object
 Shift+Alt+N      | Transfer Normals from active object to all other selected objects
 Ctrl+Shift+Alt+N | Clear Custom Normals data for entire selection
 Alt+W            | Wrap Normals

You can selectively transfer normals from a source object (possibly just a plane) by selecting both objects, and - with the target object as your active one - hitting Alt+N. You can then select a vertex group to limit the effect.


text:
Do some materials appear to be darker at grazing angles ?
When I walk on an asphalt road on a summer day and I look below me ( where I set my feet ) the area around my feet appear to be lighter than the area a few meters away.  I think I notice the same with brick walls. They appear to be darker to me at grazing angles.
But all theory I can find and what I experience in blender is that when you increase the roughness of a material, and/or you play with Fresnel  the materials created in blender show a lighter color at grazing angles.  See also the youtube videos about physically based rendering from CynicatPro at https://www.youtube.com/playlist?list=PLlH00768JwqFtFtsTKBxnLwadWsNo36R-
I started to think that glossy materials might appear lighter at grazing angles and rough materials darker, but I am sure my theory is far from correct.  I hope anyone can tell me more about it.  Is it maybe that the bumpiness caused self shadowing when it comes to materials like roads and walls, and so they appear to be darker at grazing angles ?

It's not about being lighter or darker. It's that the material is more reflective at grazing angles. So if the surrounding environment is lighter than the object, the grazing angles will appear lighter. If the surrounding environment is darker it will appear darker. The material's lowest point of reflectivity is also a factor.
To understand why the material reflects more at grazing angles, take this example of a sphere with lots of tiny particles being emitted from it. These little shards reflect light more, whereas the sphere itself absorbs it more (as perceived from the viewing angle). This is a simulation of how roughness works. The "roughness" value of a shader simulates the effect of microscopic bumps on the surface of materials.

In the image below, the sky is a black and white gradient. Here we can see that the Fresnel effect is not lightening or darkening, but rather reflecting more or less. So areas of the sky that are more white are causing lighter edges and areas that are more black are causing darker ones.

Sorry for the late reply. I Did a lot of experiments, after reading your answer, and indeed this seems to be correct to me. I checked in real life; most paper materials appear almost like a mirror when viewing at a very grazing angle.

@robwesseling Cool :-)  would you mind accepting the answer if it sufficiently addressed your question?


text:
FBX with Weight or Deformation support?
I am trying to edit models for a game. Specifically hair. In 3ds MAX, there is a special window that allows you to export the file with deformations, considering in this game, hair has physics:

I like 3ds max for modeling, however, I like blender for texture mapping. It seems when I edit the model in Blender after I edit it in 3ds MAX, in game, it is stiff as in it isn't flowing or having any flow to it at all. Even though 3ds max has this feature, it makes the hair very glitchy in the game. Is there a way for blender to export FBX files, with the support for deformation, for the hair to have physics in game? Thanks for the help!

The only animated mesh deformations Blender can export to FBX are:

Armature-driven ones.
Relative shape keys.

So if you can bake your physics into shapekeys, or use a 'fake-physics' armature, it should work.
PS: don’t know Max, but I would bet their “deformations” are similar to Blender’s “shape keys”?


text:
Pitchypoy rigify issue
Using a character rigged with Pitchypoy Rigify in different scenes.
Can't understand why when opening certain scenes the "rig layers" normally visible in the N panel disappear.
My "auto run scripts" in pref users is ON.
Any help?

Appending the rigged object to different scenes doesn't automatically include/run the rig_ui.py script. The script can then be located in the original .blend file's /Text folder.
You can also keep a local copy of the script by generating a new Rigify rig in an empty scene and saving it. Just be sure to change the rig_id in the script to match the rig you wish to generate a UI for before you run it... like this:


text:
Why this material doesn't render?
this issue is driving me crazy. I have this simple node material with a dirt texture (.png) applied to a plane.
In the preview render it works and shows up but as soon as i try to render i get nothing!
Someone can help?

Show us the camera view.

Try using a mix shader to mix between the diffuse and transparent, using the alpha channel of the image as the factor. That's the traditional method, although in theory I can see using the add method working. Also check out this answer about objects not rendering. If neither of those work, could you please upload your .blend (or stripped down .blend that shows the same issues) to BlendExchange?

That is an unconventional way to make a transparent shader. See this answer for the normal setup.

btw, could you post a result of a normal render? I think it's quite possible that the add shader is messing it up, but I still think that something would show up in the render.

Because transparent shader brings alpha channel information.
Diffuse shader by default contributes to the final image alpha with a value of 1.
Transparent shader contributes with a alpha value that reflect its colour HSV value's... value. High values corrispond to a low alpha (not in a proportional way).
By using an Add shader you are combining the shaders's alpha info (or you can  call it Transparency values) in the final render too. I can't exactly tell you the math between the values combination (see below for some thought about it)... anyway the important thing is that the low values rules!
If the Transparency values would be the imputs of a logical operation, the Add shader node would work quite like an OR operator.

In this particular case, the white transparent shader would bring to an almost completely black alpha channel in the final rendered image. If you examine the composite pass without enabling alpha channel I bet you'll see the image correctly rendered, and the alpha channel almost completely black, resulting in an empty final image.
What about the preview?
The difference from the preview cames from the fact that the preview has no alpha, and the grey checker pattern that looks to us as if there is nothing...it's merely a simple, true, background image! It gives the illusion of transparency but it's not related with the final alpha channel. It's the same result you would get in the final render by adding a checker background.
In fact if you put an object with alpha behind your geometry, it will shows up correctly (same thing if you disable Transparent option in the Film panel).

As the resulting shader bring not exactly to a completely black alpha channel, you can try to exaggerate the difference of the values stored into by adding a Math node set to Greater than as in the following picture:

By the way, the most common way to use alpha from texture in shaders involve using the mix shader node as in the following picture:

So the final alpha will be composed from a mix of values of the diffuse alpha (1) and the values from transparent shader (0) masked by the texture's alpha channel.

Here's a brief analysis of how Add Shader node combines two imput values.
Testing scene setup:

Some values:

As shown by the blue function in the graphs above, the resulting alpha is quite similar to the sphere sector equation. The difference is probebly due to the use of some dampening factor, anyway there is no doubt that should be something not too far away from:
Alpha = (1-Value1^2-Value2^2)^0.5

As stated before the Diffuse shader gives you an alpha value of 1, so it means it behaves as a black transparent shader, so it's Transparency = 0. By setting a full white Transparent shader (Transparency = 1) and adding the two shaders you'll have:
Alpha = (1-1^2-0^2)^0.5=(1-1-0)^0.5=0

Which means that with that node setup your images will always have an empty alpha channel.
I wasn't able to find any evidence in the documentation of what I said, so consider it as my personal opinion.

Thank so much to all of you for all this great information. Now i have more clear some basic but very important aspects in Blender nodes.

Thanks so much for the great info you wrote here.
I didn't know that the checker map in teh preview window was not a real transparency! Unfortunately, i tried different way to get the PNG work as i wish but i give up. Instead i render it as a normal texture and then, as you can see in the picture, in POST i put a simple multiply mode to the layer.. and it works fine.
( the problem was to add a "dirt layer" between the character an the real footage because in the original footage it seems like there's no window at all) Now, after reading all your info i will try again with the mix node more in

I'm afraid to be not able (yet!) to give a look at the source code to check the truthfulness of my opinions. I hope somebody with more knowledge can correct me about it. I've added some thought about how the Add shader combine imput values.

Techniques

Use a mix shader not a add shader
Know the user view and camera view are two different concepts
Press 0 repeatedly to alternate between camera view and user view
Place a light and more objects in the scene to check for render visibility
Check the render enable state of your object in the outliner view
Check Cycles Camera Ray Visibility State
Check Render Layer Settings


text:
How Reconstruction tools works?
i have this scene tracked. The "camera solve error" appear to be not bad (0.5).
My question is: How the "reconstruction tools" works?
To set the FLOOR it ask only two trackers when normally we need minimum 3 points to have a plane. To set an AXIS it ask only one tracker when from what i know we need minimum 2 points to have a line. In fact, when i try to define one axis in the tracked scene selecting one tracker it changes anytime the result without an apparent logic behind. Now in this scene the trackers are moving nice and following their spots in a good way but the final perspective of the camera is not good as you can see.
(The settings of camera and lens are correct.)
I apologize for my bad English.

Dont use the reconstruction tool for that type of tracking, use the solve camera motion. Then use one tracker as a origin, three trackers as a plane and two as axis.

authors: Вадим Чеховский


text:
cycles through everything while trying to select one thing
is this normal behavior for Blender? at some point in my working in blender it starts to no longer let me just click on an object to select it when their are more then one within the work area.
Instead when I click on the object I want, it will not select it (right away), it cycles through everything until it gets to the one I want before it gets selected.
in object mode and pose mode. it is really annoying, so now I'm asking.

Yes, this is normal. This is the way Blender handles selectable objects that are coincident, or very close to each other. If it can't tell which one you want, it will cycle through each possible option until you stop on the one you want.
If you want to avoid this behavior, there are a few options.

You may be able to move some objects to other layers.
A little known tool is "Local View." Press numpad / in object mode to view only the selected object. Do what you want to it, and then press / again to see everything else again.
Use h to hide selected objects
Use shift to hide UNselected objects
Use the Outliner to turn off selectability for certain objects

" If it can't tell which one you want, it will cycle through each possible option" my pointer/arrow is right on top of it and it still cycles. but thanks for the information on how to get around.

Yeah, that can be frustrating sometimes, but it really is the best option. Blender doesn't assume that you can always be as precise as you want, so it remains open to the possibility that the closest selection might not be the one you want ;-) There's been many times that I was glad Blender worked that way. Essentially, if you're having that much trouble selecting what you want, then it means your scene is complex enough to warrant the next level of organization.

just running through this riggy rigging youtube vid, seeing that dude having up what I do and he selects what I cannot. no biggy, it is just good to know that it is a normal behavior to cycle and it wasn't something I did with the settings that can be removed. I'll hopefully get use to it. :D


text:
how to vary the space between the object and mirrored object

is their a way to space the right side of subjects face (mirrored object) further away from the left side of subjects face so that the eyes match up better to the photo?
added mirror of circle with no clipping and this is what I end up with.

In [object mode] move the [origin] of your eye mesh to center of face image.  In [edit mode] move the eye mesh to match the eyes of image.  State in your question whether or not you have understanding of [object mode] versus [edit mode] and [origin]

Thank you I think I got it figured out. I mirrored the object in object mode, then went to edit mode, sized the circle to match the eye size then seperated them from center. that moved them to the respective areas over both eyes, respectively. then went from there, and work off of that. @atomicbezierslinger

If you have arrived at a solution ... please place a BSE answer for your own question and mark it as an answer, so that others do not attempt to answer your question again.

that is like a 2 to 3 day proccess .. rules rules rules ..

Thank you I think I got it figured out. I mirrored the object in object mode, then went to edit mode, sized the circle to match the eye size then seperated them from center. that moved them to the respective areas over both eyes, respectively. then went from there, and work off of

You are correct. Whenever you want to mirror and you want to increase distance, you need to move the vertices in edit mode further away from the object's origin.


text:
how to get rid of discoloration?
I made this using more then one object, then joined them together. used some fill faces as well. Then when I put the subdivision mod on it I get this three color pattern on the now Whole oject. Is that normal? I think not. so if I am right how to I get it to show all of it in the same color?

what is the heading ?? Having taking the time out of your life to add this notice you could at least diriect me to that. Instead of change it ...


text:
Motion tracking stops at a certain frame before the end of the shot
I have 7223 frames to track, I set my track mark it only goes to 762 then stops. Even though it does not do that usual thing when it loses it mark, I still reset the mark, then go one frame at a time, and it is not tracking it.
as you see it does not lose the track it just stops and will not go any further.

Any ideas why?

Check that the media is actually the right length then generate Timecode/proxy from it. This will help Blender read the video file you are using. Sometimes a heavily compressed file is hard for Blender to read back correctly.

I broke it down into png files, then selected just the first one, first time trying to do it this way, youtube vids have been saying this is how to do it. then it automatically selects the rest of the images in sequence. so no proxy can be used off images. time frames all match

Umm, you should be able to create a proxy still, anyway it sounds like you're hitting a memory issue. Move Clip editor should be able to dump frames as it goes. Notice the line that builds as you play or track thru? Can you scrub past this point?

authors: Алиса Резник


text:
getting the most out of tracking vs memory
I think this has to do with having lots of tracking points vs memory that is slowing me down to a craw.
I have 16GB ram, and 11GB swap. I selected detect features, giving me a lot of tracking points, (per youtube I found out this feature) when I run it to track of course it runs fine for a while until my RAM is almost used up, then slows to a craw.
I too have proxied my video to 50% as well.
from what I have learned on YouTube the more tracking points the better. How do I utilize this feature in blender to select the points for me and still be able to use them all while tracking something over 150 frames. the limit that
they all use for training purposes.
this too is a per-recorded movie by someone else.

thanks, in that link it said something about using png or image files instead, will that help cut down on mem, or help track for longer frames other then 250 default settings?


text:
Everything moves, not just the selected vertex
I go into edit mode for an object, select vertex mode, select one of the squares, then pull the arrow it moves just the square like it is suppose to. If I resize it then go into edit mode it no longer does this.
When I select vertex select a square, then go to move that square everything moves now, not just the vertex. Why?
I have already reset everything back to default settings and it is still doing this. It wasn't doing this yesterday, but today it is.

Are you using Proportional editing in edit mode? There's not enough information to be able to help you. Please provide screenshots of the problem or your scene or possibly a blend file.

I don't know, what' setting chane that? I just did what I did yesturday. hit tab, selected edit and it worked, but not today. Hold on, let me look it over again. Ok thanks for the hint, it was set to Proportional editing, I changed it to OFF, and its back to how it was yesturday. How it got changed without my knowlwadge I have no Idea. Nor do I know all of them little things yet. Thanks again! solved.

You're probably using Proportional Editing. This mode allows the user to make changes to vertices (or other selectables) within a given region, based on how close those vertices (or other selectables) are to the actual selection.
From the Manual:

Proportional Edit is a way of transforming selected elements (such as vertices) while having that transformation affect other nearby elements. For example, having the movement of a single vertex cause the movement of unselected vertices within a given range. Unselected vertices that are closer to the selected vertex will move more than those farther from it (i.e. they will move proportionally relative to the location of the selected element). Since proportional editing affects the nearby geometry, it is very useful when you need to smoothly deform the surface of a dense mesh.

This can be (accidentally) turned on by pressing O. It can be turned off the same way.
GUI controls in Blender 2.8x (proportional editing enabled):

GUI controls in Blender 2.7x:

(The highlighted button toggles the mode on and off)


text:
Copy animation from rig to rig
i have a character rig animated. I tried to "copy and paste" in curve editor the animation from rig to another one but seems not to be the way.
How can i transfer animation from a rig to another?
Thanks.

Does the two rigs have the same structure? Same bones names, etc? If not, I'm afraid you can't.

Yes. in this case they are exactly the same.

whoa! @SottoZen I didn't know you came here! I love you stuff.

Hey..thank you so much! I just discovered this site and i think it's really great. It helped me so much! I hope one day i can also give my little contribute to others :) Thanks again!

If (and only if) both rigs have the same structure, with same bones naming, so you can:

Select the first animated rig.
In the dope sheet window, choose Action Editor context, in drop-down menu at the bottom:

Just to the right, there is an Action browser that allows you to choose the current animation of the selected object. Here you can name your action properly, to find it easily later.

Select the second rig, then in click on the left button of this Action browser to display all existing actions, and select in the list the one you named before.

And that's it! Your second rig should have exactly the same animation as the first one.
Be aware that if you change something in the first rig's animation, it will also change the second's one, since they share the same action. To avoid this, you can click on the "2" button (or any number that shows the number of users you have for the action) to make a single-user copy of the action and have two independent actions:

Great!
I was not working with actions but i can easily convert my animation data to action.

Well actually in Blender EVERY animation IS an action. You just have to open the action editor to see it.

right. now i see them. Sorry i am coming from Softimage and its hard to start all over :)
Thanks for your help and patience

You're welcome. Glad to have helped. Can you mark the answer as "accepted" if this solution suits your needs? Thanks.

just a small remark here: if the name is not the same, search for "batch rename" -> bones, then it will work ;)

To build on the accepted answer:  If you want to import from a separate file, you can link and append Actions from another .blend and it will show up in the action list as described before.


text:
Why texture painting without color?
i am texture painting my model and i can't figure out this: i am trying to paint with this "pois texture" i have made (.png with alpha) but, as you can see in ther picture, it appear without its color on the mesh. (instead of purple)
My first time using Blender texture painting tools so i am sorry if this will result a very basic question.

Your color is set to dark green

YEP! *****!!! Didnt know the color was influencing the texture. I had the feeling was something basic and "simple"! Thanks so much Denis!

While using a brush texture in paint mode the value of the texture is mixed with the brush color.
To paint with the original color of the texture set the brush color to pure white.


text:
blender 2.79b graph editor not showing graphs
I opened it up like the tut vid said and I see no graphs for anything, I've clicked all of the button, and such and still nothing, what am i doing wrong, or is it blender?

I downloaded the .blend and saw that just select the frames to appear in the rendering. Hold 'shift' and go by clicking on them.

Then just render.

@ElektroJavrski I'm trying to edit the graphs around  frame 629 to adjust the partial system on the cone for fireworks, not rendering all layers. Layer 3 is where the cone is at. the camera view is for my working area.

See this short video, it will solve your problem. I tested it on your project and it worked. https://www.youtube.com/watch?v=df9LGwBg91A

: back: nope that is nothing like what I am doing, other than the explosion, what you gave me is called a work around, not a fix. I still have no graph editor for that or anything else that I'd need it for.  @ElektroJavrski

I'm starting a different file, and putting everything together in post.

I get a -1 points for telling a truth, someone gave me a work around, not a proper answer, then deciding the best thing to do is start over, and someone shmuck gives me a -1 point. Where mom and Dads fail they thrive.


text:
why is the emitter shooting out in a little striaght line and not the materal?
this has happened before, and I just delete and start over and that is getting really old. I have attached an partial system to a material and it is shooting the particle in a straight line like it is only working off the little dot that the arrows are attached to. the first partial system is a baked system on a different cache file. that one is working but I am trying to eliminate having to back look change bake and look again cycle this puts me in. (smoke and fire)

Sometimes when a particle system fails for me I turn the eye button off. Then go back to the start frame and turn it on again. This seems to clear any broken buffer.

The idiosyncrasies of Blender, where's the book on that one? (rolls eyes) thanks for the tip.

Did it help tho?

No, but I did manage to finally get what I was looking to get, but render times rep frame, wow 1:xx:xx.xx @ 200 x 8 cores. that is hours:min:secs.th-secs right?

Hmmm, IIRC it goes down to tenths of a second


text:
CLI (linux) rendering cycles, and cpu + GPU
I'm currently testing my first try at the rendering cycles on the CLI in Linux. this is the script  I wrote for it. I was wondering what about using the GPU along with cpu.Laptop Specs
CPU Intel(R) Core(TM) i7-2760QM CPU @ 2.40GHz
RAM 15993 MB : 1614 : 151
Graphics Card [AMD/ATI] Seymour [Radeon HD 6400M/7400M Series]

#!/bin/bash

#executable
Blender=/media/data/blender-2.79-5480de3fca8-linux-glibc219-x86_64/blender
#file to render
file=/media/data/Charlotte_Zone_video/CZ_Shorter_version/BlenderNightly/Charlotte_Zone_Marque_SS_ShorterVersion_08a2a.blend
#output images to
output=/media/projects/Charlotte_Zone_video/CLI_CZ_Shorter_version_middle/Charlotte_Zone_SuperStar_ShorterVersion_Marque_08a-####
render_type=CYCLES
cores=2
#Frame Numbers
start=2355
finish=2400

 "$Blender" -b "$file" -o "$output" -E "$render_type" -s "$start" -e "$finish" -t "$cores" -a

reference page:
Blender CLI


text:
new objects are automaticlly locking together
I am on a layer, I make a dup object, it gets locked to the original one. I do it again, I make an object, then a brand new one to size it smaller to put it inside of it instead, as soon as it touches it they become one object, stuck together. put a different object in to see what that would do ,as soon as I put it in contact with the first object it to is now locked together, I tried using 'U' on the duplicate object "shift D" it did not separate them either.
layer 10 on the first set of layers,

The objects move together as you have proportional editing enabled. They snap together from the snapping settings

thanks, I knew it had to be something simple, just didn't know what. thanks again, now I can move on with this. @sambler


text:
Antimation-how to make object visible then invisible
I am creating a small antimation, where I need a few objects. One which is text to appear then disappear, and one object to disappear at a given frame setting(s).
I know the eye button in the outliner can do this, but how do I work that in using key frames?

which renderer are you using ? Here it is matter of setting nodes with a mix shader (your shader and transparency) and the factor of the mix shader is frame driven

related: http://blender.stackexchange.com/questions/38373/how-to-copy-animation-attributes-to-multiple-objects/

Cycles render (of course ;) )

If you want it to fade in and out you will need to keyframe the alpha.  If you just want it to disappear abruptly then keyframe the hide_render property (which looks like an old-school reel film movie camera) which is different from the hide property (eyeball) as is discussed in the two answers.

na mine is just appering and disapeering no fades --- :D

In Blender Internal you may achieve it keyframing the alpha transparency values. E.g. in frame 1 hover the cursor over the Alpha slider with the value set to 1.000 and press I to keyframe it. Then go to frame 2, change the alpha value to 0.000 and keyframe it again.

In Cycles you can keyframe the Fac value of the Mix Shader (which mixes your shader with Transparent shader).

OK I'm doing the Nodes for cycles, How do you reset the I when it goes wrong to fix it, and how do you get rid of it all together and start over. I have my dope sheet up but do Not know how to delete just the ones attaced to one object without deleteing everything within the dope sheet.

Hover your cursor over the Fac slider of the Mix Shader, then RMB--> Delete/Replace Keyframe to remove/change a single one or Clear Keyframes to start over. You can adjust the periods between keyframes using a Dope Sheet Editor. Making the spacing between keyframes bigger allows you to fade the object out.

thank you... I was getting into the habbit of box select delete all of the keyframes in dope editor but when I got to more than one objecct it was getting rediculious .. thanks

Lets say you want to make something appear in frame ten and then dissappear at frame 20. At frame 0 go to outliner and click camera icon (eye only hide things from 3D view, not from render) and press "I" while hovering still over the camera icon and you see that it create keyframe for it. Now go to frame 10 and click camera icon again to make it visible on render and while hovering over press "I" again to make keyframe... at frame 20 do same that you did in frame 0. I have used to make keyframes for both, eye icon and camera icon, so same things would happen also in rendered view and in 3D view.


text:
Limit the selection to the visible object (in object mode)
If I have one object hidden behind another, clicking the visible one multiple times in Object mode alternates the selection between the two. Is it possible to turn this behaviour off, and make the selection stick to the visible object regardless of how many times I click it, similar to Limit selection to visible in Edit mode?

This is expected and useful I might add behavior, I don't think it can be altered. Really helpful when you have a cluttered scene as you can purposely click the same object several times to pick something behind or nearby.

You can also hold down alt to get a menu of objects to select, but I don't believe you can disable the cycle through objects behaviour.

I also think this is a strange request, since the current behavior got its advantages. I don't understand why you want to click many times to select it, or at least you can give a spcific example here.

You're talking about this button in edit mode?

No, I don't think there's an object mode equivalent. I don't see how it would be very useful, however, what's the problem?


text:
Python : Change cursor icon
in my add on, every execution of my operator, I change my icon cursor. (see code)
I have to repeat these two lines of code in all operators or there is a solution to change icon when an operator is running?
def execute(self,context):
    bpy.context.window.cursor_set("WAIT")
    ....
    My code
    .....

    bpy.context.window.cursor_set("DEFAULT")
    return {'FINISHED'}

Tested it with time module: bpy.context.window.cursor_set("WAIT") time.sleep(5) bpy.context.window.cursor_set("DEFAULT") Code works. What is your issue?

yes the code works perfectly.
my question is this:
If I have 10 operators, I have to put this code in each operator?

You could probably write a decorator function if you find yourself writing repetitive code like that, but this is more like a stackoverflow general python question then..

Using a decorator in an Operator class. Notice the repeating code is defined once in the decorator and any* function which you want to wrap that code around can be decorated with the @mouse_change
import bpy
import time

# declare the decorator
def mouse_change(func):
    def add_mouse_change(*args):
        bpy.context.window.cursor_set("WAIT")
        func(*args)
        bpy.context.window.cursor_set("DEFAULT")
    return add_mouse_change

class SimpleCBOperator(bpy.types.Operator):
    bl_idname = "node.some_callback_identifier"
    bl_label = "Short Name"

    fn_name = bpy.props.StringProperty(default='')

    @mouse_change
    def dispatch(self, context, type_op):

        if type_op == 'some_named_function':
            time.sleep( 5 )
            print(type_op)

        elif type_op == 'some_named_other_function':
            time.sleep( 5 )
            print(type_op)

    def execute(self, context):
        self.dispatch(context, self.fn_name)
        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.node.some_callback_identifier(fn_name='some_named_function')

*The way I wrote the decorator function won't let you decorate the execute function.
you would have less code, and arguably more understandable code, by dropping the decorator entirely and going with a dispatch-callback pattern..
class SimpleCBOperator(bpy.types.Operator):
    bl_idname = "node.some_callback_identifier"
    bl_label = "Short Name"

    fn_name = bpy.props.StringProperty(default='')

    def dispatch(self, context, type_op):
        cursor_set = bpy.context.window.cursor_set
        cursor_set("WAIT")

        if type_op == 'some_named_function':
            pass

        elif type_op == 'some_named_other_function':
            pass

        cursor_set("DEFAULT")

    def execute(self, context):
        self.dispatch(context, self.fn_name)
        return {'FINISHED'}

The drawback of using a single operator 'callback' with an internal dispatch, is that the tooltip wouldn't be unique per fn_name. These are at least a few options to look into.


text:
How to bake uv map texture to vertex color (selected to active)?
I have two mesh ! One mesh textured and one mesh no textured. How to bake uv map texture to vertex color (selected to active) ?

Could you explain in which way "Selected to active" and "Bake to vertex color" options don't work in your case?

I don't know if this is exactly what you want, but maybe these steps can help you (do a backup before doing anything!):

Do UV mapping and apply texture to your object.
Apply Dynamic Paint to your object.
We will transfer that Texture color information into Vertex Colors. And this is how you do it. Under Dynamic Paint attribute:

Once you done that, you hit Apply under Modifier to complete the bake of Vertex Color into the Vertex.
Now you will have an object with Vertex Color that originated from UV Texture.

I got it from this link: link
Go ahead to the section "Bake texture as vertex color". It's the same as i posted plus some other maybe useful information.

Have you tried it? I applied the dynamic paint modifier in blender internal mode, and the color isn't applied.

Also, do you happen to know how to export vertex colors as a json/txt/ply/obj. I just tried exporting to .ply, and the vertex color are all 255,255,255.


text:
Export stereo camera .chan
How to export a stereo camera in .chan file format ?
I use a option Stereo 3D in RenderLayer pannel. I can't switch camera left or right for export. There is not option in export settings. Do you have a trick ?

Never seen a stereo .chan file. Can you post an example?

i would like a .chan for the left camera and a other .chan file for the right. The objective is import two .chan files in Nuke. Below an example : https://dl.dropboxusercontent.com/u/4721466/BLENDER/StereoTest.blend

I don't select the left and right camera because this is a same object.

UP ! I don't find solution. I can't apply "Cameras"  button. Even with bake, i have a single object. Nobody have a trick ?


text:
should a "lamp" object ever be used in cycle?
Friendly greetings !
So, i'm kind of a beginner in blender. Used it for many many year (since before v1.0) but on an extremely irregular basis. (a few times a year)
When cycle came out i assumed that every light should be an object with an emissive shader. Make sense, right ?
Now i realize it's actually :

possible
may not be totally stupid

... to use a "light" object (point, sun, spot, hemi, area). Or is it ?

What are the pro and con of using a light object when using cycle ? when/why do you use it if you do ?

rendering speed ?
temporary placeholder ?
debugging lightning ?
firefly/noise ?
easier "light modeling" ? (eg : spot shape (blend/size))
accuracy/realism ?

Thank you <3

Also related https://blender.stackexchange.com/a/89665/29586 for showing benefits of lamp compared to emissive mesh.


text:
Can the UV map be updated without unwrapping the mesh?
I am modifying a pre-made armor mesh. The armor has some holes in it that I would really like gone. So I deleted the faces with the holes and replaced them with new faces. The problem is that the UV map does not add the new faces, so the new faces are not being textured with the rest of the armor. I know I can unwrap the new section, then patch the UV map manually, but I would prefer a more automatic way since it would probably look a bit better.
Here are the holes I don't want in the mesh.

Here is the mesh after I replaced the old faces, and used unwrap on the new ones.

I am pretty new to Blender and I am using an outdated version, but any advise would be greatly appreciated. Thank you.

You wrote ....  I am using an outdated version ....... Please use a reasonably new version in the future. Its probabaly an unnecessary situation for you and the reader.  If you state your reasons for using an outdated version I feel confident someone can convince you to do otherwise.

Well, I'm using Blender exclusively for modding armors for Fallout 3/New Vegas. Apparently the Import/Export options only work reliably with older versions of Blender/Nif scripts/PyFFI/Python/Nifskope. I could probably get the new versions to work, but I don't really feel the need mess with it at this point. So I guess I am stuck with it for now.

First select the original UVs and pin using P shortcut and enable Live Unwrap
Then in the UV/Image Editor move one of the vertices of the new created faces and it should snap the faces in the right position.