Merge branch 'development' into mipwip

This commit is contained in:
AzaezelX 2025-08-04 11:04:49 -05:00
commit 65e92fc50c
220 changed files with 7290 additions and 8630 deletions

View file

@ -4,3 +4,58 @@ datablock ItemData(PrototypeItemData)
ShapeAsset = "Prototyping:TorusPrimitive_shape";
cameraMaxDist = "0.75";
};
datablock PlayerData( ProtoPlayer ) {
// Third person shape
ShapeAsset = "Prototyping:Playerbot_shape";
controlMap = "playerKeyMap";
AIControllerData = "aiPlayerControl";
};
datablock WheeledVehicleTire(ProtoCarTire)
{
// Tires act as springs and generate lateral and longitudinal
// forces to move the vehicle. These distortion/spring forces
// are what convert wheel angular velocity into forces that
// act on the rigid body.
shapeAsset = "Prototyping:carwheel_shape";
staticFriction = 1;
kineticFriction = 4.2;
// Spring that generates lateral tire forces
lateralForce = 150000;
lateralDamping = 30000;
lateralRelaxation = 0.1;
// Spring that generates longitudinal tire forces
longitudinalForce = 600;
longitudinalDamping = 1600;
longitudinalRelaxation = 0.1;
};
datablock WheeledVehicleSpring(ProtoCarSpring)
{
// Wheel suspension properties
length = "0.6"; // Suspension travel
force = 3600; // Spring force
damping = 2800; // Spring damping
antiSwayForce = 300; // Lateral anti-sway force
};
datablock WheeledVehicleData(ProtoCar)
{
category = "Vehicles";
shapeAsset = "Prototyping:car_shape";
collisionMul = 0;
impactMul = 0;
controlMap = "vehicleKeyMap";
AIControllerData = "aiCarControl";
cameraMaxDist = "2.81993";
ShapeFile = "data/Prototyping/shapes/Vehicles/car.dae";
mass = "1000";
originalAssetName = "ProtoCar";
massCenter = "0 0.75 0";
dragForce = "0.1";
};

View file

@ -0,0 +1,47 @@
//-----------------------------------------------------------------------------
// Copyright (c) 2012 GarageGames, LLC
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to
// deal in the Software without restriction, including without limitation the
// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
// sell copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
// IN THE SOFTWARE.
//-----------------------------------------------------------------------------
// This file contains script methods unique to the WheeledVehicle class. All
// other necessary methods are contained in "../server/scripts/vehicle.cs" in
// which the "generic" Vehicle class methods that are shared by all vehicles,
// (flying, hover, and wheeled) can be found.
function ProtoCar::onAdd(%this, %obj)
{
Parent::onAdd(%this, %obj);
// Setup the car with some tires & springs
for (%i = %obj.getWheelCount() - 1; %i >= 0; %i--)
{
%obj.setWheelTire(%i, ProtoCarTire);
%obj.setWheelSpring(%i, ProtoCarSpring);
%obj.setWheelPowered(%i, false);
}
// Steer with the front tires
%obj.setWheelSteering(0, 1);
%obj.setWheelSteering(1, 1);
// Only power the two rear wheels... assuming there are only 4 wheels.
%obj.setWheelPowered(2, true);
%obj.setWheelPowered(3, true);
}

View file

@ -1,5 +1,39 @@
AssetBrowser::registerAssetType("ImageAsset", "Images");
function ImageAsset::onCreateNew()
{
%moduleName = $CurrentAssetBrowser.newAssetSettings.moduleName;
%modulePath = "data/" @ %moduleName;
%assetName = $CurrentAssetBrowser.newAssetSettings.assetName;
%assetPath = NewAssetTargetAddress.getText() @ "/";
%tamlpath = %assetPath @ %assetName @ ".asset.taml";
%filePath = %assetPath @ %assetName @ ".png";
%asset = new ImageAsset()
{
AssetName = %assetName;
versionId = 1;
imageFile = %assetName @ ".png";
};
TamlWrite(%asset, %tamlpath);
%moduleDef = ModuleDatabase.findModule(%moduleName, 1);
AssetDatabase.addDeclaredAsset(%moduleDef, %tamlpath);
%file = new FileObject();
if(%file.openForWrite(%filePath))
{
%file.close();
}
return %tamlpath;
}
function ImageAsset::buildBrowserElement(%this, %previewData)
{
//%module = %this.dirHandler.getModuleFromAddress(makeRelativePath(filePath(%assetDef.getImagePath())));
@ -96,6 +130,17 @@ function ImageAsset::generatePreviewImage(%this, %previewButton, %forceRegenerat
function ImageAsset::onShowActionMenu(%this)
{
GenericAsset::onShowActionMenu(%this);
%assetId = %this.getAssetId();
EditAssetPopup.setItemPosition("Create Composite Texture" TAB "" TAB "CompositeTextureEditor.buildComposite(\"" @ %assetId @ "\");", 4);
EditAssetPopup.objectData = %assetId;
EditAssetPopup.objectType = AssetDatabase.getAssetType(%assetId);
EditAssetPopup.reloadItems();
EditAssetPopup.showPopup(Canvas);
}
function ImageAsset::onEditProperties(%this)

View file

@ -1,5 +1,13 @@
AssetBrowser::registerAssetType("MaterialAsset", "Materials");
function MaterialAsset::setupCreateNew()
{
NewAssetPropertiesInspector.startGroup("Material");
NewAssetPropertiesInspector.addField("InheritFrom", "Inherit From", "MaterialInheritList", "What material should this new one inherit from.", "", "", $CurrentAssetBrowser.newAssetSettings);
NewAssetPropertiesInspector.endGroup();
}
function MaterialAsset::onCreateNew()
{
%assetName = $CurrentAssetBrowser.newAssetSettings.assetName;
@ -18,6 +26,7 @@ function MaterialAsset::onCreateNew()
materialDefinitionName = %assetName;
new Material(%assetName) {
inheritFrom = $CurrentAssetBrowser.newAssetSettings.inheritFrom;
mapTo = %assetName;
};
};
@ -227,3 +236,101 @@ function GuiInspectorTypeMaterialAssetPtr::onControlDropped( %this, %payload, %p
EWorldEditor.isDirty = true;
}
function GuiInspectorGroup::buildMaterialInheritListField(%this, %fieldName, %fieldLabel, %fieldDesc, %fieldDefaultVal, %fieldDataVals, %callbackName, %ownerObj)
{
%extent = 18;
%fieldCtrl = %this.createInspectorField();
%extent = %this.stack.getExtent();
%width = mRound(%extent/2);
%height = 20;
%inset = 10;
%editControl = new GuiPopUpMenuCtrlEx() {
class = "materialInheritListField";
maxPopupHeight = "200";
sbUsesNAColor = "0";
reverseTextList = "0";
bitmapBounds = "16 16";
maxLength = "1024";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
isContainer = "0";
Profile = "ToolsGuiPopUpMenuProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = %fieldCtrl.edit.position;
Extent = %fieldCtrl.edit.extent;
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
tooltip = ""; //%tooltip;
text = %fieldDefaultVal;
hovertime = "1000";
ownerObject = %ownerObj;
fieldName = %fieldName;
callbackName = %callbackName;
allowTextSearch = true;
};
//set the field value
if(getSubStr(%this.fieldName, 0, 1) $= "$")
{
if(%fieldName $= "")
%editControl.setText(%fieldName);
}
else if(isObject(%ownerObj))
{
//regular variable
%setCommand = %editControl @ ".setText(" @ %ownerObj @ "." @ %fieldName @ ");";
eval(%setCommand);
}
%listCount = getTokenCount(%fieldDataVals, ",;");
for(%i=0; %i < materialSet.getCount(); %i++)
{
%matObj = materialSet.getObject(%i);
%matName = %matObj.getName();
if(%matName !$= "")
%editControl.add(%matName);
}
%fieldCtrl.setCaption(%fieldLabel);
%fieldCtrl.setEditControl(%editControl);
//echo("GuiInspectorListField - " @ %editControl.getID() @ " - " @ %fieldName);
%this.addInspectorField(%fieldCtrl);
}
function materialInheritListField::onSelect( %this, %id, %text )
{
if(getSubStr(%this.fieldName, 0, 1) $= "$")
{
//ah, a global var, just do it straight, then
%setCommand = %this.fieldName @ " = \"" @ %text @ "\";";
}
else if(isObject(%this.ownerObject))
{
//regular variable
%setCommand = %this.ownerObject @ "." @ %this.fieldName @ " = \"" @ %text @ "\";";
}
else if(%this.callbackName !$= "")
{
%setCommand = %this.callbackName @ "(\"" @ %this.fieldName @ "\",\"" @ %text @"\");";
}
echo("materialInheritListField::onSelect() - command: " @ %setCommand);
eval(%setCommand);
}

View file

@ -16,6 +16,11 @@ function AssetBrowser::editAsset(%this, %assetDef)
}
else
{
if(AssetDatabase.isDeclaredAsset(%assetDef))
{
%assetDef = AssetDatabase.acquireAsset(%assetDef);
}
if(isObject(%assetDef))
{
%assetType = AssetDatabase.getAssetType(%assetDef.getAssetId());

View file

@ -2,6 +2,6 @@
canSave="true"
canSaveDynamicFields="true"
AssetName="CubemapEditor"
scriptFile="@assetFile=cubemapEditor.gui"
scriptFile="@assetFile=cubemapEditor.tscript"
GUIFile="@assetFile=cubemapEditor.gui"
VersionId="1" />

View file

@ -0,0 +1,437 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiControl(CompositeTextureEditor) {
extent = "1920 1080";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
isContainer = "1";
canSaveDynamicFields = "1";
enabled = "1";
new GuiWindowCtrl(CompositeTextureEditorWindow) {
Text = "Composite Texture Editor";
resizeWidth = "0";
resizeHeight = "0";
canMinimize = "0";
canMaximize = "0";
closeCommand = "Canvas.popDialog(CompositeTextureEditor);";
position = "721 416";
extent = "478 248";
minExtent = "478 248";
horizSizing = "center";
vertSizing = "center";
profile = "ToolsGuiWindowProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiContainer(CompTextureEd_RedChan) {
position = "11 39";
extent = "107 174";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
className = "CompositeTextureSlotContainer";
new GuiTextCtrl() {
Text = "Red Channel";
position = "5 -2";
extent = "100 15";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 20";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "InputMode";
className = "CompositeTextureChannelMode";
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueContainer";
new GuiTextEditCtrl() {
position = "0 8";
extent = "28 20";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueTxtEdit";
className = "CompositeTextureRawValueEdit";
};
new GuiSliderCtrl() {
position = "38 9";
extent = "68 19";
profile = "GuiSliderProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueSlider";
className = "CompositeTextureRawValueSlider";
Command = "$thisControl.onDragComplete();";
range = 0 SPC 1;
ticks = 0.01;
};
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "TextureContainer";
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:unknownImage_image";
BitmapFile = "tools/materialEditor/images/unknownImage.png";
position = "21 9";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "Bitmap";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
position = "21 9";
extent = "64 64";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
command = "$CompTexSourceChannel = 0;AssetBrowser.showDialog(\"ImageAsset\", \"CompositeTextureEditor.setSourceTex\");";
tooltipProfile = "ToolsGuiDefaultProfile";
ToolTip = "Set the source of the texture for this channel to sample from when baking a composite.";
};
new GuiTextCtrl() {
Text = "Source Channel";
position = "5 85";
extent = "100 10";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 97";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "sourceChannel";
className = "CompositeTextureTexSrcChannel";
};
};
};
new GuiContainer(CompTextureEd_GreenChan) {
position = "129 39";
extent = "107 174";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
className = "CompositeTextureSlotContainer";
new GuiTextCtrl() {
Text = "Green Channel";
position = "5 -2";
extent = "100 15";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 20";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "InputMode";
className = "CompositeTextureChannelMode";
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueContainer";
new GuiTextEditCtrl() {
position = "0 8";
extent = "28 20";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueTxtEdit";
className = "CompositeTextureRawValueEdit";
};
new GuiSliderCtrl() {
position = "38 9";
extent = "68 19";
profile = "GuiSliderProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueSlider";
className = "CompositeTextureRawValueSlider";
Command = "$thisControl.onDragComplete();";
range = 0 SPC 1;
ticks = 0.01;
};
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "TextureContainer";
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:unknownImage_image";
BitmapFile = "tools/materialEditor/images/unknownImage.png";
position = "21 9";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "Bitmap";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
position = "21 9";
extent = "64 64";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
command = "$CompTexSourceChannel = 1;AssetBrowser.showDialog(\"ImageAsset\", \"CompositeTextureEditor.setSourceTex\");";
tooltipProfile = "ToolsGuiDefaultProfile";
ToolTip = "Set the source of the texture for this channel to sample from when baking a composite.";
};
new GuiTextCtrl() {
Text = "Source Channel";
position = "5 85";
extent = "100 10";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 97";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "sourceChannel";
className = "CompositeTextureTexSrcChannel";
};
};
};
new GuiContainer(CompTextureEd_BlueChan) {
position = "247 39";
extent = "107 174";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
className = "CompositeTextureSlotContainer";
new GuiTextCtrl() {
Text = "Blue Channel";
position = "5 -2";
extent = "100 15";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 20";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "InputMode";
className = "CompositeTextureChannelMode";
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueContainer";
new GuiTextEditCtrl() {
position = "0 8";
extent = "28 20";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueTxtEdit";
className = "CompositeTextureRawValueEdit";
};
new GuiSliderCtrl() {
position = "38 9";
extent = "68 19";
profile = "GuiSliderProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueSlider";
className = "CompositeTextureRawValueSlider";
Command = "$thisControl.onDragComplete();";
range = 0 SPC 1;
ticks = 0.01;
};
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "TextureContainer";
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:unknownImage_image";
BitmapFile = "tools/materialEditor/images/unknownImage.png";
position = "21 9";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "Bitmap";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
position = "21 9";
extent = "64 64";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
command = "$CompTexSourceChannel = 2;AssetBrowser.showDialog(\"ImageAsset\", \"CompositeTextureEditor.setSourceTex\");";
tooltipProfile = "ToolsGuiDefaultProfile";
ToolTip = "Set the source of the texture for this channel to sample from when baking a composite.";
};
new GuiTextCtrl() {
Text = "Source Channel";
position = "5 85";
extent = "100 10";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 97";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "sourceChannel";
className = "CompositeTextureTexSrcChannel";
};
};
};
new GuiContainer(CompTextureEd_AlphaChan) {
position = "361 39";
extent = "107 174";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
className = "CompositeTextureSlotContainer";
new GuiTextCtrl() {
Text = "Alpha Channel";
position = "5 -2";
extent = "100 15";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 20";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "InputMode";
className = "CompositeTextureChannelMode";
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueContainer";
new GuiTextEditCtrl() {
position = "0 8";
extent = "28 20";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueTxtEdit";
className = "CompositeTextureRawValueEdit";
};
new GuiSliderCtrl() {
position = "38 9";
extent = "68 19";
profile = "GuiSliderProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "RawValueSlider";
className = "CompositeTextureRawValueSlider";
Command = "$thisControl.onDragComplete();";
range = 0 SPC 1;
ticks = 0.01;
};
};
new GuiContainer() {
position = "0 41";
extent = "107 125";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "TextureContainer";
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:unknownImage_image";
BitmapFile = "tools/materialEditor/images/unknownImage.png";
position = "21 9";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "Bitmap";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
position = "21 9";
extent = "64 64";
horizSizing = "center";
profile = "ToolsGuiDefaultProfile";
command = "$CompTexSourceChannel = 3;AssetBrowser.showDialog(\"ImageAsset\", \"CompositeTextureEditor.setSourceTex\");";
tooltipProfile = "ToolsGuiDefaultProfile";
ToolTip = "Set the source of the texture for this channel to sample from when baking a composite.";
};
new GuiTextCtrl() {
Text = "Source Channel";
position = "5 85";
extent = "100 10";
horizSizing = "width";
profile = "ToolsGuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrl() {
position = "1 97";
extent = "106 23";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuEditProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "sourceChannel";
className = "CompositeTextureTexSrcChannel";
};
};
};
new GuiButtonCtrl() {
Text = "Save";
position = "339 216";
extent = "74 24";
profile = "ToolsGuiButtonProfile";
command = "CompositeTextureEditor.saveComposite();";
tooltipProfile = "GuiToolTipProfile";
};
new GuiButtonCtrl() {
Text = "Cancel";
position = "417 216";
extent = "52 24";
profile = "ToolsGuiButtonProfile";
command = "Canvas.popDialog(CompositeTextureEditor);";
tooltipProfile = "GuiToolTipProfile";
};
};
};
//--- OBJECT WRITE END ---

View file

@ -0,0 +1,192 @@
function CompositeTextureEditor::buildComposite(%this, %sourceTex0, %sourceTex1, %sourceTex2, %sourceTex3, %sourceChan0, %sourceChan1, %sourceChan2, %sourceChan3, %callback)
{
Canvas.pushDialog(%this);
CompTextureEd_RedChan.setChannelData(%sourceTex0, %sourceChan0);
CompTextureEd_GreenChan.setChannelData(%sourceTex1, %sourceChan1);
CompTextureEd_BlueChan.setChannelData(%sourceTex2, %sourceChan2);
CompTextureEd_AlphaChan.setChannelData(%sourceTex3, %sourceChan3);
%this.callbackFunc = %callback;
}
function CompositeTextureSlotContainer::onWake(%this)
{
%this-->InputMode.clear();
%this-->InputMode.add("Raw Value");
%this-->InputMode.add("Texture");
%this-->InputMode.setSelected(1);
%this-->InputMode.active = false;
%this-->sourceChannel.clear();
%this-->sourceChannel.add("Red");
%this-->sourceChannel.add("Green");
%this-->sourceChannel.add("Blue");
%this-->sourceChannel.add("Alpha");
}
function CompositeTextureSlotContainer::setChannelData(%this, %sourceValue, %sourceChannel)
{
//for now, hard-force Texture mode
%this-->InputMode.setSelected(1);
if(AssetDatabase.isDeclaredAsset(%sourceValue))
{
%this-->InputMode.setSelected(1);
%this-->bitmap.setBitmap(%sourceValue);
if(%sourceChannel $= "")
%sourceChannel = "Red";
%this-->sourceChannel.setText(%sourceChannel);
}
/*else
{
%this-->InputMode.setSelected(0);
%value = 0;
if(%sourceValue !$= "" && (isFloat(%sourceValue) || isFloat(%sourceValue)))
{
%value = %sourceValue;
}
%this-->RawValueTxtEdit.setText(%value);
%this-->RawValueSlider.setValue(%value);
}*/
}
function CompositeTextureSlotContainer::getChannelData(%this)
{
return "";
}
function CompositeTextureChannelMode::onSelect(%this, %id, %text)
{
%isRawValueMode = %text $= "Raw Value";
%this.getParent()-->RawValueContainer.setVisible(%isRawValueMode);
%this.getParent()-->TextureContainer.setVisible(!%isRawValueMode);
}
function CompositeTextureEditor::setSourceTex(%this, %assetId)
{
if($CompTexSourceChannel $= "")
$CompTexSourceChannel = 0;
%channelContainer = CompositeTextureEditorWindow.getObject($CompTexSourceChannel);
%channelContainer-->bitmap.setBitmap(%assetId);
}
function CompositeTextureEditor::saveComposite(%this)
{
%cubemap = CubemapEditor.currentCubemap;
%aoMap = CompTextureEd_RedChan-->Bitmap.getBitmap();
%roughMap = CompTextureEd_GreenChan-->Bitmap.getBitmap();
%metalMap = CompTextureEd_BlueChan-->Bitmap.getBitmap();
if(%aoMap $= "ToolsModule:unknownImage_image")
%aoMap = "";
if(%roughMap $= "ToolsModule:unknownImage_image")
%roughMap = "";
if(%metalMap $= "ToolsModule:unknownImage_image")
%metalMap = "";
if(%aoMap $= "" && %roughMap $= "" && %metalMap $= "")
{
toolsMessageBoxOK("Error", "Saving a composite map requires at least one channel slot to have source data!");
return;
}
AssetBrowser.setupCreateNewAsset("ImageAsset", AssetBrowser.selectedModule, "CompositeEditorDoSaveComposite");
}
function CompositeEditorDoSaveComposite(%assetId)
{
%assetDef = AssetDatabase.acquireAsset(%assetId);
if(!isObject(%assetDef))
{
toolsMessageBoxOK("Error", "We somehow failed to successfully create a new ImageAsset!");
return;
}
%targetFilePath = %assetDef.getImagePath();
%aoMapAsset = CompTextureEd_RedChan-->Bitmap.getBitmap();
%roughMapAsset = CompTextureEd_GreenChan-->Bitmap.getBitmap();
%metalMapAsset = CompTextureEd_BlueChan-->Bitmap.getBitmap();
if(%aoMapAsset $= "ToolsModule:unknownImage_image")
{
%aoMap = "";
}
else
{
%aoAssetDef = AssetDatabase.acquireAsset(%aoMapAsset);
%aoMap = %aoAssetDef.getImagePath();
}
if(%roughMapAsset $= "ToolsModule:unknownImage_image")
{
%roughMap = "";
}
else
{
%roughAssetDef = AssetDatabase.acquireAsset(%roughMapAsset);
%roughMap = %roughAssetDef.getImagePath();
}
if(%metalMapAsset $= "ToolsModule:unknownImage_image")
{
%metalMap = "";
}
else
{
%metalAssetDef = AssetDatabase.acquireAsset(%metalMapAsset);
%metalMap = %roughAssetDef.getImagePath();
}
if(%aoMap $= "" && %roughMap $= "" && %metalMap $= "")
{
toolsMessageBoxOK("Error", "Attempted to create a composite texture but all three source textures are blank or invalid!");
return;
}
%redChanSource = CompTextureEd_RedChan-->sourceChannel;
%greenChanSource = CompTextureEd_GreenChan-->sourceChannel;
%blueChanSource = CompTextureEd_BlueChan-->sourceChannel;
%aoChan = %redChanSource.findText(%redChanSource.getText());
%aoChan = %aoChan == -1 ? 0 : %aoChan;
%roughChan = %greenChanSource.findText(%greenChanSource.getText());
%roughChan = %roughChan == -1 ? 1 : %roughChan;
%metalChan = %blueChanSource.findText(%blueChanSource.getText());
%metalChan = %metalChan == -1 ? 2 : %metalChan;
%channelKey = %aoChan SPC %roughChan SPC %metalChan SPC 3;
error("Storing: \"" @ %aoMap @"\" \""@ %roughMap @"\" \""@ %metalMap @"\" \""@ %channelKey @"\" \""@ %targetFilePath @"\"");
saveCompositeTexture(%aoMap, %roughMap, %metalMap, "", %channelKey, %targetFilePath);
%assetDef.refreshAsset();
%command = CompositeTextureEditor.callbackFunc @ "(\"" @ %assetId @ "\");";
if(CompositeTextureEditor.callbackFunc !$= "")
{
eval(%command);
CompositeTextureEditor.callbackFunc = "";
}
Canvas.popDialog(CompositeTextureEditor);
}
function CompositeTextureRawValueEdit::onReturn(%this)
{
%this.getParent()-->RawValueSlider.setValue(%this.getText());
}
function CompositeTextureRawValueSlider::onDragComplete(%this)
{
%value = %this.getValue();
%this.getParent()-->RawValueTxtEdit.setText(%value);
}

View file

@ -39,7 +39,7 @@ $guiContent = new GuiControl(CubemapEditor) {
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
closeCommand = "MaterialEditorGui.hideCubemapEditor(true);";
closeCommand = "CubemapEditor.hideCubemapEditor(true);";
text = "Cubemap Editor";
new GuiTextCtrl(){
@ -69,23 +69,23 @@ $guiContent = new GuiControl(CubemapEditor) {
AnchorRight = "0";
text = "myCubemap 1";
maxLength = "1024";
AltCommand = "MaterialEditorGui.editCubemapName($ThisControl.getText());";
AltCommand = "CubemapEditor.editCubemapName($ThisControl.getText());";
};
new GuiButtonCtrl(){
Profile = "ToolsGuiButtonProfile";
position = "339 216";
Extent = "74 24";
text = "Select";
command = "MaterialEditorGui.selectCubemap();"; // needs hookup use selected cubemap
command = "CubemapEditor.selectCubemap();"; // needs hookup use selected cubemap
};
new GuiButtonCtrl(){
Profile = "ToolsGuiButtonProfile";
position = "417 216";
Extent = "52 24";
text = "Cancel";
command = "MaterialEditorGui.hideCubemapEditor(true);"; // needs hookup Cancel
command = "CubemapEditor.hideCubemapEditor(true);"; // needs hookup Cancel
};
new GuiScrollCtrl(matEd_cubemapEd_availableCubemapScroller) {
new GuiScrollCtrl(cubemapEd_availableCubemapScroller) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
@ -106,7 +106,7 @@ $guiContent = new GuiControl(CubemapEditor) {
constantThumbHeight = "0";
childMargin = "0 0";
new GuiListBoxCtrl(matEd_cubemapEd_availableCubemapList) {
new GuiListBoxCtrl(cubemapEd_availableCubemapList) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -130,7 +130,7 @@ $guiContent = new GuiControl(CubemapEditor) {
text = "Cubemaps";
};
// ------------------------------ Right X Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_XPos) {
new GuiBitmapCtrl(cubemapEd_XPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -146,12 +146,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_xPosTxt) {
new GuiTextCtrl(cubeMapEd_xPosTxt) {
position = "304 110";
Extent = "57 10";
text = "+ X Right";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXPOSImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateXPOSImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -163,7 +163,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"0\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"0\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -173,7 +173,7 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
};
// ------------------------------ X Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_XNeg) {
new GuiBitmapCtrl(cubemapEd_XNeg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -189,12 +189,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_xNegTxt) {
new GuiTextCtrl(cubeMapEd_xNegTxt) {
position = "171 110";
Extent = "57 10";
text = "- X Left";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateXNEGImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateXNEGImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -206,7 +206,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"1\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"1\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -216,7 +216,7 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
};
// ------------------------------ Y Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_YPos) {
new GuiBitmapCtrl(cubemapEd_YPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -232,12 +232,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_yPosTxt) {
new GuiTextCtrl(cubeMapEd_yPosTxt) {
position = "237 175";
Extent = "57 10";
text = "+ Y Front";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYPOSImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateYPOSImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -249,7 +249,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"3\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"3\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -259,7 +259,7 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
};
// ------------------------------ Y Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_YNeG) {
new GuiBitmapCtrl(cubemapEd_YNeG) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -275,12 +275,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_yNegTxt) {
new GuiTextCtrl(cubeMapEd_yNegTxt) {
position = "237 44";
Extent = "57 10";
text = "- Y Back";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateYNegImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateYNegImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -292,7 +292,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"2\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"2\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -302,7 +302,7 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
};
// ------------------------------ Z Positive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_ZPos) {
new GuiBitmapCtrl(cubemapEd_ZPos) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -318,12 +318,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_zPosTxt) {
new GuiTextCtrl(cubeMapEd_zPosTxt) {
position = "237 110";
Extent = "57 10";
text = "+ Z Top";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZPosImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateZPosImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -335,7 +335,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"4\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"4\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -345,7 +345,7 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:cubemapBtnBorder_n_image";
};
// ------------------------------ Z Negitive ------------------------------------
new GuiBitmapCtrl(matEd_cubemapEd_ZNeg) {
new GuiBitmapCtrl(cubemapEd_ZNeg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -361,12 +361,12 @@ $guiContent = new GuiControl(CubemapEditor) {
bitmapAsset = "ToolsModule:unknownImage_image";
wrap = "0";
};
new GuiTextCtrl(matEd_cubeMapEd_zNegTxt) {
new GuiTextCtrl(cubeMapEd_zNegTxt) {
position = "369 110";
Extent = "57 10";
text = "- Z Bottom";
};
new GuiBitmapButtonCtrl(matEd_cubeMapEd_updateZNegImg) {
new GuiBitmapButtonCtrl(cubeMapEd_updateZNegImg) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
@ -378,7 +378,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.editCubemapImage(\"5\", $ThisControl.bitmap );";
Command = "CubemapEditor.editCubemapImage(\"5\", $ThisControl.bitmap );";
tooltipprofile = "ToolsGuiDefaultProfile";
ToolTip = "When using Static Cubemaps, select your CubeMap by clicking here.";
hovertime = "1000";
@ -401,7 +401,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "matEd_addCubemapWindow.setVisible(1);"; // -------------- Needs Hookup Create New Cubemap
Command = "addCubemapWindow.setVisible(1);"; // -------------- Needs Hookup Create New Cubemap
hovertime = "1000";
tooltip = "Create New Cubemap";
bitmapAsset = "ToolsModule:new_n_image";
@ -421,7 +421,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.showDeleteCubemapDialog();"; // -------------- Needs Hookup Delete Cubemap
Command = "CubemapEditor.showDeleteCubemapDialog();"; // -------------- Needs Hookup Delete Cubemap
hovertime = "1000";
tooltip = "Delete Cubemap";
bitmapAsset = "ToolsModule:delete_n_image";
@ -442,7 +442,7 @@ $guiContent = new GuiControl(CubemapEditor) {
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.showSaveCubemapDialog();"; // -------------- Needs Hookup Save Cubemap
Command = "CubemapEditor.showSaveCubemapDialog();"; // -------------- Needs Hookup Save Cubemap
hovertime = "1000";
tooltip = "Save Cubemap";
bitmapAsset = "ToolsModule:save_icon_n_image";
@ -451,4 +451,123 @@ $guiContent = new GuiControl(CubemapEditor) {
useMouseEvents = "0";
};
};
new GuiWindowCtrl(addCubemapWindow) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "center";
VertSizing = "center";
position = "362 333";
Extent = "300 99";
MinExtent = "48 92";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Create Cubemap";
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "cubemapName";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 35";
Extent = "196 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
AltCommand = "";
passwordMask = "*";
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "12 36";
Extent = "77 16";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
text = "Cubemap Name";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 68";
Extent = "126 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Create";
Command = "CubemapEditor.addCubemap( addCubemapWindow-->cubemapName.getText() );addCubemapWindow.setVisible(0);";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "228 68";
Extent = "64 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Cancel";
Command = "addCubemapWindow.setVisible(0);";
};
};
};

View file

@ -0,0 +1,367 @@
function CubemapEditor::onWake(%this)
{
cubemapEd_availableCubemapList.clear();
}
function CubemapEditor::cancelCubemap(%this)
{
%cubemap = CubemapEditor.currentCubemap;
%idx = cubemapEd_availableCubemapList.findItemText( %cubemap.getName() );
cubemapEd_availableCubemapList.setItemText( %idx, notDirtyCubemap.originalName );
%cubemap.setName( notDirtyCubemap.originalName );
CubemapEditor.copyCubemaps( notDirtyCubemap, %cubemap );
CubemapEditor.copyCubemaps( notDirtyCubemap, matEdCubeMapPreviewMat);
%cubemap.updateFaces();
matEdCubeMapPreviewMat.updateFaces();
}
function CubemapEditor::showCubemapEditor(%this)
{
if (cubemapEditor.isVisible())
return;
CubemapEditor.currentCubemap = "";
cubemapEditor.setVisible(1);
new PersistenceManager(cubemapEdPerMan);
CubemapEditor.setCubemapNotDirty();
for( %i = 0; %i < RootGroup.getCount(); %i++ )
{
if( RootGroup.getObject(%i).getClassName()!$= "CubemapData" )
continue;
for( %k = 0; %k < UnlistedCubemaps.count(); %k++ )
{
%unlistedFound = 0;
if( UnlistedCubemaps.getValue(%k) $= RootGroup.getObject(%i).name )
{
%unlistedFound = 1;
break;
}
}
if( %unlistedFound )
continue;
cubemapEd_availableCubemapList.addItem( RootGroup.getObject(%i).name );
}
singleton CubemapData(notDirtyCubemap);
// if there was no cubemap, pick the first, select, and bail, these are going to take
// care of themselves in the selected function
if( !isObject( CubemapEditor.currentMaterial.cubemap ) )
{
if( cubemapEd_availableCubemapList.getItemCount() > 0 )
{
cubemapEd_availableCubemapList.setSelected(0, true);
return;
}
else
{
// if there are no cubemaps, then create one, select, and bail
%cubemap = CubemapEditor.createNewCubemap();
cubemapEd_availableCubemapList.addItem( %cubemap.name );
cubemapEd_availableCubemapList.setSelected(0, true);
return;
}
}
// do not directly change activeMat!
CubemapEditor.currentCubemap = CubemapEditor.currentMaterial.cubemap.getId();
%cubemap = CubemapEditor.currentCubemap;
notDirtyCubemap.originalName = %cubemap.getName();
CubemapEditor.copyCubemaps( %cubemap, notDirtyCubemap);
CubemapEditor.copyCubemaps( %cubemap, matEdCubeMapPreviewMat);
CubemapEditor.syncCubemap( %cubemap );
}
function CubemapEditor::hideCubemapEditor(%this,%cancel)
{
if(%cancel)
CubemapEditor.cancelCubemap();
cubemapEd_availableCubemapList.clearItems();
cubemapEdPerMan.delete();
cubemapEditor.setVisible(0);
}
// create category and update current material if there is one
function CubemapEditor::addCubemap( %this,%cubemapName )
{
if( %cubemapName $= "" )
{
toolsMessageBoxOK( "Error", "Can not create a cubemap without a valid name.");
return;
}
for(%i = 0; %i < RootGroup.getCount(); %i++)
{
if( %cubemapName $= RootGroup.getObject(%i).getName() )
{
toolsMessageBoxOK( "Error", "There is already an object with the same name.");
return;
}
}
// Create and select a new cubemap
%cubemap = CubemapEditor.createNewCubemap( %cubemapName );
%idx = cubemapEd_availableCubemapList.addItem( %cubemap.name );
cubemapEd_availableCubemapList.setSelected( %idx, true );
// material category text field to blank
addCubemapWindow-->cubemapName.setText("");
}
function CubemapEditor::createNewCubemap( %this, %cubemap )
{
if( %cubemap $= "" )
{
for(%i = 0; ; %i++)
{
%cubemap = "newCubemap_" @ %i;
if( !isObject(%cubemap) )
break;
}
}
new CubemapData(%cubemap)
{
cubeMapFaceAsset[0] = "ToolsModule:cube_xNeg_image";
cubeMapFaceAsset[1] = "ToolsModule:cube_xPos_image";
cubeMapFaceAsset[2] = "ToolsModule:cube_zNeg_image";
cubeMapFaceAsset[3] = "ToolsModule:cube_zPos_image";
cubeMapFaceAsset[4] = "ToolsModule:cube_yNeg_image";
cubeMapFaceAsset[5] = "ToolsModule:cube_yPos_image";
parentGroup = RootGroup;
};
cubemapEdPerMan.setDirty( %cubemap, "art/materials." @ $TorqueScriptFileExtension );
cubemapEdPerMan.saveDirty();
return %cubemap;
}
function CubemapEditor::setCubemapDirty(%this)
{
%propertyText = "Create Cubemap *";
cubemapEditor.text = %propertyText;
cubemapEditor.dirty = true;
cubemapEditor-->saveCubemap.setActive(true);
%cubemap = CubemapEditor.currentCubemap;
// materials created in the materail selector are given that as its filename, so we run another check
if( CubemapEditor.isMatEditorMaterial( %cubemap ) )
cubemapEdPerMan.setDirty(%cubemap, "art/materials." @ $TorqueScriptFileExtension);
else
cubemapEdPerMan.setDirty(%cubemap);
}
function CubemapEditor::setCubemapNotDirty(%this)
{
%propertyText= strreplace("Create Cubemap" , "*" , "");
cubemapEditor.text = %propertyText;
cubemapEditor.dirty = false;
cubemapEditor-->saveCubemap.setActive(false);
%cubemap = CubemapEditor.currentCubemap;
cubemapEdPerMan.removeDirty(%cubemap);
}
function CubemapEditor::showDeleteCubemapDialog(%this)
{
%idx = cubemapEd_availableCubemapList.getSelectedItem();
%cubemap = cubemapEd_availableCubemapList.getItemText( %idx );
%cubemap = %cubemap.getId();
if( %cubemap == -1 || !isObject(%cubemap) )
return;
if( isObject( %cubemap ) )
{
toolsMessageBoxYesNoCancel("Delete Cubemap?",
"Are you sure you want to delete<br><br>" @ %cubemap.getName() @ "<br><br> Cubemap deletion won't take affect until the engine is quit.",
"CubemapEditor.deleteCubemap( " @ %cubemap @ ", " @ %idx @ " );",
"",
"" );
}
}
function CubemapEditor::deleteCubemap( %this, %cubemap, %idx )
{
cubemapEd_availableCubemapList.deleteItem( %idx );
UnlistedCubemaps.add( "unlistedCubemaps", %cubemap.getName() );
if( !CubemapEditor.isMatEditorMaterial( %cubemap ) )
{
cubemapEdPerMan.removeDirty( %cubemap );
cubemapEdPerMan.removeObjectFromFile( %cubemap );
}
if( cubemapEd_availableCubemapList.getItemCount() > 0 )
{
cubemapEd_availableCubemapList.setSelected(0, true);
}
else
{
// if there are no cubemaps, then create one, select, and bail
%cubemap = CubemapEditor.createNewCubemap();
cubemapEd_availableCubemapList.addItem( %cubemap.getName() );
cubemapEd_availableCubemapList.setSelected(0, true);
}
}
function cubemapEd_availableCubemapList::onSelect( %this, %id, %cubemap )
{
%cubemap = %cubemap.getId();
if( CubemapEditor.currentCubemap $= %cubemap )
return;
if( cubemapEditor.dirty )
{
%savedCubemap = CubemapEditor.currentCubemap;
toolsMessageBoxYesNoCancel("Save Existing Cubemap?",
"Do you want to save changes to <br><br>" @ %savedCubemap.getName(),
"CubemapEditor.saveCubemap(" @ true @ ");",
"CubemapEditor.saveCubemapDialogDontSave(" @ %cubemap @ ");",
"CubemapEditor.saveCubemapDialogCancel();" );
}
else
CubemapEditor.changeCubemap( %cubemap );
}
function CubemapEditor::showSaveCubemapDialog( %this )
{
%cubemap = CubemapEditor.currentCubemap;
if( !isObject(%cubemap) )
return;
toolsMessageBoxYesNoCancel("Save Cubemap?",
"Do you want to save changes to <br><br>" @ %cubemap.getName(),
"CubemapEditor.saveCubemap( " @ %cubemap @ " );",
"",
"" );
}
function CubemapEditor::saveCubemap( %this, %cubemap )
{
notDirtyCubemap.originalName = %cubemap.getName();
CubemapEditor.copyCubemaps( %cubemap, notDirtyCubemap );
CubemapEditor.copyCubemaps( %cubemap, matEdCubeMapPreviewMat);
cubemapEdPerMan.saveDirty();
CubemapEditor.setCubemapNotDirty();
}
function CubemapEditor::saveCubemapDialogDontSave( %this, %newCubemap)
{
//deal with old cubemap first
%oldCubemap = CubemapEditor.currentCubemap;
%idx = cubemapEd_availableCubemapList.findItemText( %oldCubemap.getName() );
cubemapEd_availableCubemapList.setItemText( %idx, notDirtyCubemap.originalName );
%oldCubemap.setName( notDirtyCubemap.originalName );
CubemapEditor.copyCubemaps( notDirtyCubemap, %oldCubemap);
CubemapEditor.copyCubemaps( notDirtyCubemap, matEdCubeMapPreviewMat);
CubemapEditor.syncCubemap( %oldCubemap );
CubemapEditor.changeCubemap( %newCubemap );
}
function CubemapEditor::saveCubemapDialogCancel( %this )
{
%cubemap = CubemapEditor.currentCubemap;
%idx = cubemapEd_availableCubemapList.findItemText( %cubemap.getName() );
cubemapEd_availableCubemapList.clearSelection();
cubemapEd_availableCubemapList.setSelected( %idx, true );
}
function CubemapEditor::changeCubemap( %this, %cubemap )
{
CubemapEditor.setCubemapNotDirty();
CubemapEditor.currentCubemap = %cubemap;
notDirtyCubemap.originalName = %cubemap.getName();
CubemapEditor.copyCubemaps( %cubemap, notDirtyCubemap);
CubemapEditor.copyCubemaps( %cubemap, matEdCubeMapPreviewMat);
CubemapEditor.syncCubemap( %cubemap );
}
function CubemapEditor::editCubemapImage( %this, %face )
{
CubemapEditor.setCubemapDirty();
%cubemap = CubemapEditor.currentCubemap;
%bitmap = CubemapEditor.openFile("texture");
if( %bitmap !$= "" && %bitmap !$= "tools/materialEditor/gui/cubemapBtnBorder" )
{
%cubemap.cubeFace[%face] = %bitmap;
CubemapEditor.copyCubemaps( %cubemap, matEdCubeMapPreviewMat);
CubemapEditor.syncCubemap( %cubemap );
}
}
function CubemapEditor::editCubemapName( %this, %newName )
{
CubemapEditor.setCubemapDirty();
%cubemap = CubemapEditor.currentCubemap;
%idx = cubemapEd_availableCubemapList.findItemText( %cubemap.getName() );
cubemapEd_availableCubemapList.setItemText( %idx, %newName );
%cubemap.setName(%newName);
CubemapEditor.syncCubemap( %cubemap );
}
function CubemapEditor::syncCubemap( %this, %cubemap )
{
%xpos = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[0]);
if( %xpos !$= "" )
cubemapEd_XPos.setBitmap( %xpos );
%xneg = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[1]);
if( %xneg !$= "" )
cubemapEd_XNeg.setBitmap( %xneg );
%yneg = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[2]);
if( %yneg !$= "" )
cubemapEd_YNeG.setBitmap( %yneg );
%ypos = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[3]);
if( %ypos !$= "" )
cubemapEd_YPos.setBitmap( %ypos );
%zpos = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[4]);
if( %zpos !$= "" )
cubemapEd_ZPos.setBitmap( %zpos );
%zneg = CubemapEditor.searchForTexture(%cubemap.getName(), %cubemap.cubeFace[5]);
if( %zneg !$= "" )
cubemapEd_ZNeg.setBitmap( %zneg );
cubemapEd_activeCubemapNameTxt.setText(%cubemap.getName());
%cubemap.updateFaces();
matEdCubeMapPreviewMat.updateFaces();
}
function CubemapEditor::copyCubemaps( %this, %copyFrom, %copyTo)
{
%copyTo.cubeFace[0] = %copyFrom.cubeFace[0];
%copyTo.cubeFace[1] = %copyFrom.cubeFace[1];
%copyTo.cubeFace[2] = %copyFrom.cubeFace[2];
%copyTo.cubeFace[3] = %copyFrom.cubeFace[3];
%copyTo.cubeFace[4] = %copyFrom.cubeFace[4];
%copyTo.cubeFace[5] = %copyFrom.cubeFace[5];
}

View file

@ -1,7 +0,0 @@
<GUIAsset
canSave="true"
canSaveDynamicFields="true"
AssetName="MaterialEditorGui,EditorGuiGroup"
scriptFile="@assetFile=guiMaterialPropertiesWindow.ed.gui"
GUIFile="@assetFile=guiMaterialPropertiesWindow.ed.gui"
VersionId="1" />

View file

@ -0,0 +1,5 @@
<GUIAsset
AssetName="NuMaterialEditor"
ScriptFile="@assetFile=NuMaterialEditor.tscript"
GUIFile="@assetFile=NuMaterialEditor.gui"
VersionId="1"/>

View file

@ -0,0 +1,490 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiControl(MaterialEditorGui) {
extent = "2560 1440";
profile = "GuiNonModalDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
isContainer = "1";
canSaveDynamicFields = "1";
currentLayer = "0";
currentMaterialAsset = "Prototyping:FloorGray";
currentMeshMode = "EditorShape";
currentMode = "Material";
docked = "1";
fileSpec = "Torque Material Files (materials.tscript)|materials.tscript|All Files (*.*)|*.*|";
livePreview = "1";
materialDirty = "0";
modelFormats = "DTS Files (*.dts)|*.dts";
originalAssetName = "MaterialEditorGui";
originalName = "FloorGray";
panelHidden = "0";
preventUndo = "1";
resizing = "0";
textureFormats = "Image Files (*.png, *.jpg, *.dds, *.bmp, *.gif, *.jng. *.tga)|*.png;*.jpg;*.dds;*.bmp;*.gif;*.jng;*.tga|All Files (*.*)|*.*|";
new GuiWindowCollapseCtrl(MaterialEditorGuiWindow) {
Text = " :: Material Editor";
canMove = "0";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
canCollapse = "0";
margin = "5 5 5 5";
position = "2168 39";
extent = "392 1303";
minExtent = "300 150";
horizSizing = "windowRelative";
vertSizing = "windowRelative";
profile = "ToolsGuiWindowProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "InspectorWindow";
new GuiBitmapButtonCtrl(MaterialEditorGui_showBtn) {
BitmapAsset = "ToolsModule:panel_show_n_image";
position = "4 1";
extent = "18 18";
minExtent = "8 8";
profile = "ToolsGuiButtonProfile";
visible = "0";
command = "MaterialEditorGui.showSidePanel();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Show Sidepanel";
hidden = "1";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_UnDockBtn) {
BitmapAsset = "ToolsModule:panel_undock_n_image";
position = "369 0";
extent = "18 18";
minExtent = "8 8";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
command = "MaterialEditorGui.releaseSidePanel();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Detach Sidepanel";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_hideBtn) {
BitmapAsset = "ToolsModule:panel_hide_n_image";
position = "351 0";
extent = "18 18";
minExtent = "8 8";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
command = "MaterialEditorGui.hideSidePanel();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Hide Sidepanel";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_DockBtn) {
BitmapAsset = "ToolsModule:panel_dock_n_image";
position = "369 0";
extent = "18 18";
minExtent = "8 8";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
visible = "0";
command = "MaterialEditorGui.dockSidePanel();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Dock Sidepanel";
hidden = "1";
};
new GuiSplitContainer() {
orientation = "Horizontal";
splitPoint = "182 354";
fixedSize = "692";
position = "3 24";
extent = "387 1269";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiPanel() {
docking = "Client";
extent = "387 352";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "Panel1";
new GuiContainer(matEd_previewPanel) {
docking = "Client";
margin = "24 1 3 3";
position = "3 24";
extent = "381 327";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiSwatchButtonCtrl(matEd_previewBackground) {
color = "0 0 0 0.2";
position = "-1 -1";
extent = "383 329";
horizSizing = "width";
vertSizing = "height";
tooltipProfile = "GuiToolTipProfile";
};
new GuiContainer() {
position = "-1 -1";
extent = "383 329";
horizSizing = "width";
vertSizing = "height";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiMaterialPreview(matEd_previewObjectView) {
position = "1 1";
extent = "380 326";
horizSizing = "width";
vertSizing = "height";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
isContainer = "0";
};
};
new GuiPopUpMenuCtrl(matEd_quickPreview_Popup) {
Text = "Cube";
position = "4 0";
extent = "67 18";
profile = "ToolsGuiPopUpMenuProfile";
command = "MaterialEditorGui.updatePreviewObject();";
tooltipProfile = "GuiToolTipProfile";
ToolTip = "Changes the Preview Mesh";
isContainer = "0";
};
new GuiSwatchButtonCtrl(matEd_lightColorPicker) {
position = "79 4";
extent = "14 14";
command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateLightColor\");";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Change Normal Light Color";
};
new GuiSwatchButtonCtrl(matEd_ambientLightColorPicker) {
position = "97 4";
extent = "14 14";
command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateAmbientColor\");";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Change Ambient Light Color";
};
new GuiSwatchButtonCtrl(MaterialPreviewBackgroundPicker) {
color = "0 0 0 0.2";
position = "113 0";
extent = "20 20";
command = "getColorF($thisControl.color, \"MaterialEditorGui.updatePreviewBackground\");";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Change Background Color (preview)";
};
new GuiCheckBoxCtrl() {
Text = "Preview in World";
position = "266 1";
extent = "114 18";
horizSizing = "left";
profile = "ToolsGuiCheckBoxProfile";
variable = "MaterialEditorGui.livePreview";
command = "MaterialEditorGui.updateLivePreview($ThisControl.getValue());";
tooltipProfile = "GuiToolTipProfile";
};
};
new GuiPanel() {
docking = "Client";
position = "0 356";
extent = "387 913";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
internalName = "panel2";
new GuiContainer() {
extent = "388 22";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiBitmapButtonCtrl(MatEd_phoBreadcrumb) {
BitmapAsset = "ToolsModule:folderUp_image";
position = "-1 0";
extent = "20 19";
profile = "GuiDefaultProfile";
visible = "0";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Go back to previous editor";
hidden = "1";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:delete_n_image";
position = "368 1";
extent = "17 17";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
command = "MaterialEditorGui.deleteMaterial();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Delete Material from File";
};
new GuiBitmapButtonCtrl(MatEd_editMaterial) {
BitmapAsset = "ToolsModule:open_file_n_image";
position = "249 1";
extent = "16 16";
horizSizing = "left";
profile = "GuiDefaultProfile";
command = "AssetBrowser.showDialog(\"MaterialAsset\", \"MaterialEditorGui.selectMaterialAsset\");";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Open Existing Material";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:new_n_image";
position = "269 1";
extent = "16 16";
horizSizing = "left";
profile = "ToolsGuiDefaultProfile";
command = "MaterialEditorGui.createNewMaterial();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Create New Material";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:save_icon_n_image";
position = "289 1";
extent = "16 16";
horizSizing = "left";
profile = "ToolsGuiDefaultProfile";
command = "MaterialEditorGui.save();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Save Material (ALT S)";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:visible_n_image";
position = "309 1";
extent = "16 16";
horizSizing = "left";
profile = "ToolsGuiDefaultProfile";
command = "MaterialEditorGui.lookupMaterialInstances();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Lookup Material Instances";
};
new GuiBitmapCtrl() {
BitmapAsset = "ToolsModule:separator_h_image";
BitmapFile = "tools/gui/images/separator-h.png";
position = "330 1";
extent = "2 16";
minExtent = "2 16";
horizSizing = "left";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:reset_icon_n_image";
position = "334 1";
extent = "17 17";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
command = "MaterialEditorGui.refreshMaterial();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Revert Material to Saved";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:clear_icon_n_image";
position = "351 1";
extent = "17 17";
horizSizing = "left";
profile = "ToolsGuiButtonProfile";
command = "MaterialEditorGui.clearMaterial();";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Clear All Material Properties";
};
};
new GuiContainer() {
position = "0 27";
extent = "388 88";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiContainer(MatEdMaterialMode) {
extent = "392 39";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiTextCtrl() {
Text = "Material";
position = "10 1";
extent = "50 16";
profile = "ToolsGuiTextRightProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiTextEditCtrl() {
position = "80 0";
extent = "305 20";
horizSizing = "width";
profile = "ToolsGuiTextEditProfile";
altCommand = "MaterialEditorGui.setMaterialDirty();MaterialEditorGui.updateActiveMaterialName($ThisControl.getText());";
tooltipProfile = "GuiToolTipProfile";
internalName = "selMaterialName";
};
new GuiTextCtrl() {
position = "70 20";
extent = "317 16";
horizSizing = "width";
profile = "GuiTextProfile";
tooltipProfile = "GuiToolTipProfile";
};
};
new GuiContainer(MatEdTargetMode) {
extent = "394 20";
horizSizing = "width";
profile = "GuiDefaultProfile";
visible = "0";
tooltipProfile = "GuiToolTipProfile";
hidden = "1";
new GuiTextCtrl() {
Text = "Material Slot";
position = "4 1";
extent = "74 16";
profile = "ToolsGuiTextRightProfile";
tooltipProfile = "GuiToolTipProfile";
ToolTip = "List of Material Slots available for selected object (If applicable)";
};
new GuiPopUpMenuCtrlEx(SubMaterialSelector) {
Text = "MaterialAsset";
position = "96 0";
extent = "292 17";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuProfile";
active = "0";
command = "SubMaterialSelector.onSelect();";
tooltipProfile = "GuiToolTipProfile";
ToolTip = "Target Material Slot";
};
};
new GuiContainer() {
position = "0 24";
extent = "394 62";
horizSizing = "width";
profile = "GuiDefaultProfile";
tooltipProfile = "GuiToolTipProfile";
new GuiTextCtrl() {
Text = "MapTo";
position = "6 2";
extent = "58 16";
profile = "ToolsGuiTextRightProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Name of material slot lookup to associate this material to for shapes.";
};
new GuiTextEditCtrl() {
position = "80 -2";
extent = "307 20";
horizSizing = "width";
profile = "ToolsGuiTextEditProfile";
altCommand = "MaterialEditorGui.setMaterialDirty();MaterialEditorGui.updateActiveMaterialMapTo($ThisControl.getText());";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Name of material slot lookup to associate this material to for shapes.";
internalName = "selMaterialMapTo";
};
new GuiTextCtrl() {
Text = "Inherit From";
position = "6 25";
extent = "69 16";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Other material that this one should inherit fields from as its parent.";
profile = "ToolsGuiTextRightProfile";
};
new GuiTextEditCtrl() {
position = "80 21";
extent = "285 20";
horizSizing = "width";
profile = "ToolsGuiTextEditProfile";
altCommand = "MaterialEditorGui.setMaterialDirty();MaterialEditorGui.updateActiveMaterialInheritFrom($ThisControl.getText());";
tooltipProfile = "GuiToolTipProfile";
internalName = "selMaterialInheritFrom";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Other material that this one should inherit fields from as its parent.";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:material_image";
position = "368 24";
extent = "16 16";
horizSizing = "left";
profile = "GuiDefaultProfile";
command = "AssetBrowser.showDialog(\"MaterialAsset\", \"MaterialEditorGui.updateActiveMaterialInheritFrom\");";
tooltipProfile = "ToolsGuiToolTipProfile";
ToolTip = "Select Material to set as this material to inherit from.";
};
new GuiTextCtrl() {
Text = "Layer";
position = "4 46";
extent = "56 16";
profile = "ToolsGuiTextRightProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiPopUpMenuCtrlEx(MaterialEditorLayerSelector) {
Text = "Layer 0";
position = "80 45";
extent = "305 17";
horizSizing = "width";
profile = "ToolsGuiPopUpMenuProfile";
command = "MaterialEditorGui.changeLayer( $ThisControl.getText() );";
tooltipProfile = "GuiToolTipProfile";
ToolTip = "Material Layer";
};
};
};
new GuiContainer() {
docking = "None";
margin = "0 43 0 5";
anchorTop = "0";
anchorLeft = "0";
position = "0 120";
extent = "382 793";
minExtent = "64 64";
horizSizing = "width";
profile = "ToolsGuiDefaultProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
isContainer = "0";
new GuiTextEditCtrl(MaterialEditorGuiFilter) {
placeholderText = "Filter...";
validate = "MaterialEditorPropInspector.setSearchText($ThisControl.getText());";
position = "5 0";
extent = "383 20";
horizSizing = "width";
profile = "ToolsGuiTextEditProfile";
tooltipProfile = "GuiToolTipProfile";
};
new GuiBitmapButtonCtrl() {
BitmapAsset = "ToolsModule:clear_icon_n_image";
position = "371 1";
extent = "17 17";
horizSizing = "left";
profile = "ToolsGuiDefaultProfile";
command = "MaterialEditorGuiFilter.setText(\"\");MaterialEditorPropInspector.setSearchText(\"\");";
tooltipProfile = "ToolsGuiToolTipProfile";
};
new GuiScrollCtrl() {
hScrollBar = "alwaysOff";
lockHorizScroll = "1";
docking = "None";
anchorTop = "0";
anchorLeft = "0";
position = "5 22";
extent = "382 766";
minExtent = "8 8";
horizSizing = "width";
vertSizing = "height";
profile = "GuiEditorScrollProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
new GuiInspector(MaterialEditorPropInspector) {
groupFilters = "-Internal -Ungrouped -Editing -Object -Persistence -Dynamic Fields";
forcedArrayIndex = "0";
position = "1 1";
extent = "367 48";
minExtent = "8 8";
horizSizing = "width";
profile = "GuiInspectorProfile";
tooltipProfile = "ToolsGuiToolTipProfile";
superClass = "EditorInspectorBase";
collapseState = "1 1 0 0 0 0 0 0";
};
};
};
};
};
};
};
//--- OBJECT WRITE END ---

View file

@ -1,456 +0,0 @@
//--- OBJECT WRITE BEGIN ---
$guiContent = new GuiControl() {
canSaveDynamicFields = "0";
internalName = "MatEdPreviewWindowContainer";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
Position = "0 0";
Extent = "800 600";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
new GuiWindowCollapseCtrl(MaterialEditorPreviewWindow) {
canSaveDynamicFields = "0";
internalName = "MatEdPreviewWindow";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "windowRelative";
VertSizing = "windowRelative";
Position = getWord($pref::Video::mode, 0) - 360
SPC getWord(EditorGuiToolbar.extent, 1) + 6;
Extent = "360 300";
MinExtent = "300 150";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "4 4 4 4";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
closeCommand = "MaterialEditorPreviewWindow.setVisible(false);";
minSize = "50 50";
EdgeSnap = "1";
text = ":: Material Editor - Preview";
/*new GuiContainer(MaterialEditorPreviewPane) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1"; //1
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "4 23";
Extent = "200 221";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Docking = "Client";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";*/
new GuiContainer(matEd_previewPanel) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "1";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "4 45";
Extent = "300 300";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Docking = "Client";
Margin = "24 1 3 3 ";
new GuiSwatchButtonCtrl(matEd_previewBackground) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "width";
VertSizing = "height";
position = "-1 -1";
Extent = "302 302";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
color = "0 0 0 .8";
//bitmap = "tools/materialEditor/gui/gridTiny2.PNG";
//wrap = "1";
};
new GuiContainer(){ // this is blocking the mouse imput to the swatch imput behind it
HorizSizing = "width";
VertSizing = "height";
Position = "-1 -1";
Extent = "302 302";
};
new GuiMaterialPreview(matEd_previewObjectView) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiDefaultProfile";
HorizSizing = "width";
VertSizing = "height";
position = "1 1";
Extent = "299 299";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
cameraZRot = "0";
forceFOV = "0";
};
//};
};
new GuiPopUpMenuCtrl(matEd_quickPreview_Popup) {
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiPopUpMenuProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "4 24";
Extent = "67 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.updatePreviewObject();";
ToolTip = "Changes the Preview Mesh";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
text = "Sphere";
maxLength = "1024";
maxPopupHeight = "200";
sbUsesNAColor = "0";
reverseTextList = "0";
bitmapBounds = "16 16";
};
new GuiSwatchButtonCtrl(MaterialPreviewBackgroundPicker) { // Background Color
canSaveDynamicFields = "0";
Enabled = "1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "left";
VertSizing = "top";
position = "330 270";
Extent = "20 20";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($thisControl.color, \"MaterialEditorGui.updatePreviewBackground\");";
color = "0 0 0 .7";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
ToolTip ="Change Background Color (preview)";
tooltipprofile = "ToolsGuiToolTipProfile";
};
// Ambient light color picker
new GuiSwatchButtonCtrl(matEd_ambientLightColorPicker) {
canSaveDynamicFields = "0";
Enabled = "1";
color = "1 1 1 1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "81 28";
Extent = "14 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateAmbientColor\");";
hovertime = "1000";
groupNum = "-1";
ToolTip ="Change Ambient Light Color";
tooltipprofile = "ToolsGuiToolTipProfile";
buttonType = "PushButton";
useMouseEvents = "0";
};
// Light color picker
new GuiSwatchButtonCtrl(matEd_lightColorPicker) {
canSaveDynamicFields = "0";
Enabled = "1";
color = "1 1 1 1";
isContainer = "0";
Profile = "GuiInspectorSwatchButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "75 23";
Extent = "14 14";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
Command = "getColorF($ThisControl.color, \"MaterialEditorGui.updateLightColor\");";
hovertime = "1000";
groupNum = "-1";
ToolTip ="Change Normal Light Color";
tooltipprofile = "ToolsGuiToolTipProfile";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiCheckboxCtrl(){
position = "245 25";
Extent = "98 18";
HorizSizing = "left";
profile = "ToolsGuiCheckBoxProfile";
Variable = "MaterialEditorGui.livePreview";
Command = "MaterialEditorGui.updateLivePreview($ThisControl.getValue());";
text = "Preview in World";
};
// window / panel buttons
new GuiBitmapButtonCtrl(MaterialEditorGui_UnDockBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "330 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "0";
Command = "MaterialEditorGui.releaseSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Detach Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_undock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_DockBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "330 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "0";
Command = "MaterialEditorGui.dockSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Dock Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_dock_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_HideBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "left";
VertSizing = "bottom";
Position = "312 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.hideSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Hide Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_hide_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
new GuiBitmapButtonCtrl(MaterialEditorGui_ShowBtn) {
canSaveDynamicFields = "0";
internalName = "";
Enabled = "1";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
Position = "4 1";
Extent = "18 18";
MinExtent = "8 8";
canSave = "1";
Visible = "1";
Command = "MaterialEditorGui.showSidePanel();";
tooltipprofile = "ToolsGuiToolTipProfile";
ToolTip = "Show Sidepanel";
hovertime = "1000";
bitmapAsset = "ToolsModule:panel_show_n_image";
text = "";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
};
};
new GuiWindowCtrl(matEd_addCubemapWindow) {
canSaveDynamicFields = "0";
isContainer = "1";
Profile = "ToolsGuiWindowProfile";
HorizSizing = "center";
VertSizing = "center";
position = "362 333";
Extent = "300 99";
MinExtent = "48 92";
canSave = "1";
Visible = "0";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
resizeWidth = "1";
resizeHeight = "1";
canMove = "1";
canClose = "0";
canMinimize = "0";
canMaximize = "0";
minSize = "50 50";
EdgeSnap = "1";
text = "Create Cubemap";
new GuiTextEditCtrl() {
canSaveDynamicFields = "0";
internalName = "cubemapName";
isContainer = "0";
Profile = "ToolsGuiTextEditProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 35";
Extent = "196 18";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
historySize = "0";
password = "0";
tabComplete = "0";
sinkAllKeyEvents = "0";
AltCommand = "";
passwordMask = "*";
};
new GuiTextCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiTextProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "12 36";
Extent = "77 16";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
Margin = "0 0 0 0";
Padding = "0 0 0 0";
AnchorTop = "1";
AnchorBottom = "0";
AnchorLeft = "1";
AnchorRight = "0";
maxLength = "1024";
text = "Cubemap Name";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "96 68";
Extent = "126 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Create";
Command = "MaterialEditorGui.addCubemap( matEd_addCubemapWindow-->cubemapName.getText() );matEd_addCubemapWindow.setVisible(0);";
};
new GuiButtonCtrl() {
canSaveDynamicFields = "0";
isContainer = "0";
Profile = "ToolsGuiButtonProfile";
HorizSizing = "right";
VertSizing = "bottom";
position = "228 68";
Extent = "64 22";
MinExtent = "8 2";
canSave = "1";
Visible = "1";
tooltipprofile = "ToolsGuiToolTipProfile";
hovertime = "1000";
groupNum = "-1";
buttonType = "PushButton";
useMouseEvents = "0";
text = "Cancel";
Command = "matEd_addCubemapWindow.setVisible(0);";
};
};
};
//--- OBJECT WRITE END ---

View file

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.7 KiB

After

Width:  |  Height:  |  Size: 8.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.7 KiB

After

Width:  |  Height:  |  Size: 7.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 7.8 KiB

After

Width:  |  Height:  |  Size: 7.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 8.4 KiB

After

Width:  |  Height:  |  Size: 8.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 13 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 384 B

After

Width:  |  Height:  |  Size: 384 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 458 B

After

Width:  |  Height:  |  Size: 458 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 416 B

After

Width:  |  Height:  |  Size: 416 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 479 B

After

Width:  |  Height:  |  Size: 479 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 360 B

After

Width:  |  Height:  |  Size: 360 B

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 397 B

After

Width:  |  Height:  |  Size: 397 B

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more