Timeline for How to move and resize a bone in Python such that the head and the tail are at a certain global position?
Current License: CC BY-SA 4.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jan 16, 2023 at 14:16 | comment | added | Jack Gordon | Have done so. Thanks again! | |
Jan 16, 2023 at 14:16 | vote | accept | Jack Gordon | ||
Jan 16, 2023 at 14:07 | comment | added | Harry McKenzie♦ | you're welcome can u tick the checkmark to mark the answer so we know ur query is resolved. | |
Jan 16, 2023 at 13:57 | comment | added | Jack Gordon | Thank you so much. I was able to make it work. Thank you again :) | |
Jan 16, 2023 at 12:26 | comment | added | Harry McKenzie♦ |
select it with armature.select_set(True)
|
|
Jan 16, 2023 at 12:22 | comment | added | Jack Gordon | OK, thank you. And can I somehow select the armature in Python instead of clicking on it? I'll Google it, but I'm asking here if you know how to do it. I also updated my original question. | |
Jan 16, 2023 at 12:20 | comment | added | Harry McKenzie♦ | you have to return to object mode and then select the next armature then run the script. | |
Jan 16, 2023 at 12:16 | comment | added | Jack Gordon | I agree with you. I think I am able to figure out how to move different bones, regardless of whether they are a part of one armature or multiple armatures. However, as I stated in my first comment to your post, I can only modify the head and the tail of one bone. When I try to access the bone in other armatures, I get the key error I mentioned above. I think this has something to do with Edit mode, but I'm not sure. | |
Jan 16, 2023 at 12:10 | comment | added | Harry McKenzie♦ | But i think you should be knowledgable enough to figure that out. that's just a matter of simple looping, the heavy lifting of your requirement is basically there. It should be a piece of cake for you to figure out the rest :) | |
Jan 16, 2023 at 12:06 | comment | added | Harry McKenzie♦ | uhm. you asked for one bone. you did not specify exactly what the requirement was. so what exactly do you need? please update your question post. Like is it for alot of armatures with one bone or is it for armatures with many bones? or is it only 1 armature with many bones? please be specific. | |
Jan 16, 2023 at 10:41 | comment | added | Jack Gordon |
Thank you for the script. It works for one bone. However, I tried it for multiple bones and it doesn't work. I get an error KeyError: 'bpy_prop_collection[key]: key "Bone" not found' for any other Bone i try to access, even though the names of all of my bones are Bone under different armatures. Do you know why this code doesn't work for multiple bones?
|
|
Jan 16, 2023 at 9:55 | history | edited | Harry McKenzie♦ | CC BY-SA 4.0 |
added 235 characters in body
|
Jan 16, 2023 at 9:44 | history | edited | Harry McKenzie♦ | CC BY-SA 4.0 |
deleted 151 characters in body
|
Jan 16, 2023 at 9:37 | history | answered | Harry McKenzie♦ | CC BY-SA 4.0 |