mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-01-20 04:34:48 +00:00
Fixes handling in the generic creator function to deal with commands formatted with "return " at the start AND without
Fixes assignment of default material to convex shape when the toolbar button is pressed to create a 1u cube automatically.
This commit is contained in:
parent
c7342cc64f
commit
cde1d68f78
|
|
@ -51,6 +51,8 @@ function ConvexEditorGui::onSleep( %this )
|
|||
function ConvexEditorGui::createConvexBox( %this )
|
||||
{
|
||||
%obj = genericCreateObject( "ConvexShape" );
|
||||
%obj.setMaterial(%this.materialName); //set whatever the editor has as it's default material to the new one
|
||||
|
||||
%this.handleDeselect();
|
||||
%this.selectConvex( %obj );
|
||||
%this.dropSelectionAtScreenCenter();
|
||||
|
|
|
|||
|
|
@ -227,6 +227,10 @@ function ObjectCreator::createObject( %this, %cmd )
|
|||
%this.setNewObjectGroup( getScene(0) );
|
||||
|
||||
pushInstantGroup();
|
||||
|
||||
if(startsWith(%cmd, "return "))
|
||||
%objId = eval(%cmd);
|
||||
else
|
||||
%objId = eval("return " @ %cmd);
|
||||
popInstantGroup();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue