Profile Picture

Unreal Live Link - hip bone transform looks odd - can you help me understand why?

Posted By will.cowling.uk 5 Years Ago
You don't have permission to rate!

Unreal Live Link - hip bone transform looks odd - can you help me...

Author
Message
will.cowling.uk
will.cowling.uk
Posted 5 Years Ago
View Quick Profile
Junior Member

Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 115
Hi,

I've been working on my own version of the Unreal Live Link plugin since, as I mentioned in another thread, I think the official version is overpriced and also, more critically for me, it just doesn't work in my project as I build Unreal from source code.

I've made pretty good progress so far in just a few days. Getting the Live Link bit working was fairly straight forward as I expected (since Epic provide all the code for this) so I have the live data link between iClone and UE 4.23 working and I can print out all the transforms from objects and characters in Unreal and see them changing as they are animating in iClone. That's all fine, and if I link those transforms to visible objects with a single transform (like cameras, props or character roots) in Unreal the objects move and rotate as expected.

The next stage is the bit that I was expecting to be tricky, and it is, but not for the reasons I predicted.  

To get animated characters working I need to retarget the animations from iClone's internal characters bone structure to the different bone structure of the characters once they have been imported into Unreal.  The official plugin seems to do this internally inside iClone, whereas I'm planning on using Unreal's animation retargeting system, which I believe will provide more flexibility for driving different characters in Unreal, plus I don't have access to iClone’s retargeting code as it's not exposed to the Python API, AFAIK.

My current sticking point though is that the transforms of the bones in iClone look odd, which is confusing my attempts to retarget them in Unreal.
I've attached a plugin script which dumps out the bone hierarchy and transforms for the current pose of a character in iClone.  When I run this for a character in the default T pose, I get something like this...

https://forum.reallusion.com/uploads/images/6543af29-1250-421f-99f3-cf2c.png

What I find odd, is that transform on the Hips, which is the first child of the root. The positional element looks fine (a 94cm z (up) offset), but that quaternion rotation (X Y Z W is the output format) is a 90-degree rotation around the X axis, which seems strange to me, as I'd expect the hip rotation to be close to Identity. Can anyone help me understand why it's there, and why it has no visible effect on the character in iClone, as if I apply my theoretical knowledge of hierarchical transforms I would expect this to flip the character so that it was lying flat with its head pointing along the Y axis.

As an aside, I'm also wondering if this is related to something else I've noticed when using iClone. If I select the character root, like this...

https://forum.reallusion.com/uploads/images/69f29ea8-5ac7-4c09-b297-a840.png

... then the rotation axis are aligned with the world axis. i.e the Red x-axis rotator goes around the world x-axis, and the same applies to the y and z axes.
But if I now select the Hip bone...


https://forum.reallusion.com/uploads/images/5bcb651c-43fb-4d26-abf4-9c1f.png

...the y and z axes are no longer aligned, but are instead consistent with a 90 degree rotation around the x axis, like I'm seeing in the bone transform data. What's going on here? Why is there a 90 rotation with no noticeable effect on the character?

Is this a bug/issue with iClone, or something fundamental I'm misunderstanding? I don't claim to be an expert in animation systems, and one of the reasons I'm attempting to do this is to learn more about iClone and Unreal, so it's quite possible this is just me not understanding something important. Can anyone shine some light on this for me and help me understand?

Ultimately, when I get this working, I'd like to release what I have as open source on GitHub so others can use it and perhaps contribute to improving it. At the very least I have a Python wrapper for the Unreal Live Link dll that Epic provides which might be useful for others who want to experiment with a live data link to Unreal from within the iClone Python API.

Many thanks,
Will

Attachments
AnimTestPlugin.zip (30 views, 1.00 KB)
Edited
5 Years Ago by will.cowling.uk
The-any-Key
The-any-Key
Posted 5 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)Distinguished Member (2.8K reputation)

Group: Forum Members
Last Active: 3 Weeks Ago
Posts: 356, Visits: 1.9K
My understanding is that the bones in the rig is rotated to avoid potential gimbal when working with eulers.
However, you can also do some quaternion calculations between two rigs so they match if they are initiated in the same pose at start. Can't go into details however as I only made it work in Unity and not in iClone, as there are some quaternion bugs in the python API.




iClone 7, 3DXchange 7 Pipeline, CC3 Pipeline, CT8 Pipeline, Iray, Live Face, iPhone Xr, Win 10, i9 9900K ~5GHz, Nvidia RTX 2080 8GB, 16GB Ram, M.2 SSD
will.cowling.uk
will.cowling.uk
Posted 5 Years Ago
View Quick Profile
Junior Member

Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)Junior Member (243 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 11, Visits: 115
That sort of makes sense, although I'm a little surprised that something like that would be exposed to the user in the UI.  I could understand if it was hidden away internally, but switching the axes in the UI like that with no obvious reason why visible to the user seems odd to me.  Also, I don't see anything like this in other animation software I've tried like Maya and Blender.  In Maya the hip rotation is zero for a T pose, as I was expecting.  Can anyone from Reallusion give any further insight into this?

Many thanks,
Will




Reading This Topic