|
@@ -499,6 +499,15 @@ function UVEditor::showDialog( %this, %applyCallback, %obj, %uv)
|
|
|
|
|
|
// Get the preview bitmap. Code copied from Material Selector.
|
|
|
%material = %obj.material;
|
|
|
+ if(!isObject(%material))
|
|
|
+ {
|
|
|
+ %matAssetId = %obj.materialAsset;
|
|
|
+ if(%matAssetId !$= "")
|
|
|
+ {
|
|
|
+ %matAssetDef = AssetDatabase.acquireAsset(%matAssetId);
|
|
|
+ %material = %matAssetDef.materialDefinitionName;
|
|
|
+ }
|
|
|
+ }
|
|
|
if( %material.getToneMap(0) $= "" && %material.getDiffuseMap(0) $= "" && !isObject(%material.cubemap) )
|
|
|
{
|
|
|
%previewImage = "core/images/warnmat";
|
|
@@ -507,13 +516,14 @@ function UVEditor::showDialog( %this, %applyCallback, %obj, %uv)
|
|
|
{
|
|
|
if( %material.toneMap[0] !$= "" )
|
|
|
%previewImage = %material.getToneMap(0);
|
|
|
+ else if( %material.getDiffuseMapAsset(0) !$= "" )
|
|
|
+ %previewImage = %material.getDiffuseMapAsset(0);
|
|
|
else if( %material.getDiffuseMap(0) !$= "" )
|
|
|
%previewImage = %material.getDiffuseMap(0);
|
|
|
else if( %material.cubemap.cubeFace[0] !$= "" )
|
|
|
%previewImage = %material.cubemap.cubeFace[0];
|
|
|
}
|
|
|
|
|
|
- UVEditor-->bitmapPreview.setBitmap(getAssetPreviewImage(%previewImage));
|
|
|
|
|
|
// Set up the color popup
|
|
|
%popup = UVEditor-->colorPopup;
|
|
@@ -535,6 +545,7 @@ function UVEditor::showDialog( %this, %applyCallback, %obj, %uv)
|
|
|
|
|
|
Canvas.pushDialog(UVEditorOverlay);
|
|
|
UVEditor.setVisible(1);
|
|
|
+ UVEditor-->bitmapPreview.setBitmap(getAssetPreviewImage(%previewImage));
|
|
|
}
|
|
|
|
|
|
function UVEditor::hideDialog( %this )
|