cleanup nodes

ADDED: functionality to clean nodes out of the script that are related to a specific target
ADDED: functionality to clean multiple addCollisionDetails from the script
ADDED: ColConvex get added as nodes now and dont just get skipped (for future reference ColMeshes are checked for colConvex are not but this will be needed in future)

Removed: erroneous deletion of nodes and meshes from shapeEditorActions tscript file.
This commit is contained in:
marauder2k7 2024-05-16 07:04:54 +01:00
parent 25b0c5e2b1
commit 92b10df7eb
4 changed files with 64 additions and 35 deletions

View file

@ -1021,6 +1021,9 @@ DefineTSShapeConstructorMethod( addCollisionDetail, bool, ( S32 size, const char
mShape->getNodeWorldTransform( nodeIndex, &mat );
if ( !mat.isIdentity() )
setNodeTransform( colNodeName, TransformF::Identity );
// clean node commands that are related to this target.
cleanTargetNodes(colNodeName, target);
}
// Add the meshes to the shape =>
@ -1064,15 +1067,8 @@ DefineTSShapeConstructorMethod( addCollisionDetail, bool, ( S32 size, const char
mShape->addMesh( mesh->tsmesh, meshName );
// Add a node for this object if needed (non-identity transform)
if ( mesh->transform.isIdentity() )
{
mShape->setObjectNode( objName, colNodeName );
}
else
{
addNode( meshName, colNodeName, TransformF( mesh->transform ) );
mShape->setObjectNode( objName, meshName );
}
addNode( meshName, colNodeName, target, TransformF( mesh->transform ) );
mShape->setObjectNode( objName, meshName );
}
mShape->init();