Dear Maxon / @Dr-Sassi ,
I am finding difficulty exporting an animated scene of rigged hand poses with corrective points using the Posemorph tag PLUS using subdivision surfaces. Usually this works fine if rendering out of C4D, but I've been trying to figure out an efficient workflow for real-time purposes (rigging, animating, and point correcting on a low-poly mesh then exporting with SDS as FBX to Unreal Engine 5.1). In trying to maintain this pipeline I ran into several issues previously discussed with @Dr-Sassi in this 2017 -Export Sub-D to Unity thread.
I found a solution (which I will explain below) which involves exporting & re-importing FBXs several times each correcting something lost / broken in the conversion.
The purpose of this post is to illustrate how pain-staking this process is, and in lieu of increasing demand for real-time content/workflows, I'm hoping Maxon / C4D can update the Posemorph/SDS tags so that only 1 FBX export is needed.
Step 1 - Animate & Correct Points
The 1st C4D file is the master working file where I animate each hand pose (every 5 frames) and then add a Pose morph tag to correct certain poses. To get things working, I only corrected the first pose on frame 04. I toggled SDS "GEO" ON when point correcting so that I can see what it would look like at the final poly resolution. For point correction, I followed the CorrectionalPSD workflow described in the Maxon help documentation on the Posemorph Tag Properties:
I found that working off the bat in relative mode didn't give me the same results so I tried CorrectionalPSD which seemed to get the closest (but not EXACT) results. It would be nice if the conversion to relative (for real-time applications) could be more streamlined - perhaps on export to FBX vs currently having to manually click things (as described in the above instructions) for EACH pose. That's a lot of clicks!
Frame 04 had a palm pose which I added wrinkles around the front and back of the thumb base.
When I was happy with the results, I then exported 2 files.
- "Spikey Poses" With Subdivisions ON - This version creates "Spikes" as @Dr-Sassi describes bc the Posemorph Point data is calculated after subdivisions and so it loses count and gets confused.
- " Lo-Poly Poses" With Subdivisions OFF - This version I will use to subdivide AFTER the Posemorph calculations and then replace the poses created from "Spikey Poses" with the subdivided poses from this file.
Both with these FBX Export settings:
(Note that sometimes the Posemorph tag wouldn't show up in the exported FBX unless I had all the animation track items checked (though it doesn't seem like I would need "Bake all frames", nor "PLA to Vertex Cache") and unchecked "Bound Joints Only".
Step 2 - Re-Importing both FBX files and fixing the "Spikes"
When I imported the FBX exports, I noticed the Posemorph tag created reference poses (great this saves me time later!). Whatever it is doing works correctly when importing into Unreal engine - It recognizes this format as morph targets as long as morph targets are checked on in UE's import settings).
Here is what the "Spikey Poses" hand looks like:
Here is what the "Lo-Poly Poses" hand looks like:
I was able to get smooth correct subdivided posed hands by subdividing the "Lo-Poly Poses" hand and avoided the "Spikes" because the Posemorph calculations have already been calculated. I tried checking the priorities of the Posemorph tag hoping to get subdivisions AFTER the pose morph to avoid the "spikes", but whatever I tried, the SDS (Hypernurb Object) or the newer Subdivide Node Operator always went before the Posemorph operations. So by exporting a non-subdivided rigged Posemorphed file, I could then subdivide the base and 04 poses and replace the spikey ones present in the other file.
I subdivided the references poses created from the "Lo-Poly Poses" poses, ran a Current State To Object, and then copied them over to the "Spikey Poses" file.
In the "Spikey Poses" file, in the Posemorph tag, I re-targeted each pose with the newly subdivided version.
Step 3 - Delete excess and re-animate pose corrections.
After deleting the old Spikey reference poses... time to re-export the FBX!
I thought I was done but upon doing so, here's what happens...
For some reason, I get a duplicate reference pose for 04 (guessing any poses you have that's not the base pose will be duplicated). With lots of poses this could get heavy esp. when working in games / real-time applications. Also, the keyframed animations in the Posemorph tag are gone. I have to reanimate this so that Unreal Engine knows when to use this point correction vs other corrections for other poses - I could also reanimate within UE5 but its gotta be animated at somepoint, may as well be here. I'll also delete the duplicate reference pose (though I think it will come back).
After exporting one last time (4th), the Posemorph animation was intact (and the duplicate reference pose returned) but it worked!! I was able to keep a lo-poly workflow (which again helps with point correction and animation) and I have the ability to increase my subdivision levels for LOD (level of detail) for games if needed...
As you can see, the working file (left) vs the results (right) are ALMOST exact - good enough for now.
I think the main reason it takes 4 FBX exports and tweaking is because of the order of operations. While the Posemorph tag provides priority settings (both Base priority and Priority) the Subdivision object does not. If perhaps it did, then one can set it to calculate AFTER the pose morph. Amongst the things I tried, the shift priority tag on the Subdivision object didn't work because it affects the children as well and since the Subdivision object is parenting the mesh containing the Posemorph tag, they all move in unison (priority wise).
From the Maxon Help documentation on Posemorphs, it was cool to see how the priorities are grouped. I think the Subdivision Object is considered a generator which would have calculated after the Posemorph's default expression priority 0, but it didn't work when I set the Posemorph's priority at Generator +400 or above. So I don't know what's going on there.
Anyway, thanks for taking the time to read this! I know it was long and @Dr-Sassi has already dealt with this but I'm hoping this could get improved. My company is currently collaborating with Stretchsense - a hand motion-capture company in creating documentation on how to use their mocap gloves for non-human proportioned hands using Unreal Engine. The final FBX file from this post will be used to capture snapshots of poses (UE5 - Pose Assets) to blend to when the mocap engine detects a predefined pose.
Have a great day/night!