These are at least a few options to look into. Press the Windows key + I key simultaneously to open the Settings Application. The drawback of using a single operator 'callback' with an internal dispatch, is that the tooltip wouldn't be unique per fn_name. How change the color of your cursor in Windows 11 or Windows 10. class SimpleCBOperator():įn_name = (default='')Ĭursor_set = _set You would have less code, and arguably more understandable code, by dropping the decorator entirely and going with a dispatch-callback pattern. *The way I wrote the decorator function won't let you decorate the execute function. Notice the repeating code is defined once in the decorator and any* function which you want to wrap that code around can be decorated with the import bpyĬlass SimpleCBOperator():īl_idname = "node.some_callback_identifier"įn_name = dispatch(self, context, type_op):Įlif type_op = 'some_named_other_function':īpy.utils.register_class(SimpleCBOperator)īpy.utils.unregister_class(SimpleCBOperator)īpy._callback_identifier(fn_name='some_named_function')
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |