mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-05-20 09:47:56 -05:00
Merge pull request #401 from ousttrue/fix_export_nonactive_mesh
Fix export nonactive mesh
This commit is contained in:
commit
d949f7852f
|
|
@ -25,6 +25,18 @@ namespace VRM
|
|||
wiz.OnWizardUpdate();
|
||||
}
|
||||
|
||||
void OnEnable()
|
||||
{
|
||||
// Debug.Log("OnEnable");
|
||||
EditorApplication.hierarchyWindowChanged += OnWizardUpdate;
|
||||
}
|
||||
|
||||
void OnDisable()
|
||||
{
|
||||
// Debug.Log("OnDisable");
|
||||
EditorApplication.hierarchyWindowChanged -= OnWizardUpdate;
|
||||
}
|
||||
|
||||
void OnWizardCreate()
|
||||
{
|
||||
// save dialog
|
||||
|
|
|
|||
|
|
@ -83,6 +83,11 @@ namespace VRM
|
|||
{
|
||||
yield return "ReduceBlendshapeSize is need VRMBlendShapeProxy, you need to convert to VRM once.";
|
||||
}
|
||||
|
||||
if(Source.GetComponentsInChildren<Renderer>().All(x => !x.gameObject.activeInHierarchy))
|
||||
{
|
||||
yield return "No active mesh";
|
||||
}
|
||||
}
|
||||
|
||||
public void InitializeFrom(GameObject go)
|
||||
|
|
|
|||
|
|
@ -19,8 +19,22 @@ namespace VRM
|
|||
{
|
||||
var transform = UniGLTF.UnityExtensions.GetFromPath(root.transform, binding.RelativePath);
|
||||
var renderer = transform.GetComponent<SkinnedMeshRenderer>();
|
||||
if (renderer == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if(!renderer.gameObject.activeInHierarchy)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
var mesh = renderer.sharedMesh;
|
||||
var meshIndex = meshes.IndexOf(mesh);
|
||||
if (meshIndex == -1)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new glTF_VRM_BlendShapeBind
|
||||
{
|
||||
|
|
@ -36,7 +50,16 @@ namespace VRM
|
|||
var list = new List<glTF_VRM_BlendShapeBind>();
|
||||
if (clip.Values != null)
|
||||
{
|
||||
list.AddRange(clip.Values.Select(y => Create(transform, meshes.ToList(), y)));
|
||||
foreach (var value in clip.Values)
|
||||
{
|
||||
var bind = Create(transform, meshes, value);
|
||||
if (bind == null)
|
||||
{
|
||||
// Debug.LogFormat("{0}: skip blendshapebind", clip.name);
|
||||
continue;
|
||||
}
|
||||
list.Add(bind);
|
||||
}
|
||||
}
|
||||
|
||||
var materialList = new List<glTF_VRM_MaterialValueBind>();
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user