📋 Metadata
- Author: Motiomancer
- Date: 2022-07-31 15:32:48
- Type:
answer - Reply to: post_04482
💬 Content
Adam_Szalai:
Just curious how do You know how to “convert” a toogle command into this true false?
I mean the toogle command looks totally different from the true false one.
In this specific case there is a property being turned on and off so there has to be a direct way to do it, so you search ‘xray toggle python blender’ or you look it up in this same thread (when roaoao was active he solved some really complex problems)
So the answer at the end is just to google it, but you need to have some idea of python to know what you are looking for.
for example: ‘blender python edit mode’ leads us to a blender stackexchange post that has:
import bpy
for obj in bpy.data.objects:
if obj.name[0:4] == "Text" and obj.type == "MESH":
bpy.context.scene.objects.active = obj
bpy.ops.object.mode_set(mode = 'EDIT')
print(bpy.context.mode)
#bpy.ops.mesh.select_all(action = 'SELECT')
#print(bpy.ops.mesh.remove_doubles(0.0001))
bpy.ops.object.mode_set(mode = 'OBJECT')
What you need would be:
bpy.ops.object.mode_set(mode = 'EDIT')
bpy.ops.object.mode_set(mode = 'OBJECT')
To get a specific mode, and since its an operator pie menu should also give you more options
❤️ 2 likes

image694×258 24.1 KB