Questions tagged [properties]

Questions about accessing object properties or attributes while scripting

Filter by
Sorted by
Tagged with
8
votes
1answer
7k views

Dynamic EnumProperty by type of selection

Iam searching for a method to get a EnumProperty by the type of the object (Lamp, Geo, Camera) thats selected in the viewport. E.g. If the selected object is a lamp, it would be nice the enum ...
21
votes
3answers
6k 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 ...
14
votes
4answers
10k 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
1answer
509 views

Copy existing property from e.g. Properties window to a custom panel

So if I have this custom panel in the 3D view, is there a way I can take a property from for example the properties window and paste it onto my panel below the "text" prop, without creating a new ...
24
votes
2answers
17k 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 ...
15
votes
4answers
9k views

Can I refer to another object's properties from a Cycles node shader? Drivers? If so, how?

I am trying to develop several shaders that need to take into account the position or orientation of another object in my scene. Seems like a generally useful thing to be able to do. Here's an ...
10
votes
1answer
13k views

How display and use operator properties in a Python Blender UI panel?

I have try to make an UI Panel with my operator, but i can not create a panel with the 2 choices (axis and widht). I can create a button who launch a menu in the tools pannel, and the operator works ...
5
votes
4answers
1k views

Drive shape key based on relative camera orientation?

Let's say (for the sake of simplicity) that this cube with two blue sides is my character... and the shape key in question raises a few vertices on top. Whenever the camera views either Blue side, I'...
4
votes
2answers
3k views

How do I register 'Scene' properties with Python in 2.8?

I'm currently udpating some 2.7x script for 2.8. Everything is going fine except for one thing: Currently the script uses a class to store some properties like so: ...
12
votes
2answers
2k views

Assign datablock to custom property

With bpy.props I can assign bool, int, float and string ...
11
votes
1answer
12k views

Use custom properties (variable values) in the node editor

An object's Custom Properties panel looks like a great way to inject variable values in the Compositor: However, there does not seem to be an Input that defines a reference to the Object Data's ...
9
votes
1answer
6k 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 ...
4
votes
1answer
849 views

How do I get invoke_props_popup to work?

I'm trying to get invoke_props_popup to work. But my code produces this error: ...
3
votes
1answer
2k views

Return values of operators

When calling an operator like wm.link, is there a way to get the user input like selected directory, filepath or object name? Here is a simple code example: ...
2
votes
1answer
234 views

Using 'Float Property Layers' value in Node Editor (similar to Vertex Color)

I have an object called origin with 272 meshes/faces and Float Property Layers (called ...
2
votes
3answers
2k views

Set rotation values without applying them

Is it possible to set some rotation values to Blender GUI corresponding object fields (or any other like location or scale) without actually applying them to the object itself, like some sort of "...
10
votes
3answers
5k 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 ...
12
votes
2answers
1k views

How to register global (i.e., unique per file) properties?

I need to store additional information in a .blend file, that occurs only once per file. So, attaching it to, for example, bpy.types.Scene doesn't help. Since <...
4
votes
3answers
3k views

How to edit a custom property in a python script?

I am creating a custom property on an Empty in a script, and then editing the property's data such as the name, limits, and Tooltip description. I am using the commands echo'ed from the info panel ...
4
votes
1answer
1k views

Keyframing emission shader colour/strength using python

I'm trying to animate the colour and strength properties of an emission shader based on external data using script. I add a cube and give it an emission shader. I can alter the strength property using:...
1
vote
1answer
219 views

How can I get the full path of the selected file from the file explorer?

I have tried in several ways and the only one that worked for me was through a modal that extends from ImportHelper, however I would like to do everything from the ...
0
votes
1answer
666 views

How to start second action after check that first one is done in bge?

Here I want help of you people. here I want to start second action animation but before this i want to check that first action is done. same this way i want to do third action before that i want to ...
7
votes
2answers
8k views

Adding Other types of Custom Properties

I'm starting to use the amazing, yet simple to use Blender Drivers: I'm looking for a way to add other Types of Custom Properties than the default floats. For instance: Color, Vector, String, ...
8
votes
2answers
4k views

Setting a Property's min and max values after creation

When using an Int- or FloatProperty, is there any way of changing their min and ...
9
votes
1answer
6k views

Creating a custom permanent property in Blender 2.70 python script to access in GUI Panel

I was going through the "Getting started" API documentation for 2.68 since I'm guessing 2.70 is similar. I was testing out how to create my first script in 2.70 which I would like to save values which ...
6
votes
1answer
2k views

Control custom properties

How can I add remove and create a callback/event for a custom property using bpy. I have a scene, called scene, and I want to add a custom property named ...
3
votes
1answer
943 views

prop_search with a custom PropertyGroup

I want the user to be able to select some data from a CollectionProperty ...
6
votes
2answers
33k views

How to open properties bar, I accidentally closed it? [duplicate]

As you can see I accidentally closed my properties bar on the right hand side and I can't figure out how to open it again. Please help! I mean the part I have boxed in red in this one I can't get ...
5
votes
1answer
3k views

Python with Blender: Using EnumProperty the dynamic way

I want to use the EnumProperty the dynamic way. I've got two dialog boxes. In the first one I'm asking for database parameters and in the second one the user has to ...
3
votes
1answer
2k views

Hide custom properties in the UI panel with python

I tried to use options={'HIDDEN'} when I declare my property but it doesn't seems to work. Is there a way to hide a custom property in the UI panel?
2
votes
1answer
2k views

How do I pass an argument to an operator that is called inside a panel?

I would like to be able to pass aarguments to operators that I am calling from panels/buttons but I do not know how to do that. At the moment I use "global" variables but they tend to make the code a ...
1
vote
2answers
706 views

How to get / set attributes scene property in blender 2.79?

This question has already been asked for blender 2.8, now that I have had an answer I quote the code fragment of @aliasguru's answer (How to write __annotations__ (scene property) in new scene?) ...
0
votes
1answer
1k views

Properties Tab only showing World Tab

My properties tab on the right is only showing the World tab and nothing else. I'm new and don't know how to solve this.
10
votes
1answer
4k views

In Python is it possible to change the background color of a property ui?

I want to be able to change the background color of a property ui. At the moment it does: Green = has an Fcurve Yellow = has a keyframe Purple = has a Driver I want to to be able to change the ...
13
votes
3answers
3k views

How would I change a Cycles material's color using the scale of the object instance it's applied to?

Basically I have a field of spheres that are a bunch of different sizes that use the same material and I want them to be a different color based on their size. I'm using a volumetric shader, so each ...
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) ...
6
votes
1answer
2k views

Python script to print tooltip value when mouse is over a property

I want to get the tooltip value of a property when the mouse is over it (after pressing a shortcut), like the X location of an object or another value that can be animated in the scene. In specific, ...
4
votes
1answer
979 views

Save objects in Object ID Properties (Blender 2.79)

I saw that Blender 2.79 has the ability to save objects in properties using their id's. However, due to the limited documentation i can't figure out what i am doing wrong. I have included the code and ...
10
votes
2answers
10k 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", ...
6
votes
1answer
2k views

Controlling drivers with data received via TCP/UDP

For a project I need to drive shape keys with data received via a network connection. In my setup I receive input form a TouchOSC app running on an iPad into PureData on a Mac. The input data then is ...
2
votes
1answer
1k views

Creating a Custom Properties Tab in Blender 2.80

I have a suite of several addons that I grouped together in a custom tab in Blender 2.7x, assigning the bl_category to the name of my custom suit: ...
2
votes
1answer
1k views

Timers and animation frame rate

The following image represents a timer with minutes and seconds that I created: What is the correct value of the "skip" option in the always sensor if I want it to activate every 1 second? Also, ...
1
vote
1answer
638 views

Python: Edit panel to edit custom bmesh face layers?

With the bmesh module, I added a custom data layer to a mesh, holding information for each face. ...
1
vote
1answer
1k views

register group of properties 2.8 [duplicate]

I'm updating my addon to 2.80 and I'm stuck with the new register class system. I try to follow the answer here but I'm not good enough as a coder to understand the solution. The problem comes to ...
6
votes
1answer
757 views

PointerProperty to node of material node tree

I'm trying to register a PointerProperty to a node in a material's node tree. After hours of trying a number of things, I suspect this is impossible and I think it's related to nodes not having their ...
4
votes
2answers
744 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 ...
3
votes
1answer
552 views

How to display the "animate property" diamond keyframe insert button (2.8x)

I am making a custom panel for a rig and I would like to be able to easily insert keyframes on my rig properties the same way we can already do in the default properties panel. I'd basically like to ...
3
votes
1answer
1k views

How to make my prop search show the objects in my scene?

I have a simple object selector using a prop search. At the moment it runs but doesn't show any of the objects in my scene. This is what it looks like: How can I get that to show all of my objects? ...
2
votes
1answer
280 views

Is there any way to override UILayout.prop tooltip?

I have a collection on boolean properties I want to display in a node. BoolVectorProperty isn't really applicable because I want to be able to change the size of ...
2
votes
1answer
197 views

How to write __annotations__ (scene property) in new scene?

I have a scene with custom properties, written in a class, I am now able to access the values of these properties, I would like to know how to write these values in a new scene. For example: This is ...