Skip to main content
deleted 345 characters in body
Source Link

Here is how it works:

You can change your bpy.props parametres after declaration like so:

import bpy
prop = bpy.types.IntProperty()
prop[1]['min'] = 200
prop[1]['default'] = 123
# etc.

But you can't do that to a static propertyan actual instance:

import bpy
bpy.types.Object.prop = bpy.typesprops.IntProperty() 

bpy.context.active_object.prop # this is just an int - not subscriptable
# itthis onlyevaluates holdswhat the value

# so to adjust the min maxis etc.and youreturns need<class to'int'> re-declare it:not subscriptable

enter image description here

To adjust the min max etc. you need to re-declare it:

bpy.types.Object.prop = bpy.typesprops.IntProperty(min=100, max=300)
# or if you only need to change 1 thingnote:
bpy.types.Object.prop[1]['soft_max'] = 300
# and yeah thisre-declaring will change it for all the objects:(

Note that changingChanging the default value will not change the actual value of that static property - you will need to assign it a new value in that case. But newly created objects will have this new default.

So the solution depends on what you do with the properties. I will assume you need them displayed in some panel and they are static scene's properties.You can make it work like this:

  1. create callback function for your hT property
  2. have this function re-declare your fW property with new parameters based on hT value

Here is how it works:

You can change your bpy.props parametres after declaration like so:

import bpy
prop = bpy.types.IntProperty()
prop[1]['min'] = 200
prop[1]['default'] = 123
# etc.

But you can't do that to a static property:

import bpy
bpy.types.Object.prop = bpy.types.IntProperty()
bpy.context.active_object.prop # this is just an int - not subscriptable
# it only holds the value

# so to adjust the min max etc. you need to re-declare it:
bpy.types.Object.prop = bpy.types.IntProperty(min=100, max=300)
# or if you only need to change 1 thing:
bpy.types.Object.prop[1]['soft_max'] = 300
# and yeah this will change it for all the objects:(

Note that changing the default value will not change the actual value of that static property - you will need to assign it a new value in that case. But newly created objects will have this new default.

So the solution depends on what you do with the properties. I will assume you need them displayed in some panel and they are static scene's properties.

  1. create callback function for your hT property
  2. have this function re-declare your fW property with new parameters based on hT value

You can't do that to an actual instance:

import bpy
bpy.types.Object.prop = bpy.props.IntProperty() 

bpy.context.active_object.prop
# this evaluates what the value is and returns <class 'int'> - not subscriptable

enter image description here

To adjust the min max etc. you need to re-declare it:

bpy.types.Object.prop = bpy.props.IntProperty(min=100, max=300)
# note: re-declaring will change it for all the objects

Changing the default value will not change the actual value of that static property - you will need to assign it a new value in that case. But newly created objects will have this new default.

You can make it work like this:

  1. create callback function for your hT property
  2. have this function re-declare your fW property with new parameters based on hT value
Source Link

Here is how it works:

You can change your bpy.props parametres after declaration like so:

import bpy
prop = bpy.types.IntProperty()
prop[1]['min'] = 200
prop[1]['default'] = 123
# etc.

But you can't do that to a static property:

import bpy
bpy.types.Object.prop = bpy.types.IntProperty()
bpy.context.active_object.prop # this is just an int - not subscriptable
# it only holds the value

# so to adjust the min max etc. you need to re-declare it:
bpy.types.Object.prop = bpy.types.IntProperty(min=100, max=300)
# or if you only need to change 1 thing:
bpy.types.Object.prop[1]['soft_max'] = 300
# and yeah this will change it for all the objects:(

Note that changing the default value will not change the actual value of that static property - you will need to assign it a new value in that case. But newly created objects will have this new default.

So the solution depends on what you do with the properties. I will assume you need them displayed in some panel and they are static scene's properties.

  1. create callback function for your hT property
  2. have this function re-declare your fW property with new parameters based on hT value