Profile Picture

Script for transferring rotation values from one joint to another?

Posted By Auroratrek 4 Years Ago
You don't have permission to rate!

Script for transferring rotation values from one joint to another?

Author
Message
Auroratrek
Auroratrek
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 191, Visits: 980
I'm fairly new to iClone, so not sure if iClone can do this, or if I would need a script. When I used Poser, I would import mocap data onto a figure via BVH, which worked fairly well, but the data I was working with contained side-to-side motion on the forearms, which is unnatural--that kind of rotation happens in the "twist" of the shoulder in the real world.  I had a Python script that would take the side-to-side data from the forearms (and delete it there) and add it to any already-existing "twist" values (in both positive and negative values) on the shoulders (rather than replace it) so none of the motion would be lost, just moved. Does anybody know if iClone can do something like this natively, or if there is a Python script for iClone that could do this, or might it be possible to adapt the Python script I have to work with iClone?

On my Youtube Channel: Quest of the Key: Chapter One
Kelleytoons
Kelleytoons
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 9.1K, Visits: 21.8K
You might be able to mod your Python script to do this -- all the functions you need are there (but bone data in general isn't the easiest to work with in iClone Python).



Alienware Aurora R12, Win 10, i9-119000KF, 3.5GHz CPU, 128GB RAM, RTX 3090 (24GB), Samsung 960 Pro 4TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
Auroratrek
Auroratrek
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 191, Visits: 980
Thanks , Kellytoons. I should have been clearer, however, that I didn't write the script I had for Poser--it was written for me by Phil C (who made a lot of scripts for Poser, but seems to be out of the game now). I've fiddled around the edges of bits of code here and there, but I don't think I'd be up to the task of "modding" (if that's the correct term) this script to work with iClone. Do you think this is the kind of thing I could hire a developer here on this site to do?

On my Youtube Channel: Quest of the Key: Chapter One
Kelleytoons
Kelleytoons
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)Distinguished Member (35.6K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 9.1K, Visits: 21.8K
I can't speak for other devs but for me it always comes down to how useful such a script would be, both to myself and others.

This sounds like an edge case situation -- I've never heard of anyone having the problems you're having -- so it wouldn't interest me at all.  Perhaps you could find some folks who wanted that original Python script (I assume on the Poser forum?) and see if any of them there are interested.  By and large nearly all BVH data comes in just fine through 3DX into iClone.



Alienware Aurora R12, Win 10, i9-119000KF, 3.5GHz CPU, 128GB RAM, RTX 3090 (24GB), Samsung 960 Pro 4TB M-2 SSD, TB+ Disk space
Mike "ex-genius" Kelley
Auroratrek
Auroratrek
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)Distinguished Member (1.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 191, Visits: 980
Thanks, that makes sense about usefulness. There aren't a lot of iClone/Daz animators, period, let alone ones seeking a solution like this. In my case, at least, I'm now using Optitrack mocap bvh on Daz figures (using 3DX and iClone), and it's always had a problem with the forearm rotation (with or without 3DX), and I get the same problem with files from iClone and even Mixamo files: side-to-side motion in the forearm. The arms look like they are moving okay--the hands are in the right place, etc.--but the elbow gets twisted. It's not as noticeable in a figure with clothing with sleeves, but a bare elbow looks twisted and doesn't get the clean "point" when it bends. It also makes it difficult to adjust the forearms, since they don't bend logically if they're twisted. I think I've found a workaround (which is pretty much my whole workflow--maybe I should call it a "workaroundflow") where I can use 3DX to export a bvh to Poser, use my Poser script to fix the arms, then transfer the arm motion over to Daz. A little kludgy, but...

On my Youtube Channel: Quest of the Key: Chapter One
Lord Ashes
Lord Ashes
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)Distinguished Member (20.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 1.3K, Visits: 1.6K
Something like this script should do what you are looking for:


import RLPy

RLPy.RGlobal.Stop()

print("Get Rope Object")
avatar = RLPy.RScene.GetSelectedObjects()[0]

print("Get Bones")
motion_bones = avatar.GetSkeletonComponent().GetMotionBones()

print("Create clip")
clip = avatar.GetSkeletonComponent().AddClip(RLPy.RGlobal.GetTime())

frame = 0

bone = bone[0]
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationX").GetValues(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotX)
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationY").GetValues(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotY)
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationZ").GetValues(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotZ)

bone = bone[1]
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationX").SetValue(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotX)
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationY").SetValue(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotY)
clip.GetControl("Layer", bone).GetDataBlock().GetControl("Rotation/RotationZ").SetValue(RLPy.RTime(frame/60*1000, RLPy.kMilliseconds), rotZ)


You may have to fine tune it because I did not get a chance to try it but it should give you a rough idea of how the script should go.

"We often compare ourselves to the U.S. and often they come out the best, but they only have the right to bear arms while we have the right to bare breasts"
Bowser and Blue, Busting The Breast



Reading This Topic