Skip to content

Commit

Permalink
Update assimp net, which now has mesh and material name
Browse files Browse the repository at this point in the history
Add name and material name output on mesh and material node
  • Loading branch information
mrvux committed Aug 28, 2020
1 parent 1733e73 commit d3c3f77
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 1 deletion.
Binary file modified Dependencies/x64/AssimpNet.dll
Binary file not shown.
Binary file modified Dependencies/x86/AssimpNet.dll
Binary file not shown.
6 changes: 6 additions & 0 deletions Nodes/VVVV.DX11.Nodes.Assimp/AssimpMaterialNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ public class AssimpMaterialNode : IPluginEvaluate
[Input("Scene", IsSingle = true)]
protected IDiffSpread<AssimpScene> FInScene;

[Output("Name")]
protected ISpread<string> FOutName;

[Output("Ambient Color")]
protected ISpread<RGBAColor> FOutAmbient;

Expand Down Expand Up @@ -52,6 +55,7 @@ public void Evaluate(int SpreadMax)
this.FOutSpecular.SliceCount = matcount;
this.FOutDiffuse.SliceCount = matcount;
this.FOutPower.SliceCount = matcount;
this.FOutName.SliceCount = matcount;

List<eAssimpTextureType> types = new List<eAssimpTextureType>();
List<eAssimpTextureMapMode> mapmodes = new List<eAssimpTextureMapMode>();
Expand All @@ -67,6 +71,7 @@ public void Evaluate(int SpreadMax)
this.FOutPower[i] = mat.SpecularPower;

this.FOutTexPath[i].SliceCount = mat.TexturePath.Count;
this.FOutName[i] = mat.Name;

types.AddRange(mat.TextureType);
mapmodes.AddRange(mat.TextureMapMode);
Expand All @@ -82,6 +87,7 @@ public void Evaluate(int SpreadMax)
}
else
{
this.FOutName.SliceCount = 0;
this.FOutTexPath.SliceCount = 0;
this.FOutTexType.SliceCount = 0;
this.FOutTexMapMode.SliceCount = 0;
Expand Down
6 changes: 6 additions & 0 deletions Nodes/VVVV.DX11.Nodes.Assimp/AssimpMeshNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ public class AssimpMeshNode : IPluginEvaluate,IDisposable,IDX11ResourceHost
[Output("Output")]
protected Pin<DX11Resource<DX11IndexedGeometry>> FOutGeom;

[Output("Name")]
protected ISpread<string> FOutName;

[Output("Bone Names")]
protected ISpread<ISpread<string>> FOutBoneNames;

Expand Down Expand Up @@ -72,6 +75,7 @@ public void Evaluate(int SpreadMax)
this.FOutValid.SliceCount = meshcnt;
this.FOutBoundingMin.SliceCount = meshcnt;
this.FOutBoundingMax.SliceCount = meshcnt;
this.FOutName.SliceCount = meshcnt;

for (int i = 0; i < meshcnt; i++)
{
Expand All @@ -90,6 +94,7 @@ public void Evaluate(int SpreadMax)
this.FOutValid[i] = assimpmesh.Indices.Count > 0 && assimpmesh.VerticesCount > 0;
this.FOutBoundingMin[i] = assimpmesh.BoundingBox.Minimum;
this.FOutBoundingMax[i] = assimpmesh.BoundingBox.Maximum;
this.FOutName[i] = assimpmesh.Name;
}
}
else
Expand All @@ -101,6 +106,7 @@ public void Evaluate(int SpreadMax)
this.FOutValid.SliceCount = 0;
this.FOutBoundingMin.SliceCount = 0;
this.FOutBoundingMax.SliceCount = 0;
this.FOutName.SliceCount = 0;
}
this.FInvalidate = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public BvhShapeDefinition(AssimpMesh mesh)
this.vertices = new Vector3[mesh.VerticesCount];
this.indices = mesh.Indices.ToArray();

Vector3* v = (Vector3*)mesh.Positions();
Vector3* v = (Vector3*)mesh.PositionPointer;

for (int i = 0; i < mesh.VerticesCount; i++)
{
Expand Down

0 comments on commit d3c3f77

Please sign in to comment.