Profile Picture

Export from CC3 to Blender to .GLTF

Posted By codyvbrown 3 Years Ago
You don't have permission to rate!
Author
Message
codyvbrown
codyvbrown
Posted 3 Years Ago
View Quick Profile
Senior Member

Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 9, Visits: 61
Hello All. Pipeline question for you.

I've been having a ton of trouble exporting my model from CC3 until I found @victor.soupday's amazing plugin. It looks great once it is loaded there. 

https://forum.reallusion.com/uploads/images/debaee0c-bc93-43ae-9bc3-9890.png

the trouble begins when I export it out. Either back out as .fbx or to .GLTF.

https://forum.reallusion.com/uploads/images/ad013e7b-3275-4c74-9de9-ee44.png

GLTF imports back in with chaotic textures. skin is glossy, arms are weird, eyes are black.

https://forum.reallusion.com/uploads/images/c5c71c2e-9c6e-4c4b-9d50-82c3.png

.fbx with textures copied and embedded only exports the model w/ his eyes. 

any thoughts on the best way to get a clean export from CC3 to .GLTF? Am using the .GLTF format because I need it for a web 3D project in Babylon.js. 

I'm very new to all of this and any help is greatly appreciated. thank you.
Victor.Soupday
Victor.Soupday
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 519, Visits: 7.2K
The GLTF exporter isn't going to understand the node setups for the advanced materials. It has some particular requirements for exports outlined here: https://docs.blender.org/manual/en/dev/addons/import_export/scene_gltf2.html?highlight=gltf#gltf-2-0

The GLTF exporter works better with the basic materials setup:
If you open the Build settings panel in the CC3 tab and rebuild the materials with these settings
https://forum.reallusion.com/uploads/images/5eefaca2-e34d-43cc-8156-7546.png

You will then need to delete the CC_Base_EyeOcclusion object as the exporter will never understand it as it uses procedurally generated textures.

Then the GLTF exporter should do a better job.

codyvbrown
codyvbrown
Posted 3 Years Ago
View Quick Profile
Senior Member

Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 9, Visits: 61
Victor.Soupday (5/12/2021)
The GLTF exporter isn't going to understand the node setups for the advanced materials. It has some particular requirements for exports outlined here: https://docs.blender.org/manual/en/dev/addons/import_export/scene_gltf2.html?highlight=gltf#gltf-2-0

The GLTF exporter works better with the basic materials setup:
If you open the Build settings panel in the CC3 tab and rebuild the materials with these settings
https://forum.reallusion.com/uploads/images/5eefaca2-e34d-43cc-8156-7546.png

You will then need to delete the CC_Base_EyeOcclusion object as the exporter will never understand it as it uses procedurally generated textures.

Then the GLTF exporter should do a better job.



thank you!!! I tried that for .GLTF and the problems with the eyes went away. 

if I want to do a more high fidelity export, that matches what it looks like in blender, what would you recommend for an export? are there settings I need to tweak for this to export in .OBJ or .FBX and have it work independently of CC3? 

thank you again. I'm a noob here and this is much appreciated help.

Victor.Soupday
Victor.Soupday
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 519, Visits: 7.2K
The problem is that the raw textures as exported from CC3 (and from Blender with GLTF) are only part of the picture. They don't take into account that the textures need to be used with modifications, e.g. the specular channels for the skin need to be significantly lowered and many of the textures are meant to be layered over other textures (much like photoshop layers) to modify colours or normals.

So to get the full fidelity of the CC3 characters requires complex arrangements of these textures, which none of the exporters (or importers) understand. So what we get is the character mesh and a whole load of textures, wondering what to do with them. Due to the differences in rendering engines, game engines and 3d applications there is no 'one size fits all' solution to re-creating the character in another system.

That said, one of the reasons I made my Blender material setup add-on was so that once in Blender it's possible to bake those complex texture arrangements into simpler single texture based channels that the other systems can work with. Even then, you need to know what your baking for. The baking process is complicated and laborious and each PBR channel for each material needs to be baked separately and it takes a long time.

To that end I have been working on an add-on script that does this automatically, it's far from finished but so far I have got it to successfully bake textures for Sketchfab. This is the result:
https://sketchfab.com/3d-models/rose-8c224dbd4712460f836f2a2bc2530057
(You will need to turn on HD textures to see them in their full detail)
It took about 30 minutes to bake everything, but to do it by hand would take hours.
The baked textures for Sketchfab are mostly compatible with the GLTF exporter, with a little bit of modification it could work for that, but it's quite complicated to use at the moment, which is why I haven't released it yet, it needs to some work to simplify the process.

If there interest in this I could get it ready to make available, but I'm kind of busy at the moment and don't know how long that would take.
codyvbrown
codyvbrown
Posted 3 Years Ago
View Quick Profile
Senior Member

Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 9, Visits: 61
Victor.Soupday (5/12/2021)
The problem is that the raw textures as exported from CC3 (and from Blender with GLTF) are only part of the picture. They don't take into account that the textures need to be used with modifications, e.g. the specular channels for the skin need to be significantly lowered and many of the textures are meant to be layered over other textures (much like photoshop layers) to modify colours or normals.

So to get the full fidelity of the CC3 characters requires complex arrangements of these textures, which none of the exporters (or importers) understand. So what we get is the character mesh and a whole load of textures, wondering what to do with them. Due to the differences in rendering engines, game engines and 3d applications there is no 'one size fits all' solution to re-creating the character in another system.

That said, one of the reasons I made my Blender material setup add-on was so that once in Blender it's possible to bake those complex texture arrangements into simpler single texture based channels that the other systems can work with. Even then, you need to know what your baking for. The baking process is complicated and laborious and each PBR channel for each material needs to be baked separately and it takes a long time.

To that end I have been working on an add-on script that does this automatically, it's far from finished but so far I have got it to successfully bake textures for Sketchfab. This is the result:
https://sketchfab.com/3d-models/rose-8c224dbd4712460f836f2a2bc2530057
(You will need to turn on HD textures to see them in their full detail)
It took about 30 minutes to bake everything, but to do it by hand would take hours.
The baked textures for Sketchfab are mostly compatible with the GLTF exporter, with a little bit of modification it could work for that, but it's quite complicated to use at the moment, which is why I haven't released it yet, it needs to some work to simplify the process.

If there interest in this I could get it ready to make available, but I'm kind of busy at the moment and don't know how long that would take.


Victor! that is an incredible export to Sketchfab!!! can not believe the fidelity. looks amazing.

I would * love * to be able to try out the plugin. totally understand if its complicated to use, happy to jump through any hoops to get that kind of result.

just let me know! 

pipdoun
pipdoun
Posted 3 Years Ago
View Quick Profile
New Member

New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)New Member (6 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 1, Visits: 25
I got blender export fbx with all baked textures from cc3. CC3 creates two different diffuse named pngs one of it includes rgb other one is alpha info then combined two of them in adobe ps and I could have one png with colors and transparency in this way. 
 https://forum.reallusion.com/uploads/images/92584f89-322b-49aa-bc25-83ed.png 
I dont know how to handle blend mode while exporting glTF. Just alpha hashed seems what I need aesthetically. I mean eyes and hair transparency etc.https://forum.reallusion.com/uploads/images/af7869c1-d4f3-4ddb-8273-79fe.png
Nor Alpha clip nor alpha blend
https://forum.reallusion.com/uploads/images/e607eb4d-1de3-496d-bfaa-c4fc.png
https://forum.reallusion.com/uploads/images/281061ab-09be-4402-9afc-2866.png

How did you truely export your model would you bring a guide here ?
Or would you help me about my model that I brought here
codyvbrown
codyvbrown
Posted 3 Years Ago
View Quick Profile
Senior Member

Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)Senior Member (344 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 9, Visits: 61
hey Victor.Soupday.

if your plugin isn't ready do you have any tips for how to achieve the effect you got on Sketchfab? With all the lighting/textures baked in? 

I'm trying to figure it out and not having much luck. 

thank you so much for the help. 
Victor.Soupday
Victor.Soupday
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 519, Visits: 7.2K
It's a relatively simple process, just really repetitive.



The complexity of the add-on comes from trying to determine what textures to bake for what target application and what size to bake each texture and then untangling things like the Ambient occlusion from diffuse and the various normal layers. It's all but done now though, I just need to check it through for any glaring mistakes.
Victor.Soupday
Victor.Soupday
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)Distinguished Member (5.2K reputation)

Group: Forum Members
Last Active: Yesterday
Posts: 519, Visits: 7.2K
Here it is:
https://github.com/soupday/cc3_blender_bake/releases


You'll find it in the "CC3 Bake" tab.
It operates on the selected objects, so select everything you want to bake the textures for, pick the target application, number of samples (It doesn't really get any better beyond 5 samples, can probably get away with just 1 sample), texture format and quality, and the folder to put all the baked textures into. Then press the bake button and wait... (up to around 5-10 minutes)
You can show the console window (Menu->Window->Toggle System Console, *before* you press Bake.) to see the running logs of what it's doing.

https://forum.reallusion.com/uploads/images/cb368c0c-3c23-4cba-9008-7c2b.jpg

The complex node setups are reduced down to simple texture inputs like this, presevering as much detail as the target application can support. In this case for GLTF there is no subsurface or micronormals, but everything else is intact.

Most of the testing I've done is for baking for Blender, GLTF exports and Sketchfab.

This setup, for the example here, is now compatible with the GLTF exporter. You may have issues with the hair, especially Smart hair as it uses vertex colours as a factor for additional colour blending. So it may be advisable to delete any vertex colours in the hair objects before exporting with GLTF (or for Sketchfab for that matter), at least until I can find a way to remap the vertex colours in a way that works with the exporters / target applications.

https://forum.reallusion.com/uploads/images/0d952ac5-f9b0-446b-adb9-4eb4.jpg

All the textures can be found in the bake folder specified:

https://forum.reallusion.com/uploads/images/42f51d18-1b6e-4a17-b4fe-4bbb.jpg

So far I haven't had much luck getting refractive eyes to work for Sketchfab or GLTF so it might be best not to use them when build the materials for CC3 characters. (Set this before importing the character)

https://forum.reallusion.com/uploads/images/b7797832-bd11-40a7-af97-889f.jpg

There are options to override the maximum size of the textures it bakes. It will only ever scale down, not up (as there is no point scaling up), but the quality of scaling the baked textures down isn't very good, so if you need to scale the textures down, do it in GIMP or Photoshop or something that will do a much better job of image scaling.

So that's it for now, see if it works for you, if it's any use. Keep an eye out for it going horribly wrong.
r.mccullough
r.mccullough
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)Junior Member (140 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 7, Visits: 102
Group, following up on this thread (Victor these plugins are amazing!) I think I am 99.8% of the way there. I find that when rotating a model in Babylon.js I still get a few positions where the Alpha on the hair is a bit much and you can see the scalp below. Is there is a simple adjustment to make the top hair more opaque I guess to prevent this minor point form happening? Last little bit to push this over the goal-line. Everything else is amazing. Thanks everyone for your input..https://forum.reallusion.com/uploads/images/87b50bb9-9edf-4ebb-8b8f-3f7b.png



Reading This Topic