iClone 7.x - Morph Creator - Offset & Distortion Issue


https://forum.reallusion.com/Topic362408.aspx
Print Topic | Close Window

By Lord Ashes - 6 Years Ago


I created a pair of pants which I imported through CC2.3 and then brought into iClone7.3 on a CC2 character.
I then opened Morph Creator to try and add a morph to the pair of pants. I was able to add a clothing morph to a mini skirt so there does not seem to be an issue with adding morphs to clothing.
Initially I had some issues with my morph (not matching the number of vertices), so I got the idea of exporting my mesh from Morph Creator to ensure that I am applying the morph to the correct mesh.

First surprise was that when I exported the mesh from Morph Creator it seemed to have an offset as compared to original. After some though, I concluded that this could be correct because when I was rigging the pair of pants, I did move it. However the second surprise was that the morph failed spectacularly. It did load but when applied it did not look at all like it was supposed to. The other interesting observation was that when I use the morph that was based on the original mesh, the application of the morph in Morph Creator did not produce an offset. Assuming the assumption about why there was a Y offset between my original base mesh and the one exported from Morph Creator was true then I would have expected that when the morph based on the exported mesh is used then it would not have an offset but the opposite seems true.

In any case both morphs failed spectacularly and morph based on the Morph Creator export causes an additional Y offset. As can be seen in the video, the meshes when viewed in a software editing program show perfectly fine (I did not spin them around in the video but I did check that they are fine). I am sure that I will get a few laughs when people notice the software that I am using but when the meshes are loaded into Blender they also appear fine.

Does anyone have any idea what could be causing this?

BTW: I am not sure if it is related but I sometimes saw a similar y-offset introduced when I was working with using character expressions to make morph props (prior to iClone7). However, in these cases applying an offset to compensate usually resolved the problem. In this case the problem is not only the offset.
By 4u2ges - 6 Years Ago
I am not sure if that is your case (I never morphed a cloth), but as a rule, before I rig a cloth to the character I make sure to reset scale,
location and rotation (that is in Blender). As a matter of fact I do it with anything before I export it out of Blender. Saves me all kind of trouble in the future.
You may want to go back and rig those pants over making sure you reset all to 0 (if there is a way to do it in Anim80or) before you rig it.
Then bring it back to CC/iClone and try to morph again. See if you get a different result.
By Lord Ashes - 6 Years Ago
Thanks. I will give that a try. I have a feeling that may help with the offset but I am dubious that it will help with the distortion...but I'll give it a try just in case.
By Lord Ashes - 6 Years Ago
I managed to get the issue resolved. I rigged the clothing in Blender and then used that mesh as the mesh for my morphs. Initial results resolved the distortion issue but the scale was off by 100! When I scale up the morphs based on the Blender mesh, it worked almost perfectly but there was a slight Y axis shift. I compensated with a Y-axis shift in the opposite direction and now the morphs work fine...no distortion.

But now that leads me to another related question...

https://forum.reallusion.com/362551/Morph-Creator-How-To-Save-Morphs    
By Rampa - 6 Years Ago
Don't forget you can set the scale in the Blender export panels for OBJ or FBX.
By Lord Ashes - 6 Years Ago
Rampa (4/2/2018)
Don't forget you can set the scale in the Blender export panels for OBJ or FBX.

Ah! That is probably how the FBX (and thus CC) is getting a version of the mesh that is 100 times bigger (and thus I needed to scale my morphs accordingly). Thanks for that reminder.
By Lord Ashes - 6 Years Ago
I noticed that the morphs still have distortion after all...it is just very small compared to the original distortion problem. I think I need to figure out the correct scale for CC so that there is no scaling anywhere. I wonder if the distortion is a rounding error or something...
By 4u2ges - 6 Years Ago
What is your workflow on this (through Blender I assume). I'd like to try it. Appreciate a brief Step-by-Step.
By Lord Ashes - 6 Years Ago
I found one immediate issue which is adding to the frustration of scale: The Template FBX and the Template OBJ are not the same scale. The Template OBJ is 100 times larger. I opened Blender and imported the Template FBX (Body Templates General) and then the Template OBJ (Body Templates | OBJ with Quad Mesh) and the OBJ is 100 times bigger. If I scale the OBJ mesh down by 100, it lines up with the FBX.

Work Flow:
1. Open Template OBJ file in mesh editing software (I use a different program than Blender to modify the mesh...haven't mastered that in Blender yet...but I use Blender for rigging).
2. Cut off torso and feet to get a pair of skin tight pants.
3. Save OBJ file. Note that this process did not involve any scaling.
4. Modify mesh to create Morph.
5. Save OBJ file. Note that this process did not involve any scaling.
6. Open Blender.
7. Import Template FBX file (to get CC2 Armature).
8. Import OBJ file created in step 3.
9. Observe that OBJ content is 100 times too larger.
10. Scale OBJ content by 0.01
11. Attach OBJ mesh to armature (with empty weight groups)
12. Transfer weights from CC Body to OBJ mesh
13. Export FBX (using Scale 1.0 during the export)
14. In CC2 use the Create Cloth option to import FBX.
15. In CC2 conform resulting clothing to character.
16. Push to iC7
17. In iC7 open Morph Creator.
18. Add Morph and select the OBJ file created in step 5 (i.e. the morph)
19. Observe that when the morph is applied there is a slight shift backwards and slight distortion (certain vertices seem to be offset creating some cone like protrusions from the mesh)

I cannot explain either the shift or the distortion.

I specifically loaded the OBJ and FBX into blender (and after scaling) checked to see if there is an offset between them (that would account for the offset being added during the morph). However, to me it looks like the meshes overlap each other exactly (i.e. there does not seem to be a shift between the OBJ and FBX content).
I also tried exporting the FBX scaled up and scaled down (in case the distortion is some form of clipping) but that did not seem to help, it just make the content load oddly in CC2 because the scale was either too big or too small for CC2.    
By Lord Ashes - 6 Years Ago
Just to add...

To compensate for the scale difference between the OBJ and FBX files, I have tried both scaling the OBJ down and scaling the FBX up. Neither produced fully working results.
By Rampa - 6 Years Ago
I think you should skip all the exporting and re-importing steps. If you duplicate the mesh from the template body, it's already rigged and weighted. That way you can totally avoid any scaling issues.

See how I made a bodysuit here. It does not require any rigging or weighting. You could even import your 2 morphed versions into CC so they are both iAvatars and then use the iAvatars as morphs.

By 4u2ges - 6 Years Ago
Thank you Lord for the effort. I am yet to try it.

Simple is that. You just added the modified OBJ from step 5 as a Morph in Step 18 (while cloth is selected in Morph Creator).

It might work for a simple morphing, where the mesh offset in relation to the respective bone is minimal. But remember, the cloth is weight painted.
So the large enough mesh shift would cause an unexpected deformation, where bone would be pulling back those vertices as they forcefully moved somewhere else by the morph slider... I think. That might be your problem... not sure.

If there was an option to transfer vertex weight values along with new coordinates (this has to be for iAvatar), it would open a door to a lot of neat options, like pulling up sleeves and such. But I must be dreaming. Hehe
By Lord Ashes - 6 Years Ago
Rampa (4/5/2018)
I think you should skip all the exporting and re-importing steps. If you duplicate the mesh from the template body, it's already rigged and weighted. That way you can totally avoid any scaling issues.
See how I made a bodysuit here. It does not require any rigging or weighting. You could even import your 2 morphed versions into CC so they are both iAvatars and then use the iAvatars as morphs.

Yes, ideally this would be the best solution. However, as I mentioned, I am still very much a beginner with Blender. The 3D mesh editing software that I use is ancient (a recently updated version of software from 1995 and 1998) but I have figured out how to do things that I need using it. My plan *is* eventually to migrate to Blender directly but right now I don't really have the time to invest into learning to use it. Don't get me wrong, I think Blender is an amazing software but (in my opinion) it doesn't have the easiest learning curves (especially since it has a few concepts which are a little counter-intuitive to Windows users...like right clicking to select...which I seem to recall can be switched somewhere). The software that I use even has rigging capabilities but being from way-back-then it uses its own proprietary format for storing rigging (i.e. no FBX output), so that is why I need to push everything to Blender for rigging.

BTW, I have no actual problems importing clothing via this method into CC2 (as can be seen from my many clothing bases in the Marketplace) and the scale is correct (I guess that as long as the scale of the mesh matches the scale of the armature and isn't too extreme then CC2 will accept is correctly). It is just the morphs that are causing a problem. 

By Lord Ashes - 6 Years Ago
4u2ges (4/5/2018)
It might work for a simple morphing, where the mesh offset in relation to the respective bone is minimal. But remember, the cloth is weight painted.

While I didn't consider that yet...agreed. The morph I am working on right now basically keeps the cloth in relative relation to the bone just pushes it somewhat further away. I am trying to make some pants which will have a couple morphs to turn then into bell bottom pants (with the morphs providing options where to start the bell effect). In this case it should work.
I think something like shortening the length of a skirt or even rolling up the sleeves a little should also be okay if the starting and ending end with the same bone. For example, rolling up the sleeves to just under the elbows should be okay for the most part because regardless if the sleeves are rolled down or up the bone that contributes the most in the weight mapping would be the lower arm. Rolling up the sleeves past the elbow would, on the other hand, be problematic because the sleeves would be weight mapped to the lower arm but now would be on the upper arm.
Once I get the process working correctly, I will see just how far this can be taken in this state.  

By Lord Ashes - 6 Years Ago
Finally managed to get a working morph without distortion...

1. I imported the clothing into CC2 using my usual workflow.  
2. Pushed to iC7
3. Opened Morph Creator
4. Select clothing
5. Export selected as OBJ
6. Use the exported OBJ to make the morphs 

The odd thing is that I am fairly sure I tried this before and it wasn't working correctly. I guess, when I tried it last time, I must have selected the wrong file to use as the morph import.
I still have no idea what causes the distortion but at least now I was able to get the morphs working without inducing the distortion BigGrin
By Rampa - 6 Years Ago
Well that is good news! Glad you got that working.
By 4u2ges - 6 Years Ago
That's great! Still did not have a change to try. But now I am thinking about getting hair morphs. Like for combing for instance.
Most of the hair (the top part at least) are at 100 influence of the head bone. So moving it would be quite possible without distortion.
By 4u2ges - 6 Years Ago
There is a thread started by AncientWire about transforming a skirt so figured I'll try. But I cannot get it working. Those slight distortions are hunting me.
I saw you managed to make a substantial morphs with skirt length, looks very nice. So what is your secret Lord? Did you use Blender? Any specific OBJ import/export settings?


By Lord Ashes - 6 Years Ago
No real secret...use the work flow as detailed earlier.
1. Created CC Cloth item using the usual work flow (in my case in Anim8or and then rigged in Blender)
2. In CC added clothing from step 1 to CC character
3. Pushed CC character to iC7
4. Activated Morph Creator on the CC character
5. Selected just the clothing and used Morph Creator's Export to export (as OBJ) the selected item (do no include the character)
6. Created my morph based on that Morph Creator reference obtained in step 5
7. Applied morph created in step 6 in Morph Creator
8. Pushed character back to CC to save clothing. Note: In CC the morphs won't show up but they are still retained (saved)

I believe that getting the OBJ "reference" from Morph Creator (and using that to create the morph) was the trick that allowed me to avoid the distortion that I was getting earlier and also any shifts.

Couple of things to note:

1. The morphs should be basically limited to changes along the same bones (as was mentioned earlier) because of the weight painting
2. When morphing, for example, the length it is likely that you will get poke-through at some values. To address this I created a morph that is a slightly larger version of my clothing and called it a Fit Adjustment. When poke through occurs, typically it can be eliminated by applying a bit of the Fit Adjustment morph. You can see this idea at the end of the following video: https://youtu.be/BDhaWs0rzQ8    
By Lord Ashes - 6 Years Ago
I have not yet tried to do hair...I watched a tutorial once but it seemed to be a tedious process to create all the layers...but that sounds like a really cool idea (i.e. creating hair morphs).
By 4u2ges - 6 Years Ago
Boom!! Got it working! I guess I was tired last night and neglected to switch from "Split" to "Keep Vertex Order" while importing OBJ into Blender (specifically that the skirt has some disconnected mesh, which is not so good by itself though).


By Lord Ashes - 6 Years Ago
4u2ges (4/7/2018)
Boom!! Got it working! I guess I was tired last night and neglected to switch from "Split" to "Keep Vertex Order" while importing OBJ into Blender (specifically that the skirt has some disconnected mesh, which is not so good by itself though).

Nice work! Looks like my Morph Cloth Line is going to get some competition ;-)

By 4u2ges - 6 Years Ago
Thanks, but not really any competition...Smile  (If I only had time for everything I had in mind)