can anyone point me what is going wrong here :
[ just copy and paste in console ]
class Test_sett(bpy.types.IDPropertyGroup):pass
Test_sett.StringProperty(attr="username",
name="Username",
description="Username",
maxlen=64,default="")
Test_sett.StringProperty(attr="password",
name="Password",
description="Password",
maxlen=64,
default="")
bpy.types.Scene.PointerProperty(attr="competition_login_settings",
type=Test_sett,
name="Test_sett",
description="Settings")
here is the error:
Traceback (most recent call last):
File "<blender_console>", line 1, in <module>
TypeError: PointerProperty(...): expected an RNA type derived
from IDPropertyGroup, failed with: SystemError: BoolProperty(...): internal error,
self of type 'type' had no bl_rna attribute, should never happen
helping hands will be rewarded
its a python decorator problem
just need to add
def rnaType(rna_type):
if bpy: bpy.types.register(rna_type)
return rna_type
@rnaType
class Test_sett(bpy.types.IDPropertyGroup):pass
to get things working…
also applicable to this script in this post
http://blenderartists.org/forum/showthread.php?t=179694
if you want to see that script working in Blender 2.5 Beta
can you upload latest script with this new code in it
would be easier to try to understand it
keep up the good work
happy 2.5
from bpy import ops , context, data, types
def rnaType(rna_type):
## this will check whether module 'types' is loaded
if types:
## this will register our custom class ap_CameraExport
types.register(rna_type)
## and the interesting thing is that
## it will return the same class back to us
## or that is what is known as decorator afaik
return rna_type
## this little guy with @ symbol means the class ap_CameraExport has to pass through
## function rnaType at the time of builing , more info : google
@rnaType
class ap_CameraExport( types.IDPropertyGroup):
pass
ap_CameraExport.EnumProperty(attr="mode",
items=(
("STYLE_AE", "After Effects", "Export Adobe Javascript"),
("STYLE_MAX", "3DS Max", "Export Discreet MaxScript"),
),
name="Output mode",
description="Mode of generated ASCII text",
default="STYLE_AE")
types.Scene.PointerProperty(attr = "export_style",
type = ap_CameraExport,
name = "Export Style",
description= "Camera Export Style")
class OBJECT_PT_hello( types.Panel):
bl_label = "Hello World Panel"
bl_space_type = "PROPERTIES"
bl_region_type = "WINDOW"
bl_context = "scene"
def draw(self, context):
layout = self.layout
obj = context.object
scene = context.scene
row = layout.row()
row.label(text="Hello World!", icon='WORLD_DATA')
exportStyle = scene.export_style
layout.prop(exportStyle, "mode", expand=False)
layout.prop(exportStyle, "mode", expand=True)
row = layout.row()
row.label(text="Active object is: " + obj.name)
row = layout.row()
row.prop(obj, "name")
def register():
types.register(OBJECT_PT_hello)
def unregister():
types.unregister(OBJECT_PT_hello)
if __name__ == '__main__':
register()
if there is any problem let me know…