0
$\begingroup$

I have a problem with geometry nodes and panel. I use context.active_object and if I create many instances with my addon … only the active object gets the effect.

I’m wondering, is it possible to synchronize float custom property (in panel) and geometry nodes slider group input per object? This would be so, that when I place a driver or keyframe to the panel - also the node input would have the same expression - not just the value from the experssion/keyframe.

There is no error in console. But the getter prints every tick if I input something to print there.

Custom property:

RadiusProperty: FloatProperty(
            name = "Radius",
            description = "A float property",
            default = 1.0,
            min = 0,
            max = float("inf"),
            update = Updatevaluesfunc,
            get = uni_getter("Input_28"),
            set = uni_setter("Input_28"),
            precision= 3,
            ) 

UI:

valuetool = scene.value_tool
row.prop(valuetool, “RadiusProperty”)

Update function

def Updatevaluesfunc(self, context):
activeobject = bpy.context.active_object
    activeobject.data.update()

return 

Getter/Setter:

def uni_getter(attr_str):
    def get_value(self):          
           activeobject = bpy.context.active_object        
           activemodifier = activeobject.modifiers.active
           activeobject.data.update()                 
           return activemodifier[attr_str]
        return get_value   



def uni_setter(attr_str):
    def set_value(self, value):
        activeobject = bpy.context.active_object
        amo = activeobject.modifiers.active
        amo[attr_str] = value                      
    return set_value 

Thank you if you had the time to read this!

I’ve been thinking this for 3 days straight… like all the time… I could do it straight using geometry nodes sliders as props in panel… but that way if I set the values - I lost the default/min/max values of nodes. I have been doing a script for it, but it’s slow so I want to change the way to operate with custom properties.

$\endgroup$

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.