We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Show additional options only upon changing dropdown/ticking a box. See this example using check():
check()
import bpy def main(context): for ob in context.scene.objects: print(ob) class SimplePanel(bpy.types.Panel): """Creates Import Menu in Properties -> Scene """ bl_label = "Test" bl_space_type = "PROPERTIES" bl_region_type = "WINDOW" bl_context = "scene" def draw(self, context): layout = self.layout row = layout.row(align=True) row.alignment = 'EXPAND' row.operator("object.simple_operator", text = "Run", icon ='VISIBLE_IPO_ON') class SimpleOperator(bpy.types.Operator): """Tooltip""" bl_idname = "object.simple_operator" bl_label = "Simple Object Operator" bl_options = {'REGISTER', 'UNDO'} val1 = bpy.props.BoolProperty() val2 = bpy.props.BoolProperty() val3 = bpy.props.BoolProperty() @classmethod def poll(cls, context): """If this returns False, operator is greyed-out.""" return context.selected_objects != [] def check(self, context): """While this returns True, draw() is called continuously.""" return True def execute(self, context): main(context) return {'FINISHED'} def draw(self, context): layout = self.layout layout.prop(self, "val1") if self.val1: box = layout.box() box.prop(self, "val2") box.prop(self, "val3") def invoke(self, context, event): return context.window_manager.invoke_props_dialog(self, width = 800) def register(): bpy.utils.register_class(SimpleOperator) bpy.utils.register_class(SimplePanel) def unregister(): bpy.utils.unregister_class(SimpleOperator) bpy.utils.unregister_class(SimplePanel) if __name__ == "__main__": register()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Show additional options only upon changing dropdown/ticking a box. See this example using
check()
:The text was updated successfully, but these errors were encountered: