I get it for props directly assigned to types.Object or Scene etc, but how does it work with group of property like types.Object.My_group.xxx or types.Scene.My_group.My_subGroup.xxx ?
I try to adapt the method described below here to my script to update my property fields while running :
class MyPropGroup(bpy.types.PropertyGroup):
pass
MyPropGroup.my_float = bpy.props.FloatProperty()
it’s from here : http://wiki.blender.org/index.php/Dev:2.5/Py/API/Overview#Manipulating-Classes
two menus (bpy.props.EnumProperty) items lists are updated with a function, during my script execution. I mean it’s the goal, atm it’s updated at init and does not refresh. the menus are declared in a propertyGroup class. (in fact a sub group class)
class ChessTheme(bpy.types.PropertyGroup) :
'''
'''
path = bpy.utils.script_paths('addons/io_pgn/themes/')[0]
used_board = 'default'
used_pieces = 'default'
<b>thm</b> = themesRefresh(path)
<b>board </b>= bpy.props.EnumProperty( items = <b>thm</b>['board'], default = used_board, name = "Board", description = "" )
<b>pieces </b>= bpy.props.EnumProperty( items = <b>thm</b>['pieces'], default = used_pieces, name = "Pieces", description = "" )
class Chess(bpy.types.PropertyGroup) :
'''
'''
theme = bpy.props.PointerProperty(type=ChessTheme)
# sys
path = bpy.utils.script_paths('addons/io_pgn/')[0]
[...]
my_float = bpy.props.FloatProperty(name="Some Floating Point", default=3)
the classes are registered under types.Scene, chess and chess.theme
but I can’t update my class props. sure I can read it from console or from the script:
>>> bpy.context.scene.chess.my_float
-192.04258728027344
>>> bpy.context.scene.chess.theme.board
'lite'
but I can’t redeclare the property to refresh the items list.
bpy.types.Scene.chess<b>?????</b> = bpy.props.EnumProperty( items = <b>thm</b>['pieces'], default = used_pieces, name = "Pieces", description = "" )
the example should mention the api path before MyPropGroup :
bpy<b>.???.</b>MyPropGroup.my_float = bpy.props.FloatProperty()