mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-14 16:14:38 +00:00
Merge pull request #813 from Areloch/MiscConvexToolFixes
Fix Misc ConvexShape Tooling Issues
This commit is contained in:
commit
5fb227a1e7
4 changed files with 95 additions and 18 deletions
|
|
@ -263,7 +263,7 @@ bool ConvexShape::protectedSetSurfaceTexture(void *object, const char *index, co
|
||||||
|
|
||||||
surfaceMaterial surface;
|
surfaceMaterial surface;
|
||||||
|
|
||||||
surface._setMaterial(data);
|
surface._setMaterial(StringTable->insert(data));
|
||||||
|
|
||||||
shape->mSurfaceTextures.push_back(surface);
|
shape->mSurfaceTextures.push_back(surface);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1075,7 +1075,7 @@ void GuiConvexEditorCtrl::renderScene(const RectI & updateRect)
|
||||||
Point3F boxPos = objBox.getCenter();
|
Point3F boxPos = objBox.getCenter();
|
||||||
objMat.mulP( boxPos );
|
objMat.mulP( boxPos );
|
||||||
|
|
||||||
drawer->drawObjectBox( desc, objBox.getExtents(), boxPos, objMat, ColorI::WHITE );
|
drawer->drawObjectBox( desc, objBox.getExtents() / 2, boxPos, objMat, ColorI::WHITE );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -38,7 +38,7 @@ function ConvexEditorGui::onWake( %this )
|
||||||
%mat = %matName;
|
%mat = %matName;
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvexEditorOptionsWindow-->matPreviewBtn.setBitmap( getAssetPreviewImage(%mat.getDiffuseMap(0)));
|
ConvexEditorOptionsWindow-->matPreviewBtn.bitmapAsset = getAssetPreviewImage(%mat.getDiffuseMap(0));
|
||||||
|
|
||||||
ConvexEditorOptionsWindow.activeMaterial = %mat;
|
ConvexEditorOptionsWindow.activeMaterial = %mat;
|
||||||
}
|
}
|
||||||
|
|
@ -78,7 +78,7 @@ function ConvexEditorGui::onSelectionChanged( %this, %shape, %face )
|
||||||
|
|
||||||
ConvexEditorOptionsWindow-->defMatPreviewBtn.setText("");
|
ConvexEditorOptionsWindow-->defMatPreviewBtn.setText("");
|
||||||
%shapeMat = %shape.getMaterial();
|
%shapeMat = %shape.getMaterial();
|
||||||
ConvexEditorOptionsWindow-->defMatPreviewBtn.setBitmap(getAssetPreviewImage(%shapeMat.getDiffuseMap(0)));
|
ConvexEditorOptionsWindow-->defMatPreviewBtn.bitmapAsset = getAssetPreviewImage(%shapeMat.getDiffuseMap(0));
|
||||||
|
|
||||||
ConvexEditorOptionsWindow.activeShape = %shape;
|
ConvexEditorOptionsWindow.activeShape = %shape;
|
||||||
|
|
||||||
|
|
@ -166,18 +166,8 @@ function ConvexEditorMaterialBtn::gotMaterialName(%this, %name)
|
||||||
//eval(%this.object @ "." @ %this.targetField @ " = " @ %name @ ";");
|
//eval(%this.object @ "." @ %this.targetField @ " = " @ %name @ ";");
|
||||||
//%this.object.changeMaterial(getTrailingNumber(%this.targetField), %name);
|
//%this.object.changeMaterial(getTrailingNumber(%this.targetField), %name);
|
||||||
//%this.object.inspectorApply();
|
//%this.object.inspectorApply();
|
||||||
%diffusemap = %materialAsset.materialDefinitionName.getDiffuseMap(0);
|
%diffusemap = %materialAsset.materialDefinitionName.getDiffuseMapAsset(0);
|
||||||
if(%diffusemap $= "")
|
ConvexEditorOptionsWindow-->matPreviewBtn.bitmapAsset = getAssetPreviewImage(%diffusemap);
|
||||||
{
|
|
||||||
%diffuseAsset = %materialAsset.materialDefinitionName.getDiffuseMapAsset(0);
|
|
||||||
if(%diffuseAsset !$= "")
|
|
||||||
{
|
|
||||||
%diffuseAssetDef = AssetDatabase.acquireAsset(%diffuseAsset);
|
|
||||||
%diffusemap = %diffuseAssetDef.getImagePath();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ConvexEditorOptionsWindow-->matPreviewBtn.setBitmap(getAssetPreviewImage(%diffusemap));
|
|
||||||
|
|
||||||
ConvexEditorOptionsWindow.activeMaterial = %materialAsset.getAssetId();
|
ConvexEditorOptionsWindow.activeMaterial = %materialAsset.getAssetId();
|
||||||
}
|
}
|
||||||
|
|
@ -242,7 +232,7 @@ function ConvexEditorDefaultMaterialBtn::gotMaterialName(%this, %name)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ConvexEditorOptionsWindow-->defMatPreviewBtn.setBitmap(getAssetPreviewImage(%diffusemap));
|
ConvexEditorOptionsWindow-->defMatPreviewBtn.bitmapAsset = getAssetPreviewImage(%diffusemap);
|
||||||
|
|
||||||
ConvexEditorOptionsWindow.activeShape.setMaterial(%name);
|
ConvexEditorOptionsWindow.activeShape.setMaterial(%name);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
Position = Canvas.extent.x - 209
|
Position = Canvas.extent.x - 209
|
||||||
SPC getWord(EditorGuiToolbar.extent, 1) - 2;
|
SPC getWord(EditorGuiToolbar.extent, 1) - 2;
|
||||||
Extent = "210 485";
|
Extent = "210 550";
|
||||||
minExtent = "210 298";
|
minExtent = "210 298";
|
||||||
horizSizing = "windowRelative";
|
horizSizing = "windowRelative";
|
||||||
vertSizing = "windowRelative";
|
vertSizing = "windowRelative";
|
||||||
|
|
@ -745,6 +745,93 @@ $guiContnt = new GuiControl(ConvexEditorOptions)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
new GuiContainer() {
|
||||||
|
docking = "Top";
|
||||||
|
margin = "0 0 3 3";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "4 502";
|
||||||
|
extent = "1432 50";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "inspectorStyleRolloutDarkProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiTextCtrl() {
|
||||||
|
text = "Brush Actions";
|
||||||
|
maxLength = "1024";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "5 0";
|
||||||
|
extent = "121 18";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiDefaultProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
|
||||||
|
new GuiButtonCtrl() {
|
||||||
|
text = "Hollow Selected";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
position = "5 22";
|
||||||
|
extent = "90 21";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
command = "ConvexEditorGui.hollowSelection();";
|
||||||
|
};
|
||||||
|
|
||||||
|
new GuiButtonCtrl() {
|
||||||
|
text = "Recenter Selected";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
position = "100 22";
|
||||||
|
extent = "110 21";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
command = "ConvexEditorGui.recenterSelection();";
|
||||||
|
};
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue