|
@@ -563,6 +563,7 @@ function simGroup::SelectFiteredObjects(%this, %min, %max)
|
|
|
|
|
|
function SceneObject::filteredSelect(%this, %min, %max)
|
|
function SceneObject::filteredSelect(%this, %min, %max)
|
|
{
|
|
{
|
|
|
|
+ echo("SceneObject::filteredSelect() - min: " @ %min @ " max: " @ %max);
|
|
%box = %this.getWorldBox();
|
|
%box = %this.getWorldBox();
|
|
%xlength = mAbs(getWord(%box,0) - getWord(%box,3));
|
|
%xlength = mAbs(getWord(%box,0) - getWord(%box,3));
|
|
%ylength = mAbs(getWord(%box,1) - getWord(%box,4));
|
|
%ylength = mAbs(getWord(%box,1) - getWord(%box,4));
|
|
@@ -584,22 +585,27 @@ function simGroup::onInspect(%obj, %inspector)
|
|
//it will route down through GuiInspectorGroup(the namespace of %group) and call onConstructField in an attemp to see if there's any
|
|
//it will route down through GuiInspectorGroup(the namespace of %group) and call onConstructField in an attemp to see if there's any
|
|
//script defined functions that can build a field of that type.
|
|
//script defined functions that can build a field of that type.
|
|
//We happen to define the required 'build @ <fieldTypeName> @ Field()' function below, allowing us to build out the custom field type
|
|
//We happen to define the required 'build @ <fieldTypeName> @ Field()' function below, allowing us to build out the custom field type
|
|
- %group.addField("minSize", "F32", "min diagonal size of objects");
|
|
|
|
- %group.addField("maxSize", "F32", "max diagonal size of objects");
|
|
|
|
- %group.addField("select", "SimGroupSelectionButton", "Select filtered objects");
|
|
|
|
|
|
+ %group.addField("Select Objects", "SimGroupSelectionButton", "Select filtered objects");
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
function GuiInspectorGroup::buildSimGroupSelectionButtonField(%this, %fieldName, %fieldLabel, %fieldDesc,
|
|
function GuiInspectorGroup::buildSimGroupSelectionButtonField(%this, %fieldName, %fieldLabel, %fieldDesc,
|
|
%fieldDefaultVal, %fieldDataVals, %callback, %ownerObj)
|
|
%fieldDefaultVal, %fieldDataVals, %callback, %ownerObj)
|
|
{
|
|
{
|
|
|
|
+
|
|
|
|
+ //Set defaults if needbe
|
|
|
|
+ if(%ownerObj.minSize $= "")
|
|
|
|
+ %ownerObj.minSize = 0.1;
|
|
|
|
+ if(%ownerObj.maxSize $= "")
|
|
|
|
+ %ownerObj.maxSize = 1;
|
|
|
|
+
|
|
%container = new GuiControl() {
|
|
%container = new GuiControl() {
|
|
canSaveDynamicFields = "0";
|
|
canSaveDynamicFields = "0";
|
|
Profile = "EditorContainerProfile";
|
|
Profile = "EditorContainerProfile";
|
|
HorizSizing = "right";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
VertSizing = "bottom";
|
|
Position = "0 0";
|
|
Position = "0 0";
|
|
- Extent = "300 18";
|
|
|
|
|
|
+ Extent = "300 80";
|
|
MinExtent = "8 2";
|
|
MinExtent = "8 2";
|
|
canSave = "0";
|
|
canSave = "0";
|
|
Visible = "1";
|
|
Visible = "1";
|
|
@@ -607,24 +613,83 @@ function GuiInspectorGroup::buildSimGroupSelectionButtonField(%this, %fieldName,
|
|
tooltip = "";// %tooltip;
|
|
tooltip = "";// %tooltip;
|
|
tooltipProfile = "EditorToolTipProfile";
|
|
tooltipProfile = "EditorToolTipProfile";
|
|
|
|
|
|
|
|
+ new GuiTextCtrl() {
|
|
|
|
+ profile = GuiInspectorFieldProfile;
|
|
|
|
+ text = %fieldLabel;
|
|
|
|
+ Position = "16 2";
|
|
|
|
+ Extent = "300 18";
|
|
|
|
+ HorizSizing = "right";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ new GuiControl() {
|
|
|
|
+ Position = "40 20";
|
|
|
|
+ Extent = "270 18";
|
|
|
|
+ HorizSizing = "right";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+
|
|
|
|
+ new GuiTextCtrl() {
|
|
|
|
+ profile = GuiInspectorFieldProfile;
|
|
|
|
+ text = "Minimum Size:";
|
|
|
|
+ Position = "0 2";
|
|
|
|
+ Extent = "150 18";
|
|
|
|
+ HorizSizing = "right";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ new GuiTextEditCtrl() {
|
|
|
|
+ profile = GuiInspectorTextEditProfile;
|
|
|
|
+ variable = %ownerObj @ ".minSize";
|
|
|
|
+ Position = "150 2";
|
|
|
|
+ Extent = "150 18";
|
|
|
|
+ HorizSizing = "left";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ new GuiControl() {
|
|
|
|
+ Position = "40 40";
|
|
|
|
+ Extent = "270 18";
|
|
|
|
+ HorizSizing = "right";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+
|
|
|
|
+ new GuiTextCtrl() {
|
|
|
|
+ profile = GuiInspectorFieldProfile;
|
|
|
|
+ text = "Maximum Size:";
|
|
|
|
+ Position = "0 2";
|
|
|
|
+ Extent = "150 18";
|
|
|
|
+ HorizSizing = "right";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+ };
|
|
|
|
+
|
|
|
|
+ new GuiTextEditCtrl() {
|
|
|
|
+ profile = GuiInspectorTextEditProfile;
|
|
|
|
+ variable = %ownerObj @ ".maxSize";
|
|
|
|
+ Position = "150 2";
|
|
|
|
+ Extent = "150 18";
|
|
|
|
+ HorizSizing = "left";
|
|
|
|
+ VertSizing = "bottom";
|
|
|
|
+ };
|
|
|
|
+ };
|
|
|
|
+
|
|
new GuiButtonCtrl() {
|
|
new GuiButtonCtrl() {
|
|
canSaveDynamicFields = "0";
|
|
canSaveDynamicFields = "0";
|
|
Profile = "ToolsGuiButtonProfile";
|
|
Profile = "ToolsGuiButtonProfile";
|
|
HorizSizing = "right";
|
|
HorizSizing = "right";
|
|
VertSizing = "bottom";
|
|
VertSizing = "bottom";
|
|
- Position = "16 3";
|
|
|
|
- Extent = "300 18";
|
|
|
|
|
|
+ Position = "40 60";
|
|
|
|
+ Extent = "265 18";
|
|
MinExtent = "8 2";
|
|
MinExtent = "8 2";
|
|
canSave = "0";
|
|
canSave = "0";
|
|
Visible = "1";
|
|
Visible = "1";
|
|
hovertime = "100";
|
|
hovertime = "100";
|
|
tooltip = ""; //%tooltip;
|
|
tooltip = ""; //%tooltip;
|
|
tooltipProfile = "EditorToolTipProfile";
|
|
tooltipProfile = "EditorToolTipProfile";
|
|
- text = %fieldName;
|
|
|
|
|
|
+ text = "Select";
|
|
maxLength = "1024";
|
|
maxLength = "1024";
|
|
command = %ownerObj @ ".SelectFiteredObjects("@ %ownerObj.minSize @","@ %ownerObj.maxSize @");";
|
|
command = %ownerObj @ ".SelectFiteredObjects("@ %ownerObj.minSize @","@ %ownerObj.maxSize @");";
|
|
};
|
|
};
|
|
};
|
|
};
|
|
-
|
|
|
|
|
|
+
|
|
%this-->stack.add(%container);
|
|
%this-->stack.add(%container);
|
|
}
|
|
}
|