mirror of
https://github.com/vrm-c/UniVRM.git
synced 2026-09-08 03:48:19 -05:00
Merge branch 'master' into feature/bone_morph
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using UnityEngine.Rendering;
|
||||
using UnityEngine.Rendering;
|
||||
|
||||
namespace UniGLTF
|
||||
{
|
||||
@@ -6,19 +6,19 @@ namespace UniGLTF
|
||||
{
|
||||
public static RenderPipelineTypes GetRenderPipelineType()
|
||||
{
|
||||
RenderPipeline currentPipeline = RenderPipelineManager.currentPipeline;
|
||||
RenderPipelineAsset currentRenderPipelineAsset = GraphicsSettings.currentRenderPipeline;
|
||||
|
||||
if (currentPipeline == null)
|
||||
if (currentRenderPipelineAsset == null)
|
||||
{
|
||||
return RenderPipelineTypes.BuiltinRenderPipeline;
|
||||
}
|
||||
|
||||
if (currentPipeline.GetType().Name.Contains("HDRenderPipeline"))
|
||||
if (currentRenderPipelineAsset.GetType().Name.Contains("HDRenderPipeline"))
|
||||
{
|
||||
return RenderPipelineTypes.HighDefinitionRenderPipeline;
|
||||
}
|
||||
|
||||
if (currentPipeline.GetType().Name.Contains("UniversalRenderPipeline"))
|
||||
if (currentRenderPipelineAsset.GetType().Name.Contains("UniversalRenderPipeline"))
|
||||
{
|
||||
return RenderPipelineTypes.UniversalRenderPipeline;
|
||||
}
|
||||
@@ -26,4 +26,4 @@ namespace UniGLTF
|
||||
return RenderPipelineTypes.Unknown;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -255,9 +255,10 @@ namespace UniGLTF
|
||||
}
|
||||
}
|
||||
|
||||
static Dictionary<Transform, IReadOnlyDictionary<Transform, TransformState>> PoseMap = new();
|
||||
static readonly Dictionary<Transform, IReadOnlyDictionary<Transform, TransformState>> PoseMap = new();
|
||||
|
||||
public static IReadOnlyDictionary<Transform, TransformState> SafeGetInitialPose(
|
||||
Transform root, bool useCache = true)
|
||||
Transform root, bool useCache = false)
|
||||
{
|
||||
if (useCache && PoseMap.TryGetValue(root, out var pose))
|
||||
{
|
||||
@@ -278,7 +279,10 @@ namespace UniGLTF
|
||||
}
|
||||
|
||||
// add cache
|
||||
PoseMap.Add(root, pose);
|
||||
if (useCache)
|
||||
{
|
||||
PoseMap.Add(root, pose);
|
||||
}
|
||||
|
||||
return pose;
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace UniVRM10
|
||||
// use material.name, because material name may renamed in GltfParser.
|
||||
matDesc = new MaterialDescriptor(
|
||||
m.name,
|
||||
Shader.Find(MToon10Meta.UnityShaderName),
|
||||
Shader,
|
||||
null,
|
||||
Vrm10MToonTextureImporter.EnumerateAllTextures(data, m, mtoon).ToDictionary(tuple => tuple.key, tuple => tuple.Item2.Item2),
|
||||
TryGetAllFloats(m, mtoon).ToDictionary(tuple => tuple.key, tuple => tuple.value),
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace UniVRM10
|
||||
// use material.name, because material name may renamed in GltfParser.
|
||||
matDesc = new MaterialDescriptor(
|
||||
m.name,
|
||||
Shader.Find(MToon10Meta.UnityUrpShaderName),
|
||||
Shader,
|
||||
null,
|
||||
Vrm10MToonTextureImporter.EnumerateAllTextures(data, m, mtoon).ToDictionary(tuple => tuple.key, tuple => tuple.Item2.Item2),
|
||||
BuiltInVrm10MToonMaterialImporter.TryGetAllFloats(m, mtoon).ToDictionary(tuple => tuple.key, tuple => tuple.value),
|
||||
|
||||
Reference in New Issue
Block a user