mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-15 16:44:36 +00:00
Added asset import logging
Added WIP of lighting viz logic to point and spotlight shaders Made new asset window adhere to path-based system Ongoing work to standardize asset import actions Context-based Asset Import popups Fixed behavior with adding a new sequence in shape editor Made it so apply in PostFX editor no longer closes window Work to re-add class visibility filters in editor
This commit is contained in:
parent
7dc6ab42dc
commit
d840d52038
24 changed files with 613 additions and 281 deletions
|
|
@ -955,7 +955,7 @@ void SceneObject::_updateZoningState() const
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
|
|
||||||
U32 SceneObject::_getCurrZone( const U32 index ) const
|
U32 SceneObject::getCurrZone( const U32 index ) const
|
||||||
{
|
{
|
||||||
_updateZoningState();
|
_updateZoningState();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -282,12 +282,6 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce
|
||||||
/// of the object is dirty, the list contents may be outdated.
|
/// of the object is dirty, the list contents may be outdated.
|
||||||
ZoneRef* _getZoneRefHead() const { return mZoneRefHead; }
|
ZoneRef* _getZoneRefHead() const { return mZoneRefHead; }
|
||||||
|
|
||||||
/// Gets the number of zones containing this object.
|
|
||||||
U32 _getNumCurrZones() const { return mNumCurrZones; }
|
|
||||||
|
|
||||||
/// Returns the nth zone containing this object.
|
|
||||||
U32 _getCurrZone( const U32 index ) const;
|
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Transform and Collision Members
|
/// @name Transform and Collision Members
|
||||||
|
|
@ -749,6 +743,12 @@ class SceneObject : public NetObject, private SceneContainer::Link, public Proce
|
||||||
void setLightingPlugin( SceneObjectLightingPlugin* plugin ) { mLightPlugin = plugin; }
|
void setLightingPlugin( SceneObjectLightingPlugin* plugin ) { mLightPlugin = plugin; }
|
||||||
SceneObjectLightingPlugin* getLightingPlugin() { return mLightPlugin; }
|
SceneObjectLightingPlugin* getLightingPlugin() { return mLightPlugin; }
|
||||||
|
|
||||||
|
/// Gets the number of zones containing this object.
|
||||||
|
U32 getNumCurrZones() const { return mNumCurrZones; }
|
||||||
|
|
||||||
|
/// Returns the nth zone containing this object.
|
||||||
|
U32 getCurrZone(const U32 index) const;
|
||||||
|
|
||||||
/// @}
|
/// @}
|
||||||
|
|
||||||
/// @name Global Bounds
|
/// @name Global Bounds
|
||||||
|
|
|
||||||
|
|
@ -198,6 +198,35 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DIFFUSE_LIGHT_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
float3 diffuse = BRDF_GetDebugDiffuse(surface,surfaceToLight) * factor;
|
||||||
|
float3 final = max(0.0f, diffuse);
|
||||||
|
return float4(final, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPECULAR_LIGHT_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
float3 diffuse = BRDF_GetDebugSpecular(surface,surfaceToLight) * factor;
|
||||||
|
float3 final = max(0.0f, diffuse);
|
||||||
|
return float4(final, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DETAIL_LIGHTING_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
vec3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
|
||||||
|
vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
|
||||||
|
|
||||||
|
vec3 final = max(vec3(0.0f), diffuse + spec * surface.F);
|
||||||
|
return final;
|
||||||
|
#endif
|
||||||
|
|
||||||
//get punctual light contribution
|
//get punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -128,6 +128,35 @@ float4 main( ConvexConnectP IN ) : SV_TARGET
|
||||||
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
lightCol *= max(cookie.r, max(cookie.g, cookie.b));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef DIFFUSE_LIGHT_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
float3 diffuse = BRDF_GetDebugDiffuse(surface,surfaceToLight) * factor;
|
||||||
|
float3 final = max(0.0f, diffuse) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
||||||
|
return float4(final, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef SPECULAR_LIGHT_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
float3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
float3 diffuse = BRDF_GetDebugSpecular(surface,surfaceToLight) * factor;
|
||||||
|
float3 final = max(0.0f, diffuse) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
||||||
|
return float4(final, 0);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifdef DETAIL_LIGHTING_VIZ
|
||||||
|
float attenuation = getDistanceAtt(surfaceToLight.Lu, radius);
|
||||||
|
vec3 factor = lightColor * max(surfaceToLight.NdotL, 0) * shadow * lightIntensity * attenuation;
|
||||||
|
|
||||||
|
vec3 diffuse = BRDF_GetDiffuse(surface,surfaceToLight) * factor;
|
||||||
|
vec3 spec = BRDF_GetSpecular(surface,surfaceToLight) * factor;
|
||||||
|
|
||||||
|
vec3 final = max(vec3(0.0f), diffuse + spec * surface.F) * getSpotAngleAtt(-surfaceToLight.L, lightDirection, lightSpotParams );
|
||||||
|
return final;
|
||||||
|
#endif
|
||||||
|
|
||||||
//get Punctual light contribution
|
//get Punctual light contribution
|
||||||
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
lighting = getPunctualLight(surface, surfaceToLight, lightCol, lightBrightness, lightInvSqrRange, shadowed);
|
||||||
//get spot angle attenuation
|
//get spot angle attenuation
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@
|
||||||
<Setting name="UseExistingMaterials">1</Setting>
|
<Setting name="UseExistingMaterials">1</Setting>
|
||||||
<Setting name="CreateComposites">1</Setting>
|
<Setting name="CreateComposites">1</Setting>
|
||||||
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
|
<Setting name="UseDiffuseSuffixOnOriginImage">1</Setting>
|
||||||
|
<Setting name="PopulateMaterialMaps">1</Setting>
|
||||||
</Group>
|
</Group>
|
||||||
<Group name="Meshes">
|
<Group name="Meshes">
|
||||||
<Setting name="DoScaleOverride">0</Setting>
|
<Setting name="DoScaleOverride">0</Setting>
|
||||||
|
|
@ -34,7 +35,6 @@
|
||||||
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
|
<Setting name="NormalTypeSuffixes">_NORMAL,_NORM</Setting>
|
||||||
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
|
<Setting name="AOTypeSuffixes">_AO,_AMBIENT,_AMBIENTOCCLUSION</Setting>
|
||||||
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
|
<Setting name="MetalnessTypeSuffixes">_METAL,_MET,_METALNESS,_METALLIC</Setting>
|
||||||
<Setting name="PopulateMaterialMaps">1</Setting>
|
|
||||||
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
|
<Setting name="CompositeTypeSuffixes">_COMP,_COMPOSITE</Setting>
|
||||||
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
|
<Setting name="RoughnessTypeSuffixes">_ROUGH,_ROUGHNESS</Setting>
|
||||||
<Setting name="ImageType">N/A</Setting>
|
<Setting name="ImageType">N/A</Setting>
|
||||||
|
|
|
||||||
|
|
@ -503,25 +503,29 @@
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
new GuiTextCtrl(AssetImportSummarization) {
|
new GuiBitmapButtonCtrl(ImportLogButton) {
|
||||||
maxLength = "1024";
|
bitmap = "tools/gui/images/iconInformation.png";
|
||||||
margin = "0 0 0 0";
|
bitmapMode = "Centered";
|
||||||
padding = "0 0 0 0";
|
autoFitExtents = "0";
|
||||||
anchorTop = "1";
|
useModifiers = "0";
|
||||||
anchorBottom = "0";
|
useStates = "1";
|
||||||
anchorLeft = "1";
|
masked = "0";
|
||||||
anchorRight = "0";
|
groupNum = "-1";
|
||||||
position = "4 554";
|
buttonType = "PushButton";
|
||||||
extent = "574 23";
|
useMouseEvents = "0";
|
||||||
|
position = "5 555";
|
||||||
|
extent = "22 22";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "width";
|
horizSizing = "left";
|
||||||
vertSizing = "top";
|
vertSizing = "bottom";
|
||||||
profile = "ToolsGuiTextProfile";
|
profile = "ToolsGuiButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
|
command = "ImportAssetWindow.toggleLogWindow();";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
tooltip = "View Import Log";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "1";
|
isContainer = "0";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,119 @@
|
||||||
|
//--- OBJECT WRITE BEGIN ---
|
||||||
|
%guiContent = new GuiControl(AssetBrowserImportLog) {
|
||||||
|
position = "0 0";
|
||||||
|
extent = "1024 768";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "right";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiDefaultNonModalProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "1";
|
||||||
|
|
||||||
|
new GuiWindowCtrl(AssetBrowserImportLogWindow) {
|
||||||
|
text = "Import Log";
|
||||||
|
resizeWidth = "1";
|
||||||
|
resizeHeight = "1";
|
||||||
|
canMove = "1";
|
||||||
|
canClose = "1";
|
||||||
|
canMinimize = "0";
|
||||||
|
canMaximize = "0";
|
||||||
|
canCollapse = "0";
|
||||||
|
closeCommand = "Canvas.popDialog(AssetBrowserImportLog);";
|
||||||
|
edgeSnap = "1";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "178 113";
|
||||||
|
extent = "649 528";
|
||||||
|
minExtent = "48 92";
|
||||||
|
horizSizing = "center";
|
||||||
|
vertSizing = "center";
|
||||||
|
profile = "ToolsGuiWindowProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiScrollCtrl() {
|
||||||
|
willFirstRespond = "1";
|
||||||
|
hScrollBar = "alwaysOn";
|
||||||
|
vScrollBar = "alwaysOn";
|
||||||
|
lockHorizScroll = "0";
|
||||||
|
lockVertScroll = "0";
|
||||||
|
constantThumbHeight = "0";
|
||||||
|
childMargin = "0 0";
|
||||||
|
mouseWheelScrollSpeed = "-1";
|
||||||
|
margin = "0 0 0 0";
|
||||||
|
padding = "0 0 0 0";
|
||||||
|
anchorTop = "1";
|
||||||
|
anchorBottom = "0";
|
||||||
|
anchorLeft = "1";
|
||||||
|
anchorRight = "0";
|
||||||
|
position = "7 25";
|
||||||
|
extent = "635 468";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "height";
|
||||||
|
profile = "ToolsGuiScrollProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
|
new GuiTextListCtrl(ImportLogTextList) {
|
||||||
|
columns = "0";
|
||||||
|
fitParentWidth = "1";
|
||||||
|
clipColumnText = "0";
|
||||||
|
rowHeightPadding = "2";
|
||||||
|
position = "1 1";
|
||||||
|
extent = "620 2";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "width";
|
||||||
|
vertSizing = "height";
|
||||||
|
profile = "ToolsGuiTextEditProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "1";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
new GuiButtonCtrl() {
|
||||||
|
text = "Cancel";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "576 497";
|
||||||
|
extent = "64 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
command = "Canvas.popDialog(AssetBrowserImportLog);";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
};
|
||||||
|
};
|
||||||
|
//--- OBJECT WRITE END ---
|
||||||
|
|
@ -45,78 +45,8 @@
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
|
|
||||||
new GuiButtonCtrl(NewAssetCreateBtn) {
|
new GuiTextCtrl() {
|
||||||
text = "Done";
|
text = "Target Module:";
|
||||||
groupNum = "-1";
|
|
||||||
buttonType = "PushButton";
|
|
||||||
useMouseEvents = "0";
|
|
||||||
position = "227 419";
|
|
||||||
extent = "64 22";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "right";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "ToolsGuiButtonProfile";
|
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
command = "CreateNewAsset();";
|
|
||||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "0";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
|
||||||
new GuiBitmapButtonCtrl() {
|
|
||||||
bitmap = "tools/gui/images/iconOpen.png";
|
|
||||||
bitmapMode = "Centered";
|
|
||||||
autoFitExtents = "0";
|
|
||||||
useModifiers = "0";
|
|
||||||
useStates = "1";
|
|
||||||
masked = "0";
|
|
||||||
groupNum = "-1";
|
|
||||||
buttonType = "PushButton";
|
|
||||||
useMouseEvents = "0";
|
|
||||||
position = "342 27";
|
|
||||||
extent = "22 22";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "left";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "ToolsGuiButtonProfile";
|
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"newAssetUpdatePath\");\nSelectAssetPathWindow.selectWindow();";
|
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
|
||||||
tooltip = "New Module";
|
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "0";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
|
||||||
new GuiButtonCtrl() {
|
|
||||||
text = "Cancel";
|
|
||||||
groupNum = "-1";
|
|
||||||
buttonType = "PushButton";
|
|
||||||
useMouseEvents = "0";
|
|
||||||
position = "295 419";
|
|
||||||
extent = "64 22";
|
|
||||||
minExtent = "8 2";
|
|
||||||
horizSizing = "right";
|
|
||||||
vertSizing = "bottom";
|
|
||||||
profile = "ToolsGuiButtonProfile";
|
|
||||||
visible = "1";
|
|
||||||
active = "1";
|
|
||||||
command = "AssetBrowser_newAssetWindow.onClose();";
|
|
||||||
tooltipProfile = "ToolsGuiToolTipProfile";
|
|
||||||
hovertime = "1000";
|
|
||||||
isContainer = "0";
|
|
||||||
canSave = "1";
|
|
||||||
canSaveDynamicFields = "0";
|
|
||||||
};
|
|
||||||
new GuiTextEditCtrl(NewAssetTargetAddress) {
|
|
||||||
historySize = "0";
|
|
||||||
tabComplete = "0";
|
|
||||||
sinkAllKeyEvents = "0";
|
|
||||||
password = "0";
|
|
||||||
passwordMask = "*";
|
|
||||||
maxLength = "1024";
|
maxLength = "1024";
|
||||||
margin = "0 0 0 0";
|
margin = "0 0 0 0";
|
||||||
padding = "0 0 0 0";
|
padding = "0 0 0 0";
|
||||||
|
|
@ -124,14 +54,14 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "135 30";
|
position = "12 54";
|
||||||
extent = "204 18";
|
extent = "116 17";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "width";
|
horizSizing = "right";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
profile = "ToolsGuiTextEditProfile";
|
profile = "ToolsGuiTextProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "0";
|
active = "1";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
|
|
@ -161,8 +91,12 @@
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
new GuiTextCtrl() {
|
new GuiTextEditCtrl(NewAssetTargetAddress) {
|
||||||
text = "Target Module:";
|
historySize = "0";
|
||||||
|
tabComplete = "0";
|
||||||
|
sinkAllKeyEvents = "0";
|
||||||
|
password = "0";
|
||||||
|
passwordMask = "*";
|
||||||
maxLength = "1024";
|
maxLength = "1024";
|
||||||
margin = "0 0 0 0";
|
margin = "0 0 0 0";
|
||||||
padding = "0 0 0 0";
|
padding = "0 0 0 0";
|
||||||
|
|
@ -170,20 +104,46 @@
|
||||||
anchorBottom = "0";
|
anchorBottom = "0";
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "12 54";
|
position = "135 30";
|
||||||
extent = "116 17";
|
extent = "201 18";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "right";
|
horizSizing = "width";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
profile = "ToolsGuiTextProfile";
|
profile = "ToolsGuiTextEditProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "0";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
isContainer = "1";
|
isContainer = "1";
|
||||||
canSave = "1";
|
canSave = "1";
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
|
new GuiBitmapButtonCtrl() {
|
||||||
|
bitmap = "tools/gui/images/iconOpen.png";
|
||||||
|
bitmapMode = "Centered";
|
||||||
|
autoFitExtents = "0";
|
||||||
|
useModifiers = "0";
|
||||||
|
useStates = "1";
|
||||||
|
masked = "0";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "343 27";
|
||||||
|
extent = "22 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "bottom";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
command = "SelectAssetPath.showDialog(AssetBrowser.dirHandler.currentAddress, \"newAssetUpdatePath\");\nSelectAssetPathWindow.selectWindow();";
|
||||||
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
|
tooltip = "New Module";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
new GuiTextEditCtrl(NewAssetTargetModule) {
|
new GuiTextEditCtrl(NewAssetTargetModule) {
|
||||||
historySize = "0";
|
historySize = "0";
|
||||||
tabComplete = "0";
|
tabComplete = "0";
|
||||||
|
|
@ -198,7 +158,7 @@
|
||||||
anchorLeft = "1";
|
anchorLeft = "1";
|
||||||
anchorRight = "0";
|
anchorRight = "0";
|
||||||
position = "135 53";
|
position = "135 53";
|
||||||
extent = "204 18";
|
extent = "202 18";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "width";
|
horizSizing = "width";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
|
|
@ -229,7 +189,7 @@
|
||||||
position = "7 79";
|
position = "7 79";
|
||||||
extent = "354 334";
|
extent = "354 334";
|
||||||
minExtent = "8 2";
|
minExtent = "8 2";
|
||||||
horizSizing = "right";
|
horizSizing = "width";
|
||||||
vertSizing = "bottom";
|
vertSizing = "bottom";
|
||||||
profile = "ToolsGuiScrollProfile";
|
profile = "ToolsGuiScrollProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
|
|
@ -255,8 +215,8 @@
|
||||||
position = "1 1";
|
position = "1 1";
|
||||||
extent = "337 338";
|
extent = "337 338";
|
||||||
minExtent = "16 16";
|
minExtent = "16 16";
|
||||||
horizSizing = "right";
|
horizSizing = "width";
|
||||||
vertSizing = "bottom";
|
vertSizing = "height";
|
||||||
profile = "GuiDefaultProfile";
|
profile = "GuiDefaultProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
|
|
@ -267,6 +227,46 @@
|
||||||
canSaveDynamicFields = "0";
|
canSaveDynamicFields = "0";
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
new GuiButtonCtrl(NewAssetCreateBtn) {
|
||||||
|
text = "Done";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "227 419";
|
||||||
|
extent = "64 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
command = "CreateNewAsset();";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
|
new GuiButtonCtrl() {
|
||||||
|
text = "Cancel";
|
||||||
|
groupNum = "-1";
|
||||||
|
buttonType = "PushButton";
|
||||||
|
useMouseEvents = "0";
|
||||||
|
position = "295 419";
|
||||||
|
extent = "64 22";
|
||||||
|
minExtent = "8 2";
|
||||||
|
horizSizing = "left";
|
||||||
|
vertSizing = "top";
|
||||||
|
profile = "ToolsGuiButtonProfile";
|
||||||
|
visible = "1";
|
||||||
|
active = "1";
|
||||||
|
command = "AssetBrowser_newAssetWindow.onClose();";
|
||||||
|
tooltipProfile = "ToolsGuiToolTipProfile";
|
||||||
|
hovertime = "1000";
|
||||||
|
isContainer = "0";
|
||||||
|
canSave = "1";
|
||||||
|
canSaveDynamicFields = "0";
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
//--- OBJECT WRITE END ---
|
//--- OBJECT WRITE END ---
|
||||||
|
|
|
||||||
|
|
@ -38,23 +38,23 @@ function initializeAssetBrowser()
|
||||||
new ArrayObject(AssetFilterTypeList);
|
new ArrayObject(AssetFilterTypeList);
|
||||||
|
|
||||||
AssetFilterTypeList.add("All");
|
AssetFilterTypeList.add("All");
|
||||||
AssetFilterTypeList.add("Component");
|
AssetFilterTypeList.add("ComponentAsset");
|
||||||
AssetFilterTypeList.add("Cpp");
|
AssetFilterTypeList.add("CppAsset");
|
||||||
AssetFilterTypeList.add("Cubemap");
|
AssetFilterTypeList.add("CubemapAsset");
|
||||||
AssetFilterTypeList.add("GameObject");
|
AssetFilterTypeList.add("GameObjectAsset");
|
||||||
AssetFilterTypeList.add("GUI");
|
AssetFilterTypeList.add("GUIAsset");
|
||||||
AssetFilterTypeList.add("Image");
|
AssetFilterTypeList.add("ImageAsset");
|
||||||
AssetFilterTypeList.add("Level");
|
AssetFilterTypeList.add("LevelAsset");
|
||||||
AssetFilterTypeList.add("Material");
|
AssetFilterTypeList.add("MaterialAsset");
|
||||||
AssetFilterTypeList.add("Particle");
|
AssetFilterTypeList.add("ParticleAsset");
|
||||||
AssetFilterTypeList.add("PostFX");
|
AssetFilterTypeList.add("PostFXAsset");
|
||||||
AssetFilterTypeList.add("Script");
|
AssetFilterTypeList.add("ScriptAsset");
|
||||||
AssetFilterTypeList.add("Shape");
|
AssetFilterTypeList.add("ShapeAsset");
|
||||||
AssetFilterTypeList.add("ShapeAnimation");
|
AssetFilterTypeList.add("ShapeAnimationAsset");
|
||||||
AssetFilterTypeList.add("Sound");
|
AssetFilterTypeList.add("SoundAsset");
|
||||||
AssetFilterTypeList.add("StateMachine");
|
AssetFilterTypeList.add("StateMachineAsset");
|
||||||
AssetFilterTypeList.add("Terrain");
|
AssetFilterTypeList.add("TerrainAsset");
|
||||||
AssetFilterTypeList.add("TerrainMaterial");
|
AssetFilterTypeList.add("TerrainMaterialAsset");
|
||||||
}
|
}
|
||||||
|
|
||||||
exec("./guis/assetBrowser.gui");
|
exec("./guis/assetBrowser.gui");
|
||||||
|
|
@ -71,6 +71,7 @@ function initializeAssetBrowser()
|
||||||
exec("./guis/importTemplateModules.gui");
|
exec("./guis/importTemplateModules.gui");
|
||||||
exec("./guis/assetPreviewButtonsTemplate.gui");
|
exec("./guis/assetPreviewButtonsTemplate.gui");
|
||||||
exec("./guis/newFolder.gui");
|
exec("./guis/newFolder.gui");
|
||||||
|
exec("./guis/assetImportLog.gui");
|
||||||
|
|
||||||
exec("./scripts/assetBrowser.cs");
|
exec("./scripts/assetBrowser.cs");
|
||||||
exec("./scripts/popupMenus.cs");
|
exec("./scripts/popupMenus.cs");
|
||||||
|
|
@ -127,6 +128,13 @@ function initializeAssetBrowser()
|
||||||
|
|
||||||
if(!isObject(ImportAssetTree))
|
if(!isObject(ImportAssetTree))
|
||||||
new GuiTreeViewCtrl(ImportAssetTree);
|
new GuiTreeViewCtrl(ImportAssetTree);
|
||||||
|
|
||||||
|
if(!isObject(ImportActivityLog))
|
||||||
|
new ArrayObject(ImportActivityLog);
|
||||||
|
|
||||||
|
ImportAssetWindow.importingFilesArray = new ArrayObject();
|
||||||
|
ImportAssetWindow.importAssetUnprocessedListArray = new ArrayObject();
|
||||||
|
ImportAssetWindow.importAssetFinalListArray = new ArrayObject();
|
||||||
|
|
||||||
AssetBrowser.buildPopupMenus();
|
AssetBrowser.buildPopupMenus();
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -96,8 +96,7 @@ function AssetBrowser_addModuleWindow::CreateNewModule(%this)
|
||||||
ModuleDatabase.ignoreLoadedGroups(false);
|
ModuleDatabase.ignoreLoadedGroups(false);
|
||||||
|
|
||||||
//force a reload of the Module lists
|
//force a reload of the Module lists
|
||||||
GameObjectModuleList.refresh();
|
AssetBrowser.refresh();
|
||||||
ImportAssetModuleList.refresh();
|
|
||||||
|
|
||||||
AssetBrowser.newModuleId = %newModuleName;
|
AssetBrowser.newModuleId = %newModuleName;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -47,9 +47,6 @@ function AssetBrowser::onWake(%this)
|
||||||
AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
|
AssetBrowser-->filterTree.buildIconTable( ":tools/classIcons/Prefab:tools/classIcons/Prefab" @
|
||||||
":tools/classIcons/SimSet:tools/classIcons/SimSet");
|
":tools/classIcons/SimSet:tools/classIcons/SimSet");
|
||||||
|
|
||||||
%this.importingFilesArray = new ArrayObject();
|
|
||||||
%this.importAssetUnprocessedListArray = new ArrayObject();
|
|
||||||
%this.importAssetFinalListArray = new ArrayObject();
|
|
||||||
%this.isReImportingAsset = false;
|
%this.isReImportingAsset = false;
|
||||||
|
|
||||||
%this.coreModulesFilter = false;
|
%this.coreModulesFilter = false;
|
||||||
|
|
|
||||||
|
|
@ -77,8 +77,8 @@ function AssetBrowser::onBeginDropFiles( %this )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error("% DragDrop - Beginning files dropping.");
|
error("% DragDrop - Beginning files dropping.");
|
||||||
%this.importAssetUnprocessedListArray.empty();
|
ImportAssetWindow.importAssetUnprocessedListArray.empty();
|
||||||
%this.importAssetFinalListArray.empty();
|
ImportAssetWindow.importAssetFinalListArray.empty();
|
||||||
|
|
||||||
ImportAssetWindow.assetHeirarchyChanged = false;
|
ImportAssetWindow.assetHeirarchyChanged = false;
|
||||||
|
|
||||||
|
|
@ -99,23 +99,23 @@ function AssetBrowser::onDropFile( %this, %filePath )
|
||||||
%fileExt = fileExt( %filePath );
|
%fileExt = fileExt( %filePath );
|
||||||
//add it to our array!
|
//add it to our array!
|
||||||
if(isImageFormat(%fileExt))
|
if(isImageFormat(%fileExt))
|
||||||
%this.addImportingAsset("Image", %filePath);
|
%this.addImportingAsset("ImageAsset", %filePath);
|
||||||
else if( isShapeFormat(%fileExt))
|
else if( isShapeFormat(%fileExt))
|
||||||
%this.addImportingAsset("Model", %filePath);
|
%this.addImportingAsset("ShapeAsset", %filePath);
|
||||||
else if( isSoundFormat(%fileExt))
|
else if( isSoundFormat(%fileExt))
|
||||||
%this.addImportingAsset("Sound", %filePath);
|
%this.addImportingAsset("SoundAsset", %filePath);
|
||||||
else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" )
|
else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" )
|
||||||
%this.addImportingAsset("Script", %filePath);
|
%this.addImportingAsset("ScriptAsset", %filePath);
|
||||||
else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" )
|
else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" )
|
||||||
%this.addImportingAsset("GUI", %filePath);
|
%this.addImportingAsset("GUIAsset", %filePath);
|
||||||
else if (%fileExt $= ".zip")
|
else if (%fileExt $= ".zip")
|
||||||
%this.onDropZipFile(%filePath);
|
%this.onDropZipFile(%filePath);
|
||||||
|
|
||||||
//Used to keep tabs on what files we were trying to import, used mainly in the event of
|
//Used to keep tabs on what files we were trying to import, used mainly in the event of
|
||||||
//adjusting configs and needing to completely reprocess the import
|
//adjusting configs and needing to completely reprocess the import
|
||||||
//ensure we're not doubling-up on files by accident
|
//ensure we're not doubling-up on files by accident
|
||||||
if(%this.importingFilesArray.getIndexFromKey(%filePath) == -1)
|
if(ImportAssetWindow.importingFilesArray.getIndexFromKey(%filePath) == -1)
|
||||||
%this.importingFilesArray.add(%filePath);
|
ImportAssetWindow.importingFilesArray.add(%filePath);
|
||||||
}
|
}
|
||||||
|
|
||||||
function AssetBrowser::onDropZipFile(%this, %filePath)
|
function AssetBrowser::onDropZipFile(%this, %filePath)
|
||||||
|
|
@ -140,17 +140,17 @@ function AssetBrowser::onDropZipFile(%this, %filePath)
|
||||||
|
|
||||||
//If not modules, it's likely an art pack or other mixed files, so we'll import them as normal
|
//If not modules, it's likely an art pack or other mixed files, so we'll import them as normal
|
||||||
if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") )
|
if( (%fileExt $= ".png") || (%fileExt $= ".jpg") || (%fileExt $= ".bmp") || (%fileExt $= ".dds") )
|
||||||
%this.importAssetListArray.add("Image", %filePath);
|
%this.importAssetListArray.add("ImageAsset", %filePath);
|
||||||
else if( (%fileExt $= ".dae") || (%fileExt $= ".dts"))
|
else if( (%fileExt $= ".dae") || (%fileExt $= ".dts"))
|
||||||
%this.importAssetListArray.add("Model", %filePath);
|
%this.importAssetListArray.add("ShapeAsset", %filePath);
|
||||||
else if( (%fileExt $= ".ogg") || (%fileExt $= ".wav") || (%fileExt $= ".mp3"))
|
else if( (%fileExt $= ".ogg") || (%fileExt $= ".wav") || (%fileExt $= ".mp3"))
|
||||||
%this.importAssetListArray.add("Sound", %filePath);
|
%this.importAssetListArray.add("SoundAsset", %filePath);
|
||||||
else if( (%fileExt $= ".gui") || (%fileExt $= ".gui.dso"))
|
else if( (%fileExt $= ".gui") || (%fileExt $= ".gui.dso"))
|
||||||
%this.importAssetListArray.add("GUI", %filePath);
|
%this.importAssetListArray.add("GUIAsset", %filePath);
|
||||||
//else if( (%fileExt $= ".cs") || (%fileExt $= ".dso"))
|
//else if( (%fileExt $= ".cs") || (%fileExt $= ".dso"))
|
||||||
// %this.importAssetListArray.add("Script", %filePath);
|
// %this.importAssetListArray.add("Script", %filePath);
|
||||||
else if( (%fileExt $= ".mis"))
|
else if( (%fileExt $= ".mis"))
|
||||||
%this.importAssetListArray.add("Level", %filePath);
|
%this.importAssetListArray.add("LevelAsset", %filePath);
|
||||||
|
|
||||||
// For now, if it's a .cs file, we'll assume it's a behavior.
|
// For now, if it's a .cs file, we'll assume it's a behavior.
|
||||||
if (fileExt(%fileFrom) !$= ".cs")
|
if (fileExt(%fileFrom) !$= ".cs")
|
||||||
|
|
@ -221,9 +221,9 @@ function AssetBrowser::reloadImportingFiles(%this)
|
||||||
//Effectively, we re-import the files we were trying to originally. We'd only usually do this in the event we change our import config
|
//Effectively, we re-import the files we were trying to originally. We'd only usually do this in the event we change our import config
|
||||||
%this.onBeginDropFiles();
|
%this.onBeginDropFiles();
|
||||||
|
|
||||||
for(%i=0; %i < %this.importingFilesArray.count(); %i++)
|
for(%i=0; %i < ImportAssetWindow.importingFilesArray.count(); %i++)
|
||||||
{
|
{
|
||||||
%this.onDropFile(%this.importingFilesArray.getKey(%i));
|
%this.onDropFile(ImportAssetWindow.importingFilesArray.getKey(%i));
|
||||||
}
|
}
|
||||||
|
|
||||||
%this.onEndDropFiles();
|
%this.onEndDropFiles();
|
||||||
|
|
@ -296,53 +296,26 @@ function AssetBrowser::addImportingAsset( %this, %assetType, %filePath, %parentA
|
||||||
processed = false;
|
processed = false;
|
||||||
generatedAsset = false;
|
generatedAsset = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
//little bit of interception here
|
|
||||||
/*if(%assetItem.assetType $= "Model")
|
|
||||||
{
|
|
||||||
%fileExt = fileExt(%assetItem.filePath);
|
|
||||||
%shapeInfo = new GuiTreeViewCtrl();
|
|
||||||
if(%fileExt $= ".dae")
|
|
||||||
{
|
|
||||||
enumColladaForImport(%assetItem.filePath, %shapeInfo, false);
|
|
||||||
}
|
|
||||||
else if(%fileExt $= ".dts")
|
|
||||||
{
|
|
||||||
%shapeInfo.insertItem(0, "Shape", 1);
|
|
||||||
%shapeInfo.insertItem(0, "Animations", 0);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
%success = GetShapeInfo(%assetItem.filePath, %shapeInfo);
|
|
||||||
}
|
|
||||||
|
|
||||||
%assetItem.shapeInfo = %shapeInfo;
|
|
||||||
|
|
||||||
%shapeCount = %assetItem.shapeInfo._meshCount;
|
|
||||||
|
|
||||||
%animCount = %assetItem.shapeInfo._animCount;
|
|
||||||
|
|
||||||
//If the model has shapes AND animations, then it's a normal shape with embedded animations
|
|
||||||
//if it has shapes and no animations it's a regular static mesh
|
|
||||||
//if it has no shapes and animations, it's a special case. This means it's a shape animation only file so it gets flagged as special
|
|
||||||
if(%shapeCount == 0 && %animCount != 0)
|
|
||||||
{
|
|
||||||
%assetItem.assetType = "Animation";
|
|
||||||
}
|
|
||||||
else if(%shapeCount == 0 && %animCount == 0)
|
|
||||||
{
|
|
||||||
//either it imported wrong or it's a bad file we can't read. Either way, don't try importing it
|
|
||||||
error("Error - attempted to import a model file with no shapes or animations! Model in question was: " @ %filePath);
|
|
||||||
|
|
||||||
%assetItem.delete();
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if(%assetType $= "Material")
|
if(%parentAssetItem !$= "")
|
||||||
|
{
|
||||||
|
ImportActivityLog.add("Added Child Importing Asset to " @ %parentAssetItem.assetName);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImportActivityLog.add("Added Importing Asset");
|
||||||
|
}
|
||||||
|
|
||||||
|
ImportActivityLog.add(" Asset Info: Name: " @ %assetName @ " | Type: " @ %assetType);
|
||||||
|
|
||||||
|
if(%assetType $= "MaterialAsset")
|
||||||
{
|
{
|
||||||
%assetItem.generatedAsset = true;
|
%assetItem.generatedAsset = true;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ImportActivityLog.add(" File: " @ %filePath);
|
||||||
|
}
|
||||||
|
|
||||||
if(%parentAssetItem $= "")
|
if(%parentAssetItem $= "")
|
||||||
{
|
{
|
||||||
|
|
@ -405,7 +378,9 @@ function AssetBrowser::importNewAssetFile(%this)
|
||||||
//
|
//
|
||||||
function ImportAssetButton::onClick(%this)
|
function ImportAssetButton::onClick(%this)
|
||||||
{
|
{
|
||||||
ImportAssetsPopup.showPopup(Canvas);
|
//ImportAssetsPopup.showPopup(Canvas);
|
||||||
|
|
||||||
|
Canvas.pushDialog(AssetImportCtrl);
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
|
@ -443,6 +418,8 @@ function ImportAssetWindow::onWake(%this)
|
||||||
AssetImportTargetAddress.text = AssetBrowser.dirHandler.currentAddress;
|
AssetImportTargetAddress.text = AssetBrowser.dirHandler.currentAddress;
|
||||||
AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
AssetImportTargetModule.text = AssetBrowser.dirHandler.getModuleFromAddress(AssetBrowser.dirHandler.currentAddress).ModuleId;
|
||||||
ImportAssetConfigList.setSelected(0);
|
ImportAssetConfigList.setSelected(0);
|
||||||
|
|
||||||
|
ImportActivityLog.empty();
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
function ImportAssetWindow::reloadImportOptionConfigs(%this)
|
||||||
|
|
@ -515,7 +492,7 @@ function ImportAssetWindow::processNewImportAssets(%this, %id)
|
||||||
|
|
||||||
//%assetConfigObj.assetName = %assetItem.assetName;
|
//%assetConfigObj.assetName = %assetItem.assetName;
|
||||||
|
|
||||||
if(%assetItem.assetType $= "Animation")
|
if(%assetItem.assetType $= "AnimationAsset")
|
||||||
{
|
{
|
||||||
//if we don't have our own file, that means we're gunna be using our parent shape's file so reference that
|
//if we don't have our own file, that means we're gunna be using our parent shape's file so reference that
|
||||||
if(!isFile(%assetItem.filePath))
|
if(!isFile(%assetItem.filePath))
|
||||||
|
|
@ -774,7 +751,7 @@ function ImportAssetWindow::refresh(%this)
|
||||||
%id = ImportAssetTree.getChild(1);
|
%id = ImportAssetTree.getChild(1);
|
||||||
|
|
||||||
ImportAssetWindow.assetHeirarchyChanged = false;
|
ImportAssetWindow.assetHeirarchyChanged = false;
|
||||||
AssetBrowser.importAssetFinalListArray.empty();
|
ImportAssetWindow.importAssetFinalListArray.empty();
|
||||||
|
|
||||||
%this.processNewImportAssets(%id);
|
%this.processNewImportAssets(%id);
|
||||||
|
|
||||||
|
|
@ -788,7 +765,7 @@ function ImportAssetWindow::refresh(%this)
|
||||||
AssetImportCtrl-->NewAssetsTree.clear();
|
AssetImportCtrl-->NewAssetsTree.clear();
|
||||||
AssetImportCtrl-->NewAssetsTree.insertItem(0, "Importing Assets");
|
AssetImportCtrl-->NewAssetsTree.insertItem(0, "Importing Assets");
|
||||||
|
|
||||||
if(AssetBrowser.importAssetUnprocessedListArray.count() == 0)
|
if(ImportAssetWindow.importAssetUnprocessedListArray.count() == 0)
|
||||||
{
|
{
|
||||||
//We've processed them all, prep the assets for actual importing
|
//We've processed them all, prep the assets for actual importing
|
||||||
//Initial set of assets
|
//Initial set of assets
|
||||||
|
|
@ -852,7 +829,7 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
|
||||||
%toolTip = "";
|
%toolTip = "";
|
||||||
%configCommand = "ImportAssetOptionsWindow.editImportSettings(" @ %assetItem @ ");";
|
%configCommand = "ImportAssetOptionsWindow.editImportSettings(" @ %assetItem @ ");";
|
||||||
|
|
||||||
if(%assetType $= "Model" || %assetType $= "Animation" || %assetType $= "Image" || %assetType $= "Sound")
|
if(%assetType $= "ShapeAsset" || %assetType $= "AnimationAsset" || %assetType $= "ImageAsset" || %assetType $= "SoundAsset")
|
||||||
{
|
{
|
||||||
if(%assetItem.status $= "Error")
|
if(%assetItem.status $= "Error")
|
||||||
{
|
{
|
||||||
|
|
@ -890,19 +867,19 @@ function ImportAssetWindow::refreshChildItem(%this, %id)
|
||||||
|
|
||||||
if(%assetItem.status $= "")
|
if(%assetItem.status $= "")
|
||||||
{
|
{
|
||||||
if(%assetType $= "Model")
|
if(%assetType $= "ShapeAsset")
|
||||||
%iconIdx = 1;
|
%iconIdx = 1;
|
||||||
else if(%assetType $= "Material")
|
else if(%assetType $= "MaterialAsset")
|
||||||
%iconIdx = 3;
|
%iconIdx = 3;
|
||||||
else if(%assetType $= "Image")
|
else if(%assetType $= "ImageAsset")
|
||||||
%iconIdx = 5;
|
%iconIdx = 5;
|
||||||
else if(%assetType $= "Sound")
|
else if(%assetType $= "SoundAsset")
|
||||||
%iconIdx = 7;
|
%iconIdx = 7;
|
||||||
}
|
}
|
||||||
|
|
||||||
AssetImportCtrl-->NewAssetsTree.insertItem(%parentItem, %assetName, %assetItem, "", %iconIdx, %iconIdx+1);
|
AssetImportCtrl-->NewAssetsTree.insertItem(%parentItem, %assetName, %assetItem, "", %iconIdx, %iconIdx+1);
|
||||||
|
|
||||||
AssetBrowser.importAssetFinalListArray.add(%assetItem);
|
ImportAssetWindow.importAssetFinalListArray.add(%assetItem);
|
||||||
|
|
||||||
if(ImportAssetTree.isParentItem(%id))
|
if(ImportAssetTree.isParentItem(%id))
|
||||||
{
|
{
|
||||||
|
|
@ -941,6 +918,12 @@ function NewAssetsViewTree::onSelect(%this, %itemId)
|
||||||
AssetImportCtrl-->NewAssetsInspector.endGroup();
|
AssetImportCtrl-->NewAssetsInspector.endGroup();
|
||||||
|
|
||||||
AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("assetType", false);
|
AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("assetType", false);
|
||||||
|
|
||||||
|
if(AssetBrowser.isMethod("inspectImporting" @ %assetItem.assetType))
|
||||||
|
{
|
||||||
|
%command = "AssetBrowser.inspectImporting" @ %assetItem.assetType @ "(" @ %assetItem @ ");";
|
||||||
|
eval(%command);
|
||||||
|
}
|
||||||
//AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("status", false);
|
//AssetImportCtrl-->NewAssetsInspector.setFieldEnabled("status", false);
|
||||||
|
|
||||||
/*moduleName = %moduleName;
|
/*moduleName = %moduleName;
|
||||||
|
|
@ -960,9 +943,33 @@ function NewAssetsViewTree::onRightMouseDown(%this, %itemId)
|
||||||
|
|
||||||
if( %itemId != 1 && %itemId != -1)
|
if( %itemId != 1 && %itemId != -1)
|
||||||
{
|
{
|
||||||
ImportAssetActions.showPopup(Canvas);
|
%assetItem = %this.getItemValue(%itemId);
|
||||||
ImportAssetActions.assetItem = %this.getItemValue(%itemId);
|
|
||||||
ImportAssetActions.itemId = %itemId;
|
if(%assetItem.assetType $= "MaterialAsset")
|
||||||
|
{
|
||||||
|
%contextPopup = ImportAssetMaterialMaps;
|
||||||
|
|
||||||
|
for(%i=0; %i < 7; %i++)
|
||||||
|
{
|
||||||
|
%contextPopup.enableItem(%i, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isObject(%assetItem.diffuseImageAsset))
|
||||||
|
%contextPopup.enableItem(0, false);
|
||||||
|
|
||||||
|
if(isObject(%assetItem.normalImageAsset))
|
||||||
|
%contextPopup.enableItem(1, false);
|
||||||
|
|
||||||
|
if(isObject(%assetItem.compositeImageAsset))
|
||||||
|
%contextPopup.enableItem(2, false);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
%contextPopup = ImportAssetActions;
|
||||||
|
}
|
||||||
|
%contextPopup.showPopup(Canvas);
|
||||||
|
%contextPopup.assetItem = %assetItem;
|
||||||
|
%contextPopup.itemId = %itemId;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -979,18 +986,37 @@ function NewAssetsPanelInputs::onRightMouseDown(%this)
|
||||||
//
|
//
|
||||||
function ImportAssetWindow::removeImportingAsset(%this)
|
function ImportAssetWindow::removeImportingAsset(%this)
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Removing Asset from Import");
|
||||||
|
|
||||||
ImportAssetTree.removeAllChildren(ImportAssetActions.itemId);
|
ImportAssetTree.removeAllChildren(ImportAssetActions.itemId);
|
||||||
ImportAssetTree.removeItem(ImportAssetActions.itemId);
|
ImportAssetTree.removeItem(ImportAssetActions.itemId);
|
||||||
|
|
||||||
ImportAssetWindow.refresh();
|
ImportAssetWindow.refresh();
|
||||||
}
|
}
|
||||||
|
|
||||||
function ImportAssetWindow::addNewImportingAsset(%this)
|
function ImportAssetWindow::addNewImportingAsset(%this, %filterType)
|
||||||
{
|
{
|
||||||
|
%filter = "Any Files (*.*)|*.*|";
|
||||||
|
|
||||||
|
if(%filterType $= "Sound" || %filterType $= "")
|
||||||
|
%filter = "Sound Files(*.wav, *.ogg)|*.wav;*.ogg|" @ %filter;
|
||||||
|
if(%filterType $= "Image" || %filterType $= "")
|
||||||
|
%filter = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds|" @ %filter;
|
||||||
|
if(%filterType $= "Shape" || %filterType $= "")
|
||||||
|
%filter = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts|" @ %filter;
|
||||||
|
|
||||||
|
//get our item depending on which action we're trying for
|
||||||
|
if(ImportAssetActions.visible)
|
||||||
|
%parentAssetItem = ImportAssetActions.assetItem;
|
||||||
|
else if(ImportAssetMaterialMaps.visible)
|
||||||
|
%parentAssetItem = ImportAssetMaterialMaps.assetItem;
|
||||||
|
|
||||||
|
%defaultPath = filePath(%parentAssetItem.filePath) @ "/";
|
||||||
|
|
||||||
%dlg = new OpenFileDialog()
|
%dlg = new OpenFileDialog()
|
||||||
{
|
{
|
||||||
Filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts|Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds|Any Files (*.*)|*.*|";
|
Filters = %filter;
|
||||||
DefaultFile = "";
|
DefaultFile = %defaultPath;
|
||||||
ChangePath = false;
|
ChangePath = false;
|
||||||
MustExist = true;
|
MustExist = true;
|
||||||
MultipleFiles = false;
|
MultipleFiles = false;
|
||||||
|
|
@ -1004,22 +1030,25 @@ function ImportAssetWindow::addNewImportingAsset(%this)
|
||||||
|
|
||||||
%dlg.delete();
|
%dlg.delete();
|
||||||
|
|
||||||
|
if(%filePath $= "")
|
||||||
|
return "";
|
||||||
|
|
||||||
//AssetBrowser.onDropFile( %path );
|
//AssetBrowser.onDropFile( %path );
|
||||||
|
|
||||||
%fileExt = fileExt( %filePath );
|
%fileExt = fileExt( %filePath );
|
||||||
//add it to our array!
|
//add it to our array!
|
||||||
if(isImageFormat(%fileExt))
|
if(isImageFormat(%fileExt))
|
||||||
%type = "Image";
|
%type = "ImageAsset";
|
||||||
else if( isShapeFormat(%fileExt))
|
else if( isShapeFormat(%fileExt))
|
||||||
%type = "Model";
|
%type = "ShapeAsset";
|
||||||
else if( isSoundFormat(%fileExt))
|
else if( isSoundFormat(%fileExt))
|
||||||
%type = "Sound";
|
%type = "SoundAsset";
|
||||||
else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" )
|
else if( %fileExt $= ".cs" || %fileExt $= ".cs.dso" )
|
||||||
%type = "Script";
|
%type = "ScriptAsset";
|
||||||
else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" )
|
else if( %fileExt $= ".gui" || %fileExt $= ".gui.dso" )
|
||||||
%type = "GUI";
|
%type = "GUIAsset";
|
||||||
|
|
||||||
AssetBrowser.addImportingAsset(%type, %filePath, ImportAssetActions.assetItem);
|
%newAssetItem = AssetBrowser.addImportingAsset(%type, %filePath, %parentAssetItem);
|
||||||
|
|
||||||
//Used to keep tabs on what files we were trying to import, used mainly in the event of
|
//Used to keep tabs on what files we were trying to import, used mainly in the event of
|
||||||
//adjusting configs and needing to completely reprocess the import
|
//adjusting configs and needing to completely reprocess the import
|
||||||
|
|
@ -1028,6 +1057,15 @@ function ImportAssetWindow::addNewImportingAsset(%this)
|
||||||
%this.importingFilesArray.add(%filePath);
|
%this.importingFilesArray.add(%filePath);
|
||||||
|
|
||||||
AssetBrowser.onEndDropFiles();
|
AssetBrowser.onEndDropFiles();
|
||||||
|
|
||||||
|
return %newAssetItem;
|
||||||
|
}
|
||||||
|
|
||||||
|
function ImportAssetWindow::addMaterialMap(%this, %map)
|
||||||
|
{
|
||||||
|
%newAssetItem = %this.addNewImportingAsset("Image");
|
||||||
|
|
||||||
|
%newAssetItem.ImageType = %map;
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
@ -1130,8 +1168,10 @@ function ImportAssetWindow::validateAsset(%this, %id)
|
||||||
%assetItem.status = "error";
|
%assetItem.status = "error";
|
||||||
%assetItem.statusType = "DuplicateAsset";
|
%assetItem.statusType = "DuplicateAsset";
|
||||||
%assetItem.statusInfo = "Duplicate asset names found with the target module!\nAsset \"" @
|
%assetItem.statusInfo = "Duplicate asset names found with the target module!\nAsset \"" @
|
||||||
%assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!";
|
%assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" has a matching name.\nPlease rename it and try again!";
|
||||||
|
|
||||||
|
ImportActivityLog.add("Error! Asset " @ %assetItem.assetName @ " has an identically named asset in the target module");
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1156,6 +1196,8 @@ function ImportAssetWindow::validateAsset(%this, %id)
|
||||||
%assetItem.status = "error";
|
%assetItem.status = "error";
|
||||||
%assetItem.statusType = "MissingFile";
|
%assetItem.statusType = "MissingFile";
|
||||||
%assetItem.statusInfo = "Unable to find file to be imported. Please select asset file.";
|
%assetItem.statusInfo = "Unable to find file to be imported. Please select asset file.";
|
||||||
|
|
||||||
|
ImportActivityLog.add("Error! Asset " @ %assetItem.filePath @ " was not found");
|
||||||
}
|
}
|
||||||
|
|
||||||
if(%assetItem.status $= "Warning")
|
if(%assetItem.status $= "Warning")
|
||||||
|
|
@ -1163,6 +1205,8 @@ function ImportAssetWindow::validateAsset(%this, %id)
|
||||||
if(getAssetImportConfigValue("General/WarningsAsErrors", "0") == 1)
|
if(getAssetImportConfigValue("General/WarningsAsErrors", "0") == 1)
|
||||||
{
|
{
|
||||||
%assetItem.status = "error";
|
%assetItem.status = "error";
|
||||||
|
|
||||||
|
ImportActivityLog.add("Warnings treated as errors!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1250,6 +1294,8 @@ function ImportAssetWindow::checkAssetForCollision(%this, %assetItem, %id)
|
||||||
%assetItem.statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" @
|
%assetItem.statusInfo = "Duplicate asset names found with importing assets!\nAsset \"" @
|
||||||
%assetItemB.assetName @ "\" of type \"" @ %assetItemB.assetType @ "\" and \"" @
|
%assetItemB.assetName @ "\" of type \"" @ %assetItemB.assetType @ "\" and \"" @
|
||||||
%assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" have matching names.\nPlease rename one of them and try again!";
|
%assetItem.assetName @ "\" of type \"" @ %assetItem.assetType @ "\" have matching names.\nPlease rename one of them and try again!";
|
||||||
|
|
||||||
|
ImportActivityLog.add("Warning! Asset " @ %assetItem.assetName @ ", type " @ %assetItem.assetType @ " has a naming collisions with asset " @ %assetItemB.assetName @ ", type " @ %assetItemB.assetType);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
@ -1273,6 +1319,8 @@ function ImportAssetWindow::deleteImportingAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
%item = ImportAssetTree.findItemByObjectId(%assetItem);
|
%item = ImportAssetTree.findItemByObjectId(%assetItem);
|
||||||
|
|
||||||
|
ImportActivityLog.add("Deleting Importing Asset " @ %assetItem.assetName @ " and all it's child items");
|
||||||
|
|
||||||
ImportAssetTree.removeAllChildren(%item);
|
ImportAssetTree.removeAllChildren(%item);
|
||||||
ImportAssetTree.removeItem(%item);
|
ImportAssetTree.removeItem(%item);
|
||||||
|
|
||||||
|
|
@ -1285,7 +1333,7 @@ function ImportAssetWindow::deleteImportingAsset(%this, %assetItem)
|
||||||
function ImportAssetWindow::ImportAssets(%this)
|
function ImportAssetWindow::ImportAssets(%this)
|
||||||
{
|
{
|
||||||
//do the actual importing, now!
|
//do the actual importing, now!
|
||||||
%assetCount = AssetBrowser.importAssetFinalListArray.count();
|
%assetCount = ImportAssetWindow.importAssetFinalListArray.count();
|
||||||
|
|
||||||
//get the selected module data
|
//get the selected module data
|
||||||
%moduleName = AssetImportTargetModule.getText();
|
%moduleName = AssetImportTargetModule.getText();
|
||||||
|
|
@ -1326,15 +1374,15 @@ function ImportAssetWindow::doImportAssets(%this, %id)
|
||||||
%assetImportSuccessful = false;
|
%assetImportSuccessful = false;
|
||||||
%assetId = %moduleName@":"@%assetName;
|
%assetId = %moduleName@":"@%assetName;
|
||||||
|
|
||||||
if(%assetType $= "Image")
|
if(%assetType $= "ImageAsset")
|
||||||
{
|
{
|
||||||
AssetBrowser.importImageAsset(%assetItem);
|
AssetBrowser.importImageAsset(%assetItem);
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Model")
|
else if(%assetType $= "ShapeAsset")
|
||||||
{
|
{
|
||||||
AssetBrowser.importShapeAsset(%assetItem);
|
AssetBrowser.importShapeAsset(%assetItem);
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Animation")
|
else if(%assetType $= "AnimationAsset")
|
||||||
{
|
{
|
||||||
%assetPath = "data/" @ %moduleName @ "/ShapeAnimations";
|
%assetPath = "data/" @ %moduleName @ "/ShapeAnimations";
|
||||||
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
||||||
|
|
@ -1362,7 +1410,7 @@ function ImportAssetWindow::doImportAssets(%this, %id)
|
||||||
error("Unable to import asset: " @ %filePath);
|
error("Unable to import asset: " @ %filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Sound")
|
else if(%assetType $= "SoundAsset")
|
||||||
{
|
{
|
||||||
%assetPath = "data/" @ %moduleName @ "/Sounds";
|
%assetPath = "data/" @ %moduleName @ "/Sounds";
|
||||||
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
||||||
|
|
@ -1384,11 +1432,11 @@ function ImportAssetWindow::doImportAssets(%this, %id)
|
||||||
error("Unable to import asset: " @ %filePath);
|
error("Unable to import asset: " @ %filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Material")
|
else if(%assetType $= "MaterialAsset")
|
||||||
{
|
{
|
||||||
AssetBrowser.importMaterialAsset(%assetItem);
|
AssetBrowser.importMaterialAsset(%assetItem);
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Script")
|
else if(%assetType $= "ScriptAsset")
|
||||||
{
|
{
|
||||||
%assetPath = "data/" @ %moduleName @ "/Scripts";
|
%assetPath = "data/" @ %moduleName @ "/Scripts";
|
||||||
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
||||||
|
|
@ -1411,7 +1459,7 @@ function ImportAssetWindow::doImportAssets(%this, %id)
|
||||||
error("Unable to import asset: " @ %filePath);
|
error("Unable to import asset: " @ %filePath);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(%assetType $= "GUI")
|
else if(%assetType $= "GUIAsset")
|
||||||
{
|
{
|
||||||
%assetPath = "data/" @ %moduleName @ "/GUIs";
|
%assetPath = "data/" @ %moduleName @ "/GUIs";
|
||||||
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
%assetFullPath = %assetPath @ "/" @ fileName(%filePath);
|
||||||
|
|
@ -1460,7 +1508,7 @@ function ImportAssetWindow::doImportAssets(%this, %id)
|
||||||
function ImportAssetWindow::Close(%this)
|
function ImportAssetWindow::Close(%this)
|
||||||
{
|
{
|
||||||
//Some cleanup
|
//Some cleanup
|
||||||
AssetBrowser.importingFilesArray.empty();
|
ImportAssetWindow.importingFilesArray.empty();
|
||||||
|
|
||||||
Canvas.popDialog();
|
Canvas.popDialog();
|
||||||
}
|
}
|
||||||
|
|
@ -1472,13 +1520,19 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem)
|
||||||
{
|
{
|
||||||
%resolutionAction = getAssetImportConfigValue("General/DuplicatAutoResolution", "AutoPrune");
|
%resolutionAction = getAssetImportConfigValue("General/DuplicatAutoResolution", "AutoPrune");
|
||||||
|
|
||||||
|
%humanReadableStatus = %assetItem.statusType $= "DuplicateImportAsset" ? "Duplicate Import Asset" : "Duplicate Asset";
|
||||||
|
|
||||||
if(%resolutionAction $= "AutoPrune")
|
if(%resolutionAction $= "AutoPrune")
|
||||||
{
|
{
|
||||||
%this.deleteImportingAsset(%assetItem);
|
%this.deleteImportingAsset(%assetItem);
|
||||||
%this.prunedDuplicateAssets++;
|
%this.prunedDuplicateAssets++;
|
||||||
|
|
||||||
|
ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Autopruned due to " @ %humanReadableStatus);
|
||||||
}
|
}
|
||||||
else if(%resolutionAction $= "AutoRename")
|
else if(%resolutionAction $= "AutoRename")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Asset " @ %assetItem.assetName @ " was Auto-Renamed due to " @ %humanReadableStatus);
|
||||||
|
|
||||||
%noNum = stripTrailingNumber(%assetItem.assetName);
|
%noNum = stripTrailingNumber(%assetItem.assetName);
|
||||||
%num = getTrailingNumber(%assetItem.assetName);
|
%num = getTrailingNumber(%assetItem.assetName);
|
||||||
|
|
||||||
|
|
@ -1492,6 +1546,8 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem)
|
||||||
%assetItem.assetName = %noNum @ %num;
|
%assetItem.assetName = %noNum @ %num;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ImportActivityLog.add(" New name is " @ %assetItem.assetName);
|
||||||
|
|
||||||
%this.autoRenamedAssets++;
|
%this.autoRenamedAssets++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1506,9 +1562,9 @@ function ImportAssetWindow::resolveIssue(%this, %assetItem)
|
||||||
|
|
||||||
function ImportAssetWindow::findMissingFile(%this, %assetItem)
|
function ImportAssetWindow::findMissingFile(%this, %assetItem)
|
||||||
{
|
{
|
||||||
if(%assetItem.assetType $= "Model")
|
if(%assetItem.assetType $= "ShapeAsset")
|
||||||
%filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts";
|
%filters = "Shape Files(*.dae, *.cached.dts)|*.dae;*.cached.dts";
|
||||||
else if(%assetItem.assetType $= "Image")
|
else if(%assetItem.assetType $= "ImageAsset")
|
||||||
%filters = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds";
|
%filters = "Images Files(*.jpg,*.png,*.tga,*.bmp,*.dds)|*.jpg;*.png;*.tga;*.bmp;*.dds";
|
||||||
|
|
||||||
%dlg = new OpenFileDialog()
|
%dlg = new OpenFileDialog()
|
||||||
|
|
@ -1539,7 +1595,7 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem)
|
||||||
%assetItem.filePath = %fullPath;
|
%assetItem.filePath = %fullPath;
|
||||||
%assetItem.assetName = fileBase(%assetItem.filePath);
|
%assetItem.assetName = fileBase(%assetItem.filePath);
|
||||||
|
|
||||||
if(%assetItem.assetType $= "Image")
|
if(%assetItem.assetType $= "ImageAsset")
|
||||||
{
|
{
|
||||||
//See if we have anything important to update for our material parent(if we have one)
|
//See if we have anything important to update for our material parent(if we have one)
|
||||||
%treeItem = ImportAssetTree.findItemByObjectId(%assetItem);
|
%treeItem = ImportAssetTree.findItemByObjectId(%assetItem);
|
||||||
|
|
@ -1548,7 +1604,7 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem)
|
||||||
if(%parentItem != 0)
|
if(%parentItem != 0)
|
||||||
{
|
{
|
||||||
%parentAssetItem = ImportAssetTree.getItemObject(%parentItem);
|
%parentAssetItem = ImportAssetTree.getItemObject(%parentItem);
|
||||||
if(%parentAssetItem.assetType $= "Material")
|
if(%parentAssetItem.assetType $= "MaterialAsset")
|
||||||
{
|
{
|
||||||
AssetBrowser.prepareImportMaterialAsset(%parentAssetItem);
|
AssetBrowser.prepareImportMaterialAsset(%parentAssetItem);
|
||||||
}
|
}
|
||||||
|
|
@ -1559,6 +1615,27 @@ function ImportAssetWindow::findMissingFile(%this, %assetItem)
|
||||||
}
|
}
|
||||||
//
|
//
|
||||||
|
|
||||||
|
//
|
||||||
|
function ImportAssetWindow::toggleLogWindow()
|
||||||
|
{
|
||||||
|
if(AssetBrowserImportLog.isAwake())
|
||||||
|
{
|
||||||
|
Canvas.popDialog(AssetBrowserImportLog);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Canvas.pushDialog(AssetBrowserImportLog);
|
||||||
|
}
|
||||||
|
|
||||||
|
ImportLogTextList.clear();
|
||||||
|
for(%i=0; %i < ImportActivityLog.count(); %i++)
|
||||||
|
{
|
||||||
|
ImportLogTextList.addRow(%i, ImportActivityLog.getKey(%i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//
|
||||||
|
|
||||||
//
|
//
|
||||||
function ImportAssetModuleList::onWake(%this)
|
function ImportAssetModuleList::onWake(%this)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,22 @@ function ImportAssetConfigList::onSelect( %this, %id, %text )
|
||||||
{
|
{
|
||||||
//Apply our settings to the assets
|
//Apply our settings to the assets
|
||||||
echo("Changed our import config!");
|
echo("Changed our import config!");
|
||||||
AssetBrowser.importAssetUnprocessedListArray.empty();
|
|
||||||
AssetBrowser.importAssetUnprocessedListArray.duplicate(AssetBrowser.importAssetNewListArray);
|
if(ImportActivityLog.count() != 0)
|
||||||
AssetBrowser.importAssetFinalListArray.empty();
|
ImportActivityLog.add("");
|
||||||
|
|
||||||
|
ImportActivityLog.add("Asset Import Configs set to " @ %text);
|
||||||
|
ImportActivityLog.add("");
|
||||||
|
|
||||||
|
ImportAssetWindow.importAssetUnprocessedListArray.empty();
|
||||||
|
ImportAssetWindow.importAssetUnprocessedListArray.duplicate(AssetBrowser.importAssetNewListArray);
|
||||||
|
ImportAssetWindow.importAssetFinalListArray.empty();
|
||||||
|
|
||||||
ImportAssetWindow.activeImportConfigIndex = %id;
|
ImportAssetWindow.activeImportConfigIndex = %id;
|
||||||
ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id);
|
ImportAssetWindow.activeImportConfig = ImportAssetWindow.importConfigsList.getKey(%id);
|
||||||
|
|
||||||
//If we were trying to import anything, refresh it with the new config
|
//If we were trying to import anything, refresh it with the new config
|
||||||
if( AssetBrowser.importingFilesArray.count() != 0)
|
if( ImportAssetWindow.importingFilesArray.count() != 0)
|
||||||
AssetBrowser.reloadImportingFiles();
|
AssetBrowser.reloadImportingFiles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -62,6 +69,7 @@ function setupImportConfigSettingsList()
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/IgnoreMaterials", "Ignore Materials", "command", "", "", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/IgnoreMaterials", "Ignore Materials", "command", "", "", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/AlwaysPresentImageMaps", "Always Present Image Maps", "bool",
|
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/AlwaysPresentImageMaps", "Always Present Image Maps", "bool",
|
||||||
"Wether to always display all normal material map fields, even if an image isn't detected.", "", "");
|
"Wether to always display all normal material map fields, even if an image isn't detected.", "", "");
|
||||||
|
ImportAssetConfigSettingsList.addNewConfigSetting("Materials/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "");
|
||||||
|
|
||||||
//Animations
|
//Animations
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Animations/ImportAnimations", "Import Animations", "bool", "", "1", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Animations/ImportAnimations", "Import Animations", "bool", "", "1", "");
|
||||||
|
|
@ -95,7 +103,6 @@ function setupImportConfigSettingsList()
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Images/Scaling", "Scaling", "float", "", "1.0", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Images/Scaling", "Scaling", "float", "", "1.0", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Images/Compressed", "Is Compressed", "bool", "", "1", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Images/Compressed", "Is Compressed", "bool", "", "1", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Images/GenerateMaterialOnImport", "Generate Material On Import", "bool", "", "1", "");
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Images/PopulateMaterialMaps", "Populate Material Maps", "bool", "", "1", "");
|
|
||||||
|
|
||||||
//Sounds
|
//Sounds
|
||||||
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
|
ImportAssetConfigSettingsList.addNewConfigSetting("Sounds/VolumeAdjust", "Volume Adjustment", "float", "", "1.0", "");
|
||||||
|
|
@ -131,7 +138,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem)
|
||||||
ImportOptionsList.addField("AssetName", "Asset Name", "string", "", "NewAsset", "", %assetItem);
|
ImportOptionsList.addField("AssetName", "Asset Name", "string", "", "NewAsset", "", %assetItem);
|
||||||
ImportOptionsList.endGroup();
|
ImportOptionsList.endGroup();
|
||||||
|
|
||||||
if(%assetType $= "Model")
|
if(%assetType $= "ShapeAsset")
|
||||||
{
|
{
|
||||||
//Get the shape info, so we know what we're doing with the mesh
|
//Get the shape info, so we know what we're doing with the mesh
|
||||||
%shapeInfo = GetShapeInfo(%filePath);
|
%shapeInfo = GetShapeInfo(%filePath);
|
||||||
|
|
@ -168,13 +175,13 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem)
|
||||||
ImportOptionsList.endGroup();
|
ImportOptionsList.endGroup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Material")
|
else if(%assetType $= "MaterialAsset")
|
||||||
{
|
{
|
||||||
ImportOptionsList.startGroup("Material");
|
ImportOptionsList.startGroup("Material");
|
||||||
ImportOptionsList.addField("CreateComposites", "Create Composite Textures", "bool", "", "1", "", %assetConfigObj);
|
ImportOptionsList.addField("CreateComposites", "Create Composite Textures", "bool", "", "1", "", %assetConfigObj);
|
||||||
ImportOptionsList.endGroup();
|
ImportOptionsList.endGroup();
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Image")
|
else if(%assetType $= "ImageAsset")
|
||||||
{
|
{
|
||||||
ImportOptionsList.startGroup("Formatting");
|
ImportOptionsList.startGroup("Formatting");
|
||||||
ImportOptionsList.addField("ImageType", "Image Type", "string", "", "Diffuse", "", %assetConfigObj);
|
ImportOptionsList.addField("ImageType", "Image Type", "string", "", "Diffuse", "", %assetConfigObj);
|
||||||
|
|
@ -199,7 +206,7 @@ function ImportAssetOptionsWindow::editImportSettings(%this, %assetItem)
|
||||||
ImportOptionsList.addField("IgnoreMaterials", "Ignore Importing Materials that fit these naming convention.", "command", "", "1", "", %optionsObj);
|
ImportOptionsList.addField("IgnoreMaterials", "Ignore Importing Materials that fit these naming convention.", "command", "", "1", "", %optionsObj);
|
||||||
ImportOptionsList.endGroup();
|
ImportOptionsList.endGroup();
|
||||||
}
|
}
|
||||||
else if(%assetType $= "Sound")
|
else if(%assetType $= "SoundAsset")
|
||||||
{
|
{
|
||||||
ImportOptionsList.startGroup("Adjustment");
|
ImportOptionsList.startGroup("Adjustment");
|
||||||
ImportOptionsList.addField("VolumeAdjust", "VolumeAdjustment", "float", "", "1.0", "", %assetConfigObj);
|
ImportOptionsList.addField("VolumeAdjust", "VolumeAdjustment", "float", "", "1.0", "", %assetConfigObj);
|
||||||
|
|
@ -216,6 +223,12 @@ function ImportAssetOptionsWindow::saveAssetOptions(%this)
|
||||||
{
|
{
|
||||||
%success = AssetImportSettings.write();
|
%success = AssetImportSettings.write();
|
||||||
|
|
||||||
|
if(ImportActivityLog.count() != 0)
|
||||||
|
ImportActivityLog.add("");
|
||||||
|
|
||||||
|
ImportActivityLog.add("Asset Import Configs saved, refreshing Import session");
|
||||||
|
ImportActivityLog.add("");
|
||||||
|
|
||||||
ImportAssetWindow.refresh();
|
ImportAssetWindow.refresh();
|
||||||
ImportAssetOptionsWindow.setVisible(0);
|
ImportAssetOptionsWindow.setVisible(0);
|
||||||
}
|
}
|
||||||
|
|
@ -309,6 +322,7 @@ function ImportAssetConfigEditorWindow::addNewConfig(%this)
|
||||||
AssetImportSettings.setValue("Materials/UseDiffuseSuffixOnOriginImage", "1");
|
AssetImportSettings.setValue("Materials/UseDiffuseSuffixOnOriginImage", "1");
|
||||||
AssetImportSettings.setValue("Materials/UseExistingMaterials", "1");
|
AssetImportSettings.setValue("Materials/UseExistingMaterials", "1");
|
||||||
AssetImportSettings.setValue("Materials/AlwaysPresentImageMaps", "0");
|
AssetImportSettings.setValue("Materials/AlwaysPresentImageMaps", "0");
|
||||||
|
AssetImportSettings.setValue("Materials/PopulateMaterialMaps", "1");
|
||||||
|
|
||||||
//Animations
|
//Animations
|
||||||
AssetImportSettings.setValue("Animations/ImportAnimations", "1");
|
AssetImportSettings.setValue("Animations/ImportAnimations", "1");
|
||||||
|
|
@ -338,7 +352,6 @@ function ImportAssetConfigEditorWindow::addNewConfig(%this)
|
||||||
AssetImportSettings.setValue("Images/Scaling", "1.0");
|
AssetImportSettings.setValue("Images/Scaling", "1.0");
|
||||||
AssetImportSettings.setValue("Images/Compressed", "1");
|
AssetImportSettings.setValue("Images/Compressed", "1");
|
||||||
AssetImportSettings.setValue("Images/GenerateMaterialOnImport", "1");
|
AssetImportSettings.setValue("Images/GenerateMaterialOnImport", "1");
|
||||||
AssetImportSettings.setValue("Images/PopulateMaterialMaps", "1");
|
|
||||||
|
|
||||||
//Sounds
|
//Sounds
|
||||||
AssetImportSettings.setValue("Sounds/VolumeAdjust", "1.0");
|
AssetImportSettings.setValue("Sounds/VolumeAdjust", "1.0");
|
||||||
|
|
|
||||||
|
|
@ -24,7 +24,7 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
%filePath = %assetItem.filePath;
|
%filePath = %assetItem.filePath;
|
||||||
if(%filePath !$= "")
|
if(%filePath !$= "")
|
||||||
%materialAsset = AssetBrowser.addImportingAsset("Material", "", "", %noSuffixName);
|
%materialAsset = AssetBrowser.addImportingAsset("MaterialAsset", "", "", %noSuffixName);
|
||||||
|
|
||||||
%materialAsset.filePath = filePath(%assetItem.filePath) @ "/" @ %noSuffixName;
|
%materialAsset.filePath = filePath(%assetItem.filePath) @ "/" @ %noSuffixName;
|
||||||
|
|
||||||
|
|
@ -107,6 +107,15 @@ function AssetBrowser::prepareImportImageAsset(%this, %assetItem)
|
||||||
%assetItem.processed = true;
|
%assetItem.processed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function AssetBrowser::inspectImportingImageAsset(%this, %assetItem)
|
||||||
|
{
|
||||||
|
AssetImportCtrl-->NewAssetsInspector.startGroup("Image");
|
||||||
|
AssetImportCtrl-->NewAssetsInspector.addField("ImageType", "Image Type", "list", "Intended usage case of this image. Used to map to material slots and set up texture profiles.", "GUI",
|
||||||
|
"Color,Normal,Composite,Roughness,AO,Metalness,Glow,GUI,Particle,Decal", %assetItem);
|
||||||
|
|
||||||
|
AssetImportCtrl-->NewAssetsInspector.endGroup();
|
||||||
|
}
|
||||||
|
|
||||||
function AssetBrowser::importImageAsset(%this, %assetItem)
|
function AssetBrowser::importImageAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
%moduleName = AssetImportTargetModule.getText();
|
%moduleName = AssetImportTargetModule.getText();
|
||||||
|
|
|
||||||
|
|
@ -47,6 +47,8 @@ function AssetBrowser::editMaterialAsset(%this, %assetDef)
|
||||||
|
|
||||||
function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName);
|
||||||
|
|
||||||
//Iterate over to find appropriate images for
|
//Iterate over to find appropriate images for
|
||||||
|
|
||||||
//Fetch just the fileBase name
|
//Fetch just the fileBase name
|
||||||
|
|
@ -66,6 +68,9 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
//We fit the bill, ignore this material and skip it
|
//We fit the bill, ignore this material and skip it
|
||||||
%assetItem.skip = true;
|
%assetItem.skip = true;
|
||||||
|
|
||||||
|
ImportActivityLog.add(%assetItem.assetName @ " has been ignored due to config Materials/IgnoreMaterials settings");
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -73,6 +78,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
|
if(getAssetImportConfigValue("Materials/PopulateMaterialMaps", "1") == 1)
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Attempting to Auto-Populate Material Maps");
|
||||||
|
|
||||||
%materialItemId = ImportAssetTree.findItemByObjectId(%assetItem);
|
%materialItemId = ImportAssetTree.findItemByObjectId(%assetItem);
|
||||||
|
|
||||||
if(%assetItem.diffuseImageAsset $= "")
|
if(%assetItem.diffuseImageAsset $= "")
|
||||||
|
|
@ -83,6 +90,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Diffuse Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%diffuseAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%diffuseAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.diffuseImageAsset = %diffuseAsset;
|
%assetItem.diffuseImageAsset = %diffuseAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -106,6 +115,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Normal Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%normalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.normalImageAsset = %normalAsset;
|
%assetItem.normalImageAsset = %normalAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -127,6 +138,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Metalness Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%metalAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.metalImageAsset = %metalAsset;
|
%assetItem.metalImageAsset = %metalAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -148,6 +161,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Roughness Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%roughnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.roughnessImageAsset = %roughnessAsset;
|
%assetItem.roughnessImageAsset = %roughnessAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -169,6 +184,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Smoothness Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%smoothnessAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.SmoothnessImageAsset = %smoothnessAsset;
|
%assetItem.SmoothnessImageAsset = %smoothnessAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -190,6 +207,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated AO Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%AOAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.AOImageAsset = %AOAsset;
|
%assetItem.AOImageAsset = %AOAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -211,6 +230,8 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(%targetFilePath !$= "")
|
if(%targetFilePath !$= "")
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Auto-Populated Composite Map Image Asset via file: " @ %targetFilePath);
|
||||||
|
|
||||||
%compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
%compositeAsset = AssetBrowser.addImportingAsset("Image", %targetFilePath, %assetItem);
|
||||||
%assetItem.compositeImageAsset = %compositeAsset;
|
%assetItem.compositeImageAsset = %compositeAsset;
|
||||||
}
|
}
|
||||||
|
|
@ -236,6 +257,9 @@ function AssetBrowser::prepareImportMaterialAsset(%this, %assetItem)
|
||||||
|
|
||||||
%compositeAssetPath = AssetBrowser.dirHandler.currentAddress @ "/";
|
%compositeAssetPath = AssetBrowser.dirHandler.currentAddress @ "/";
|
||||||
%saveAsPath = %compositeAssetPath @ "/" @ %assetItem.assetName @ "_composite.png";
|
%saveAsPath = %compositeAssetPath @ "/" @ %assetItem.assetName @ "_composite.png";
|
||||||
|
|
||||||
|
ImportActivityLog.add("Auto-Generated Composite Map from ORM maps");
|
||||||
|
|
||||||
%compositeAsset = AssetBrowser.addImportingAsset("Image", "", %assetItem, %assetItem.assetName @ "_composite");
|
%compositeAsset = AssetBrowser.addImportingAsset("Image", "", %assetItem, %assetItem.assetName @ "_composite");
|
||||||
%compositeAsset.generatedAsset = true;
|
%compositeAsset.generatedAsset = true;
|
||||||
%compositeAsset.filePath = %saveAsPath;
|
%compositeAsset.filePath = %saveAsPath;
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,8 @@ function AssetBrowser::deleteShapeAsset(%this, %assetDef)
|
||||||
|
|
||||||
function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||||
{
|
{
|
||||||
|
ImportActivityLog.add("Preparing Shape for Import: " @ %assetItem.assetName);
|
||||||
|
|
||||||
%fileExt = fileExt(%assetItem.filePath);
|
%fileExt = fileExt(%assetItem.filePath);
|
||||||
|
|
||||||
if(!isObject(%assetItem.shapeInfo))
|
if(!isObject(%assetItem.shapeInfo))
|
||||||
|
|
@ -78,7 +80,6 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(getAssetImportConfigValue("Meshes/ImportMesh", "1") == 1 && %shapeCount > 0)
|
if(getAssetImportConfigValue("Meshes/ImportMesh", "1") == 1 && %shapeCount > 0)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
%animCount = %assetItem.shapeInfo._animCount;
|
%animCount = %assetItem.shapeInfo._animCount;
|
||||||
|
|
@ -86,28 +87,13 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||||
|
|
||||||
if(getAssetImportConfigValue("Animations/ImportAnimations", "1") == 1 && %animCount > 0)
|
if(getAssetImportConfigValue("Animations/ImportAnimations", "1") == 1 && %animCount > 0)
|
||||||
{
|
{
|
||||||
/*%animationItem = %assetItem.shapeInfo.getChild(%animItem);
|
|
||||||
|
|
||||||
%animName = %assetItem.shapeInfo.getItemText(%animationItem);
|
|
||||||
|
|
||||||
AssetBrowser.addImportingAsset("Animation", %animName, %shapeId);
|
|
||||||
|
|
||||||
%animationItem = %assetItem.shapeInfo.getNextSibling(%animationItem);
|
|
||||||
while(%animationItem != 0)
|
|
||||||
{
|
|
||||||
%animName = %assetItem.shapeInfo.getItemText(%animationItem);
|
|
||||||
//%animName = %assetItem.shapeInfo.getItemValue(%animationItem);
|
|
||||||
|
|
||||||
AssetBrowser.addImportingAsset("Animation", %animName, %shapeId);
|
|
||||||
|
|
||||||
%animationItem = %shapeInfo.getNextSibling(%animationItem);
|
|
||||||
}*/
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
%matCount = %assetItem.shapeInfo._materialCount;
|
%matCount = %assetItem.shapeInfo._materialCount;
|
||||||
%matItem = %assetItem.shapeInfo.findItemByName("Materials");
|
%matItem = %assetItem.shapeInfo.findItemByName("Materials");
|
||||||
|
|
||||||
|
ImportActivityLog.add(" Shape Info: Mesh Count: " @ %shapeCount @ " | Material Count: " @ %matCount @ " | Anim Count: " @ %animCount);
|
||||||
|
|
||||||
if(getAssetImportConfigValue("Materials/ImportMaterials", "1") == 1 && %matCount > 0)
|
if(getAssetImportConfigValue("Materials/ImportMaterials", "1") == 1 && %matCount > 0)
|
||||||
{
|
{
|
||||||
%materialItem = %assetItem.shapeInfo.getChild(%matItem);
|
%materialItem = %assetItem.shapeInfo.getChild(%matItem);
|
||||||
|
|
@ -117,23 +103,23 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||||
%filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
|
%filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
|
||||||
if(%filePath !$= "" && isFile(%filePath))
|
if(%filePath !$= "" && isFile(%filePath))
|
||||||
{
|
{
|
||||||
AssetBrowser.addImportingAsset("Material", %filePath, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//check to see if it's actually just a flat color
|
//check to see if it's actually just a flat color
|
||||||
if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
|
if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
|
||||||
{
|
{
|
||||||
AssetBrowser.addImportingAsset("Material", %matName, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//we need to try and find our material, since the shapeInfo wasn't able to find it automatically
|
//we need to try and find our material, since the shapeInfo wasn't able to find it automatically
|
||||||
%filePath = findImageFile(filePath(%assetItem.filePath), %matName);
|
%filePath = findImageFile(filePath(%assetItem.filePath), %matName);
|
||||||
if(%filePath !$= "" && isFile(%filePath))
|
if(%filePath !$= "" && isFile(%filePath))
|
||||||
AssetBrowser.addImportingAsset("Material", %filePath, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
|
||||||
else
|
else
|
||||||
AssetBrowser.addImportingAsset("Material", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -144,23 +130,23 @@ function AssetBrowser::prepareImportShapeAsset(%this, %assetItem)
|
||||||
%filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
|
%filePath = %assetItem.shapeInfo.getItemValue(%materialItem);
|
||||||
if(%filePath !$= "" && isFile(%filePath))
|
if(%filePath !$= "" && isFile(%filePath))
|
||||||
{
|
{
|
||||||
AssetBrowser.addImportingAsset("Material", %filePath, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//check to see if it's actually just a flat color
|
//check to see if it's actually just a flat color
|
||||||
if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
|
if(getWordCount(%filePath) == 4 && getWord(%filePath, 0) $= "Color:")
|
||||||
{
|
{
|
||||||
AssetBrowser.addImportingAsset("Material", %matName, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %matName, %assetItem);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
//we need to try and find our material, since the shapeInfo wasn't able to find it automatically
|
//we need to try and find our material, since the shapeInfo wasn't able to find it automatically
|
||||||
%filePath = findImageFile(filePath(%assetItem.filePath), %matName);
|
%filePath = findImageFile(filePath(%assetItem.filePath), %matName);
|
||||||
if(%filePath !$= "" && isFile(%filePath))
|
if(%filePath !$= "" && isFile(%filePath))
|
||||||
AssetBrowser.addImportingAsset("Material", %filePath, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", %filePath, %assetItem);
|
||||||
else
|
else
|
||||||
AssetBrowser.addImportingAsset("Material", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
|
AssetBrowser.addImportingAsset("MaterialAsset", filePath(%assetItem.filePath) @ "/" @ %matName, %assetItem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -202,12 +188,12 @@ function AssetBrowser::importShapeAsset(%this, %assetItem)
|
||||||
%dependencyAssetItem = ImportAssetTree.getItemObject(%childId);
|
%dependencyAssetItem = ImportAssetTree.getItemObject(%childId);
|
||||||
|
|
||||||
%depAssetType = %dependencyAssetItem.assetType;
|
%depAssetType = %dependencyAssetItem.assetType;
|
||||||
if(%depAssetType $= "Material")
|
if(%depAssetType $= "MaterialAsset")
|
||||||
{
|
{
|
||||||
%matSet = "%newAsset.materialSlot"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";";
|
%matSet = "%newAsset.materialSlot"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";";
|
||||||
eval(%matSet);
|
eval(%matSet);
|
||||||
}
|
}
|
||||||
if(%depAssetType $= "Animation")
|
if(%depAssetType $= "AnimationAsset")
|
||||||
{
|
{
|
||||||
%matSet = "%newAsset.animationSequence"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";";
|
%matSet = "%newAsset.animationSequence"@%matSlotId@"=\"@Asset="@%moduleName@":"@%dependencyAssetItem.assetName@"\";";
|
||||||
eval(%matSet);
|
eval(%matSet);
|
||||||
|
|
|
||||||
|
|
@ -48,19 +48,19 @@ function NewAssetTypeList::refresh(%this)
|
||||||
|
|
||||||
//TODO: make this more automated
|
//TODO: make this more automated
|
||||||
//%this.add("GameObject", 0);
|
//%this.add("GameObject", 0);
|
||||||
%this.add("Component", 0);
|
%this.add("ComponentAsset", 0);
|
||||||
%this.add("Image", 1);
|
%this.add("ImageAsset", 1);
|
||||||
%this.add("Material", 2);
|
%this.add("MaterialAsset", 2);
|
||||||
%this.add("Shape", 3);
|
%this.add("ShapeAsset", 3);
|
||||||
%this.add("Sound", 4);
|
%this.add("SoundAsset", 4);
|
||||||
%this.add("State Machine", 5);
|
%this.add("StateMachineAsset", 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
function NewAssetTypeList::onSelected(%this)
|
function NewAssetTypeList::onSelected(%this)
|
||||||
{
|
{
|
||||||
%assetType = %this.getText();
|
%assetType = %this.getText();
|
||||||
|
|
||||||
if(%assetType $= "Component")
|
if(%assetType $= "ComponentAsset")
|
||||||
{
|
{
|
||||||
NewComponentAssetSettings.hidden = false;
|
NewComponentAssetSettings.hidden = false;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -296,9 +296,9 @@ function AssetBrowser::buildPopupMenus(%this)
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
class = "EditorWorldMenu";
|
class = "EditorWorldMenu";
|
||||||
|
|
||||||
item[ 0 ] = "Import Legacy Game" TAB "" TAB "AssetBrowser.importLegacyGame();";
|
item[ 0 ] = "Import Project Loose Files" TAB "" TAB "AssetBrowser.importLegacyGame();";
|
||||||
Item[ 1 ] = "-";
|
Item[ 1 ] = "-";
|
||||||
item[ 2 ] = "Import new assets" TAB "" TAB "AssetBrowser.importNewAssetFile();";
|
item[ 2 ] = "Import new assets" TAB "" TAB "Canvas.pushDialog(AssetImportCtrl);";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -341,7 +341,27 @@ function AssetBrowser::buildPopupMenus(%this)
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
// Import Asset Actions
|
||||||
//
|
//
|
||||||
|
if( !isObject( ImportAssetMaterialMaps ) )
|
||||||
|
{
|
||||||
|
%this.ImportAssetActions = new PopupMenu( ImportAssetMaterialMaps )
|
||||||
|
{
|
||||||
|
superClass = "MenuBuilder";
|
||||||
|
class = "EditorWorldMenu";
|
||||||
|
|
||||||
|
item[0] = "Add Color Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Color\");";
|
||||||
|
item[1] = "Add Normal Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Normal\");";
|
||||||
|
item[2] = "Add Composite Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Composite\");";
|
||||||
|
item[3] = "Add Metalness Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Metalness\");";
|
||||||
|
item[4] = "Add AO Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"AO\");";
|
||||||
|
item[5] = "Add Roughness Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Roughness\");";
|
||||||
|
item[6] = "Add Glow Map" TAB "" TAB "ImportAssetWindow.addMaterialMap(\"Glow\");";
|
||||||
|
Item[7] = "-";
|
||||||
|
Item[8] = "Add Existing Image Asset" TAB "" TAB "ImportAssetWindow.addExistingImageAsset();";
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
if( !isObject( ImportAssetActions ) )
|
if( !isObject( ImportAssetActions ) )
|
||||||
{
|
{
|
||||||
%this.ImportAssetActions = new PopupMenu( ImportAssetActions )
|
%this.ImportAssetActions = new PopupMenu( ImportAssetActions )
|
||||||
|
|
@ -349,7 +369,8 @@ function AssetBrowser::buildPopupMenus(%this)
|
||||||
superClass = "MenuBuilder";
|
superClass = "MenuBuilder";
|
||||||
class = "EditorWorldMenu";
|
class = "EditorWorldMenu";
|
||||||
|
|
||||||
item[0] = "Add asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();";
|
item[0] = "Add New Asset" TAB "" TAB "ImportAssetWindow.addNewImportingAsset();";
|
||||||
|
item[0] = "Add Reference to Existing Asset" TAB "" TAB "ImportAssetWindow.addRefExistingAsset();";
|
||||||
item[1] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();";
|
item[1] = "Remove asset" TAB "" TAB "ImportAssetWindow.removeImportingAsset();";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -239,7 +239,7 @@
|
||||||
profile = "ToolsGuiButtonProfile";
|
profile = "ToolsGuiButtonProfile";
|
||||||
visible = "1";
|
visible = "1";
|
||||||
active = "1";
|
active = "1";
|
||||||
command = "PostFXEditor.apply(); Canvas.popDialog(PostFXEditor);";
|
command = "PostFXEditor.apply();";
|
||||||
tooltipProfile = "GuiToolTipProfile";
|
tooltipProfile = "GuiToolTipProfile";
|
||||||
tooltip = "Apply the settings and close this dialog";
|
tooltip = "Apply the settings and close this dialog";
|
||||||
hovertime = "1000";
|
hovertime = "1000";
|
||||||
|
|
|
||||||
|
|
@ -649,6 +649,8 @@ new GuiControlProfile( ToolsGuiTextPadProfile )
|
||||||
fontColor = EditorSettings.value("Theme/fieldTextColor");
|
fontColor = EditorSettings.value("Theme/fieldTextColor");
|
||||||
fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");
|
fontColorHL = EditorSettings.value("Theme/fieldTextHLColor");
|
||||||
fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor");
|
fontColorSEL = EditorSettings.value("Theme/fieldTextSELColor");
|
||||||
|
|
||||||
|
cursorColor = EditorSettings.value("Theme/fieldTextSELColor");
|
||||||
border = 0;
|
border = 0;
|
||||||
category = "Tools";
|
category = "Tools";
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -805,8 +805,7 @@ function ShapeEdSeqNodeTabBook::onTabSelected( %this, %name, %index )
|
||||||
{
|
{
|
||||||
case "Seq":
|
case "Seq":
|
||||||
ShapeEdPropWindow-->newBtn.ToolTip = "Add new sequence";
|
ShapeEdPropWindow-->newBtn.ToolTip = "Add new sequence";
|
||||||
//ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();";
|
ShapeEdPropWindow-->newBtn.Command = "ShapeEdSequences.onAddSequence();";
|
||||||
ShapeEdPropWindow-->newBtn.Command = "AssetBrowser.showDialog(\"ShapeAnimationAsset\", \"onAddAnimationAssetShapeEditor\", \"\", \"\", \"\");";
|
|
||||||
ShapeEdPropWindow-->newBtn.setActive( true );
|
ShapeEdPropWindow-->newBtn.setActive( true );
|
||||||
ShapeEdPropWindow-->deleteBtn.ToolTip = "Delete selected sequence (cannot be undone)";
|
ShapeEdPropWindow-->deleteBtn.ToolTip = "Delete selected sequence (cannot be undone)";
|
||||||
ShapeEdPropWindow-->deleteBtn.Command = "ShapeEdSequences.onDeleteSequence();";
|
ShapeEdPropWindow-->deleteBtn.Command = "ShapeEdSequences.onDeleteSequence();";
|
||||||
|
|
@ -1651,7 +1650,8 @@ function ShapeEdSequences::onAddSequence( %this, %name )
|
||||||
if ( %from $= "" )
|
if ( %from $= "" )
|
||||||
{
|
{
|
||||||
// No sequence selected => open dialog to browse for one
|
// No sequence selected => open dialog to browse for one
|
||||||
getLoadFormatFilename( %this @ ".onAddSequenceFromBrowse", ShapeEdFromMenu.lastPath );
|
//getLoadFormatFilename( %this @ ".onAddSequenceFromBrowse", ShapeEdFromMenu.lastPath );
|
||||||
|
AssetBrowser.showDialog("ShapeAnimationAsset", "onAddAnimationAssetShapeEditor", "", "", "");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -242,10 +242,25 @@ function setupEditorVisibilityMenu()
|
||||||
item[ 12 ] = "Probes" TAB EVisibilityProbesOptions;
|
item[ 12 ] = "Probes" TAB EVisibilityProbesOptions;
|
||||||
item[ 13 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions;
|
item[ 13 ] = "Buffer Visualization" TAB EVisibilityBufferVizOptions;
|
||||||
item[ 14 ] = "-" TAB "" TAB "";
|
item[ 14 ] = "-" TAB "" TAB "";
|
||||||
item[ 15 ] = "Class Visibility" TAB EVisibilityClassVizOptions;
|
item[ 15 ] = "Class Visibility" TAB "" TAB "Editor_VisibilityOptionsButton::onClick();";
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function Editor_VisibilityOptionsButton::onClick(%this)
|
||||||
|
{
|
||||||
|
if ( EVisibility.visible )
|
||||||
|
{
|
||||||
|
EVisibility.setVisible(false);
|
||||||
|
//visibilityToggleBtn.setStateOn(0);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
EVisibility.setVisible(true);
|
||||||
|
//visibilityToggleBtn.setStateOn(1);
|
||||||
|
EVisibility.setExtent("200 540");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function EVisibility::onWake( %this )
|
function EVisibility::onWake( %this )
|
||||||
{
|
{
|
||||||
// Create the array if it
|
// Create the array if it
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue