English


Profile Picture

Export from CC3 to Blender to .GLTF

Posted By codyvbrown 4 Years Ago
You don't have permission to rate!
1
2

Export from CC3 to Blender to .GLTF

Author
Message
mila_647012
mila_647012
Posted 3 Years Ago
View Quick Profile
Senior Member

Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)Senior Member (274 reputation)

Group: Forum Members
Last Active: Last Year
Posts: 16, Visits: 199
Hey guys,
I’m about to try all the procedure, plug-in and suggestions listed here. Just wanted to ask, before I do so, if there have been any changes that need to be taken into consideration, especially with iClone 8 and CC4? And what’s the best way to export animations and fa il animations + voice for glTF?
I’d appreciate any help on this!
tmbpodcastoffice
tmbpodcastoffice
Posted 3 Years Ago
View Quick Profile
Junior Member

Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)Junior Member (113 reputation)

Group: Forum Members
Last Active: 3 Years Ago
Posts: 5, Visits: 60
By any chance would you know the reason for this error here on hitting CC3 Bake:



I've tried differing locations for 'Bake Folder'.
I've been following the procedure as shown here: https://forum.reallusion.com/482999/Export-from-CC3-to-Blender-to-GLTF?PageIndex=1

Blender 2.93.1
CC3 Tools 1.1.5
CC3 Bake 0.1.3

More information can be provided. 
r.mccullough
r.mccullough
Posted 4 Years Ago
View Quick Profile
Junior Member

Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)

Group: Forum Members
Last Active: 2 Years Ago
Posts: 7, Visits: 102
Victor, thanks so much for providing your valuable feedback. Hugely appreciated. Your suggestion was right on point.  The modified result is below so I think I can call this one done.
Really appreciate the tools you've put out as well, using both CC3 and CC3 Bake. Before I found them, I was new to Reallusion and Blender and really really struggling. Its been a game changer for us. Cheers.
75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/b2093a88-a78d-4df1-aa78-d6af.png
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 569, Visits: 9.0K
Basic single pass alpha blending always does a poor job for rendering hair. Blender gets away with it's alpha hashed blending, but nothing else supports that as it uses sampling overdraw to make it look good.

You could try setting it to opaque with alpha clipping, but that usually ends up look too chunky and thick.

Ideally you would need a multi-pass shader to render the hair that does some kind of opaque or depth pre-pass before rending the alpha blending on top of it. Babylon.js can do this in theory, but I've got no idea how to make it happen.
  • Duplicating the hair mesh
  • Make a copy of the hair material
  • Separate the duplicated mesh by materials and delete any duplicate scalp section
  • Set the original hair material to Alpha Blend
  • Set the duplicate hair mesh to use the copied material and set that to Alpha Clipped with quite a high clip threshold (0.7+).

This in effect creates a 2 pass hair renderer. The opaque alpha clip material effectively resolves most of the z-sorting issues and the alpha blend material draws the remaining hair with transparency.

e.g: Just rendered with alpha blend:

75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/cd3d2f8c-2f5b-4472-ae9d-b989.png

Then with an opaque alpha clip mesh on top:

75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/8d3f90ff-b2bf-4a18-a38e-b6a3.png

It's a little bit wasteful as it has to process the hair mesh twice, but it works at a pinch.
As most of the hair is rendered opaque, it actually renders a lot faster than with just Alpha blend.


r.mccullough
r.mccullough
Posted 4 Years Ago
View Quick Profile
Junior Member

Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)Junior Member (162 reputation)

Group: Forum Members
Last Active: 2 Years Ago
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..75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/87b50bb9-9edf-4ebb-8b8f-3f7b.png
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 569, Visits: 9.0K
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.

75% of original size (was 667x19) - Click to enlargehttps://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.

75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/0d952ac5-f9b0-446b-adb9-4eb4.jpg

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

75% of original size (was 667x19) - Click to enlargehttps://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)

75% of original size (was 667x19) - Click to enlargehttps://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.
Victor.Soupday
Victor.Soupday
Posted 4 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)Distinguished Member (5.8K reputation)

Group: Forum Members
Last Active: Last Week
Posts: 569, Visits: 9.0K
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.
codyvbrown
codyvbrown
Posted 4 Years Ago
View Quick Profile
Senior Member

Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)

Group: Forum Members
Last Active: 4 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. 
pipdoun
pipdoun
Posted 4 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: 4 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. 
 75% of original size (was 667x19) - Click to enlargehttps://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.75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/af7869c1-d4f3-4ddb-8273-79fe.png
Nor Alpha clip nor alpha blend
75% of original size (was 667x19) - Click to enlargehttps://forum.reallusion.com/uploads/images/e607eb4d-1de3-496d-bfaa-c4fc.png
75% of original size (was 667x19) - Click to enlargehttps://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 4 Years Ago
View Quick Profile
Senior Member

Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)Senior Member (380 reputation)

Group: Forum Members
Last Active: 4 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! 


1
2



Reading This Topic

0 active, 0 guests, 0 members, 0 anonymous.
No members currently viewing this topic!