Post #2686: Got it, now it works. What about by other question? Should I use the Property op
📋 Metadata
- Author: RaphaelBarros
- Date: 2019-08-28 18:32:08
- Type:
question - Quality Score: 6/10
- Reply to: post_02684
- Replies (1): post_02687
🏷️ Tags
macro python-scripting intermediate unsolved
⚙️ Related PME Features
- Macro Editor
- Property Editor
- Python Scripting
💬 Content
Got it, now it works. What about by other question? Should I use the Property option from PME?
RaphaelBarros:
While we’re at it, is there any way for me to reference a variable outside this button? For example, in case I want to make this button be disabled after it’s clicked, I’d make the macro create an variable (let’s say “var”) in the beginning, make it True, then make it false in the last step of the macro and make this:
sub = L.row(align=True); sub.enabled = var; operator(sub, "pme.exec", cmd="open_menu('Macro Operator Name')", text=slot, icon=icon, icon_value=icon_value)Would that be possible? I tried referencing an outside variable on your previous example, but it keeps saying the variable didn’t exist:
sub = L.row(align=True); sub.enabled = False; operator(sub, "import_scene.obj", text=slot, icon=icon, icon_value=icon_value)