Post #4995: In that case, you will create a string property. As shown in the image, please c
📋 Metadata
- Author: Pluglug
- Date: 2024-01-12 13:52:21
- Type:
answer - Quality Score: 8/10
- Reply to: post_04991
🏷️ Tags
macro python-scripting intermediate solved
⚙️ Related PME Features
- Macro Editor
- Property Editor
- Python Scripting
💬 Content
In that case, you will create a string property. As shown in the image, please create my_prop_bone_name. You can access this string entered into the property using props().my_prop_bone_name within PME. As you might notice, you can copy this code by clicking on the preview.
Below is a command using my_prop_bone_name. It searches for bones that match the specified term in the property by prefix, suffix, or exact match, and then selects those bones. Please try this in Pose Mode. If it doesn’t work, let me know the details of your issue.
tgt_bone_name = props().my_prop_bone_name; arm = C.active_object; [setattr(bone.bone, 'select', bone.name.startswith(tgt_bone_name) or bone.name.endswith(tgt_bone_name) or bone.name == tgt_bone_name) for bone in arm.pose.bones] if arm and arm.type == 'ARMATURE' and arm.mode == 'POSE' else None
❤️ 1 likes
image953×852 128 KB