Questions tagged [properties]

Questions about accessing object properties or attributes while scripting

Filter by
Sorted by
Tagged with
3
votes
2answers
1k views

Add a filter for the extension of a file in the file browser

I'm writing a python script that allow us to open a file in it like that: It's a string properties wich is coded like that : ...
2
votes
1answer
463 views

How to enable ambient occlusion with python?

I am trying to access the world shading settings in python. I want to enable ambient occlusion and give it a value of 0.5. I have tried: ...
4
votes
1answer
621 views

Custom scene properties mysteriously resetting

I'm writing a script, where an operator is registered in the Add->Mesh menu. Clicking this menu displays a panel, where the user can enter certain parameters and then invoke another operator using a ...
3
votes
1answer
971 views

How can I attribute a parameter to multiple objects?

I would like to apply a custom parameter to a selection of objects with the following setup: ...
1
vote
1answer
686 views

Using RNA Property in Drivers?

I'm currently trying to modify some drivers so that they are disabled when they're not on a proxied armature. Right now, I'm using the following script to set a custom property, which is used by the ...
5
votes
3answers
3k views

Color as Custom Property?

With objects, there you can add Custom Properties to an object, though it only seems to let you specify numeric values. Is there any way that I can add a color value as a custom property, such as ...
11
votes
3answers
5k views

Is it possible to use bpy.props.PointerProperty to store a pointer to an object?

If the user renames an object, the reference via string key is lost. Is it possible to store a pointer to an object in a property assigned to a class of bpy.types ...
4
votes
2answers
2k views

How to modify Blender data from vector/arrays in Python?

I was writing a script and discover weird thing. I have code like this: import bpy obj = bpy.context.active_object for s in obj.scale: s *= 2.0 print(s) ...
9
votes
2answers
18k views

How to check if an object has a custom property with python?

The standard python hasattr() doesn't work for me, giving me False in every case: ...
2
votes
2answers
1k views

Should an Operator remember its last-used settings when invoked?

I have an operator that draw its own panel (via invoke_props_dialog) when invoked to let user set properties which are then applied to the selected object, but the ...
3
votes
1answer
582 views

How to set options before script execution

Let's say I want to create UI for addon which allows to choose options (eg delete meshes only) before script execution. How can I achieve that? I know about F6 panel (and options in the T-panel) but ...
2
votes
1answer
2k views

How to change particle size?

I was trying to make fire on blender and i got a problem with the particles , I know that particles size can be changed from the physics panel throw the size value but it doesnt work , any idea why ? ...
8
votes
2answers
7k views

How to access custom properties from python

How can I access a custom property of an object from python, the suggestion Blender gives me if I pass the mouse over the custom properties named "prop", ...
9
votes
1answer
5k views

Get “Object Color” property in Cycles

I need a way to get the Object Color in Cycles. I was thinking about using the attribute node, but I don't know what to write in the name entry. Is there another way to get the color? Please don't ...
13
votes
2answers
3k views

Parenting messes up transforms - where is the offset stored?

When I parent an object to another object with keep_transforms=True The object stays in place as expected, however I noticed that the location attribute of the child did not change. If I zero out the ...
4
votes
2answers
1k views

How to get a property value not in current frame?

I'm trying to make a driver which gets a property value not in current frame, but frame+2 for example. How I can do that?
5
votes
3answers
2k views

Scripting - How to create a game property?

I have a bunch of objects and need to create some common properties to all of them like this ...
19
votes
3answers
3k views

What does “users” means in term of datablocks?

I found that there is a "fake user" button (with a F icon) on object data tab in properties editor. What is the exact meaning of ...
11
votes
2answers
2k views

Assign datablock to custom property

With bpy.props I can assign bool, int, float and string ...
4
votes
2answers
408 views

Control several different materials via one slider

I have to set up an exterior architecture scene… to make it more lively I put a lot of silhouettes into the scene. They are planes mapped to transparency with a mask in cycles. Now I have to ...
7
votes
2answers
2k views

Dynamic creation of properties for export script

This time I have a question about Properties in Blender. I want the operator window of my add-on to have one BoolProperty per action defined in ...
9
votes
1answer
139 views

Storing preferences without having properties in every scene?

I did applink for 3dCoat app. I set Export directory manually. At present, i should set the directory in every blend scene. But i would like to set the directory path only one time and store it aways ...
8
votes
3answers
1k views

How to toggle between Flat and Smooth shading during animation?

The Edge Split modifier doesn't give me desired results (even with angle set to 0 it looks different).
6
votes
1answer
3k views

How to iterate over custom properties?

I have a number of custom string properties that I added to my scene with: ...
21
votes
1answer
11k views

How do I copy a property from an active object to selected objects?

I have been using the Copy Attributes add-on to copy some properties from active object to selected objects. This add-on is not enabled by default and must be explicitly enabled. But its a very useful ...
7
votes
1answer
2k views

Is it possible to add a custom property on bpy.types.Sequence?

I am in the process of writing a tool that makes uses of Sequences in the Sequence Editor. I was trying the following in my add-on (register() method) ...
5
votes
2answers
1k views

What is the difference between bpy.types.IntProperty and bpy.props.IntProperty?

I am always confused between bpy.types.IntProperty and bpy.props.IntProperty. (similarly with other properties) Most of the ...
7
votes
4answers
12k views

How to Set a Property Value in Blender Game Engine?

How would I set a property value with python in the Blender game engine?