mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-07-11 22:54:34 +00:00
Merge pull request #302 from Areloch/soundAndAnimationAssetImport
Integrates sound and shapeAnimation assets into the importer
This commit is contained in:
commit
5544951b5d
6 changed files with 279 additions and 13 deletions
|
|
@ -9,4 +9,40 @@ function AssetBrowser::buildSoundAssetPreview(%this, %assetDef, %previewData)
|
|||
%previewData.assetFriendlyName = %assetDef.assetName;
|
||||
%previewData.assetDesc = %assetDef.description;
|
||||
%previewData.tooltip = %assetDef.assetName;
|
||||
}
|
||||
|
||||
function AssetBrowser::onSoundAssetEditorDropped(%this, %assetDef, %position)
|
||||
{
|
||||
%targetPosition = EWorldEditor.unproject(%position SPC 1000);
|
||||
%camPos = LocalClientConnection.camera.getPosition();
|
||||
%rayResult = containerRayCast(%camPos, %targetPosition, -1);
|
||||
|
||||
%pos = EWCreatorWindow.getCreateObjectPosition();
|
||||
|
||||
if(%rayResult != 0)
|
||||
{
|
||||
%pos = getWords(%rayResult, 1, 3);
|
||||
}
|
||||
else
|
||||
{
|
||||
%pos = "0 0 0";
|
||||
}
|
||||
|
||||
%assetId = %assetDef.getAssetId();
|
||||
|
||||
%newSFXEmitter = new SFXEmitter()
|
||||
{
|
||||
position = %pos;
|
||||
fileName = %assetDef.getSoundPath();
|
||||
pitch = %assetDef.pitchAdjust;
|
||||
volume = %assetDef.volumeAdjust;
|
||||
};
|
||||
|
||||
getScene(0).add(%newSFXEmitter);
|
||||
|
||||
EWorldEditor.clearSelection();
|
||||
EWorldEditor.selectObject(%newSFXEmitter);
|
||||
|
||||
EWorldEditor.isDirty = true;
|
||||
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue