Skip to main content
deleted 1 character in body
Source Link
Bert VdB
  • 1.1k
  • 8
  • 21

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

Assigning these values to the Object like this:

bpy.types.Object.my_settings = bpy.props.PointerProperty(type=MaterialSettings)

Note: you can choose a custom name instead of 'my_settings'

And the name after the 'type=' is the classname of your property group .

You can access these properties like this: object.my_settings.my_float = 3.0 object.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

Assigning these values to the Object like this:

bpy.types.Object.my_settings = bpy.props.PointerProperty(type=MaterialSettings)

Note: you can choose a custom name instead of 'my_settings'

And the name after the 'type=' is the classname of your property group .

You can access these properties like this: object.my_settings.my_float = 3.0 object.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)

Assigning these values to the Object like this:

bpy.types.Object.my_settings = bpy.props.PointerProperty(type=MaterialSettings)

Note: you can choose a custom name instead of 'my_settings'

And the name after the 'type=' is the classname of your property group .

You can access these properties like this: object.my_settings.my_float = 3.0 object.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

added 266 characters in body
Source Link
Bert VdB
  • 1.1k
  • 8
  • 21

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

Assigning these values to the Object like this:

bpy.types.Object.my_settings = bpy.props.PointerProperty(type=MaterialSettings)

Note: you can choose a custom name instead of 'my_settings'

And the name after the 'type=' is the classname of your property group .

You can access these properties like this: materialobject.my_settings.my_float = 3.0 materialobject.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

You can access these properties like this: material.my_settings.my_float = 3.0 material.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

Assigning these values to the Object like this:

bpy.types.Object.my_settings = bpy.props.PointerProperty(type=MaterialSettings)

Note: you can choose a custom name instead of 'my_settings'

And the name after the 'type=' is the classname of your property group .

You can access these properties like this: object.my_settings.my_float = 3.0 object.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!

Source Link
Bert VdB
  • 1.1k
  • 8
  • 21

Try using a property group class where you can store all your properties.

import bpy

class MaterialSettings(bpy.types.PropertyGroup):
    my_int = bpy.props.IntProperty()
    my_float = bpy.props.FloatProperty()
    my_string = bpy.props.StringProperty()

bpy.utils.register_class(MaterialSettings)'

You can access these properties like this: material.my_settings.my_float = 3.0 material.my_settings.my_string = "Foo"

This way, only the propertyclass will be visible in the properties tab and is only editable via script!