mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-04-29 16:25:42 +00:00
decal atlas support work
allow a textureCoordCount to be used raw when texrows and coumns are not >1 in order to let the transmitted vector actually be used
correct and augment editDecalDetails to now read
DecalEditorGui.editDecalDetails( %this.instanceId, %pos, %tan, %size, %uvID );
it needed the word split to begin with, and also added the uvID for instance frame tracking/overriding
same token added a getDecalFrame(%this.instanceId); method
todos: add a frame lookup and selector for the instance tab, modify decal display to account for non-square uv portions
This commit is contained in:
parent
12db0500e8
commit
82435693dd
4 changed files with 30 additions and 12 deletions
|
|
@ -406,12 +406,15 @@ void DecalData::reloadRects()
|
||||||
bool canRenderColsByFrame = false;
|
bool canRenderColsByFrame = false;
|
||||||
S32 id = 0;
|
S32 id = 0;
|
||||||
|
|
||||||
texRect[id].point.x = 0.f;
|
|
||||||
texRect[id].extent.x = 1.f;
|
if (texRows > 1 || texCols > 1)
|
||||||
texRect[id].point.y = 0.f;
|
{
|
||||||
texRect[id].extent.y = 1.f;
|
texCoordCount = (texRows * texCols) - 1;
|
||||||
|
texRect[id].point.x = 0.f;
|
||||||
texCoordCount = (texRows * texCols) - 1;
|
texRect[id].extent.x = 1.f;
|
||||||
|
texRect[id].point.y = 0.f;
|
||||||
|
texRect[id].extent.y = 1.f;
|
||||||
|
}
|
||||||
|
|
||||||
if( texCoordCount > 16 )
|
if( texCoordCount > 16 )
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -854,7 +854,7 @@ DefineEngineMethod( GuiDecalEditorCtrl, selectDecal, void, ( U32 id ), , "select
|
||||||
object->selectDecal( decalInstance );
|
object->selectDecal( decalInstance );
|
||||||
}
|
}
|
||||||
|
|
||||||
DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan,F32 size ), , "editDecalDetails( S32 )()" )
|
DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3F pos, Point3F tan, F32 size, S32 uvID), , "editDecalDetails( S32,Point3F,Point3F,F32,S32 )()" )
|
||||||
{
|
{
|
||||||
DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id];
|
DecalInstance *decalInstance = gDecalManager->mDecalInstanceVec[id];
|
||||||
if( decalInstance == NULL )
|
if( decalInstance == NULL )
|
||||||
|
|
@ -864,7 +864,8 @@ DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3
|
||||||
decalInstance->mPosition = pos;
|
decalInstance->mPosition = pos;
|
||||||
decalInstance->mTangent = tan;
|
decalInstance->mTangent = tan;
|
||||||
decalInstance->mSize = size;
|
decalInstance->mSize = size;
|
||||||
|
decalInstance->mTextureRectIdx = uvID;
|
||||||
|
|
||||||
if ( decalInstance == object->mSELDecal )
|
if ( decalInstance == object->mSELDecal )
|
||||||
object->setGizmoFocus( decalInstance );
|
object->setGizmoFocus( decalInstance );
|
||||||
|
|
||||||
|
|
@ -873,6 +874,11 @@ DefineEngineMethod( GuiDecalEditorCtrl, editDecalDetails, void, ( U32 id, Point3
|
||||||
gDecalManager->notifyDecalModified( decalInstance );
|
gDecalManager->notifyDecalModified( decalInstance );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
DefineEngineMethod(GuiDecalEditorCtrl, getDecalFrame, S32, (U32 id), , "")
|
||||||
|
{
|
||||||
|
return gDecalManager->mDecalInstanceVec[id]->mTextureRectIdx;
|
||||||
|
}
|
||||||
|
|
||||||
DefineEngineMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" )
|
DefineEngineMethod( GuiDecalEditorCtrl, getSelectionCount, S32, (), , "" )
|
||||||
{
|
{
|
||||||
if ( object->mSELDecal != NULL )
|
if ( object->mSELDecal != NULL )
|
||||||
|
|
|
||||||
|
|
@ -71,7 +71,11 @@ function ActionEditNodeDetails::doit(%this)
|
||||||
%count = getWordCount(%this.newTransformData);
|
%count = getWordCount(%this.newTransformData);
|
||||||
if(%this.instanceId !$= "" && %count == 7)
|
if(%this.instanceId !$= "" && %count == 7)
|
||||||
{
|
{
|
||||||
DecalEditorGui.editDecalDetails( %this.instanceId, %this.newTransformData );
|
%pos = getwords(%this.newTransformData,0,2);
|
||||||
|
%tan = getwords(%this.newTransformData,3,5);
|
||||||
|
%size = getword(%this.newTransformData,6);
|
||||||
|
%uvID = DecalEditorGui.getDecalFrame(%this.instanceId);
|
||||||
|
DecalEditorGui.editDecalDetails( %this.instanceId, %pos, %tan, %size, %uvID );
|
||||||
DecalEditorGui.syncNodeDetails();
|
DecalEditorGui.syncNodeDetails();
|
||||||
DecalEditorGui.selectDecal( %this.instanceId );
|
DecalEditorGui.selectDecal( %this.instanceId );
|
||||||
return true;
|
return true;
|
||||||
|
|
@ -84,7 +88,11 @@ function ActionEditNodeDetails::undo(%this)
|
||||||
%count = getWordCount(%this.oldTransformData);
|
%count = getWordCount(%this.oldTransformData);
|
||||||
if(%this.instanceId !$= "" && %count == 7)
|
if(%this.instanceId !$= "" && %count == 7)
|
||||||
{
|
{
|
||||||
DecalEditorGui.editDecalDetails( %this.instanceId, %this.oldTransformData );
|
%pos = getwords(%this.oldTransformData,0,2);
|
||||||
|
%tan = getwords(%this.oldTransformData,3,5);
|
||||||
|
%size = getword(%this.oldTransformData,6);
|
||||||
|
%uvID = DecalEditorGui.getDecalFrame(%this.instanceId);
|
||||||
|
DecalEditorGui.editDecalDetails( %this.instanceId, %pos, %tan, %size, %uvID );
|
||||||
DecalEditorGui.syncNodeDetails();
|
DecalEditorGui.syncNodeDetails();
|
||||||
DecalEditorGui.selectDecal( %this.instanceId );
|
DecalEditorGui.selectDecal( %this.instanceId );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -341,7 +341,8 @@ function DecalEditorGui::prepGizmoTransform( %this, %decalId, %nodeDetails )
|
||||||
// Activated in onMouseUp while gizmo is dirty
|
// Activated in onMouseUp while gizmo is dirty
|
||||||
function DecalEditorGui::completeGizmoTransform( %this, %decalId, %nodeDetails )
|
function DecalEditorGui::completeGizmoTransform( %this, %decalId, %nodeDetails )
|
||||||
{
|
{
|
||||||
DecalEditorGui.doEditNodeDetails( %decalId, %nodeDetails, true );
|
if( getWordCount(%nodeDetails) == 7 )
|
||||||
|
DecalEditorGui.doEditNodeDetails( %decalId, %nodeDetails, true );
|
||||||
}
|
}
|
||||||
|
|
||||||
function DecalEditorGui::onSleep( %this )
|
function DecalEditorGui::onSleep( %this )
|
||||||
|
|
@ -628,8 +629,8 @@ function DecalEditorGui::updateInstancePreview( %this, %material )
|
||||||
if(AssetDatabase.isDeclaredAsset(%material))
|
if(AssetDatabase.isDeclaredAsset(%material))
|
||||||
{
|
{
|
||||||
%previewImage = %material;
|
%previewImage = %material;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
DecalPreviewWindow-->instancePreview.setBitmap( getAssetPreviewImage(%previewImage) );
|
DecalPreviewWindow-->instancePreview.setBitmap( getAssetPreviewImage(%previewImage) );
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue