Hello!
First of all, I’m sorry If I couldnt explain my problem well, I’ll do my best, excuse my low understanding of the blender python scripting, and feel free to ask me if you wish.
I was scripting some ui panels for my rigs, and while experimenting, I run into some problems.
Doing some researchers, I found that there are two sides of the ui scripting, (panels and operators).
First let me tell you how I think an operator would work, and please correct me if I’m wrong. Logically I think an operator would need at least 2 things to work, most importantly the action, and a text, (and maybe some other things like icons and so).
But when I wanted to make some buttons using the operators, actually it was a bit confusing.
In the #LayoutPanel(bpy.types.Panel)# for example I made #row.operator(“object.button”, text=“button”)# for me I have no idea how the “object.button” works, I made an assumption that it could be a special blender thing for drawing buttons, but I found that isnt correct, because that part can be also used to execute an action, for example replacing “object.button” with will make it execute a mode toggle action.
Another problem, is how can I know those special writings to execute my actions? the edit mode toggle was an easy thing to guess cuz its “bpy.ops.object.posemode_toggle()”, whats about other actions that doesn’t have a “bpy.ops.object”?
My second problem is in the class that does the execution (if that’s correct), which has a funny name like “OBJECT_OT_Button”.
I also found that I can specify any action in the execution function, and it works as sweet as expected (which is confusing because we can already execute actions in the LayoutPanel class), but the more important thing, I have no idea how I can link an action in the “execution class” to one of my panels in the LayoutPanel class.
Again I’m so sorry if I sound too confusing, I only hope that you got my point, and Thanks in advance :).
edit: the main problem is solved, but if any body wishes to clarify or add anything, that would be great