Posemorph + SDS = Headache!
-
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.
Et voila!
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).
In conclusion
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!
M -
Hi Michael [Oolahk],
There are no images. Anyway, what I need is a project file. Images do not tell me much, so please don't put any extra time into images. Thank you for all the effort.
With a file, I will understand the text better. BTW, the FBX has little idea about app-specific PoseMorphs, so each pose is translated into an object. Typically a PoseMorph in Cinema 4D has the same amount of point positions stored. But there are more options in Cime 4D to move them, so tests are always needed.
If you have a cloud service, like DropBox, Google, Adobe, Apple, or Wetransfer, I'm happy to look into the file. (Please, no other cloud-services; thank you.)
I'm happy to look into your material.
All the best
-
P.S.: Do I have replicated here your problem?
https://www.dropbox.com/s/vdndjr08pdb9ahe/CV4_2023_drs_23_CAps_01.c4d.zip?dl=0If so, I can give you a simple workflow to complete it. Please let me know.
-
Ming,
I guess it is late already, so I expect to get a reply before tomorrow.
Try this:
Set up your low poly PoseMorph.
Export it to FBX.
Create a new c4d file, merge the FBX
Select all (at least all polygon objects of the PoseMorph)
Use the Mesh> Add> Subdivision (cogwheel) > check: Smooth to on for SDS. Select your SDs level. Press OK!
Check your PoseMorph.
(PSD: we check later, when I have a scene file)
-
Hi @Dr-Sassi,
Thanks for your replies.
- Images - Weird they worked for me while I drafted the post. I set URLS from dropbox's image addresses..
- Good to know re: FBX & app specific Pose Morphs...Strange though how animations from the Posemorph was not included during my original steps.
- You can download my working file on Dropbox here: https://www.dropbox.com/s/441us4xalif9kjk/SB_HAND_POSES_04B.c4d?dl=1 - if you turn on the GEO SDS and export to FBX you will see the type of "Spikeys" I'm getting. I tested on both R26 and 2023 with same results. I use R26 for work as 2023 has never worked for me (perhaps I need to delete my prefs...)
- Your file kind of replicates the problem - here is the exported FBX from your latest suggestion (post above this) https://www.dropbox.com/s/zkm9p316zpit70c/SB_HAND_POSES_04B_SD.fbx?dl=1
When I subdivided the mesh it looks correct. But upon exporting to a new FBX It has the "Spikey" issue. You can try and follow my original post and see how I avoided getting the "Spikeys" - Thanks again for all your help. I appreciate all that you do for the C4D community
- BTW, my real name is Ming (no Michael). Thanks!
-
This post is deleted! -
Hi Ming,
I thought it was Michael from the post you linked above. So sorry; I like to keep it correct with names. I have changed it, of course.
Here is your file back, as FBX.
https://www.dropbox.com/s/kea0ze5gu6roz0c/CV4_2023_drs_23_CAfp_02.fbx.zip?dl=0How do I got there?
I took the SDS object from the file entirely,
Then exported it as FBX
Imported (merged it) in a new scene and placed the SDS on top of the file where it was before
Then I exported it again as FBX and shared it with you after testing it (merged it again in a scene.)Please let me know if that works for you.
Thank you for the kind words.
Enjoy
-
This post is deleted! -
Hi @Dr-Sassi ,
Thanks again for your help.
- The FBX file you sent when opened looked low-poly. The reference poses (including the duplicate 04 pose) as well as the skinned mesh were all low poly. I did see the sds parent...strange.
- I followed your steps - exporting the working file as FBX without any SDS. Merged the FBX into a new scene, added a SDS on top and re-exported as FBX. Opening that file, pose 04 worked without "Spikes" but the base reference mesh had them.
- I appreciate the help. My original solution seems to work for me (R.26) it just takes a few more steps. I guess I'll stick to 4 exports until hopefully a future update addresses the SDS/PoseMorph relationship re: order of calculations.
Thank you!
-
You're very welcome, Ming.
IF the target is a SDS free result:
If you get the first fbx low poly export, merge it in a new project file, select all and use the Mesh> Subdivide. Done.
Yes, the core part is to avoid the SDS during the first part.
Why? Place a cube into an SDS; it gets smaller.
So, the points of the PoseMorph memory keep the position in place, but not so much the PoseMorph "shapes"; the difference is in the pose.
With the first export, all Blend-shapes, including the Base-shape, are untouched by the SDS.
At least, that is my current idea about it.All the best