Step Amount for FloatProperty

When I am creating a new float property for an object like this:

bpy.types.Object.MyFloat = FloatProperty(name=“My Float”,default=.75,step=25)

I can assign a step value which will allow me to control the amount the value is increased or decreased when clicking the arrows on the control in the interface.

My question is:

Can i change the step value of this property through code?

I know this doesn’t work but i am trying to do something like this

bpy.context.active_object.MyFloat.step = 50

the step variable is only available at registration time, so could only re-register the prop every time you wanna change the step value. The current prop value will remain.

we were supposed to get some new methods with buttons using events
like the old var in 2.49

any idea when we are going to get this new type of panel?

thanks

Ricky,

I have been using the update property when creating RNA Properties. This kind of acts like an event when the value of the property is changed in the interface i can automatically call a python function to execute. I am sure you might already know this, but i thought i would throw it out there.

sorry did not really follow what happen for at leat 6 moths
so not certain what happen as changes !

sorry do you example for this uopdate property ?

does it means that you can make let say a min slider’s value function of another propertie ?
like we had in 2.49!

thanks

Update ExampleIt can be useful to perform an action when a property is changed and can be used to update other properties or synchronize with external data.All properties define update functions except for CollectionProperty.
import bpydef update_func(self, context): print(“my test function”, self)bpy.types.Scene.testprop = bpy.props.FloatProperty(update=update_func)bpy.context.scene.testprop = 11.0

I found this information in the API documentation. I am not sure what functionality was available in 2.49, because i started to learn the API with the 2.6x versions. I hope this helps.

sorry did not really follow what happen for at leat 6 moths

the update-parameter is available since 2.58 release!

You could do something hacky and make one property control another property’s min/max values, but only with re-registration of the 2nd prop every time the 1st is changed…

import bpy




class LayoutDemoPanel(bpy.types.Panel):
    """Creates a Panel in the scene context of the properties editor"""
    bl_label = "Layout Demo"
    bl_idname = "SCENE_PT_layout"
    bl_space_type = 'PROPERTIES'
    bl_region_type = 'WINDOW'
    bl_context = "scene"


    def draw(self, context):
        layout = self.layout


        scene = context.scene


        # Create a simple row.
        layout.prop(scene, "myp")
        layout.prop(scene, "myk")

def t(scene, context):
    bpy.types.Scene.myk = bpy.props.IntProperty(min=scene.myp, max=20)


def register():
    bpy.utils.register_class(LayoutDemoPanel)
    bpy.types.Scene.myp = bpy.props.IntProperty(min=0, max=10, update=t)
    bpy.types.Scene.myk = bpy.props.IntProperty(min=0, max=20)




def unregister():
    bpy.utils.unregister_class(LayoutDemoPanel)




if __name__ == "__main__":
    register()

Thanks CoDEmanX,

I think this might work for what i am trying to do.

This is a really embarrassing to ask, but i just started to use these forums. How do i post a code block in a forum post?