I try to create some properties for custom primitives in property group classes and I want to access them from an operator in another .py file to create primitives, but I get the following error:

AttributeError: 'tuple' object has no attribute 'base'

I'm trying to follow this advice:

class MyProps(PropertyGroup):
        ... # properties and stuff

class ParentProps(PropertyGroup):
        # THIS WILL NOT WORK! MyProps _has_ to be registered at this point
        #foo = PointerProperty(type=MyProps)

def register():
        # 1) register property class

        # 2) add property (now it works)
        ParentProps.foo = PointerProperty(type=MyProps)

        # 3) register parent class

Unfortunately I get another error:

ValueError: register_class(...): expected a class argument, not 'tuple'

The WIP code looks like this: http://www.pasteall.org/60602/python (line 1260).

The design idea is that operators should create primitives and set up their properties, but these properties should still be there to change it later.

  • $\begingroup$ It would help if the example that has issues was self-contained. Currently it wont do anything - missing imports and call to register. $\endgroup$
    – ideasman42
    Aug 21, 2015 at 8:14

1 Answer 1

bpy.types.Object.povcone = PointerProperty(type=RenderPovSettingsCone_add)

you do not need to register a property from bpy.props like this

the property is there after the assignment and blender will use it as a wrapper for


so simply drop the second line

  • $\begingroup$ I had noticed, but this does not solve my problem: When I try to use the base property with bpy.types.Object.povcone['base'] I get an error: " base = bpy.types.Object.povcone['base'] TypeError: tuple indices must be integers, not str $\endgroup$
    – Ray
    Aug 20, 2015 at 15:00

You must log in to answer this question.

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