Skip to main content
Add code snippet to illustrate.
Source Link
Adhi
  • 14.4k
  • 2
  • 57
  • 63

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, in the snippet below I use bpy.props.IntProperty function to add a custom property to a scene object, say, as bpy.types.Scene.int_prop. Even though scene.int_prop is a Python integer, I can still access the property's structure as scene.rna_type.properties['int_prop'], and the type will be bpy.types.IntProperty.:

import bpy

bpy.types.Scene.int_prop = bpy.props.IntProperty(default=9)

# > 9
print(bpy.context.scene.int_prop)

# > <class 'int'>
print(type(bpy.context.scene.int_prop))

# > <class 'bpy.types.IntProperty'>
print(type(bpy.context.scene.rna_type.properties['int_prop']))

del bpy.types.Scene.int_prop

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, I use bpy.props.IntProperty function to add a custom property to a scene object, say, as bpy.types.Scene.int_prop. Even though scene.int_prop is a Python integer, I can still access the property's structure as scene.rna_type.properties['int_prop'], and the type will be bpy.types.IntProperty.

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, in the snippet below I use bpy.props.IntProperty function to add a custom property to a scene object. Even though scene.int_prop is a Python integer, I can still access the property's structure as scene.rna_type.properties['int_prop'], and the type will be bpy.types.IntProperty:

import bpy

bpy.types.Scene.int_prop = bpy.props.IntProperty(default=9)

# > 9
print(bpy.context.scene.int_prop)

# > <class 'int'>
print(type(bpy.context.scene.int_prop))

# > <class 'bpy.types.IntProperty'>
print(type(bpy.context.scene.rna_type.properties['int_prop']))

del bpy.types.Scene.int_prop
Use different example.
Source Link
Adhi
  • 14.4k
  • 2
  • 57
  • 63

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, I use bpy.props.PointerPropertybpy.props.IntProperty function to add a custom property to a scene object, say, as bpy.types.Scene.my_propsint_prop. Even though scene.int_prop is a Python integer, I can thenstill access the property's structure as bpy.context.scene.my_propsrna_type.properties['int_prop'], and the type will be bpy.types.PropertyGroupbpy.types.IntProperty.

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, I use bpy.props.PointerProperty function to add a custom property to a scene object, say, as bpy.types.Scene.my_props. I can then access the property's structure as bpy.context.scene.my_props, and the type will be bpy.types.PropertyGroup.

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, I use bpy.props.IntProperty function to add a custom property to a scene object, say, as bpy.types.Scene.int_prop. Even though scene.int_prop is a Python integer, I can still access the property's structure as scene.rna_type.properties['int_prop'], and the type will be bpy.types.IntProperty.

Source Link
Adhi
  • 14.4k
  • 2
  • 57
  • 63

*Property functions in bpy.props module are what we use to instantiate the property. Classes with the same name in bpy.types contains structure related to the property, accessible at runtime.

For example, I use bpy.props.PointerProperty function to add a custom property to a scene object, say, as bpy.types.Scene.my_props. I can then access the property's structure as bpy.context.scene.my_props, and the type will be bpy.types.PropertyGroup.