0
$\begingroup$

First, I haven't been programming with the API for that long, and I don't have Python as much to work with either. I'm trying, from the interaction side, to implement something like the Modifier tab. So you can add new entries and define some properties. To program this I wanted to create an array with several objects of a Prop Group class. However, there seems to be no way to create a propertie array, or vector, with pointers. Are there other ways to create something similar? I don't expect any code, but I would be interested to know how to implement something like this.

$\endgroup$
0

1 Answer 1

0
$\begingroup$

See this stackexchange for the answer and instead try:

bpy.data.objects['AnObjectName']['MyNewProperty'] = (1.0, 2.0, 3.0) 

to add a float array of 3 to the object custom property, or

bpy.data.objects['AnObjectName'].data['MyNewProperty'] = (1.0, 2.0, 3.5) 

to add to a mesh custom property. Also see this answer.

You would have to de-reference these as

['MyNewProperty'][0], ['MyNewProperty'][1], ['MyNewProperty'][2]

to set up an X,Y,Z vector. For example:

vec = mathutils.Vector((obj['prop'][0],obj['prop'][1],obj['prop'][2],obj['prop'][3]))
$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .