English


Profile Picture

CC4 to unity

Posted By Jbowdoin 3 Years Ago
You don't have permission to rate!

CC4 to unity

Author
Message
Jbowdoin
Jbowdoin
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 123, Visits: 793
ok so this as been bugging me for a while.
I am looking to fully optimize my exported characters so I want the different levels of the LOD mesh with the original. so use  "instaLOD" right?

only I don't want the original to have so many materials ether, I want the original to have  "Merge UV" so each character only has about 5  materials at most between the main mesh and the LOD

so why not expert them separately and combine them in unity ?
well that is were im at. as you can probably guess the only problem is the original and LOD are using  have separate skeletons and therefor  can't be controlled bay the same animator the same way expecting LOD with original would work.
how can I fix this ?  

I actually can do something similar with this code 

______________________________________________________________________________________________________________________________________________________________________________
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class Equipmentizer : MonoBehaviour
  5. {
  6.     public SkinnedMeshRenderer TargetMeshRenderer;
  7.  
  8.     void Awake()
  9.     {
  10.         Dictionary<string, Transform> boneMap = new Dictionary<string, Transform>();
  11.         foreach (Transform bone in TargetMeshRenderer.bones)
  12.             boneMap[bone.gameObject.name] = bone;
  13.  
  14.  
  15.         SkinnedMeshRenderer myRenderer = gameObject.GetComponent<SkinnedMeshRenderer>();
  16.  
  17.         Transform[] newBones = new Transform[myRenderer.bones.Length];
  18.         for (int i = 0; i < myRenderer.bones.Length; ++i)
  19.         {
  20.             GameObject bone = myRenderer.bones[i].gameObject;
  21.             if (!boneMap.TryGetValue(bone.nameout newBones[i]))
  22.             {
  23.                 Debug.Log("Unable to map bone \"" + bone.name + "\" to target skeleton.");
  24.                 break;
  25.             }
  26.         }
  27.         myRenderer.bones = newBones;
  28.  
  29.     }
  30. }
______________________________________________________________________________________________________________________________________________________________________________

that lets me map extra clothing onto a character however when i try with the LOD the mesh stops rendering altogether.
any thoughts ? 
(I will look back this evening got work now) 

Victor.Soupday
Victor.Soupday
Posted 3 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: Yesterday
Posts: 569, Visits: 9.0K
Do you add the skinned mesh renderer (myRenderer) of the mesh object to the LOD group > LOD Level renderer list?

That may be why it's not rendering as it only renders what's specified in each LOD level.
Jbowdoin
Jbowdoin
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 123, Visits: 793
Yeah I did and its not rendering despite that .

not rendering is tied to the code, the moment i put that on the LOD model it stopes even if I remove the LOD group all together.
I know its the code that I use for trying to merge the skeletons that dose that and yet it works just fine for clothing 
which is why I'm considering other options  


Jbowdoin
Jbowdoin
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 123, Visits: 793
has this not come up before?

surly im not the only one who wants both optimized materials and LODs lol
Jbowdoin
Jbowdoin
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 123, Visits: 793
no luck it seems -_-

why is it so hard to find info on this ?
I know its doable, how else do people set up LOD's from other software to use one animater any way?
Victor.Soupday
Victor.Soupday
Posted 3 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: Yesterday
Posts: 569, Visits: 9.0K
The principle is sound, the problem is it requires all the original bone transforms of all the LOD levels to be carefully preserved, at least until after they have been combined, but also the bone names in the various LOD models exported from CC4 are not necessarily the same, and some LOD exports add extra bones which all need to be untangled for correct retargeting. If any bone fails to retarget it won't draw the mesh.

I've been working on a tool to combine the LOD models from the new LOD generation system in CC4 (Optimize and Decimate) which basically uses the same principle of retargeting the skinned mesh renderers to a set of common bone transforms and re-structures the transform hierarchy so that animations (include blend shape animation tracks) play correctly on all levels, but it does it in the editor and generates a new LODGroup prefab:



With modification it can also combine the multi LOD level exports from InstaLod with any custom character LOD and do exactly what you need.

Jbowdoin
Jbowdoin
Posted 3 Years Ago
View Quick Profile
Distinguished Member

Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)Distinguished Member (1.1K reputation)

Group: Forum Members
Last Active: Last Month
Posts: 123, Visits: 793
I see, so the code worked for clothing and such because to ones were unchanged but the LODs do change the bones ok
is that tool something you plan to put into the asset store ? 



Reading This Topic

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