Fix T50830: Wrong context when calling surfacedeform_bind
The custom poll function for surfacedeform_bind seems to have caused issues when calling it from Python. Fixed by using the generic modifier poll function, and setting the button to be active or not in the Python UI code instead. (there might be a better way, but for now this works fine)
This commit is contained in:
@@ -960,10 +960,13 @@ class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
||||
|
||||
layout.separator()
|
||||
|
||||
col = layout.column()
|
||||
col.active = md.target is not None
|
||||
|
||||
if md.is_bound:
|
||||
layout.operator("object.surfacedeform_bind", text="Unbind")
|
||||
col.operator("object.surfacedeform_bind", text="Unbind")
|
||||
else:
|
||||
layout.operator("object.surfacedeform_bind", text="Bind")
|
||||
col.operator("object.surfacedeform_bind", text="Bind")
|
||||
|
||||
def UV_PROJECT(self, layout, ob, md):
|
||||
split = layout.split()
|
||||
|
Reference in New Issue
Block a user