Notifications
Clear all
[Closed] Orientation constraint
May 02, 2020 5:59 am
Some way to be able to automate this kind of manual work, each object that contains orientation constraint its target object to be 2 bones of the bone hierarchy
4 Replies
May 02, 2020 5:59 am
This code assumes the bones and points are properly named for sorting them.
Select the bones and points you want to rig and run the code.
Note: The code is based on the sample scene.
(
points = #()
bones = #()
for j in selection do
(
if iskindof j point then append points j.name else append bones j.name
)
sort points
sort bones
for j = 1 to points.count do
(
controller = orientation_constraint()
pt = getnodebyname points[j]
pt.rotation.controller = controller
if j > 1 and j < points.count do
(
bn = getnodebyname bones[j-1]
controller.appendTarget bn 50.0
)
bn = getnodebyname bones[j]
controller.appendTarget bn 50.0
)
)
May 02, 2020 5:59 am
It’s excellent, thank you very much!
One question… you may be able to add 2 bones in the list of each driver as you can see in the image I posted
May 02, 2020 5:59 am
Sorry, I missed that from the .gif.
I’ve updated the code. It should now add two bones.