Post #4816:
Gh
📋 Metadata
- Author: Pluglug
- Date: 2023-07-30 15:41:05
- Type:
answer - Quality Score: 7/10
- Reply to: post_04815
🏷️ Tags
pie-menu python-scripting intermediate
⚙️ Related PME Features
- Python Scripting
- Property Editor
- Pie Menu Editor
💬 Content
Ghostil:
Part 1 like I figured out how to do it. You need to put a comma after the command and then write the following one and then both of them will be available in the menu. Can this be used everywhere?
L.column().prop(C.object, 'location'), L.column().prop(C.object, 'rotation_euler')
This code isn’t running two prop methods at once, but rather, it is bundling the results of the two calls into a single tuple.
var = 'Hello' ;message_box(var)
To combine two statements into a single line, you use ; (semicolon).
Ghostil:
cycles do not work directly there. They don’t seem to be needed there.
I’m going to answer by guessing the intent of your question. The properties of ‘Light’ vary depending on the renderer. So, depending on the situation, you may need to change the displayed menu based on the renderer.
current_renderer = bpy.context.scene.render.engine
if current_renderer == 'BLENDER_EEVEE'
# EEVEE Menu
elif current_renderer == 'CYCLES'
# Cycles Menu
elif current_renderer == 'BLENDER_WORKBENCH'
pass
Ghostil:
I want to understand how to get here any properties of any data types from blender.
Since there is no possibility of searching by name as with menu or operator. Not all properties can be accessed via the context menu.
The method of retrieving PME properties isn’t universal, so there might be times when you have to search for the code yourself. In my case, I copy the data path and try it in the Python console. I’m sorry, but I don’t have the knowledge to explain a definitive method.
Ghostil:
In reality, you can add But how to get this for all materials without a loop?
Without a loop? To my knowledge, there is no such method.