text:
How to generate texture image for home interior and how to use it in OpenGL ES?
I designed a home interior and it includes wooden floor also. I used the UV/Image Editor to generate images to draw home interior in Open GLES but I failed to generate the image.
Another problem is that the Texture Coordinate array is not complete, that means many numbers of the coordinates are not available in the array it only shows comma separated blank spaces(using obj2opengl.pl to generate the array). I added an example image, I have to generate images like this.

Did you enable the options for exporting UVs described here: http://blender.stackexchange.com/questions/121/how-do-i-export-a-model-to-obj-format ?

yes have enabled all these options.my file having this problem.
float Hall33TexCoords [] = {
// f 2/1/1 4/2/1 3/3/1
0.983474, 0.671719,
0.122201, 0.240328,
0.020922, 0.302471,
// f 1102/1101/276 1104/1102/276 1103/1103/276
0.983474, 0.671719,
0.122201, 0.240328,
0.020922, 0.302471,
// f 1101/1104/276 1102/1101/276 1103/1103/276
0.882195, 0.733862,
0.983474, 0.671719,
0.020922, 0.302471,
// f 1105//277 1106//277 1108//277
, ,
, ,
, ,
// f 1107//278 1108//278 1110//278
, ,
, ,
, ,
}

some coordinates are blank spaces with comma

Could you add a part of the .obj file? Just to see Blender export is correct, when the obj2opengl script omits the values it would be off-topic here.

yes, i can but which part i have to add .obj file is too big.

You could upload the blend here: pasteall.org/blend/ or look into the file and post the part which coresponds to the snippet from your comment above.

I uploaded .blend on http://pasteall.org/blend/29990 .
i textured only floor, not walls and ceiling, so is this the reason for uncompleted TexCoords array?

Blender exports the .obj file correctly I can't see a reason why empty values ",,,," are written in the converted file.
mtllib Musium.mtl
o Plane.275_Plane.229
v 138.827621 -14.357000 -71.175812
v 145.607269 -14.357000 -71.175812
v 138.827621 -14.357000 -123.266418
v 145.607269 -14.357000 -123.266418
vt 0.882195 0.266138
vt 0.983474 0.328281
vt 0.122201 0.759672
vt 0.020922 0.697529

It seems to be a bug/issue in the obj2opengl.pl converter possible it expects optional values which do not occur and therefore it writes empty values (between the commas).
I would recommend to write your own exporter, to get started you could use the code I posted here: How do we access Vert, Norm and UV data then print to a text file using Blender/Python?

Thanks, but how can get final image for complete designed object, like example image which added in question. I am beginner and really i don't know how to this.

This can be done by texture painting or cloning (e.g. images) into a single texture this should be another question (needs space to explain).

Hello sir, I solve the problem of blank spaces, Thanks for your support.


text:
How can I get a particular editor space in python?
Right now, to set the current action before rendering, I am doing this to find the dopesheet editor space:
dope_sheet = None
for space in bpy.context.area.spaces:
    if space.type == 'DOPESHEET_EDITOR':
        dope_sheet = space
        break
else
    print('CANNOT FIND DOPESHEET_EDITOR IN bpy.context.area.spaces!!!')
    return

Is there some easier way to get the dopesheet editor than searching spaces for it?

Your code doesn't seem right, it should be
import bpy

for area in bpy.context.screen.areas:
    if area.type == 'DOPESHEET_EDITOR':
        space_data = area.spaces.active
        break
else:
    space_data = None

if space_data is not None:
    pass

To avoid searching for the right area (which may or may not exist in current screen layout), it's possible to change bpy.context.area.type temporarily to the type you require.
However, I'm pretty sure what you actually want to do is:
bpy.context.object.animation_data.action = bpy.data.actions['The Name']

When I iterate over area in bpy.context.sceen.areas, I don't find a dopesheet editor if there isn't one currently on screen.  When I iterate over bpy.context.area.spaces, I am finding a dopesheet editor regardless of this, but maybe something else is wrong with it?

I do want to apply the animation to everything, not just the active object (isn't that what bpy.context.object.animation_data.action = bpy.data.actions['The Name'] would do?)

I'm not confident of the reliability of iterating spaces, because there is usually just one when I run some test code (mostly active space only, so of the editor type the cursor is over). My above code tells Blender to use the specified action for the context object (could be any object). It looked to me as though it's identical to setting the action in the dopesheet editor space, but I could be mistaken. Nonetheless, you could iterate all objects and assign that action if that is what you want.

source: Stack Exchange

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

sort: votes


text:
Custom operator to toggle lamp energy not working
I wrote this simple python script for Blender 2.69, which creates a new operator. The operator is supposed to change the energy for four lamps in the scene (essentially switching them off and on again). However, while the script runs fine and creates the operator itself, when I select the operator, it has no effect on the lamps' energy.
Entire script:
import bpy

def main(context):
    for ob in context.scene.objects:
        print(ob)

class LightsOperator(bpy.types.Operator):

    bl_idname = "object.lights_operator"
    bl_label = "Headlight Operator"

@classmethod
def poll(cls, context):
    return context.active_object is not None

def execute(self, context):

    if bpy.data.objects['headlight1'].energy==0.0:
        bpy.data.objects['headlight1'].energy = 0.8
    else:
        bpy.data.objects['headlight1'].energy = 0.0

    if bpy.data.objects['headlight2'].energy==0.0:
        bpy.data.objects['headlight2'].energy = 0.8
    else:
        bpy.data.objects['headlight2'].energy = 0.0

    if bpy.data.objects['headlight3'].energy==0.0:
        bpy.data.objects['headlight3'].energy = 0.8
    else:
        bpy.data.objects['headlight3'].energy = 0.0

    if bpy.data.objects['headlight4'].energy==0.0:
        bpy.data.objects['headlight4'].energy = 0.8
    else:
        bpy.data.objects['headlight4'].energy = 0.0

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.lights_operator()

Could it be that the poll and execute methods are not inside the class? Make sure that you indent them correctly

Here is a variation of the script that works on all lamp objects with their name (ob.data.name! ) starting with "headlight" (case insensitive):
import bpy

class LightsOperator(bpy.types.Operator):
    bl_idname = "object.lights_operator"
    bl_label = "Headlight Operator"

    def execute(self, context):

        for ob in context.scene.objects:
            if not ob.type == 'LAMP':
                continue
            lamp = ob.data
            if lamp.name.lower().startswith("headlight"):
                lamp.energy = 0.0 if lamp.energy >= 0.8 else 0.8

        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.lights_operator()

Note that it toggles the lights between 0.0 and 0.8, no matter what the initial value is. If you want to toggle only those with a specific energy, keep rounding errors in mind - it isn't really 0.8 unless you round(lamp.energy, 1):
>>> lamp.energy = 0.8

>>> lamp.energy == 0.8
False

>>> lamp.energy
0.800000011920929

>>> round(lamp.energy, 1)
0.8

Objects in scripting (bpy.data.objects) are not the same as the Objects you add with ShiftA.
Every scene holds a list (bpy_prop_collection) of objects. Now this is an abstract object that holds information that every object type (Mesh, Lamp, Armature) share - like position in worldspace, modifiers, etc. Here was your error.
Instead of calling bpy.data.objects[name].energy, the correct call is bpy.data.objects[name].data.energy.
Here is an improved version of the script that acts on the currently selected object (as the poll()-method suggests). Call it for every object by first setting context.scene.objects.active and then calling the operator with bpy.ops.object.lights_operator:
import bpy

def main(context):
    for ob in context.scene.objects:
        print(ob)

class LightsOperator(bpy.types.Operator):
    """Doc"""
    bl_idname = "object.lights_operator"
    bl_label = "Headlight Operator"

    # these two methods belong to the class, not global space
    @classmethod
    def poll(cls, context):
        # can also use context.object instead of context.active_object
        return context.object is not None

    def execute(self, context):
        # get the object
        obj = context.object

        # check if it is a lamp
        if not obj.type == 'LAMP':
            return {'CANCELLED'}

        # now this is an abstraction by Blender. Every scene
        # has objects. Those objects contain the data (mesh,
        # curve, and LAMPS). So to access the data of the
        # lamp we do
        lamp = obj.data

        if lamp.energy == 0:
            lamp.energy = 0.8
        else:
            lamp.energy = 0

        return {'FINISHED'}

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

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

if __name__ == "__main__":
    register()

    # test call
    bpy.ops.object.lights_operator()

The original indentation was just a result of copy+pasting. But to just make sure, I copy+pasted your indented script, and it just returns a "Python script fail". Typing directly into the console gives me a whole bunch of "unexpected indent"s.

It may give a "Python script fail" if the following objects are not in the current scene: 'headlight1', 'headlight2', 'headlight3', 'headlight4'. Check if there are four lamps with exactly thos names (yes capitalization matters). I know that it gives an error when run in the console. I'll update so that you can run it from console.

Yep those exact names are definitely there :)

Okay the script is updated and should now work as described above

Thanks for your help but the new script still doesn't work. :(

Strange, because it does for me... can you come into http://chat.stackexchange.com/rooms/8888/the-renderfarm?

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


text:
Can I fix the alpha display problems on material viewport on new Blender 2.73?
I'm making a Low poly model for videogame, but I got some problems on displaying 8bit alpha (partialy tranparent pixels) in material viewport in Blender 2.72b. Now in Blender 2.73a some of these bugs was fixed, that was great, but some other appeared too.

As you can see, the partially transparent pixels from the plane with a round ring texture of the goggles are clipping through the red lens that are right behind it.
This bug doesn't occur while in edit mode. And this didn't happen in 2.72b.
And in the Left view (3rd frame), the light wire from his exoskeleton clip through the other wire from the other leg. But not viewing from the right view (4th frame).
and these occurs no mater the backface/normal direction.
Of course none of these bugs are shown on render. But i was worried about porting these models for a game engine like Unity and get the same problems.
Do I need to worry about this on viewport? If yes. Is there a way to fix it?

The second part of my answer to this question might be related.

Do I need to worry about this on viewport?

No, I don't think so. The external game engine will be using it's own rendering pipeline, so any problems with the rendering then will be a separate and unrelated issue (with the possible exception of a problem with the data itself, e.g. double faces resulting in Z fighting etc. However this doesn't seem like the case here).

Is there a way to fix it?

Try enabling Transparent in Properties > Object > Display on all the objects with transparency.

@ganfal3 : The other guy maddin45 on comments section helped a lot. Now I know that's because the "z-culling". and there's no way to fix it on blender viewport, I'll just leave the to worry about z-culling on game engine.
Thanks a lot!


text:
How to set Import Units when importing a collada file with python script?
Blender shows the python command in the tooltip, for example, hover the mouse over File > Import > Collada (Default) (.dae), it shows:

Load a Collada file
  Python: bpy.ops.wm.collada_import()

Then I can find the bpy.ops.wm.collada_import() command in the script console.
I want to set the Import Units to True before I import the collada file, hover the mouse over the ticker it says

Python: WM_OT_collada_import.import_units

But I can't find any clue on how to use this piece of code.

WM_OT_collada_import is the bl_idname of the Collada Import Operator in the C-code notation (in Python it's wm.collada_import, but the importer is a C operator).
import_units is an operator property.
If you want to set this property to True in an operator call, give it a keyword-argument:
bpy.ops.wm.collada_import(filepath=..., import_units=True)

I have checked the signature of the python api method bpy.ops.wm.collada_import() but didn't see the import_units=True option. However your solution works like a charm, many thanks to your help!


text:
Remove Target Object reference from constraint with python
I know how to set a constraint target via Python:
ob = bpy.data.objects["RightArmIKDataPoint"]
bpy.data.objects["MySkeleton"].pose.bones["RightArmIK"].constraints["MocapHook"].target = ob

However, I do not know how to unset this. I don't know what set the target to to be empty.

Simply set the the target property to None to clear the target field.
So in your example it would be:
...constraints["MocapHook"].target = None

authors: Дмитрий Дибров


text:
Having repeating problems with hotkeys and mouse controls, how can I fix them?
Over the past few weeks, shortly before 2.7 and during 2.7, I've been having trouble with various hotkeys and mouse controls.
Occasionally,

LMB will not grab a transform axis to manipulate objects, but it will only relocate the 3D Cursor.
Numpad controls go from changing view to switching layers.
Many other controls, such as Ctrl+ and Ctrl- for growing and shrinking selections, refuse to work or work differently unless I press or hold the Esc key first.

The interesting thing is that this doesn't happen constantly.  When I start a session of modeling, controls work normally, but at some random point during the session the controls will flip over to what I described above.

ESC Required
One possibility would be that you've accidentally activated a selection or an operator awaiting further input?
In this case the Header of your 3D View might change to something like:

Example for Knife Tool
ESC would cancel such operations.
Possible Solution
On Windows you can have different keyboard layouts and switch between them by pressing Left Alt-Shift which happens very easy when using Blender.
If this is the reason change the Hotkeys in Windows: Control panel / Region & Languages / Keyboard & languages / Change keyboard / Advanced key setting
Numeric Input
On my machine the numeric block is independent from whether or not the NumLock is active it never switches the layers as the normal digits would do. The option Emulate Numpad in the User Preferences / Input would make the main keys 1 to 0 to switch the Views Orientation. But it's never the other way around.

Thanks, stacker.  It happens when I have nothing activated or selected, but doesn't seem to mess anything up when I do have a command active.  I tried the left-alt+shift and didn't see any change.  It's very strange.  I also made sure emulate numpad wasn't checked just in case that somehow was messing things up, but it wasn't.  Thanks for your reply, though.


text:
How to set child object world scale using python?
How to set child object world scale using python ?
(With the least amount of math possible)
You can read the value I try to change from:
obj.matrix_world.to_scale()

I want to modify this value to an other. Like obj.matrix_world.ItsScale = (5,6,2)

What do you mean by "world scale"? Along global axes?

Yes  it would be similar to "obj.matrix_world.to_scale() = Vector((5,3,2))"

To set a child's scale to a certain scale in world-space, you can do:
import bpy
from mathutils import Matrix

ob = bpy.context.object # child

nmat = ob.matrix_world.normalized()

target_scale = (2, 2, 2)

smat = Matrix()
for i in range(3):
    smat[i][i] = target_scale[i]

# note: order is important!
ob.matrix_world = nmat * smat

The change in scale will not affect the parent (or grand-parents) in any way. The child's children will do on the other hand.
If you want to change the scale of child and parent, traverse all the way up to the root object (which may be a grand-grand-...-parent) and change its scale:
import bpy
from mathutils import Matrix

ob = bpy.context.object
while ob.parent:
    ob = ob.parent
print("Root object:", ob.name)

ob.scale = (2, 2, 2)

Note that this will affect all children of the root object.
If you want to change scale of root and child1 only...
     root
      /\
     /  \
    /    \
child1  child2

... then it's a bit trickier, because you need to change the scale of the objects you want to exclude (they are affected by root). Here's a script that can be configured to ~~~set the selected object to the given target scale~~~ (I think it actually changes objects proportionally to the local scale, and fails if non-uniform scaling is involved), while preserving object locations:
import bpy
from mathutils import Matrix

ob = bpy.context.object
start = ob
orig_scale = start.scale
target_scale = (2, 2, 2)
target_factor = tuple(map(lambda a, b: a / b, target_scale, orig_scale))

visited = [start]
while ob.parent:
    ob = ob.parent
    visited.append(ob)
root = ob

orig_loc = {}
def store_loc_recursive(obs):
    for ob in obs:
        orig_loc[ob.name] = ob.matrix_world.to_translation()
        if ob.children:
            store_loc_recursive(ob.children)
store_loc_recursive(root.children)

other = []
other.extend(start.children)

for child in root.children:
    if child not in visited and child not in other:
        other.append(child)

root.scale = tuple(map(lambda a,b: a * b, root.scale, target_factor))

for ob in other:
    ob.scale = tuple(map(lambda a, b: a / b, ob.scale, target_factor))

bpy.context.scene.update()

def restore_loc_recursive(obs):
    for ob in obs:
        ob.matrix_world.translation = orig_loc[ob.name]
        if ob.children:
            restore_loc_recursive(ob.children)
restore_loc_recursive(root.children)

Note that the scale property of the selected object will not change. Thus, repetitive runs will grow all objects on the path from selected to root more and more. Nonetheless, the change in scale is correct - if you started at dimensions (1,1,1) and set a target scale of (2,2,2) in the script, then all objects from selected up to root will be doubled in size.
A better approach might be to un-parent temporarily, apply scale changes, then re-parent. But I noticed that even Blender's built-in Clear Parent (Keep Transform) fails to preserve non-uniformly scaled objects...

You can use a recursive function to find all the parents an object has, then multiply the object's matrix by all of the parents' matrices, then get the scale:
import bpy

def get_parents( o, parents ):
    if o.parent:
        parents.append( o.parent )
        get_parents( o.parent, parents )

    return parents

o = bpy.context.object
parents = get_parents( o, [] )

# Calc cumulative matrix:
global_matrix = o.matrix_world
for p in parents: global_matrix *= p.matrix_world

global_scale     = global_matrix.to_scale()
new_global_scale = ( 5, 7, 9 )

scale_ratio = [ ng / g for ng, g in zip( new_global_scale, global_scale  ) ]

o.scale = [ axis * ratio for axis, ratio in zip( o.scale, scale_ratio ) ]

Perhaps I expressed myself poorly. But I'm not looking for the "global_matrix". I  want to modify his value to an other. Like global_matrix.scale = (5,6,2)

@IssanouKamardineIK, well that's easy. Once you have the global matrix scale, you can update the object's scale to reflect the desired global scale by finding the ratio between the current and desired global scale (updated my code above to reflect this)

nice ! but in my case it works better without this line # for p in parents: global_matrix *= p.matrix_world

This means you're not taking into account the parent objects' scale though

Looks overly complicated give that my script (first code block) appears to work too? Please test if mine it behaves the same in more complex setups!

The simpler way is to set the scale property of the object :
obj.scale = Vector((1., 1., 1.))

Dont forget that the obj is a child and the parent scale will change. parent scale will not change "obj.scale". So "obj.scale" will not corresponding to the obj.matrix_world "scale".
word scale not = to local scale (obj.scale)

Please be more explicit. What is the difference between local and world scale to you ?

"obj.matrix_world.to_scale()"  this is global. And
"obj.scale"  is local when obj is a child

Maybe you could try something like (parent.matrix_world * child.matrix_world).to_scale() ? Is that what you need ?


text:
Applying modifiers in a script
I've seen a couple of good examples of creating modifiers and applying them to objects, but they don't seem to be working for me. Or at least are only working part way.
My function takes a modifier type (in my test case, 'UNION') and a list of objects. The first object is the target and the rest are going to be the modifications.
When this executes, my target still has the stack of modifiers attached to it. I have to manually push the Apply button in the UI for each one. How can I make that happen in my script?
def applyModifier (self, mod, items):
    target = items[0]
    for i in range(1, len(items)):
        objB = items[i]
        boo = target.modifiers.new('Booh', 'BOOLEAN')
        boo.object = objB
        boo.operation = mod
        bpy.ops.object.modifier_apply(apply_as='DATA', modifier="Booh")
        bpy.context.scene.objects.unlink(objB)
    return target

The subordinate objects do unlink from the scene, so I know that bit of code is executing properly.

Have a look at Object.to_mesh(): http://www.blender.org/documentation/blender_python_api_2_71_release/bpy.types.Object.html?highlight=to_mesh#bpy.types.Object.to_mesh If you want to apply all modifiers, then it's probably the better way. Nonetheless, bpy.ops can be the better (or only) choice in certain use cases.

That one looks interesting, too. I'll give it a shot. One of the frustrations with Blender seems to be that there are multiple ways of accomplishing things, but the advantages and disadvantages aren't always clear.

Since you're using something from bpy.ops, you need to get the editor state right (this is the failing of most of bpy.ops).
You probably need to set bpy.context.scene.objects.active = target
and in 2.8+
context.view_layer.objects.active = target

Is there a way to avoid bpy.ops to apply a modifier?

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


text:
Create a smooth, well rounded aircraft nose (with a low poly constraint)
What's the best way/method to get a smooth, well-rounded aircraft nose-cone without a lot of space to create a gradual curve, or by adding tonnes of mesh?
My main problem is that I either end up with a point on the nose (if I scale the end cap wayy down), or, I'm left with a flat surface for the nose tip.  This is for a game, so I can't use subsurface (the nose looks superb when I do that BTW. I wish there was a way to apply subsurface to selections only! -- but that's a rant for another day ;)
I've tried:
a) adding a capsule primitive and using just the rounded cap-end to then bridge to the fuselage loop. But because the nose profile is a bit oblong and rotated downward on the z axis, that makes aligning the cap-mesh addition with the existing fuselage loop vertices impossible for a flowing line and light topology.
b) Adding a bunch of loops to cause the final fall off to be gradual, but while that solved the curve issue a bit, I just then added a lot of mesh, and in the end I still have a flat nose-end-point anyway!
I'm also constrained by the aircraft nose profile -- see the image. I essentially have just the short distance you see in the image between the last 2 loops to create a well rounded shape.
Here is what the nose looks like at this time:

Ideas?
Thanks!!

I'd reduce the number of vertices in the loops and spend more on areas where they contribute to the shape of the silhouette, e.g. the round nose. Generally it'd be a good idea to create a high poly model first which allows you to bake a normal map for the low poly. This way you can get plenty of detail even though you're not using actual geometry in that area

What do you mean by "lowpoly"? What are the constraints in terms of vertices/faces?

I don't know whether this is lo-poly enough for you.. there's a similar number of edges around the cone, (quite hi-poly, in my book)

Assuming an even number of vertices in the circumference:

Cut off  the tip to your second line, select the perimeter of the hole
CtrlF Face menu > 'Grid Fill', adjust spans and offset.
with O Proportional Editing on,smooth, bring out the central vertex
In vertex mode, Vertex menu > 'Smooth vertices', on a larger region of the nose

This way, you might have to model the part with the Mirror modifier applied.. it is symmetrical, though, so you can slice it in half and stick it back.

You could try making the curve exactly as you want with no polygon restrictions and then using the decimate modifier to simplify the mesh. It will also save a lot of polygons to make the very tip of a simple shape, not a circle. It would reduce a lot of polys in the first segment of the cone.
Also, I can't tell from the image if you have already done this, you can have even less polygons and use shade smooth.

The problem with using the Decimate option is that it applies the modifier to the whole model and not just the selected nose part (needs to be in Object mode -- unless I'm doing something incorrectly?) And I don't quite understand what you meant by making the tip into a "simple shape" ?? .. as in collapse everything into a single vertex? (then I get a bunch of tri's. Clarify please?
And @rjg ... yep, I plan to bake to a low poly version.
My option now is to just use brute force to add extra loops needed to create the desired. I had just hoped there was an easier way :)

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


text:
AO bakes then disappears at the end of the baking cycle
This is not a question about Black AO or no AO. I'm posting a resolution for a somewhat unique problem (?) I had where my AO bake proceeded normally, but then simply disappeared at the end of the bake cycle.
Sharing my root cause in case someone sees the same issue (can't believe I'm the only one :))
This assumes that you are doing all the right things in terms of setting up the image in the ShaderEditor, Normals are good, no hidden objects blah blah -- lots of posts on those checklist items, so won't repeat.
My repro case:

A collection with many objects
Bake AO
You should see the bake progressing normally...AO being baked to the image
At the end of the cycle the AO that you could see in the image, simply disappears
No errors
Result: blank no-more-AO image!

The cause:  Its hidden object related, but not actually one hidden.
One of my objects was in fact, not an object at all.
At some point, I must have deleted the objects vertices, so there is no more mesh, but I did not delete the actual Object in the outliner itself. After I removed the object from the render (camera icon), the bake then "stayed"!
I figured this out through a process of elimination which took a looong time (the dang object was one of the last objects in my collection list :)), but a faster way to do this AND PERHAPS this is where someone can add a better method) was to go into object mode, and click though each object in the list in that collection to make sure you can actually "see" that is has Mesh (and not just an origin point) in the viewport!!
Hope this helps.

Are you sure that it's blanking the AO image, and not just changing the actively selected image in the image editor at the end of the bake?

Pretty sure that's not happening for 2 reasons: 1) I have only one image Texture I'm baking AO to in the material (just a BSDF and the image texture -- nothing complicated), so not sure what you mean by "changing the actively selected image" ?.. but more importantly 2) if the ONLY thing I do is to unselect that no-mesh object from the render, the AO bakes completes. If its included, then I see the behavior described (can see baking happening, but then AO disappears to be replaced with just Black).

I would have to see a file to see if I could reproduce the problem.  Set up so I just hit bake to reproduce it.


text:
Is a large UV map heavy on performance while playing?
I have a very large UV map for a house of mine. Due to the nature of the shingles being single duplicated objects, I have quite a giant UV map when exporting and importing for Unreal Engine 4. Does the giant UV map have an effect on performance at all when playing? Or does it only matter when the lighting is being built?

A UV map is a set of coordinates representing the vertices of a mesh in 2D space. It is not usual to talk about it in terms of 'large' or 'small' as its size/density mostly depends on the size/density of the mesh. You should generally not care about resources used by UVMaps. The size of textures (like lightmaps) or the resolution of the whole mesh are usually the things you should worry about.


text:
Is it possible to execute two functions on a Pie button via an additional key pressed?
The mesh hide has two options, hide selected or hide non selected.
So you need two buttons, but could it be possible to simply call the pie menu and then with an addition button pressed lets say RMB execute the other options?
this would be like this:
Shift+Alt+ RMB calls the Pie menu
LMB executes hide selected
MBB executes hide unselected

I've found an answer on this, but it still need some coding
Standard Pie Menu looks like this:
class PieMenuClass(Menu):
    bl_idname = "pie.pie_menu_class"
    bl_label = ""

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        pie.operator("mesh.subdivide", text="Subdivide")
        ...

This Pie adds a subdivide operator. Let's say we add more two options - unsubdivide while holding "Shift" and Smooth subdivide with CTRL pressed.
First add register!!! =)  one more class:
class MYSubdivide(Operator):
    bl_idname = "class.my_subdivide"
    bl_label = "Ctrl - unsubdivide, Shift - Smooth"

    def invoke(self,context,event):
        if event.shift:
            bpy.ops.mesh.subdivide(smoothness = 1)
        elif event.alt:
            bpy.ops.mesh.unsubdivide()
        elif event.ctrl:
                bpy.ops.mesh.subdivide_edgering(number_cuts =1)
        else:
            bpy.ops.mesh.subdivide()

        return {'FINISHED'}

First declaration then changed to call this class:
class PieMenuClass(Menu):
    bl_idname = "pie.pie_menu_class"
    bl_label = ""

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        pie.operator("class.my_subdivide", text="Subdivide")

The only problem is that after using this method it's impossible for me to use REDO LAST function F6 ==((  steel need a solution.

see this https://blender.stackexchange.com/questions/23998/python-ctrlclick-for-buttons-capture-invocation-event

and this https://docs.blender.org/api/blender_python_api_2_73a_release/bpy.types.Event.html


text:
Is it possible to remain in Pie menu after clicking a check box?
Everytime you click a checkbox in a Pie menu or use a slider the Pie menu goes away and you have to call it again.
Is there a way remain in it?


text:
what makes a Pie menu stay or instantly go away when releasing mouse and keys?
I encounter the issue that in my pie the RMB Pie stays open when releasing keys and mouse while the LMB Pie closes instantly I release a key or mouse buttong.
I have no idea what triggers this.
Anybody could give me a tip?
I added my Pie code here:
bl_info = {
    "name": "Claas_Pie_Menus",
    "author": "Claas Eicke Kuhnen",
    "version": (0, 2, 0),
    "blender": (2, 73, 1),
    "description": "Custom Pie Menus",
    "category": "3D View",}

import bpy, os
from bpy.types import Menu, Header
from bpy.props import IntProperty, FloatProperty, BoolProperty
import bmesh
from mathutils import *
import math
from bpy.types import Menu, Panel, UIList

#################
#    Commands   #
#################

#Calculate Normal Mesh
class CalculateNormal(bpy.types.Operator):
    bl_idname = "calculate.normal"
    bl_label = "Calculate Normal"
    bl_options = {'REGISTER', 'UNDO'}

    def execute(self, context):
        if context.active_object:
            if(context.mode == 'EDIT_MESH'):
                bpy.ops.mesh.select_all(action = 'SELECT')
                bpy.ops.mesh.normals_make_consistent(inside=False)
                bpy.ops.mesh.select_all(action = 'DESELECT')
            else:
                bpy.ops.object.editmode_toggle()
                bpy.ops.mesh.select_all(action = 'SELECT')
                bpy.ops.mesh.normals_make_consistent(inside=False)
                bpy.ops.mesh.select_all(action = 'DESELECT')
                bpy.ops.object.editmode_toggle()
        return {'FINISHED'}

#Set Origin to 3D cursor
class SetOrigin(bpy.types.Operator):
    bl_idname = "set.origin"
    bl_label = "Set Mesh Origin"
    bl_options = {'REGISTER'}

    def execute(self, context):
        if bpy.context.mode != 'EDIT_MESH':
            bpy.ops.object.editmode_toggle()
            return{'FINISHED'}
        bpy.ops.view3d.snap_cursor_to_selected()
        bpy.ops.object.editmode_toggle()
        bpy.ops.object.origin_set(type='ORIGIN_CURSOR')
        bpy.ops.object.editmode_toggle()
        return{'FINISHED'}

######################
#     Pie Menus      #
######################

# Pie RMB Viewport Shading
class PieRMB(Menu):
    bl_idname = "pie.rmb"
    bl_label = "Viewport Shading "

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        if context.active_object:
            if(context.mode == 'EDIT_MESH'):

                mesh = context.active_object.data
                scene = context.scene
                #4
                f = pie.operator("wm.context_set_enum", icon='WIRE', text='Wires')
                f.data_path='space_data.viewport_shade'
                f.value = 'WIREFRAME'
                #6
                pie.operator("mesh.reveal", text="Show Mesh")
                #2
                box = pie.split().box().column()
                row = box.row()
                box.operator("MESH_OT_faces_shade_smooth", text="Mesh Smooth")
                box.operator("MESH_OT_faces_shade_flat", text="Mesh Flat")
                box.separator()
                box.operator("calculate.normal")
                box.operator("mesh.flip_normals")
                box.separator()
                row = box.row()
                row.prop(mesh, "show_normal_face", text="Face Normal", icon='FACESEL')
                row.prop(scene.tool_settings, "normal_size", text="Size")
                box.separator()
                row = box.row(align=True)
                row.prop(mesh, "show_extra_edge_length", text="Edge Length")
                row.prop(mesh, "show_extra_face_angle", text="Face Angle")
                box.separator()
                row = box.row()
                row.prop(mesh, "use_auto_smooth")
                row.prop(mesh, "auto_smooth_angle", text="Angle")
                #8
                f = pie.operator("wm.context_set_enum", icon='SMOOTH', text='Rendered')
                f.data_path='space_data.viewport_shade'
                f.value = 'RENDERED'
                #7
                f = pie.operator("wm.context_set_enum", icon='SOLID', text='Solid')
                f.data_path='space_data.viewport_shade'
                f.value = 'SOLID'
                #9
                f = pie.operator("wm.context_set_enum", icon='MATERIAL', text='Material')
                f.data_path='space_data.viewport_shade'
                f.value = 'MATERIAL'
                #1
                pie.operator("mesh.hide", text="Hide Mesh Selected").unselected=False
                #box = pie.split().column()
                #row = box.row()
                #box.operator("mesh.hide", text="Hide Mesh Selected").unselected=False
                #box.operator("mesh.hide", text="Hide Mesh Unselected").unselected=True
                #box.operator("mesh.reveal", text="Show Mesh")
                #3
                pie.operator("mesh.hide", text="Hide Mesh Unselected").unselected=True

            else:

                mesh = context.active_object.data
                scene = context.scene

                #4 - LEFT
                f = pie.operator("wm.context_set_enum", icon='WIRE', text='Wires')
                f.data_path='space_data.viewport_shade'
                f.value = 'WIREFRAME'
                #6 - RIGHT
                pie.operator("object.hide_view_clear", text="Show Object")
                #2 - BOTTOM
                box = pie.split().box().column()
                row = box.row()
                box.operator("OBJECT_OT_shade_smooth", text="Object Smooth")
                box.operator("OBJECT_OT_shade_flat", text="Object Flat")
                box.separator()
                box.operator("calculate.normal", text="Calculate Normals")
                box.separator()
                row = box.row()
                row.prop(mesh, "use_auto_smooth")
                row.prop(mesh, "auto_smooth_angle", text="Angle")
                #8 - TOP
                f = pie.operator("wm.context_set_enum", icon='SMOOTH', text='Rendered')
                f.data_path='space_data.viewport_shade'
                f.value = 'RENDERED'
                #7 - TOP - LEFT
                f = pie.operator("wm.context_set_enum", icon='SOLID', text='Solid')
                f.data_path='space_data.viewport_shade'
                f.value = 'SOLID'
                #9 - TOP - RIGHT
                f = pie.operator("wm.context_set_enum", icon='MATERIAL', text='Material')
                f.data_path='space_data.viewport_shade'
                f.value = 'MATERIAL'
                #1 - BOTTOM - LEFT
                pie.operator("object.hide_view_set", text="Hide Object Selected")
                #3 - BOTTOM - RIGHT
                pie.operator("object.hide_view_set", text="Hide Object Unselected").unselected=True

        #4 - LEFT
        #6 - RIGHT
        #2 - BOTTOM
        #8 - TOP
        #7 - TOP - LEFT
        #9 - TOP - RIGHT
        #1 - BOTTOM - LEFT
        #3 - BOTTOM - RIGHT

addon_keymaps = []

class PieLMB(Menu):
    bl_idname = "pie.lmb"
    bl_label = "Edit"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        if(context.mode == 'EDIT_MESH'):

            mesh = context.active_object.data
            scene = context.scene

        #4 - LEFT
            pie.operator("mesh.extrude_region_move", text="Extrude")
        #6 - RIGHT
            pie.operator("mesh.bevel")
        #2 - BOTTOM
            box = pie.split().box().column()
            row = box.row()
            box.operator("mesh.remove_doubles")
            box.operator("mesh.merge", text="Merge")
            box.operator("mesh.knife_tool", text="Knife")
            box.operator("mesh.vert_connect")
            box.operator("mesh.fill_grid", text="Grid Fill")
            box.operator("mesh.inset", text="Insert Face")
            box.operator("mesh.offset_edge_loops_slide", text="Offset LoopCut")
            box.separator()
            box.operator("mesh.intersect_boolean", text="Boolean Union").operation='UNION'
            box.operator("mesh.intersect_boolean", text="Boolean Difference").operation='DIFFERENCE'
            box.operator("mesh.intersect_boolean", text="Boolean Intersect").operation='INTERSECT'
            box.separator()
            box.operator("set.origin", text="Set Origin to 3D Cursor")
        #8 - TOP
            pie.operator("mesh.bridge_edge_loops", text="Bridge")
        #7 - TOP - LEFT
            pie.operator("mesh.edge_face_add", text="Fill")
        #9 - TOP - RIGHT
            pie.operator("mesh.loopcut_slide", text="Loop Cut")
        #1 - BOTTOM - LEFT
            pie.operator("wm.call_menu_pie", text="Edge Menu", icon='PLUS').name = "EdgeMenu"
        #3 - BOTTOM - RIGHT
            pie.operator("screen.redo_last")

        else:

            mesh = context.active_object.data
            scene = context.scene

            pie.operator("object.origin_set").type='ORIGIN_CURSOR'

        #4 - LEFT
        #6 - RIGHT
        #2 - BOTTOM
        #8 - TOP
        #7 - TOP - LEFT
        #9 - TOP - RIGHT
        #1 - BOTTOM - LEFT
        #3 - BOTTOM - RIGHT

addon_keymaps = []

class EdgeMenu(Menu):
    bl_label = "More"

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

        pie = layout.menu_pie()
        #4 - LEFT
        pie.operator("transform.edge_crease", text="Crease Weight")
        #6 - RIGHT
        pie.operator("mesh.mark_sharp", text="Mark Shrap")
        #2 - BOTTOM
        pie.operator("mesh.mark_sharp", text="Clear Sharp").clear=True
        #8 - TOP
        pie.operator("mesh.mark_seam", text="Mark Seam").clear=False
        #7 - TOP - LEFT
        pie.operator("transform.edge_bevelweight", text="Bevel Weight")
        #9 - TOP - RIGHT
        pie.operator("mesh.mark_seam", text="Clear Seam").clear=True
        #1 - BOTTOM - LEFT
        pie = pie.row()
        pie.label('')
        pie = layout.menu_pie()
        #3 - BOTTOM - RIGHT
        pie = pie.row()
        pie.label('')
        pie = layout.menu_pie()
        addon_keymaps = []

def register():
    bpy.utils.register_module(__name__)

# Keympa Config

    wm = bpy.context.window_manager

    if wm.keyconfigs.addon:

        #Viewport Shade
        km = wm.keyconfigs.addon.keymaps.new(name = 'Object Non-modal')
        kmi = km.keymap_items.new('wm.call_menu_pie', "RIGHTMOUSE", "PRESS", shift=True, ctrl=True)
        kmi.properties.name = "pie.rmb"

        addon_keymaps.append(km)

        #Edit
        km = wm.keyconfigs.addon.keymaps.new(name = 'Object Non-modal')
        kmi = km.keymap_items.new('wm.call_menu_pie', "LEFTMOUSE", "PRESS", shift=True, ctrl=True)
        kmi.properties.name = "pie.lmb"

        addon_keymaps.append(km)

# Register / Unregister Classes
def unregister():
    bpy.utils.unregister_module(__name__)

    wm = bpy.context.window_manager

    if wm.keyconfigs.addon:
        for km in addon_keymaps:
            for kmi in km.keymap_items:
                km.keymap_items.remove(kmi)

            wm.keyconfigs.addon.keymaps.remove(km)

    # clear the list
    del addon_keymaps[:]

if __name__ == "__main__":
    register()

Pies have a lifetime and behavior determined by your cursor movements and keyboard events. Pies all behave the same way, however the way you may be using them may be different.
Basic Functions
Tapping: If you tap the key, which is to say you press and release quickly, the pie will stay open until you cancel out or choose an operation. You can move your cursor anywhere you please without making a selection. You may also use the numpad to make a selection (each entry position corresponds to its number position around 5. For example, 8 is top, 4 is left, etc.). Quick selection keys apply, like in the vertical-style menus (mode select pie: O for object mode, E for edit mode, etc.).
Holding: If you hold the key, you can move the cursor in a direction and release the key to select an operation in the pie. As long as you hold the key, you can move your cursor anywhere you please without making a selection. Press RMB or ESC to cancel the pie. Numpad and quick select keys apply here, too.
Special Functions
Holding: While holding, you have a few other options than just to hold and release the key. While holding the key, you may also return the cursor to the starting point, inside the circle at the center of the pie. This will not select any option in the pie. Releasing the key inside the circle to close the pie without making a selection.
Autoselect: The user preferences allow you to enable autoselection, which means the pie will automatically confirm a selection based on the cursor position outside the center circle.

User preferences -> Interface -> Pie Menus -> Confirm Threshold

This setting describes how far away from the center circle your cursor must be before a selection is automatically made. The distance is visually described with a partial circle that follows the cursor. You can still use LMB to confirm and RMB and ESC to cancel. With autoselect enabled, you are still able to tap the key to open the pie without making a selection. Numpad and quick select keys also apply here.
Subpies: If you have a pie entry that spawns another pie menu, you will need to confirm with LMB to make a selection in the subpie. Autoselect will allow you to hold the key during the entire pie navigation. Numpad and quick select keys also apply here.

I reread your post, but I am not able to figure out how to make a Pie menu that I spawn via PRESS LMB stay while with every other mouse Button the Pie will stay. Any idea?

I'm not sure, either. I haven't tried out your code yet, but I will do that and see what I can do. I would think that's a property of using LMB to spawn the menu when it's also used to confirm. There's an option in user prefs -> editing that confirms selection on mouse release. Try playing with that and see if that helps.

Yeah I get the same feeling - if true than I have to say good bye to LMB.


text:
When calling a Pie is it possible to do multiple LMB licks before it goes away?
for example when you include a menu with multiple options in a pie and you want to click two. After each LMB click the pie goes away, so you have to call the pie menu twice.

I think at present there's nothing special about pie menus, in the sense that they act the same as regular spawned menus like (the W menu). you can only click on one item and then the menu has served its purpose. Though I fully agree that a way to pin the menu according to some rule-set would allow for interesting usability features.

Thanks - Many of my pies have all buttons and "2" is mapped to a box with options. So there it would be nice to spawn the pie and the set your options. This might be worth to ask the devs to consider.


text:
Struggling with Layout element order of Pie menus
I am sensing that there is an order or format issue in my script. The following sequence results into this pie layout with the two last commands starting at the 2 position.

        box = pie.split().column()
        row = box.row()
        box.operator("MESH_OT_faces_shade_smooth", text="Mesh Smooth")
        box.operator("MESH_OT_faces_shade_flat", text="Mesh Flat")
        box.operator("calculate.normal")
        box.operator("mesh.flip_normals")
        box.prop(mesh, "show_normal_face", text="Face Normal", icon='FACESEL')
        box.prop(mesh, "show_extra_edge_length", text="Face Normal Length")
        box.prop(scene.tool_settings, "normal_size", text="Size")
        row.prop(mesh, "use_auto_smooth")
        row.prop(mesh, "auto_smooth_angle", text="Angle")

But I would like them to be in one row byt at the end of the pie menu.
Can somebody explain to me where my flaw in the logic there is?

related, essentially the same answer, and question: http://blender.stackexchange.com/questions/44402/order-of-buttons-drawn-not-matching-code-order/44403#44403

You start with -
box = pie.split().column()
row = box.row()

Then you add items to the column and then follow it with two properties in the row that you first created at the top.


text:
Define pie operator menu position
I seem to be unable to find any information online about how to define a pie menu operator position. They seem to change a lot - for example the three button section flips position between 7 and 3.
Is there no way to force a button to only show up on a certain position?

You are showing two different menus, one in object mode the other in edit mode, the different names above the centre circle indicate they are using different code - the name comes from bl_label of the menu class.
While the order that items appear does seem odd at first, there is an order to the madness. The primary design is to have one operator at each position, starting from the left, then the right, bottom, top, then the top diagonals and the bottom diagonals.
Run the following script in the text editor and have a look at the items positions, then uncomment one of the lines between operators and see how it effects the layout of the menu, repeat for each commented line.
import bpy

class VIEW3D_PIE_template(bpy.types.Menu):
    bl_label = "Render"

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

        pie = layout.menu_pie()
        pie.operator("render.render", text='one')
        #pie = pie.column()
        pie.operator("render.render", text='two')
        pie.operator("render.render", text='three')
        #pie = layout.menu_pie()
        pie.operator("render.render", text='four')
        #pie = pie.row()
        pie.operator("render.render", text='five')
        pie.operator("render.render", text='six')
        #pie = layout.menu_pie()
        pie.operator("render.render", text='seven')
        pie.operator("render.render", text='eight')

if __name__ == "__main__":
    try:
        bpy.utils.unregister_class(VIEW3D_PIE_template)
    except:
        pass
    bpy.utils.register_class(VIEW3D_PIE_template)

    bpy.ops.wm.call_menu_pie(name="VIEW3D_PIE_template")


text:
How to properly overwrite Blender default keys with Pie Menu hotkeys
I struggle understanding how to properly overwrite Blender's default keys.
Here are two PIE keyconfigs.  S works perfect. But A does not work.
I have to add SHIFt ALT and such to overwrite default S.
    #Pie Transform
    km = wm.keyconfigs.addon.keymaps.new(name='Object Non-modal')
    kmi = km.keymap_items.new('wm.call_menu_pie', 'S', 'PRESS')
    kmi.properties.name = "pie.transform"

    #Pie Select
    km = wm.keyconfigs.addon.keymaps.new(name='Object Non-modal')
    kmi = km.keymap_items.new('wm.call_menu_pie', 'A', 'PRESS', shift=True, alt=True)
    kmi.properties.name = "pie.select"

Here are the Pie definitions.
# PIE TRANSFORMATION -------------------------------------------------------------------
class PieTransform(Menu):
    bl_idname = "pie.transform"
    bl_label = "Transformation"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        if context.active_object:
            if(context.mode == 'EDIT_MESH'):
                #4 - LEFT
                pie.operator("transform.translate", text="Move")
                #6 - RIGHT
                pie.operator("transform.shrink_fatten")
                #2 - BOTTOM
                box = pie.split().column()
                box.operator("view3d.snap_cursor_to_selected")
                box.operator("wm.call_menu", text="Snap Menu").name="VIEW3D_MT_snap"
                box.separator()
                box.operator("transform.mirror")
                box.separator()
                box.operator("align.x", text="Align X")
                box.operator("align.y", text="Align y")
                box.operator("align.z", text="Align Z")
                #8 - TOP
                pie.operator("transform.rotate", text="Rotate")
                #7 - TOP - LEFT
                pie.operator("transform.resize", text="Scale")
                #9 - TOP - RIGHT
                pie.operator("transform.shear")
                #1 - BOTTOM - LEFT
                pie.operator("pivotpoint.type", text="Pivot Bounding Box").variable = 'BOUNDING_BOX_CENTER'
                #3 - BOTTOM - RIGHT
                pie.operator("pivotpoint.type", text="Pivot 3D Cursor").variable = 'CURSOR'
            else:

                #4 - LEFT
                pie.operator("transform.translate", text="Move")
                #6 - RIGHT
                pie.operator("wm.call_menu", text="Clear Tansformation").name="VIEW3D_MT_object_clear"
                #2 - BOTTOM
                box = pie.split().column()
                row = box.row()
                box.operator("view3d.snap_cursor_to_selected")
                box.operator("wm.call_menu", text="Snap Menu").name="VIEW3D_MT_snap"
                box.separator()
                box.operator("transform.mirror")
                #8 - TOP
                pie.operator("transform.rotate", text="Rotate")
                #7 - TOP - LEFT
                pie.operator("transform.resize", text="Scale")
                #9 - TOP - RIGHT
                pie.operator("wm.call_menu", text="Apply Tansformation").name="VIEW3D_MT_object_apply"
                #1 - BOTTOM - LEFT
                pie.operator("pivotpoint.type", text="Pivot Bounding Box").variable = 'BOUNDING_BOX_CENTER'
                #3 - BOTTOM - RIGHT
                pie.operator("pivotpoint.type", text="Pivot 3D Cursor").variable = 'CURSOR'

# PIE SELECT -------------------------------------------------------------------
class PieSelect(Menu):
    bl_idname = "pie.select"
    bl_label = "Select"

    def draw(self, context):
        layout = self.layout
        pie = layout.menu_pie()

        if(context.mode == 'EDIT_MESH'):

            mesh = context.active_object.data
            scene = context.scene
            #4 - LEFT
            pie.operator("view3d.select_border", text="Border Select")
            #6 - RIGHT
            pie.operator("mesh.select_all", text="De/Select All")
            #2 - BOTTOM
            pie.operator("mesh.select_all", text="Invert Select").action='INVERT'
            #8 - TOP
            pie.operator("mesh.select_mode", text="Edge", icon="EDGESEL").type='EDGE'
            #7 - TOP - LEFT
            pie.operator("mesh.select_mode", text="Vertex", icon="VERTEXSEL").type='VERT'
            #9 - TOP - RIGHT
            pie.operator("mesh.select_mode", text="Face", icon="FACESEL").type='FACE'
            #1 - BOTTOM - LEFT
            pie.operator("view3d.select_circle", text="Brush Select")
            #3 - BOTTOM - RIGHT
            pie.operator("mesh.select_linked_pick", text="Select Linked")

        else:

            mesh = context.active_object.data
            scene = context.scene
            #4 - LEFT
            pie.operator("view3d.select_border", text="Border Select")
            #6 - RIGHT
            pie.operator("object.select_all", text="Select All")
            #2 - BOTTOM
            pie.operator("object.select_all", text="Invert Selection").action='INVERT'
            #8 - TOP
            pie = pie.row()
            pie.label('')
            pie = layout.menu_pie()
#            pie.operator("object.move_to_layer")
            #7 - TOP - LEFT
            pie = pie.row()
            pie.label('')
            pie = layout.menu_pie()\
            #9 - TOP - RIGHT
            pie = pie.row()
            pie.label('')
            pie = layout.menu_pie()
            #1 - BOTTOM - LEFT
            pie.operator("view3d.select_circle", text="Brush Select")
            #3 - BOTTOM - RIGHT
            pie = pie.row()
            pie.label('')
            pie = layout.menu_pie()

It comes down to search order, something else matches before your keymap is found.
If you use the name 'Object Mode' when creating your keymap your items will show up in Preferences->Input in the same place as the default entries and your entry will override blenders select all.
km = wm.keyconfigs.addon.keymaps.new(name='Object Mode')

While it isn't documented, bpy_extras.keyconfig_utils.KM_HIERARCHY[] contains the hierarchy used to display keymaps in Preferences->Input. I haven't verified it's use but this appears to be the order searched to find a match for a keypress. This means that if your entry shows up first in Preferences->Input then it should be the one that responds to the keypress.


text:
Is it possible to decide where menu is drawn next to pie button?
I would like the menu to showup left to the pie button and not right. Is that possible?
    pie.menu("edge.menu2", text="Edge Menu")

I think it can work if [edge menu] is also a pie menu. Then, in a pie you can further decide the position of a certain item or menu.  But this may be too much here.

wait you mean draw a new mini pie over the current master pie?

pies can contain items, menus or pies. never tried myself so I'm not sure it's the answer, but yeah that's the idea


text:
How to switch "context area type" via Pie command? Object/Edit<>Nodes<>UVImage
In a Pie menu instead of switching just edit/object mode I would also like to swap out the content of the display like from 3D view switch to node editor for the selected object. But I have a hard time figuring out how to write this.
I went to the API page to see if many I can get some clues from there.
https://www.blender.org/api/blender_python_api_2_76_2/bpy.context.html?highlight=context.area#bpy.context.area
If I switch the modes the console reads this out:
bpy.context.area.type = 'IMAGE_EDITOR'
bpy.context.area.type = 'NODE_EDITOR'
bpy.context.area.type = 'VIEW_3D'

To define a edit/object mode switch I 3D view I know you can do it this way:
bpy.ops.object.editmode_toggle()

pie.operator("object.editmode_toggle", text="Edit/Object", icon='OBJECT_DATAMODE')

So I tried this but obviously it odes not work
pie.operator("context.area").type='IMAGE_EDITOR'

With the following error message:
Traceback (most recent call last):
  File "\Modeling Toolbox Pie Beta.py", line 654, in draw

AttributeError: 'NoneType' object has no attribute 'type'

location: <unknown location>:-1

Wazou wrote a good viewport/editor switch pie a while back and I've been modifying it lately. You can find it on github in addons_extern. I don't completely understand it, but I believe it's close to what you're asking for. You could probably borrow some parts of the code for your own pie.

I studied it but to my knowledge it only switches between edit/object/sculpt mode and not swaping out the 3D view with the node or image editor module.

We're looking at different scripts, because viewport_pie_menu.py allows you to change editors in a window. Press shift-space over any editor other than the console and it gives you options to switch between editors. Up is 3D view, left is a submenu of image editors, etc.

OPS - same name different thing. Thank you for this! The example is perfect to learn from!

There are already shortcuts defined to switch areas.
UserPreferences -> Input -> Window

If you browse these shortcuts you will find Context Set Enum, which uses the generic wm.context_set_enum operator. The keys are SHIFTF1-F12
So you can copy the arguments:
op_props = pie.operator("wm.context_enum_set")
op_props.data_path = "area.type"
op_props.value = "VIEW_3D"

See Area.type for the available options
Further you might also try wm.context_pie_enum to automatically layout all enum items in a pie menu.
Just define a shortcut and type area.type in the data_path field.

Note
You can find a listing of all context attributes here

Tested context_pie_enum and it seems to be buggy :/ - multiple areas are assigned to the same direction.


text:
How can I get the scene polycount in python?
Is there any access in the python API to get the total scene (or object) polygon count?
This info is already displayed in the status bar, but is this info exposed in the python API or do I need to manually loop through all objects and count the faces?

OK twitter to the rescue!
Here's my solution:
bpy.context.scene.statistics(bpy.context.view_layer) gets you the same string as shown in the status bar, so to get the triangle count this just needs to be parsed:
s = bpy.context.scene.statistics(bpy.context.view_layer)
tris = int(s.split("Tris:")[1].split(' ')[0].replace(',', ''))

This is obviously dependent on the view, so it only includes the visible objects in the current view layer.
If you only want to know the tris of a specific object you can hide everything else or just enter edit mode.

Was about to post that, beat me to it. ;)

Do you know of a way to get that while in edit mode on an object? In that mode the command returns the statistics for the selected objects only.


text:
Correct syntaxt to call object.draw_type = 'BOUNDS' as pie command?
I would like to use bpy.context.object.draw_type = 'BOUNDS' as a pie operator like in the following line:
col.operator("object.draw_type", text="Object Solid", icon="MESH_CUBE").type='SOLID'

But I fail to figure out the correct way how to declare the type and get the error that draw_type has no attribute 'type' AttributeError: 'NoneType' object has no attribute 'type'.
I checked the API and do not find any clues about how to declare this directly inside an operator.

Maximum draw type to display object with in viewport
BOUNDS Bounds, Draw the bounds of the object. WIRE Wire, Draw the
  object as a wireframe. SOLID Solid, Draw the object as a solid (if
  solid drawing is enabled in the viewport). TEXTURED Textured, Draw the
  object with textures (if textures are enabled in the viewport).
  Type: enum in [‘BOUNDS’, ‘WIRE’, ‘SOLID’, ‘TEXTURED’], default
  ‘BOUNDS’
draw_type Maximum draw type to display object with in viewport

Is this one of those commands where you have to define a class with the operator inside so you can all that via a pie instead?

read wm.py I promise this will be an eye-opener.
This has nothing to do with pies, pies are just specialized menu representations.  The property you are setting is an Enum ( a simple drop down in the UI is generally a representation of an Enum )
If you want to set the value of an Enum but don't want to present a dropdown, then you use wm.context_set_enum.
    if context.active_object:
        obj = context.active_object
        set_draw_type = layout.operator("wm.context_set_enum", text="Object Solid", icon="MESH_CUBE")
        set_draw_type.data_path = "object.draw_type"
        set_draw_type.value = 'BOUNDS'

wm.context_set_enum is defined in the class WM_OT_context_set_enum,
which delegated the execute function to execute_context_assign (also found in wm.py)

Thanks for clarifying this. I posted in an answer an example one can use to directly define the pie button.

If that is the case then you can write it this way as a pie and save the creating a custom operator to call.
f = pie.operator("wm.context_set_enum", icon='MESH_CUBE', text='Object Solid')
f.data_path='object.draw_type'
f.value = 'BOUNDS'


text:
Why does my character glitch out when i put it on a path
video blend file
i animated my character and when i put it on a path to walk it glitches out and distorts. At first i tried just moving it with g and it did the same thing and now im trying to put it on a path and it does the same thing. Ive linked a blend file and a video file. If any of you could help me it would be appreiated

In these cases I usually parent the character's main armature to what I call a
'Nav(igation) Empty'.  The character is then moved around by dragging that. This makes the armature's keyframes relative to the Nav-empty and insulates the walking action from the path's function - i.e. turn and move the character along the path. My preference is to use another Empty on the path itself and get that moving as required, then parent the character's Nav-Empty to the path Empty.  See next...

Continuing from above ... Whilst sounding a little cumbersome this approach makes things a lot easier when a character is to approach and enter a path (or any other constraint for that matter) and once traversed, leave the path and continue on using keyframes once more.

I think your problem is the following one:
You're trying to give a Follow Path constraint to your mesh, but it's not the thing to do, it's not the mesh that is supposed to follow the path, the mesh is parented to the armature, it's the armature that is supposed to follow the path... If you give your mesh a Follow Path constraint, it has 2 contradictory constraints: The Follow Path and the armature, and it can't work.
So give the Follow Path to the armature.
Also, you need to make sure that you've:

Applied the scale and rotation of your curve.
Given it the right direction, i.e. the direction that the armature is supposed to follow, in Edit mode switch it with a W > Switch Direction.
Put the curve origin at its beginning.
Put the armature at the center of the scene with an altG, so that it sticks to the beginning of the curve once you create the Follow Path.

But it looks already good...

I managed to solve this by putting the light (in my case) and circle path in the middle of the scene using Alt + G and only then appliing the Follow Path.


text:
How can i make my character walk forward?
video
I rigged my character and and did a walking animation. Now it walks in place. I was gonna go into object mode and press g and move it. But when i do it it distorts the character. what would be the best way of going about this?

If you have a standard rig with bones set up the normal way, then you have to go to the top of the hierarchy (the parent bone of all the other bones) and select and move just that.

Don't animate the mesh, you have to animate the armature in object mode too.

As FFeller suggests, In Object mode, make your armature follow a curve with the Follow Path constraint


text:
Why is my character transparent in the render?
when i render my character is transparent? Why? I have tried changing the setting under the block tab. I started having the problem after hid them for a separate render but when i unhid it it came back like this

i'm not sure if this is connected but you might have accidentally made it a shadow catcher, tough it is hard to tell from your question.


text:
How can I use my Intel HD Graphics 6000 for Cycles render?
I'm new to the community and I have no clue about where to look for an answer to this question. I'm also new in Blender. I have a MacBook Air (2017) with a 1,8 GHz Intel i5 and an Intel HD Graphics 6000. My issue is the following: I can't use GPU compute because in the system preferences under system, my graphics card isn't displayed.

https://blender.stackexchange.com/questions/7485/enabling-gpu-rendering-for-cycles https://blender.stackexchange.com/questions/31930/is-it-possible-to-do-opencl-rendering-on-intel-processors https://blender.stackexchange.com/questions/80246/gpu-rendering-on-an-intel-iris-pro-apple-macbook-pro

https://blender.stackexchange.com/questions/122992/which-mac-should-i-buy-for-blender-2-8/123005#123005


text:
How to combine the bump maps of two texture maps?

I give a clay texture map (downloaded online) to the 3d model, it gives the colour of the model, then the roughness input and finally the normal input (non color data for the last two inputs).
I also want to imprint the grayscale template with cuneiform signs placed on the 3d model, I do this by giving the template as a normal input(for the last image texture I give the b/w template image). But as you can see, the rendered image with the signs dont have the small texture/bump variations of the clay texture map (looks flat).
How do I go about combining the height input for bump node of the clay texture and b/w template for the given node configuration?
I am using cycles render, also if possible want to do it using blender node editor rather than manually combining the normal maps of the two images using some other software.
I have tried the answers given in the following link How to Combine two Normal Maps? but it hasn't worked out.

You asked an exelent question and have the perfekt answer :) Please edit your answer out of your question. Its absolutley fine to anser your own question and then mark it as the correct answer so this question gets closed.

Nvm I think I solved my issue by using a Mix RGB node to combine the heights of both the images as shown below.


text:
Chart Graphics Generator Add-On: AttributeError: '_RestrictContext' object has no attribute 'scene'
I'm new to Blender, and I'm finding that it's a very powerful tool so far. At the moment, I'm trying to enable an add-on called Chart Graphics Generator. However, it produces this error whenever I try to enable it:

AttributeError: '_RestrictContext' object has no attribute 'scene'

Source:
http://blenderartists.org/forum/showthread.php?230533-Bar-Graph-O-Matic-piechart-help-please/page2
(The attached blend file in the very last post on the thread linked)
I've updated the Add-on: Precise-Align, but the error still persists. I found out that's it's due to an intentional deprecation from Blender with certain restrictions on context.
The Traceback says the problem is on line 44, in the globals section.
pid2 = pi * 0.5
sce = bpy.context.scene
obj = bpy.context.object
boo = bpy.ops.object
bot = bpy.ops.transform
suma = 0

chartType = '' #not yet used
negativValueSeen = False
sizesCVSfile = None
colnrPKHG = '-1'
cvs_colums = 0

What I've tried:
I've tried just running the script in a text box, without trying to use it as an add-on.
This partially works. However, it only shows the data labels of the imported CSV file, without any line charts relating to the values of my own CSV file.
The line charts that appear on start up relate to the default CSV file the developer wrote the path to.
I've also tried following the vimeo tutorial video with instructions on how to use it, but the method script just seems to have deprecated methods:
http://vimeo.com/43432482
Being relatively new, I don't know how to go about solving this error. I know there must be a new way to write it, but I'm not sure where to start. Can someone please assist me in resolving this error?

The error is because addons can no longer use global variables. While I had a look I gave up trying to fix it. I found it easier to use sverchok to create a bar chart from csv data. This example might help you get started, it's my first attempt with sverchok so probably not the best way to do it.

Thank you for trying to fix it, I really appreciate it. I'll take a look into working with sverchok, it has really great examples!

Read here why you can't access context members during init: http://wiki.blender.org/index.php/Extensions:2.6/Py/API_Changes#Restricted_Context

I understand that I can't access context members. (I wanted to post that link, but as a new user could only post 2). I'm just not sure on how to fix it.


text:
Mesh masking of blur
I'm fairly new to using the compositor and I have this issues with having 2 renderlayers, one for the glare of the reflections. and one for the glare coming from the lights as some sort of glow basically.
now since those lights will sometimes be behind certain meshes and such, they shouldn't show through. how can I resolve this with still keeping the glare from the lights. but those little LEDS masked off by the mesh

as you can see, the practice file works great
but when I take the same steps in the actual model file I end up with this where the glare is not showing at all:

or this, this happens when I change the pass index to 1 in the ID mask node

would really love to hear what I can do next to resolve this. thanks in advance for your help!

I think you are looking for the ID Mask node.  For an example, I set up a simple scene with one object inside of the other.

If you go to the Render Layers tab and check the box next to the material index pass, it will now add a pass for all of the different material indexes.

Next, you have to set the indexes of your materials.  In the materials tab, go to the bottom of the material that you want to set the pass index of.  In the very bottom, under settings, there is a setting that says Pass Index.  You can set that to whatever number you want to use for that material.  The default for the background is 0, so I set my material pass indexes to 1 and 2.

After Rendering, open the compositor and get an ID Mask node.  Plug the IndexMA output from the Render Layers node into the input of the ID Mask node.  Then you can connect the Alpha output of the ID Mask node into the input of a viewer node to see the result.  You can then change the index value of the ID Mask node to whatever index you set your material indexes to.

You can then use the ID Mask node for what it says it is, a mask.

Thank you for you information, I tried recreating the scene you made to practice with and I did get the result that I wanted. but when I did the exact same on the car model it still did some weird things I can't seem to post any pictures in this comment but I'll clarify myself down here somewhere. here's what I found "

Could you post the .blend file that you are working in?  I could take a look at it later

Sure @Ben, where can I drop it for you?

Put it in the post https://blender.meta.stackexchange.com/questions/658/including-a-blend-file

It's fixed now, I forgot to make the lens in front of the leds passable as well, you can't see the individual bulbs and the lining on the lens right now. but that's for another day, thank you all so much for your help!

Yeah, glad I could help!


text:
My textures / UVs don't seem to exist anymore after upgrading to Blender 2.8
When I load up an object in Blender 2.8 beta, it does not appear to have the textures that I assigned it in 2.79. The object appears plain white. In 2.79, I can see the textures fine.
In 2.8, the UV editor window does not show any UV coordinates like it did in 2.79. What is going on? Did 2.8 delete my UV coordinates? Why can't I see the UVs or see the textures?

I have tried changing between wireframe, solid, lookdev, and render preview.
I have looked in the shading menu and changed around the settings.
I have tried changing the renderer between Cycles and Eevee.

This is most likely due to blender 2.8 not being a release build and thus not recommended for work with active projects. It might work with a newer version of 2.8, as it is updated daily.

I downloaded it yesterday. But you may be right, I just always assume I'm at fault first.


text:
Transparency in image as plane
In blender 2.8 when brought in as a reference or background, .png file, the transparent layer is retained however if broght in as a plane the transparent layer is not respected and the whole image is rendered.
Is this true or am I missing something? Please keep in mind that I'm a newbie and looking for a relevently easy fix.
Thank you.

Here's the file the comments don't allow you to post a picture

It should work... maybe share your PNG file...

Here's the png file I used. If you say that it should work maybe I'll make another test file to try it out.

As I said I would do I made 2 new png files and neither one of them retained the transparently.

mmh weird because it works correctly for me, both Add > Image > Reference and Add > Image > Background

Could be worse.  I tried "image as plane" and not only was Alpha not working but other things were messed up, too.  Changing the settings for transparency (always look for such settings in eeVee) did not fix things.  I assume bugs in the beta code.  In my case, I could easily use a solid background to match and re-exported the PNG without an alpha channel.

In 2.81
I needed to tick "Use Alpha" and was able to use transparency.

You are probably trying to work with Eevee and getting Black where the alpha shows through on the image in the Image Editor. In the Material Shader properties, change from Opaque to Alpha Blend. If you use Cycles, the alpha will work as expected immediately though.

Just tested, worked well.           Thanks!


text:
Remove extra geometry from objects
Is there a tool or an easier way to remove unneeded geometry from objects? Mostly when using a "Displace" modifier, on many places there are flat surfaces where there is extra geometry on the mesh, that you would like them to be removed. At first I thought of the "Decimate" modifier, but is there a way to do it more evenly. By preserving the edge/face flow and such. Is there some feature for something like that in Blender?

From this

To this

Or to this (if I want the geometry to be to the very limits and worrying only about the shape)

Manual with good topology
To get the topology in your second image. Select the loops you want to delete with Alt RMB , or in Wireframe mode use border select (B). Then press Delete and choose Edge Loops.
Manual with N-gons
To delete all edges and vertices on a face and just be left with a large N-gon. Select all the faces on a plane (example everything on the top); then press Delete and choose Limited Dissolve.
Modifiers
If you are less picky about topology, and want a more automatic solution Then use a Decimate modifier. For examples like your's set the Decimate modifier to Planar, then adjust the angle limit to suit your needs.

Thanks. Yeah, but that's why I mentioned the "Displace" modifier. You just end up with too much of a geometry. Is there a more automated approach for something like this and maybe doing it evenly, by keeping the edge/face flow and such?

Another manual technique I like to use is just "Dissolve" (Vertices, Edges, or Faces).  It's on the x menu.  But it's much more manual than the techniques listed in the answer.

wow, Limited Dissolve did the trick. I love Blender! As well as people sharing their wisdom. Thanks!

Where is a Decimate modifier?

I would use limited dissolve as mentioned by David, but in case you want to do this non-destructively, then you can use the Decimate modifier in Planar mode.

come on, that was crazy. I had already edited my answer with the modifier and was adding the headings when you answered it. :)

@David lol, that's what happened to me in that licensing question. :P

that happens a lot here.  It's amusing since this could only happen a lot if answers were being provided right away to questions asked.  This is easily the most well maintained Q&A sites I've encountered.  Good work all y'all.

"Limited dissolve" was what I was looking for after all


text:
bpy.props types, update, set, and get fields format
Part of my project involves integrating functionality similar to a graphing calculator into the image editor of Blender.  Once complete this will just be a nifty little time saver that helps avoid leaving Blender to bring up other tools.
I'm using bpy.props.FloatProperty for a few metrics, such as domain minimum and maximum, so that they can quickly be set in Blender for an algebraic function to be drawn.
I don't want to work with these directly from the bpy.props objects because to do so would sacrifice usability.  For example, we're used to a straightforward scale metric in Blender where if we want an object scaled to 50% on the x-axis, we simply set the x-axis scale to 0.5.  But in an algebraic function where the vertical depends upon the horizontal, this fifty percent scaling is actually accomplished by multiplying the independent variable by two.
So, it helps the user to have something sit between the interface and all the math going on under the hood.  That is exactly the kind of thing the update, set, and get fields are meant for in bpy.props objects.
The problem is that I can't find an example about how to format that string.
set = "self.set_thing ( )" ?
set = "self.set_thing" ?
self = "set_thing" ?
set = "self.set_thing ( self, thing )" ?
set = "set_thing ( self, thing )" ?

There are probably possibilities there that I'm not thinking of yet.  But how exactly do we format that and what are the restrictions?  Do the set methods have to be in the object class that the bpy.props object is a data member of? Can it be any object, i.e. set = "thing_container.set_thing(thing)"?
Finally, with a getter and a setter field, what functionality does the update field have?  Does this just allow for another method call in addition to the setter, whenever the setter is called?

Got it!
This page addresses how to get a function name, in a way that's friendly to class methods and not just script-scope functions.  Blender API requires a 'self' parameter in the specified function for update, set, and get, so it actually requires a class method anyway.
So, let Python do the formatting for you.
update: I had a partial answer here before.  I want to force use of the local dictionary, so that I know for sure that an instantiated object's method is used and that no global method is looked for.  The answers for this question provide the second part. Also, the incomplete answer I had before does not work because it uses a string where a function is expected.
Here's an example using the lower domain constraint in my script:
global set_domain_min

self["domain_left"] = bpy.props.FloatProperty(
    name="x >=",
    description="Domain left bound",
    default=-10,
    min=-sys.maxint - 1,
    max=sys.maxint,
    step=1,
    precision=6,
    subtype="DISTANCE",
    unit="LENGTH",
    set=locals()[self.set_domain_min.__name__]
)

I don't know if this is a duplicate topic, since it's specific to Blender's API requirements but is answered with a general Python question.  My last question was marked as a duplicate, and is, but I haven't deleted it because I think the original has poor wording for the topic.  Next time I happen by this site, if a mod has marked this as a duplicate then I'll just delete it.  The answering topic isn't obvious for somebody learning Python using the Blender API, but I'll leave this to others' judgment.
Update: Alternatively, the following can be used...
class foo:
    def __init__(self):
        self["bar_prop"] = bpy.props.FloatProperty(set=self.set_bar)
        self["bar"] = 1 / self["bar_prop"]

    def set_bar(self, bar_in):
        self.bar = 1 / bar_in

This makes it unnecessary to use locals ( ), but the 'self' identifier is needed.  Using locals ( ) is only necessary if there's an identifier with the same name declared global in-scope.  The first code snippet I posted above has been updated to demonstrate.  This can be useful for overloading an identifier such that the local is only used in specific cases.

Instead of set = locals () [self.set_domain_min.__name__] can't you do set = self.set_domain_min?

I'm not sure.  I can't really test it for this case until I finish a bunch of calculus in other classes, remind myself of how to register classes, and learn how to modify the user interface.  The documentation shows it done that way, but it's in the global scope, so I'm using overkill to play it safe.  I'm not sure why functions in the global scope in the documentation have a 'self' parameter.  What is 'self'?  The file?
Hopefully this will get a proper test here soon.  This is one of those rare cases when a ton of functionality has to be complete before anything can be tested at all.

the self in the set() and update()-methods is the object the attribute is applied to. For example suppose bpy.types.Object.attr = StringProperty(update=example). self in this case would be the instance of bpy.types.Object attr is set.


text:
Is there an addon to enable export of Blender object to an Objective-C header?
I have used a third party addon script to do this, but it is throwing an error:

AttributeError: Mesh object does not contain faces attribute.

It complains about the line for face in object.data.faces:
It was originally written for Blender 2.57 and apparently no longer works.
Is there some other addon for 2.70?

IIRC faces was replaced with polygons. You could try and correct the offending lines, idk if that's feasible.

Thanks Gandalf, I replaced faces with polygons and same error.  I replaced "for face in object.data.faces" with "for face in object.data.polygons".

For info, the script can be viewed at GITHub and is called io_export_objective_c_header.py written for 2.57 by a Jeff LaMarche. 

With 2.63's introduction of BMesh intregration, plugins which operate on mesh data need to be reworked to use the newer API for using loops. Renaming the accessor is not enough.

I can fix it, but I need to know how to handle Quads and NGons. Shoud everything be auto-triangulated? Which method? (fixed, fixed alternate, beauty, shortest diagonal). Shall it use vertex normals, or split vertex normals (per loop, to support mixed - smooth and sharp - edges).

Did you try the latest version? objc_blend_2.62 does not contain .faces anywhere - so seems to be compatible with 2.63+

CoDEmanX your a genius and saved me much agro, if you weren't virtual I'd give you a big man hug.  Your link there works a treat, I must have had an old link and didn't realise you could get an updated version.

How do I mark this as answered?

Anyone who's interested this add on that CoDEmanX has found the latest version of, now allows a header file to be created with all the vertices, normal and uv coordinates for displaying objects in OpenGL in IOS apps.

Did you try the latest version? There's one called objc_blend_2.62, which does not contain .faces anywhere in the code - so seems to be compatible with 2.63+ (and funnily not with 2.62!)
Link: objc_blend_2.62 @ Github


text:
Pasting long strings into the script parameters for Add 3D Function Surface?
I'm trying to use the script Add 3D Function Surface (specifically the Add X,Y,Z Function Surface feature) to produce some mathematical models for 3d printing.  The formulas for my paraemtrized surfaces are very long --- one of the simpler ones has over 4,000 characters.  Unfortunately, it appears that I can only paste 400 characters into each of the script parameter boxes.
Is there a way to get Blender to accept longer strings for each formula parameter?  I'd be willing to run the script from the command line, but I haven't figured out how to do this.
I'm running Blender 2.70 on a mac.  I'm also completely new to Blender, so let me know if there's additional information I can provide that will help.  Thanks in advance :-)
Bug report: https://developer.blender.org/T39924

I can't see any maxlen parameters in the script:
https://gitorious.org/blender-scripts/blender-3d-function-surface/source/add_mesh_3d_function_surface.py
And on Windows using Blender 2.70, I can store at least 1,000,000,000 characters in a StringProperty():
>>> C.scene.p = "x"*1000000000
>>> len(C.scene.p)
1000000000

The problem here is that there's a limit at layout level of 399 chars. You can actually type 400 and more letters into a text field, but you won't see the characters appear!
If you paste from clipboard, only the first 399 characters are taken. You can circumvent it by using python:

Go to Scripting screen
Call the XYZ Math Surface operator (parameter fields appear in Redo panel)
Create a new text datablock in the Text Editor
Add the following (substitute x_eq for the other equation fields):import bpybpy.context.active_operator.x_eq = ""
Place the cursor between the two "" quote marks and paste your formula
Click Run Script or hit AltP - it will assign the formula text to the operator's parameter field.
Click e.g. the handle of the U min property in the Redo to panel to force an update (it will not change the mesh based on the manually set equation automatically!). Don't activate any of the equation fields, it may truncate them again!

Thanks!  Have you had success actually pasting your 10^9 (or perhaps a little shorter...) length string into the Add 3D Function Surface parameter window?

I'm also trying to hunt down the script on my system to compare with the one you linked, but this is proving difficult.

It's pretty odd: it let's you type more than 399 chars, but you won't see it happening (in the operator log you do). If you paste from clipboard, only the first 399 chars are used. The only workaround is to set it via python (See my updated answer).

I'm trying to implement your fix by opening the python console (same as scripting screen?) and typing the commands you gave.  For short x_eq, this successfully puts my equation into the appropriate parameter window, but for long x_eq it again truncates my equation.
A couple of comment/questions: (1) I'm just hitting enter from the python command line.  That's not different from "Run Script", is it?  (2) On my machine, I cannot type more characters into a parameter window that already contains 400 pasted characters....
Thanks so much for your thoughts on all this!

Just to be clear:  the full equation pastes into the python console, but when I execute the command the input gets truncated to 400 characters in the 3D view window.

You can use the PyConsole as well, but I would rather use the Text Editor. In the PyConsole, you can leave out import bpy and use C. instead of bpy.context.. The text fields seem to truncate the content, but if you try len(C.active_operator.x_eq) in the PyConsole, it will tell you the real length (which shouldn't be limited to 399). You may have to click e.g. the handle of the U min property in the Redo to panel to force an update.

Finally working!  Blender is quite touchy, though: if you click on the 'X equation' in 3D view, the string will truncate to 400 characters.  You're right that clicking on, e.g., 'U min' to get the surface to render works.  Thanks for your help :-)


text:
Physics and calculus in blender
I'm physics student and I want to calculate things on blender, I've to learn many things of the program and I'm starting on it. I want to know if it's possible to do some calculus inside blender, for example, create a sphere and clicking on a point of the surface for calculate the tangent of that point, that's all I want to know for start a project on relativity physics.

Welcome to StackExchange! If by calculus you mean numerical analysis, then yes, Blender can be used as a scientific computing package. Are you looking to create an interactive application? Or are you just looking to do some data analysis. How would you define the "tangent" of that point?

I used the simplest words, it's something weird to understand and never has made before, it's something more than "calculus", it includes linear algebra, mechanics, vectors and other fields of mathematics and physics... and it isn't a "tangent" but you can figured out like that.
I want an interactive application that can show the data for the "differential" of the surface.

If I understand what you are saying correctly, then yes, you can do discrete differential geometry in Blender.


text:
How do you reduce lighting when rendering? (See pictures to understand more)

The first picture is how it looks like when i render it, and the second picture is how I want it to look like when I render it. I don't know how to reduce the lighing, somebody help because I haven't used bender in a really long time.

The shoes are illuminated the same, so you could just darken the materials. Also, check the color of your ambient light

If you are using Blender render decrease the specular intensity of the materials and increase the hardness.


text:
How To Enable Tool tip Hints
Not sure what I did but I no longer see the keyboard shortcuts for something when I hover over the TMenu. For example when in edit mode if I would hover over Loop Cut it used to say "Shortcut: Spacebar, Ctrl R" and now it just says "Cut mesh loop and slide it". Still to new to have everything memorized and really rely on these hints to keep me moving forward. Anyone know what I need to enable to show these again?

Go to Edit --> Blender Preferences --> Enable Tooltips
Also, holding Alt while Tooltips are disabled forces the tooltips to show.
(I am using Blender 2.8 by the way)

Thanks for replying mrpenguinb, I thought that too but no. I found the problem and it makes no sense. To note I do have "Tooltips" enabled. Now if I go to keymap and change Spacebar Actions to Search I lose the shortcut. Even trying to click Alt does not force it to display, regardless if Tooltips is enabled or not. So long as I have chosen "Search for the spacebar action the keyboard shortcut refuses to show. If I choose Play or Tools it works just fine. This has got to be a bug doesnt it?

I set the spacebar to be search, and now I have the same issue as you! Turns out you found a bug. Good job.
If you change your spacebar binding manually, then you can search normally AND get the tooltips. This seems to be a bug with the GUI option that is provided.

Thanks, yes I have a work around. No clue how to report this to the developers though?

I assume this is the place to go: https://developer.blender.org/maniphest/project/2/type/Bug/
It seems like the right place to report it. You should try and describe the problem thoroughly so the devs (or anyone else) can replicate it. Should be relatively easy to report.

Tips + general info about reporting bugs for Blender: https://wiki.blender.org/wiki/Process/Bug_Reports


text:
Startup Profiles
I am new to Blender and loving it. I have a request for a feature that at least for me would be a huge asset. I would like to have the ability to select from different startup files. Right now my only choice is to save current or load factory settings. I have different workflows that would benefit from having the ability to easily swap out what startup configuration I need for what ever I am doing. Currently the only way I have found to do this is to create my config folder backup, save it to a different location and then swap them out based on my needs. So where would I properly post this request?

Hi Kevin did you take a look at the Application Templates section in the Blender Manual? https://docs.blender.org/manual/en/latest/advanced/app_templates.html

Blender has a feature called Application Templates, which allow you to create custom re-usable project configurations tailored to your needs.
In order to create your own Application Template, you need to create a .blend project with the interface configurations that you like and optionally a Python script which is executed when the startup file is loaded. For detailed instructions see the following answer on Blender's StackExchange.
Existing Application Templates can be used to create a new project using File > New in Blender.

Thank you, I think I can work with this and make it work for what I need.

Not sure if this is what you are looking for, but, there are some workspaces that you can customize according to your needs. If that's not the case, go to https://blender.community/c/rightclickselect/

Good Luck

I did try doing this but the bigger thing is I have custom colors setup for each of these layouts which give me an instant que as to what workflow I currently started Blender with. Also I have specific addons that are setup to run for each, so just adding a workspace does not go deep enough into the changes I need but thanks for offering to help.


text:
UV Unwrap model as multiple flat straight strips
I'm trying to create tank tracks for my own game engine. I want to scroll the UVs so that it looks like the track is moving. I used 'Follow Active Quads' as a start. This helped immensely for the tops and bottoms of the tracks. They only needed a little bit of editing (mirroring/scaling). Unfortunately the sides of the tracks are still curved. As you can see here:

After a lot of manual editing I got them straightened out:

However doing so I made the faces of the sides no longer correspond to the area of the faces in the model. Now I'm starting to think there has to be a faster/less manual way to do this. But after a lot of searching I have not yet struck the right keyword. Does anybody know a good technique to do this?
For reference, here is my 3D model, complete with seams.

Still some manual editing ............

Remove the outer edge seams so that those sides will be attached to the outer face UV islands when unwrapped.
Select those outer faces and sides and unwrap using the Conformal method.

Select only the inner faces and unwrap.
In the UV editor move these new UV islands to the right so that they will not be overlapping the outer faces UV's.

In the UV editor straighten out edges where necessary.

If you need to separate the sides UV's from the outer faces UV's.......

In the UV Editor, select two edges that make up one of the sides and hit the  Y  (to separate)  X  (to confine in the X axis)  G  to move and drag the new island away to clear space on the UV square.
Repeat for the other 3 sides.

This is perfect, I didn't know about conformal, and its nice to see how it all works out when removing one set of seams.