diff --git a/include/ComplexShape.h b/include/ComplexShape.h index 47c2711a4a09e532ef9c1e24ae10c6f422b2b06b..ede2cdac5628291b2b19c43827df9fcec309a1a9 100644 --- a/include/ComplexShape.h +++ b/include/ComplexShape.h @@ -182,8 +182,7 @@ public: int max_bones_per_partition = 4, bool stripify = false, bool tangent_space = false, - float min_vertex_weight = 0.001f, - bool use_dismember_partitions = false + float min_vertex_weight = 0.001f ) const; /* diff --git a/src/ComplexShape.cpp b/src/ComplexShape.cpp index b7b3b6ffae8e978454ae054e56be8b5cf7d10d30..8a469c768e88f4ac3f843dc3987c8fd4e5563eaa 100644 --- a/src/ComplexShape.cpp +++ b/src/ComplexShape.cpp @@ -698,17 +698,24 @@ void ComplexShape::Merge( NiAVObject * root ) { //Done Merging } -Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int max_bones_per_partition, bool stripify, bool tangent_space, float min_vertex_weight, bool use_dismember_partitions ) const { +Ref<NiAVObject> ComplexShape::Split( NiNode * parent, Matrix44 & transform, int max_bones_per_partition, bool stripify, bool tangent_space, float min_vertex_weight ) const { //Make sure parent is not NULL if ( parent == NULL ) { throw runtime_error ("A parent is necessary to split a complex shape."); } - if( use_dismember_partitions == true ) { - if(dismemberPartitionsFaces.size() != faces.size()) { + bool use_dismember_partitions = false; + + if( dismemberPartitionsFaces.size() > 0 ) { + if( dismemberPartitionsFaces.size() != faces.size() ) { throw runtime_error ("The number of faces mapped to skin partitions is different from the actual face count."); } + if(dismemberPartitionsBodyParts.size() == 0) { + throw runtime_error ("The number of dismember partition body parts can't be 0."); + } + + use_dismember_partitions = true; } //There will be one NiTriShape per property group