Integrating latest 47acbe8
This commit is contained in:
@@ -0,0 +1,81 @@
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile].subRanges.count == 0 then
|
||||
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[2].btnImportANM.pressed()
|
||||
|
||||
|
||||
local listEntries = cryTools.cryAnim.UI.batchProcess._v.exportFiles[cryTools.cryAnim.UI.batchProcess._v.selectedFile]
|
||||
local tempStatus = ""
|
||||
|
||||
local tempCheckBeforeExport = cryTools.checkbeforeexport
|
||||
local tempSuppressWarnings = cryTools.suppresswarnings
|
||||
|
||||
cryTools.checkbeforeexport = false
|
||||
cryTools.suppresswarnings = true
|
||||
|
||||
UtilityPanel.OpenUtility CryEngine2_Exporter
|
||||
|
||||
|
||||
local tempRange = animationRange
|
||||
|
||||
if listEntries.subRanges.count == 0 then
|
||||
tempStatus = "Error: No Sub-Ranges found"
|
||||
else
|
||||
(
|
||||
|
||||
for i = 1 to listEntries.subRanges.count do
|
||||
(
|
||||
if listEntries.subRanges[i].range.start.frame == listEntries.subRanges[i].range.end.frame then
|
||||
(
|
||||
tempStatus = listEntries.subRanges[i].export + " has wrong animation range"
|
||||
continue
|
||||
)
|
||||
else
|
||||
(
|
||||
if listEntries.subRanges[i].range.start.frame > listEntries.subRanges[i].range.end.frame then
|
||||
(
|
||||
local tempTime = listEntries.subRanges[i].range.start
|
||||
listEntries.subRanges[i].range.start = listEntries.subRanges[i].range.end
|
||||
listEntries.subRanges[i].range.end = tempTime
|
||||
|
||||
cryTools.cryAnim.UI.batchProcess._f.subRangeUpdateList()
|
||||
tempStatus += "Switched Start and Stop of " + listEntries.subRanges[i].export
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
animationRange = listEntries.subRanges[i].range
|
||||
|
||||
saveMaxFile (maxFilePath + listEntries.subRangePrefix + "_" + listEntries.subRanges[i].export + ".max") quiet:true
|
||||
|
||||
local newObjects = #()
|
||||
for f = 1 to listEntries.subRanges[i].objects.count do
|
||||
(
|
||||
if (local tempNode = getNodeByName listEntries.subRanges[i].objects[f]) != undefined then
|
||||
newObjects[f] = tempNode
|
||||
else
|
||||
tempStatus += "; Can't find " + listEntries.subRanges[i].objects[f]
|
||||
)
|
||||
|
||||
|
||||
if newObjects.count > 0 then
|
||||
(
|
||||
csexport.set_node_list newObjects
|
||||
csexport.export_nodes()
|
||||
)
|
||||
else
|
||||
tempStatus += "; No Node Found"
|
||||
|
||||
deleteFile (maxFilePath + maxFileName)
|
||||
|
||||
)
|
||||
)
|
||||
animationRange = tempRange
|
||||
|
||||
cryTools.checkbeforeexport = tempCheckBeforeExport
|
||||
cryTools.suppresswarnings = tempSuppressWarnings
|
||||
|
||||
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = tempStatus
|
||||
)
|
||||
catch()
|
||||
@@ -0,0 +1,271 @@
|
||||
|
||||
struct autoLocStruct
|
||||
(
|
||||
setCon,
|
||||
getChildExtent,
|
||||
getMaxValue,
|
||||
setBodyMass,
|
||||
calcLoc,
|
||||
setLoc
|
||||
)
|
||||
|
||||
|
||||
autoLoc = autoLocStruct()
|
||||
|
||||
|
||||
autoLoc.setCon = function setCon node time =
|
||||
(
|
||||
try
|
||||
(
|
||||
for i = 1 to node.controller.keys.count do
|
||||
(
|
||||
try
|
||||
(
|
||||
tempKey = biped.getKey node.controller i
|
||||
if tempKey.time == time then
|
||||
(
|
||||
tempKey.continuity = 0
|
||||
)
|
||||
)
|
||||
catch()
|
||||
)
|
||||
)
|
||||
catch()
|
||||
)
|
||||
setCon = undefined
|
||||
|
||||
|
||||
|
||||
autoLoc.calcLoc = function calcLoc =
|
||||
(
|
||||
cycleLoc = true
|
||||
rotateLoc = #none
|
||||
posChange = false
|
||||
startLoc = #none
|
||||
locoCycle = false
|
||||
|
||||
|
||||
|
||||
at time animationRange.start
|
||||
(
|
||||
startRot = $Bip01.transform.rotation as eulerangles
|
||||
startPos = $Bip01.transform.pos
|
||||
|
||||
startLFootPos = $'Bip01 L Toe0'.transform.pos
|
||||
startRFootPos = $'Bip01 R Toe0'.transform.pos
|
||||
)
|
||||
|
||||
at time animationRange.end
|
||||
(
|
||||
endRot = $Bip01.transform.rotation as eulerangles
|
||||
endPos = $Bip01.transform.pos
|
||||
)
|
||||
|
||||
at time ((animationRange.start + animationRange.end) / 2)
|
||||
midRot = $Bip01.transform.rotation as eulerangles
|
||||
|
||||
at time 2f
|
||||
(
|
||||
startMidPos = $Bip01.transform.pos
|
||||
|
||||
startMidLFootPos = $'Bip01 L Toe0'.transform.pos
|
||||
startMidRFootPos = $'Bip01 R Toe0'.transform.pos
|
||||
)
|
||||
|
||||
at time (animationRange.end - 2)
|
||||
endMidPos = $Bip01.transform.pos
|
||||
|
||||
|
||||
|
||||
diffRot = #(endRot.x, endRot.y, endRot.z)
|
||||
diffRot[1] -= startRot.x
|
||||
diffRot[2] -= startRot.y
|
||||
diffRot[3] -= startRot.z
|
||||
|
||||
diffMidRot = #(midRot.x, midRot.y, midRot.z)
|
||||
diffMidRot[1] -= startRot.x
|
||||
diffMidRot[2] -= startRot.y
|
||||
diffMidRot[3] -= startRot.z
|
||||
|
||||
|
||||
|
||||
diffPos = endPos - startPos
|
||||
diffStartPos = startMidPos - startPos
|
||||
diffEndPos = endPos - endMidPos
|
||||
|
||||
diffLFootPos = startLFootPos - startMidLFootPos
|
||||
diffRFootPos = startRFootPos - startMidRFootPos
|
||||
|
||||
diffRotPositiv = copy diffRot #noMap
|
||||
|
||||
for i = 1 to 3 do
|
||||
(
|
||||
if diffPos[i] < 0 then diffPos[i] *= -1
|
||||
if diffPos[i] > 10 then posChange = true
|
||||
if diffRotPositiv[i] < 0 then diffRotPositiv[i] *= -1
|
||||
if diffRotPositiv[i] > 2 then cycleLoc = false
|
||||
--if diffMidRot[i] < 0 then diffMidRot[i] *= -1
|
||||
|
||||
if diffLFootPos[i] < 0 then diffLFootPos[i] *= -1
|
||||
if diffLFootPos[i] > 10 then locoCycle = true
|
||||
|
||||
if diffRFootPos[i] < 0 then diffRFootPos[i] *= -1
|
||||
if diffRFootPos[i] > 10 then locoCycle = true
|
||||
)
|
||||
|
||||
|
||||
|
||||
if cycleLoc == false then locoCycle = false
|
||||
|
||||
|
||||
diffStartPos = distance startPos startMidPos
|
||||
diffEndPos = distance endMidPos endPos
|
||||
|
||||
|
||||
|
||||
if diffStartPos < 5 and diffStartPos > 0.4 then
|
||||
(
|
||||
if locoCycle == false then
|
||||
startLoc = #start
|
||||
)
|
||||
if diffStartPos > 4 and diffEndPos < 2 then
|
||||
if locoCycle == false then
|
||||
if cycleLoc == false then
|
||||
startLoc = #stop
|
||||
|
||||
|
||||
|
||||
|
||||
if diffRot[3] < 140 and diffRot[3] > 80 then
|
||||
rotateLoc = #left
|
||||
if diffRot[3] < -40 and diffRot[3] > -100 then
|
||||
rotateLoc = #right
|
||||
|
||||
|
||||
if diffMidRot[3] > -220 and diffMidRot[3] < -140 then
|
||||
(
|
||||
if diffRot[3] < -140 and diffRot[3] > -180 then
|
||||
rotateLoc = #revL
|
||||
)
|
||||
|
||||
if diffMidRot[3] > -140 and diffMidRot[3] < -60 then
|
||||
(
|
||||
if diffRot[3] < -130 and diffRot[3] > -170 then
|
||||
rotateLoc = #revR
|
||||
)
|
||||
|
||||
-- print ("diffMidRot = " + diffMidRot as String)
|
||||
-- print ("diffRot = " + diffRot as String)
|
||||
-- print ("diffEndPos = " + diffEndPos as String)
|
||||
-- print ("diffStartPos = " + diffStartPos as String)
|
||||
-- print ("diffLFootPos = " + diffLFootPos as String)
|
||||
-- print ("diffRFootPos = " + diffRFootPos as String)
|
||||
-- print ("startLoc = " + startLoc as String)
|
||||
-- print ("rotateLoc = " + rotateLoc as String)
|
||||
-- print ("cycleLoc = " + cycleLoc as String)
|
||||
-- print ("posChange = " + posChange as String)
|
||||
-- print ("locoCycle = " + locoCycle as String)
|
||||
|
||||
|
||||
struct locStruct ( start, rotate, cycle, position )
|
||||
local tempValue = locStruct start:startLoc rotate:rotateLoc cycle:cycleLoc position:posChange
|
||||
|
||||
-- print tempValue
|
||||
|
||||
return tempValue
|
||||
)
|
||||
calcLoc = undefined
|
||||
|
||||
|
||||
autoLoc.setLoc = function setLoc =
|
||||
(
|
||||
analyseLoc = autoLoc.calcLoc()
|
||||
|
||||
cryTools.cryAnim._f.resetLocator()
|
||||
|
||||
cryTools.cryAnim._f.moveToBodyMass()
|
||||
|
||||
if analyseLoc.rotate != #none then
|
||||
(
|
||||
at time 10f
|
||||
(
|
||||
biped.setTransform $Locator_Locomotion #pos $Locator_Locomotion.transform.pos true
|
||||
autoLoc.setCon $Locator_Locomotion 10f
|
||||
)
|
||||
|
||||
at time animationRange.end
|
||||
cryTools.cryAnim._f.moveToBodyMass()
|
||||
|
||||
|
||||
with animate on
|
||||
(
|
||||
at time 16f
|
||||
(
|
||||
case analyseLoc.rotate of
|
||||
(
|
||||
#left: rotate $Locator_Locomotion (eulerangles 0 0 89)
|
||||
#right: rotate $Locator_Locomotion (eulerangles 0 0 -89)
|
||||
#revL: rotate $Locator_Locomotion (eulerangles 0 0 179)
|
||||
#revR: rotate $Locator_Locomotion (eulerangles 0 0 -179)
|
||||
)
|
||||
autoLoc.setCon $Locator_Locomotion 16f
|
||||
)
|
||||
|
||||
at time animationRange.end
|
||||
(
|
||||
case analyseLoc.rotate of
|
||||
(
|
||||
#left: rotate $Locator_Locomotion (eulerangles 0 0 89)
|
||||
#right: rotate $Locator_Locomotion (eulerangles 0 0 -89)
|
||||
#revL: rotate $Locator_Locomotion (eulerangles 0 0 179)
|
||||
#revR: rotate $Locator_Locomotion (eulerangles 0 0 -179)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
if analyseLoc.position == true then
|
||||
(
|
||||
if analyseLoc.start == #start then
|
||||
(
|
||||
at time 10f
|
||||
(
|
||||
biped.setTransform $Locator_Locomotion #pos $Locator_Locomotion.transform.pos true
|
||||
autoLoc.setCon $Locator_Locomotion 10f
|
||||
)
|
||||
|
||||
at time animationRange.end
|
||||
cryTools.cryAnim._f.moveToBodyMass()
|
||||
)
|
||||
else
|
||||
(
|
||||
at time animationRange.end
|
||||
cryTools.cryAnim._f.moveToBodyMass()
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
if analyseLoc.start == #start then
|
||||
at time animationRange.end
|
||||
cryTools.cryAnim._f.moveToBodyMass()
|
||||
)
|
||||
)
|
||||
|
||||
sliderTime = animationRange.start + 1
|
||||
sliderTime = animationRange.start
|
||||
|
||||
)
|
||||
setLoc = undefined
|
||||
|
||||
try
|
||||
autoLoc.setLoc()
|
||||
catch
|
||||
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Auto-Loc"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
try
|
||||
(
|
||||
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state = 2
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Export").pressed()
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
|
||||
tempVar = undefined
|
||||
)
|
||||
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Export" )
|
||||
@@ -0,0 +1,10 @@
|
||||
try
|
||||
(
|
||||
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state = 2
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Save").pressed()
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state = tempVar
|
||||
tempVar = undefined
|
||||
)
|
||||
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Save" )
|
||||
@@ -0,0 +1,10 @@
|
||||
try
|
||||
(
|
||||
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = 2
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Save / Export").pressed()
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
|
||||
tempVar = undefined
|
||||
)
|
||||
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Save/Export" )
|
||||
@@ -0,0 +1,16 @@
|
||||
try
|
||||
(
|
||||
if selection.count > 0 then
|
||||
local selArray = selection as Array
|
||||
else
|
||||
local selArray = Objects as Array
|
||||
|
||||
for obj in selArray do
|
||||
(
|
||||
obj.controller.position.controller = TCB_Position()
|
||||
obj.controller.rotation.controller = TCB_Rotation()
|
||||
obj.controller.scale.controller = TCB_Scale()
|
||||
)
|
||||
)
|
||||
catch
|
||||
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Setting TCB"
|
||||
@@ -0,0 +1,10 @@
|
||||
try
|
||||
(
|
||||
tempVar = (cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state = 2
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "Export").pressed()
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state = tempVar
|
||||
tempVar = undefined
|
||||
)
|
||||
catch ( cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Failed to Export" )
|
||||
@@ -0,0 +1,7 @@
|
||||
with undo off
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim._f.rotateAnim 180 range:true
|
||||
catch
|
||||
cryTools.cryAnim.UI.batchProcess._v.customScriptStatus = "Error: Rotating 180"
|
||||
)
|
||||
@@ -0,0 +1,951 @@
|
||||
-------------------------------------------------------------------------------
|
||||
-- batch8.ms #for 3DSMax v.8
|
||||
-- Version 2.4 Internal
|
||||
-- Batch Exporter for .bip and .fbx with upper body detection for upper body animations used in cryEngine
|
||||
-- By: Mathias Lindner
|
||||
-- eMail: devsupport@crytek.com
|
||||
-------------------------------------------------------------------------------
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--###############################################################################
|
||||
--// creates the dialog to customize the scripts
|
||||
--###############################################################################
|
||||
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog = function createScriptDialog dialogTitle =
|
||||
(
|
||||
try
|
||||
(
|
||||
--// rollout with edit option for the script which will be execute before exporting or at the end of check
|
||||
rollout batchProcessScriptCustomize dialogTitle
|
||||
(
|
||||
--// script container
|
||||
--edittext edScript "" pos:[2,4] height:360 width:392
|
||||
edittext edScript "" pos:[2,4] height:360 fieldWidth:392
|
||||
--// applies the script to the current scene
|
||||
button btnPreview "Preview" pos:[6,372] width:50 height:20 toolTip:"Executes the script on the current scene"
|
||||
--// applies the script to the current scene
|
||||
button btnClear "Clear" pos:[77,372] width:50 height:20 toolTip:"Clears the script in the edit box"
|
||||
--// imports other scripts
|
||||
button btnImport "Import" pos:[150,372] width:50 height:20 toolTip:"Opens a dialog to import .ms script files"
|
||||
--// saves the script and destroys dialog
|
||||
button btnCache "Cache" pos:[260,372] width:50 height:20 toolTip:"Stores the custom script in the memory"
|
||||
--// saves the script and destroys dialog
|
||||
button btnSaveAs "Save As" pos:[205,372] width:50 height:20 toolTip:"Saves the custom script in the edit box into a specific file"
|
||||
--// destroys dialog without saving
|
||||
button btnCancel "Cancel" pos:[345,372] width:50 height:20 toolTip:"Aborts the custom script generation"
|
||||
|
||||
|
||||
|
||||
on batchProcessScriptCustomize open do
|
||||
(
|
||||
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
|
||||
(
|
||||
"First Script Customization": local tempVarScript = cryTools.cryAnim.UI.batchProcess._v.firstScript
|
||||
"Second Script Customization": local tempVarScript = cryTools.cryAnim.UI.batchProcess._v.secondScript
|
||||
)
|
||||
--// if there is a defined script already
|
||||
if tempVarScript != "" then
|
||||
--// set text of the script container to the already defined script
|
||||
edScript.text = tempVarScript
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnPreview pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// tries executing the script
|
||||
tempString = execute( edScript.text )
|
||||
--print tempString
|
||||
)
|
||||
catch
|
||||
(
|
||||
--// if an error occured, print the error message
|
||||
format "*** % ***\n" (getCurrentException())
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
on btnClear pressed do
|
||||
(
|
||||
edScript.text = ""
|
||||
)
|
||||
|
||||
|
||||
on btnImport pressed do
|
||||
(
|
||||
ret = "\r\n"
|
||||
local tempVar = getOpenFileName caption:"First Script Import" filename:(getDir #scripts + "\\*.ms") types:"Script Files (*.ms)|*.ms"
|
||||
if tempVar != undefined then
|
||||
(
|
||||
cryTools.cryAnim.UI.batchProcess.customizeScript.edScript.text += ret + ret + ret +" -- Imported from " + tempVar + ret + ret
|
||||
|
||||
local tempStream = openFile tempVar mode:"r"
|
||||
while (eof tempStream) != true do
|
||||
cryTools.cryAnim.UI.batchProcess.customizeScript.edScript.text += readLine tempStream + ret
|
||||
|
||||
close tempStream
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on btnCache pressed do
|
||||
(
|
||||
local tempVar = ""
|
||||
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
|
||||
(
|
||||
"First Script Customization": ( cryTools.cryAnim.UI.batchProcess._v.firstScript = edScript.text ; tempVar = "First" )
|
||||
"Second Script Customization": ( cryTools.cryAnim.UI.batchProcess._v.secondScript = edScript.text ; tempVar = "Second" )
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:tempVar
|
||||
|
||||
--// destroys the dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
|
||||
)
|
||||
|
||||
|
||||
on btnSaveAs pressed do
|
||||
(
|
||||
local tempString = ""
|
||||
|
||||
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
|
||||
(
|
||||
"First Script Customization": tempString = "First"
|
||||
"Second Script Customization": tempString = "Second"
|
||||
)
|
||||
|
||||
local tempVar = getSaveFileName caption:"First Script Import" filename:(cryTools.buildPathFull + "Tools\\maxscript\\cryAnim\\ui\\batch\\" + tempString + "Script\\*.ms") types:"Script Files (*.ms)|*.ms"
|
||||
if tempVar != undefined then
|
||||
(
|
||||
local tempStream = openFile tempVar mode:"w"
|
||||
format edScript.text to:tempStream
|
||||
close tempStream
|
||||
|
||||
local tempFilter = filterString tempVar "\\"
|
||||
local tempString = (filterString tempFilter[tempFilter.count] ".")[1]
|
||||
|
||||
case cryTools.cryAnim.UI.batchProcess.customizeScript.title of
|
||||
(
|
||||
"First Script Customization": tempVar = "First|" + tempString
|
||||
"Second Script Customization": tempVar = "Second|" + tempString
|
||||
)
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:tempVar
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists scriptUpdate:"None"
|
||||
--// destroys the dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.customizeScript
|
||||
)
|
||||
)
|
||||
--// creates the dialog
|
||||
cryTools.cryAnim.UI.batchProcess.customizeScript = batchProcessScriptCustomize
|
||||
batchProcessScriptCustomize = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.batchProcess.customizeScript 400 400
|
||||
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess._f.createScriptDialog" )
|
||||
)
|
||||
createScriptDialog = undefined
|
||||
logOutput "> Created cryTools.cryAnim.UI.batchProcess._f.createScriptDialog function"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--###############################################################################
|
||||
--// creates the batchProcess dialog
|
||||
--###############################################################################
|
||||
cryTools.cryAnim.UI.batchProcess._f.callDialog = function callDialog =
|
||||
(
|
||||
try
|
||||
(
|
||||
--// if batchProcess is already opened, close the rollout floater
|
||||
try ( closeRolloutFloater cryTools.cryAnim.UI.batchProcess.dialog ) catch()
|
||||
--// create new batchProcess rollout floater
|
||||
cryTools.cryAnim.UI.batchProcess.dialog = newRolloutFloater "CryAnim Batch Process v2.7" 600 422
|
||||
|
||||
--// rollout with file and folder list
|
||||
rollout fileStatusRO "File Status" height:200
|
||||
(
|
||||
--// files list
|
||||
activeXControl lbFiles "MSComctlLib.ListViewCtrl" pos:[140,8] height:185 width:440
|
||||
--// sub folders list
|
||||
activeXControl lbSubFolders "MSComctlLib.TreeCtrl" pos:[8,8] height:185 width:120
|
||||
|
||||
|
||||
|
||||
on fileStatusRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// initialise
|
||||
lbFiles.GridLines = true
|
||||
lbFiles.MousePointer = #ccArrow
|
||||
lbFiles.AllowColumnReorder = true
|
||||
lbFiles.view = #lvwReport
|
||||
lbFiles.LabelEdit = #lvwManual
|
||||
lbFiles.LabelWrap = true
|
||||
lbFiles.MultiSelect = true
|
||||
lbFiles.FullRowSelect = true
|
||||
|
||||
|
||||
lbSubFolders.LineStyle = #tvwTreeLines
|
||||
lbSubFolders.Style = #tvwTreelinesPlusMinusText
|
||||
lbSubFolders.sorted = true
|
||||
lbSubFolders.checkboxes = true
|
||||
lbSubFolders.Indentation = 50
|
||||
|
||||
|
||||
--// adds columns
|
||||
lbFiles.columnHeaders.Add text:"Filename"
|
||||
lbFiles.columnHeaders.Add text:"Bone"
|
||||
lbFiles.columnHeaders.Add text:"Export"
|
||||
lbFiles.columnHeaders.Add text:"Ext"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.open" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on lbFiles Click do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// gets the cursor position of the active rollout part
|
||||
screenPos = getCursorPos lbFiles
|
||||
--// applies a hit test of the current mouse position
|
||||
tempItem = lbFiles.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
|
||||
|
||||
--// if nothing is selected
|
||||
if tempItem == undefined then
|
||||
(
|
||||
--// go through the files list and deselect every entry
|
||||
for i = 1 to lbFiles.ListItems.count do
|
||||
lbFiles.ListItems[i].selected = false
|
||||
)
|
||||
--// if an item is selected
|
||||
else
|
||||
(
|
||||
--// if a folder is selected, deselect it
|
||||
if tempItem.ListSubItems[3].text == "folder" then
|
||||
tempItem.selected = false
|
||||
|
||||
)
|
||||
--// update the files counter
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateCounter()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbFiles.click" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on lbSubFolders NodeCheck checkedNode do
|
||||
(
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim._v.various[120] != true then
|
||||
(
|
||||
--// if a state changes in the sub folders list, update the whole dialog
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateSubFolderSelection #set
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbSubFolders.nodeCheck" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on lbFiles DblClick do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// gets the cursor position of the active rollout part
|
||||
screenPos = getCursorPos lbFiles
|
||||
--// applies a hit test of the current mouse position
|
||||
tempItem = lbFiles.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
|
||||
|
||||
--// if an item is selected
|
||||
if tempItem != undefined then
|
||||
(
|
||||
--// if a folder is selected
|
||||
if tempItem.ListSubItems[3].text == "folder" then
|
||||
(
|
||||
--// deselect the folder
|
||||
tempItem.selected = false
|
||||
|
||||
--// go through the files list and select every on-coming entry (without folders) until another folder is reached
|
||||
for i = (tempItem.index + 1) to lbFiles.ListItems.count do
|
||||
(
|
||||
if lbFiles.ListItems[i].ListSubItems[3].text != "folder" then
|
||||
lbFiles.ListItems[i].selected = true
|
||||
else
|
||||
exit
|
||||
)
|
||||
)
|
||||
--// if no folder is selected
|
||||
else
|
||||
(
|
||||
--// go through the list and select every entry without folders
|
||||
for i = 1 to lbFiles.ListItems.count do
|
||||
if lbFiles.ListItems[i].ListSubItems[3].text != "folder" then
|
||||
lbFiles.ListItems[i].selected = true
|
||||
)
|
||||
)
|
||||
--// update the files counter
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateCounter()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.fileStatusRO.lbFiles.dblClick" )
|
||||
)
|
||||
|
||||
)
|
||||
logOutput "> Created fileStatusRO rollout"
|
||||
|
||||
|
||||
|
||||
|
||||
--// rollout with paths, file mask and pre export script
|
||||
rollout inputOutputRO "Input / Output" height:50
|
||||
(
|
||||
--// source folder
|
||||
button btnSourceFolder "Source" pos:[8,5] width:60 height:20 toolTip:"Opens a dialog to choose the source folder"
|
||||
label labSourceFolder "No Folder selected" pos:[80,7] width:300
|
||||
--// output folder
|
||||
button btnExportFolder "Export" pos:[8,27] width:60 height:20 toolTip:"Opens a dialog to choose the export folder"
|
||||
label labExportFolder "No Folder selected" pos:[80,29] width:300
|
||||
|
||||
--// file mask
|
||||
label labFileMask "File Mask" pos:[16,52]
|
||||
edittext etFileMask "" text:"" pos:[75,50] fieldWidth:300
|
||||
|
||||
groupbox gbScripts " Process Templates " pos:[400,5] width:180 height:62
|
||||
|
||||
label labFirstOp "1." pos:[408,24]
|
||||
dropdownlist ddFirstOp "" pos:[425,21] width:150
|
||||
|
||||
label labSecondOp "2." pos:[408,46]
|
||||
dropdownlist ddSecondOp "" pos:[425,42] width:150
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on inputOutputRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// if a source path is already set
|
||||
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
|
||||
--// set text to the old source path
|
||||
labSourceFolder.text = cryTools.cryAnim.UI.batchProcess._v.sourcePath
|
||||
|
||||
--// if the ini setting for the file extension is found
|
||||
if (local tempText = cryTools.cryAnim.base.iniFile #get #batchProcessExt) != "" then
|
||||
--// set file mask to the ini setting
|
||||
etFileMask.text = tempText
|
||||
|
||||
--// if the ini setting for the source path is found
|
||||
if (tempText = cryTools.cryAnim.base.iniFile #get #batchProcessSourcePath) != "" then
|
||||
(
|
||||
--// set source string to the ini setting
|
||||
labSourceFolder.text = tempText
|
||||
cryTools.cryAnim.UI.batchProcess._v.sourcePath = tempText
|
||||
)
|
||||
else
|
||||
--// otherwise to the default string
|
||||
labSourceFolder.text = "No Source Folder selected"
|
||||
|
||||
--// if the ini setting for the export path is found
|
||||
if (tempText = cryTools.cryAnim.base.iniFile #get #batchProcessExportPath) != "" then
|
||||
(
|
||||
--// set export string to the ini setting
|
||||
labexportFolder.text = tempText
|
||||
cryTools.cryAnim.UI.batchProcess._v.exportPath = tempText
|
||||
)
|
||||
else
|
||||
--// otherwise to the default string
|
||||
labexportFolder.text = "No Export Folder selected"
|
||||
|
||||
--// updates the first and second scripts from the folders
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateScriptLists()
|
||||
|
||||
|
||||
--// fills the sub folders list
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateSubFolders()
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateSubFolderSelection #get
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.open" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnSourceFolder pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
local tempPath = ""
|
||||
--// if a source path is defined
|
||||
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
|
||||
--// set temporary path to the source path
|
||||
tempPath = cryTools.cryAnim.UI.batchProcess._v.sourcePath
|
||||
else
|
||||
--// otherwise get new directory from an input dialog
|
||||
tempPath = (cryTools.cryAnim.base.perforce cryTools.cryAnim.UI.main._v.bipSavePath #getDirectory)
|
||||
|
||||
--// temporary string gets open directory input for source path
|
||||
tempString = (getSavePath caption:"Select Source Folder" initialDir:tempPath)
|
||||
|
||||
--// if a folder is selected by the open directory
|
||||
if tempString != undefined then
|
||||
(
|
||||
--// source path is the new folder with "\"
|
||||
cryTools.cryAnim.UI.batchProcess._v.sourcePath = tempString + (if (filterString tempString "\\").count > 1 then "\\" else "")
|
||||
--// updates the export path with the converted path to the project directory
|
||||
cryTools.cryAnim.UI.batchProcess._v.exportPath = (cryTools.cryAnim.base.perforce (cryTools.cryAnim.UI.main._f.checkExport #ProductionToGame cryTools.cryAnim.UI.batchProcess._v.sourcePath) #getDirectory)
|
||||
|
||||
--// update export folder text
|
||||
labExportFolder.text = cryTools.cryAnim.UI.batchProcess._v.exportPath
|
||||
--// update source folder text
|
||||
labSourceFolder.text = cryTools.cryAnim.UI.batchProcess._v.sourcePath
|
||||
|
||||
--// set ini setting for the source path
|
||||
cryTools.cryAnim.base.iniFile #set #batchProcessSourcePath value:labSourceFolder.text
|
||||
cryTools.cryAnim.base.iniFile #set #batchProcessExportPath value:labExportFolder.text
|
||||
|
||||
if (findString labSourceFolder.text "\\") != undefined then
|
||||
(
|
||||
--// clears and fills sub folders
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateSubFolders()
|
||||
(cryTools.cryAnim.UI.batchProcess.dialog.rollouts[1].lbSubFolders.Nodes.item 0).checked = true
|
||||
--// clears and fills the file list
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
)
|
||||
)
|
||||
--// if no folder is selected
|
||||
else
|
||||
(
|
||||
--// if no export path is set before
|
||||
if cryTools.cryAnim.UI.batchProcess._v.sourcepath == undefined then
|
||||
(
|
||||
--// enable statistic button as it can be used without exporting
|
||||
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].btnProcess.enabled = true
|
||||
)
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.btnSourceFolder.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnExportFolder pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// temporary string gets open directory input for export path
|
||||
tempString = (getSavePath caption:"Select Export Folder" initialDir:cryTools.cryAnim.UI.batchProcess._v.exportPath)
|
||||
--// if a folder is selected by the open directory
|
||||
if tempString != undefined then
|
||||
(
|
||||
--// set export path to the new folder path
|
||||
cryTools.cryAnim.UI.batchProcess._v.exportPath = tempString + "\\"
|
||||
--// update exportFolder text
|
||||
labExportFolder.text = tempString + "\\"
|
||||
|
||||
--// set ini setting for the export path
|
||||
cryTools.cryAnim.base.iniFile #set #batchProcessExportPath value:labExportFolder.text
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.btnExportFolder.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on ddFirstOp selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddFirstOp.selection == ddFirstOp.items.count then
|
||||
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog "First Script Customization"
|
||||
else
|
||||
cryTools.cryAnim._v.various[33] = ddFirstOp.items[ddFirstOp.selection]
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.ddFirstOp.selected" )
|
||||
)
|
||||
|
||||
|
||||
on ddSecondOp selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddSecondOp.selection == ddSecondOp.items.count then
|
||||
cryTools.cryAnim.UI.batchProcess._f.createScriptDialog "Second Script Customization"
|
||||
else
|
||||
cryTools.cryAnim._v.various[34] = ddSecondOp.items[ddSecondOp.selection]
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.ddSecondOp.selected" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on etFileMask entered value do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// set ini setting with changed file mask
|
||||
cryTools.cryAnim.base.iniFile #set #batchProcessExt value:etFileMask.text
|
||||
--// update whole dialog with new changes
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.inputOutputRO.etFileMask.entered" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created inputOutputRO rollout"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--// rollout with all config options and check or export button
|
||||
rollout checkExportRO "Check / Export" height:60
|
||||
(
|
||||
--// files / folders groub
|
||||
label labFilesFolders "Files / Folders :" pos:[10,11]
|
||||
groupBox gbFilesFolders "" pos:[100,-1] height:32 width:230
|
||||
|
||||
--// keep the sub folder structure when exporting
|
||||
label labKeepSubFolders "Keep Sub Folders" pos:[210,11]
|
||||
checkBox chkKeepSubFolders "" pos:[300,11] checked:true
|
||||
|
||||
--// counter for selected and maximumm files
|
||||
label labCount "Count :" pos:[130,11]
|
||||
|
||||
--// bone detection for exporting specific body parts for specific file string parts
|
||||
label labBoneDetection "Bone Detection :" pos:[10,42]
|
||||
groupBox gbBoneDetection "" pos:[100,30] height:32 width:230
|
||||
|
||||
--// config bone detection, manage sets of bone detections
|
||||
button btnConfig "Config" pos:[110,41] height:17 width:70 toolTip:"Opens a dialog to configure filename/bone detection"
|
||||
--// activate automatic file detection
|
||||
label labDetect "Detect" pos:[195,43]
|
||||
checkBox chkDetect "" pos:[235,42] checked:true
|
||||
--// only files which are detected will be shown
|
||||
label labOnlyBoneDetection " + " pos:[255,43]
|
||||
checkBox chkOnlyBoneDetection "" pos:[270,42]
|
||||
--// only files which are not detected will be shown
|
||||
label labNoBoneDetection " - " pos:[290,43]
|
||||
checkBox chkNoBoneDetection "" pos:[300,42]
|
||||
|
||||
--// executes the whole export process with pre export script, but without real exporting
|
||||
button btnProcess "P R O C E S S" pos:[345,8] height:50 width:230 enabled:false toolTip:"Processes the files/selection in the list (executes scripts)"
|
||||
|
||||
|
||||
|
||||
|
||||
on checkExportRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// clears the file list
|
||||
cryTools.cryAnim.UI.batchProcess._v.exportFiles = #()
|
||||
|
||||
try
|
||||
(
|
||||
local tempSubFilter = cryTools.cryAnim.base.iniFile #get #batchProcessSubFolderSelection
|
||||
tempSubFilter = filterString tempSubFilter "#"
|
||||
|
||||
if tempSubFilter.count == 0 then
|
||||
(cryTools.cryAnim.UI.batchProcess.dialog.rollouts[1].lbSubFolders.Nodes.item 0).checked = true
|
||||
|
||||
) catch()
|
||||
|
||||
try cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkKeepSubFolders.checked = cryTools.cryAnim.base.iniFile #get #batchProcessSubFolders catch()
|
||||
|
||||
--// if a source path is internal defined
|
||||
if cryTools.cryAnim.UI.batchProcess._v.sourcePath != undefined then
|
||||
(
|
||||
--// enable check and export button
|
||||
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].btnProcess.enabled = true
|
||||
)
|
||||
|
||||
--// get bone detection set up
|
||||
local tempBoneArray = cryTools.cryAnim.base.iniFile #get #bones
|
||||
--// if a bone setup is found
|
||||
if tempBoneArray != undefined then
|
||||
(
|
||||
tempListArray = #()
|
||||
--// goes through the bone list
|
||||
for i = 1 to tempBoneArray.count do
|
||||
--// if an entry is found
|
||||
if tempBoneArray[i].name != "" then
|
||||
--// add the entry to the list
|
||||
append tempListArray tempBoneArray[i]
|
||||
|
||||
--// set new bone list
|
||||
cryTools.cryAnim.UI.batchProcess._v.boneList = tempBoneArray
|
||||
)
|
||||
|
||||
--// update whole dialog
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.open" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on chkKeepSubFolders changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #batchProcessSubFolders value:value
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkKeepSubFolder.changed" )
|
||||
)
|
||||
|
||||
|
||||
on btnProcess pressed do
|
||||
(
|
||||
try
|
||||
--// process all used files without export
|
||||
cryTools.cryAnim.UI.batchProcess._f.processFiles #statistic
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.btnProcess.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on chkOnlyBoneDetection changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// if only bone detection is activated
|
||||
if cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkOnlyBoneDetection.checked == true then
|
||||
--// no bone detection is deactivated
|
||||
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkNoBoneDetection.checked = false
|
||||
|
||||
--// updates whole dialog
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = false
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkOnlyBoneDetection.changed" )
|
||||
)
|
||||
|
||||
|
||||
on chkNoBoneDetection changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// if no bone detection is activated
|
||||
if cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkNoBoneDetection.checked == true then
|
||||
--// only bone detections is deactivated
|
||||
cryTools.cryAnim.UI.batchProcess.dialog.rollouts[3].chkOnlyBoneDetection.checked = false
|
||||
|
||||
--// updates whole dialog
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = true
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
cryTools.cryAnim.UI.batchProcess._v.flags[1] = false
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.chkNoBoneDetection.changed" )
|
||||
)
|
||||
|
||||
on btnConfig pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
--// rollout to edit the bone list entry
|
||||
rollout entryDetailsRO "Entry Details"
|
||||
(
|
||||
label labName "Name :" pos:[8,10]
|
||||
label labExternal "External :" pos:[8,30]
|
||||
label labBones "Bones :" pos:[8,50]
|
||||
|
||||
--// sets the name, file detection and bones column
|
||||
edittext edName "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 0).text pos:[70,10] fieldWidth:300
|
||||
edittext edExternal "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 1).text pos:[70,30] fieldWidth:300
|
||||
edittext edBones "" text:(cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem.SubItems.item 2).text pos:[70,50] fieldWidth:245
|
||||
--// button to pick specific bones in the scene
|
||||
button btnPickBones "Pick" pos:[323,50] height:17 width:50 toolTip:"Opens dialog to select the bone associated to the filename detection"
|
||||
|
||||
--// save the entry or cancel
|
||||
button btnSave "Save" pos:[100,80] height:20 width:80 toolTip:"Saves filename/bone detection"
|
||||
button btnCancel "Cancel" pos:[200,80] height:20 width:80 toolTip:"Aborts filename/bone detection"
|
||||
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
--// get currently selected item
|
||||
local tempItem = cryTools.cryAnim.UI.batchProcess.editBoneList.lbList.FocusedItem
|
||||
|
||||
--// set new name
|
||||
(tempItem.SubItems.item 0).text = edName.text
|
||||
--// set new file detection
|
||||
(tempItem.SubItems.item 1).text = edExternal.text
|
||||
--// set new bone list
|
||||
(tempItem.SubItems.item 2).text = edBones.text
|
||||
|
||||
local tempListArray = #()
|
||||
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateExtent()
|
||||
--// kills bone edit dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.entryDetails
|
||||
)
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
--// kills bone edit dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.entryDetails
|
||||
)
|
||||
|
||||
on btnPickBones pressed do
|
||||
(
|
||||
local tempString = ""
|
||||
--// pick node from the scene
|
||||
objArray = selectByName title:("Select Nodes") showHidden:true
|
||||
|
||||
--// if a node is selected
|
||||
if objArray != undefined then
|
||||
(
|
||||
--// goes through the nodes
|
||||
for i = 1 to objArray.count do
|
||||
--// adds the name of the node with a ";" as seperator
|
||||
tempString += objArray[i].name + (if i != objArray.count then ";" else "")
|
||||
|
||||
--// set the new bone list
|
||||
edBones.text = tempString
|
||||
)
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.batchProcess.entryDetails = entryDetailsRO
|
||||
entryDetailsRO = undefined
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--// rollout to edit the bone detection list
|
||||
rollout editBoneListRO "Edit Bone List"
|
||||
(
|
||||
--// list of all bone setups
|
||||
activeXControl lbList "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
|
||||
--// save current setup
|
||||
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Saves selected filename/bone detection entry"
|
||||
button btnDelete "Delete" pos:[150,195] height:20 width:60 toolTip:"Deletes selected entry"
|
||||
button btnDeleteAll "Delete All" pos:[220,195] height:20 width:60 toolTip:"Clears whole list"
|
||||
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Abort filename/bone detection"
|
||||
|
||||
|
||||
on editBoneListRO open do
|
||||
(
|
||||
lbList.GridLines = true
|
||||
lbList.MousePointer = #ccArrow
|
||||
lbList.AllowColumnReorder = true
|
||||
lbList.view = #lvwReport
|
||||
lbList.LabelEdit = #lvwManual
|
||||
lbList.Sorted = true
|
||||
lbList.FullRowSelect = true
|
||||
lbList.Checkboxes = true
|
||||
|
||||
--// adds columns
|
||||
lbList.columnHeaders.Add text:"Name"
|
||||
lbList.columnHeaders.Add text:"External"
|
||||
lbList.columnHeaders.Add text:"Bones"
|
||||
|
||||
--// goes through the bone list
|
||||
for i = 1 to cryTools.cryAnim.UI.batchProcess._v.boneList.count do
|
||||
(
|
||||
--// adds a new entry
|
||||
local lbListEntry = lbList.listItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].name
|
||||
|
||||
--// if entry is active
|
||||
if cryTools.cryAnim.UI.batchProcess._v.boneList[i].active == "true" then
|
||||
--// set list entry active
|
||||
lbListEntry.checked = true
|
||||
--// if entry is not active
|
||||
if cryTools.cryAnim.UI.batchProcess._v.boneList[i].active == "false" then
|
||||
--// set list entry not active
|
||||
lbListEntry.checked = false
|
||||
|
||||
--// add external entry
|
||||
lbListEntry.listSubItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].external
|
||||
--// add bone entry
|
||||
lbListEntry.listSubItems.Add text:cryTools.cryAnim.UI.batchProcess._v.boneList[i].bones
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
on lbList DblClick do
|
||||
(
|
||||
--// gets the bone list position
|
||||
screenPos = getCursorPos lbList
|
||||
--// hit test the cursor position
|
||||
tempItem = lbList.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
|
||||
|
||||
--// if an item is selected
|
||||
if tempItem != undefined then
|
||||
(
|
||||
--// creates bone entry edit
|
||||
createDialog cryTools.cryAnim.UI.batchProcess.entryDetails 385 110
|
||||
|
||||
)
|
||||
--// if no item is selected
|
||||
else
|
||||
(
|
||||
--// empty boneStruct
|
||||
tempStringArray = (boneStruct name:"" external:"" bones:"")
|
||||
tempArray = #()
|
||||
|
||||
--// get nodes to be added
|
||||
objArray = selectByName title:("Select Nodes to be added") showHidden:true
|
||||
|
||||
--// if a node is selected
|
||||
if objArray != undefined then
|
||||
(
|
||||
--// goes through node list
|
||||
for obj in objArray do
|
||||
--// add the nodes via boneStruct to a seperate list
|
||||
append tempArray (boneStruct name:obj.name external:obj.name bones:obj.name)
|
||||
|
||||
--// goes through the node list
|
||||
for i = 1 to tempArray.count do
|
||||
(
|
||||
--// adds name(s) of the node(s)
|
||||
tempStringArray.name += tempArray[i].name + (if i != tempArray.count then ";" else "")
|
||||
--// adds file detection(s)
|
||||
tempStringArray.external += tempArray[i].external + (if i != tempArray.count then ";" else "")
|
||||
--// adds bone(s) list
|
||||
tempStringArray.bones += tempArray[i].bones + (if i != tempArray.count then ";" else "")
|
||||
)
|
||||
|
||||
--// adds entry to the bone list
|
||||
local lbListEntry = lbList.ListItems.Add text:tempStringArray.name
|
||||
lbListEntry.checked = true
|
||||
lbListEntry.ListSubItems.Add text:tempStringArray.external
|
||||
lbListEntry.ListSubItems.Add text:tempStringArray.bones
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempArray = #()
|
||||
local tempList = #()
|
||||
|
||||
--// goes through the bone list
|
||||
for i = 1 to lbList.ListItems.count do
|
||||
(
|
||||
local tempItemArray = #()
|
||||
local tempItem = lbList.ListItems[i]
|
||||
|
||||
--// save checked state
|
||||
tempItemArray[1] = tempItem.checked as String
|
||||
--// if nothing is typed in, the entry will have " " to filter correctly
|
||||
if tempItem.text != "" then tempItemArray[2] = tempItem.text else tempItemArray[2] = " "
|
||||
if tempItem.ListSubItems[1].text != "" then tempItemArray[3] = tempItem.ListSubItems[1].text else tempItemArray[3] = " "
|
||||
if tempItem.ListSubItems[2].text != "" then tempItemArray[4] = tempItem.ListSubItems[2].text else tempItemArray[4] = " "
|
||||
|
||||
--// adds the entries to a seperate list
|
||||
append tempArray (boneStruct active:tempItemArray[1] name:tempItemArray[2] external:tempItemArray[3] bones:tempItemArray[4])
|
||||
)
|
||||
|
||||
--// sets ini setting
|
||||
cryTools.cryAnim.base.iniFile #set #bones value:tempArray
|
||||
--// sets new bone list
|
||||
cryTools.cryAnim.UI.batchProcess._v.boneList = tempArray
|
||||
|
||||
--// updates whole dialog
|
||||
cryTools.cryAnim.UI.batchProcess._f.updateDialog()
|
||||
|
||||
--// kills bone list edit dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.editBoneList
|
||||
|
||||
|
||||
)
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
--// goes through the bone list
|
||||
for i = 1 to lbList.ListItems.count do
|
||||
(
|
||||
--// tries to delete the selected entry
|
||||
try
|
||||
(
|
||||
if lbList.ListItems[i].selected == true then
|
||||
lbList.ListItems.Remove i
|
||||
)
|
||||
catch()
|
||||
)
|
||||
)
|
||||
|
||||
on btnDeleteAll pressed do
|
||||
(
|
||||
--// clears whole list
|
||||
lbList.ListItems.clear()
|
||||
)
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
--// kills bone list edit dialog
|
||||
destroyDialog cryTools.cryAnim.UI.batchProcess.editBoneList
|
||||
)
|
||||
)
|
||||
cryTools.cryAnim.UI.batchProcess.editBoneList = editBoneListRO
|
||||
editBoneListRO = undefined
|
||||
|
||||
--// creates bone list edit dialog
|
||||
createDialog cryTools.cryAnim.UI.batchProcess.editBoneList 443 220
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess.dialog.checkExportRO.btnConfig.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created checkExportRO rollout"
|
||||
|
||||
|
||||
--// adds all rollouts to the UI
|
||||
addRollout fileStatusRO cryTools.cryAnim.UI.batchProcess.dialog
|
||||
addRollout inputOutputRO cryTools.cryAnim.UI.batchProcess.dialog
|
||||
addRollout checkExportRO cryTools.cryAnim.UI.batchProcess.dialog
|
||||
|
||||
fileStatusRO = undefined
|
||||
inputOutputRO = undefined
|
||||
checkExportRO = undefined
|
||||
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.batchProcess._f.callDialog" )
|
||||
)
|
||||
callDialog = undefined
|
||||
logOutput "> Created cryTools.cryAnim.UI.batchProcess._f.callDialog function"
|
||||
|
||||
|
||||
|
||||
logOutput ">> batch8.ms loaded"
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,230 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control the locator
|
||||
--###############################################################################
|
||||
rollout locatorRO "Locator"
|
||||
(
|
||||
button btnCreate "Create" pos:[8,8] width:70 height:20 toolTip:"Creates Locator_Locomotion biped prop"
|
||||
button btnDelete "Delete" pos:[80,8] width:70 height:20 toolTip:"Deletes Locator_Locomotion"
|
||||
button btnAutoLoc "Auto-Locator" pos:[8,35] width:142 height:20 toolTip:"Animates the Locator_Locomotion contextual of the animation"
|
||||
button btnResetLocator "Reset Locator" pos:[8,55] width:142 height:20 toolTip:"Resets Locator_Locomotion to the origin facing in the direction the character faces"
|
||||
button btnSetToBodyMass "Move to Body Mass" pos:[8,75] width:142 height:20 toolTip:"Moves the Locator_Locomotion to the calculated body mass of Bip01"
|
||||
|
||||
|
||||
|
||||
on locatorRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Locator" "").open = cryTools.cryAnim.base.iniFile #get #locatorRO
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.open" )
|
||||
)
|
||||
|
||||
|
||||
on locatorRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #locatorRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #locatorRO
|
||||
|
||||
local lolStream = createFile "C:\\Yeah.txt"
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on btnCreate pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Bip01 != undefined then
|
||||
(
|
||||
if queryBox "Create Locator_Locomotion?" title:"Locator_Locomotion" == true then
|
||||
(
|
||||
undo "create Locator_Locomotion" on
|
||||
(
|
||||
try
|
||||
(
|
||||
local locVertArray = #([-2.60474,5.627,0], [-2.60474,5.627,5.306], [-2.60501,-5.627,5.306], [-2.60501,-5.627,2.40557e-006], [2.60475,5.627,0], [2.60475,5.627,5.306], [2.60499,-5.627,5.306], [2.605,-5.627,1.88326e-007], [-5.71044,-5.62699,5.306], [-5.71044,-5.62699,3.72612e-006], [5.71043,-5.62701,-1.24204e-006], [5.71043,-5.62701,5.306], [-9.4768e-006,-11.63,-1.24204e-006], [-9.48043e-006,-11.63,5.306])
|
||||
$Bip01.controller.figureMode = true
|
||||
$Bip01.controller.prop1Exists = false
|
||||
|
||||
tempSaveRot = $Bip01.transform.rotation
|
||||
tempBipRot = $Bip01.transform.rotation as eulerangles
|
||||
if tempBipRot.z > 0 and tempBipRot.z < 180 then
|
||||
tempBipRot.z = -90
|
||||
|
||||
biped.setTransform $Bip01 #rotation tempBipRot false
|
||||
|
||||
$Bip01.controller.prop1Exists = true
|
||||
|
||||
tempSel = biped.getNode $Bip01 20
|
||||
tempSel.name = "Locator_Locomotion"
|
||||
select tempSel
|
||||
|
||||
cryTools.cryAnim._f.resetLocator forceDir:true
|
||||
|
||||
tempPanel = getCommandPanelTaskMode()
|
||||
setCommandPanelTaskMode #modify
|
||||
|
||||
addModifier tempSel (Edit_Poly())
|
||||
|
||||
|
||||
|
||||
|
||||
tempBit = #{1..(polyOp.getNumVerts tempSel)}
|
||||
tempSel.modifiers[1].setSelection 1 tempBit
|
||||
tempSel.modifiers[1].setOperation #DeleteVertex
|
||||
tempSel.modifiers[1].commit()
|
||||
|
||||
|
||||
for i = 1 to locVertArray.count do
|
||||
(
|
||||
tempSel.modifiers[1].CreateVertex [0,0,0]
|
||||
)
|
||||
tempSel.modifiers[1].commit()
|
||||
tempSel.modifiers[1].SetEPolySelLevel #Vertex
|
||||
|
||||
for i = 1 to locVertArray.count do
|
||||
(
|
||||
tempSel.modifiers[1].SetSelection #Vertex #{}
|
||||
tempSel.modifiers[1].Select #Vertex #{i}
|
||||
tempSel.modifiers[1].Commit()
|
||||
tempSel.modifiers[1].moveSelection locVertArray[i]
|
||||
tempSel.modifiers[1].Commit()
|
||||
|
||||
)
|
||||
|
||||
tempSel.modifiers[1].CreateFace #(6,5,1)
|
||||
tempSel.modifiers[1].CreateFace #(6,1,2)
|
||||
tempSel.modifiers[1].CreateFace #(7,6,2)
|
||||
tempSel.modifiers[1].CreateFace #(2,3,7)
|
||||
tempSel.modifiers[1].CreateFace #(8,5,6)
|
||||
tempSel.modifiers[1].CreateFace #(6,7,8)
|
||||
tempSel.modifiers[1].CreateFace #(1,4,3)
|
||||
tempSel.modifiers[1].CreateFace #(3,2,1)
|
||||
tempSel.modifiers[1].CreateFace #(1, 4,5)
|
||||
tempSel.modifiers[1].CreateFace #(4,5, 8)
|
||||
tempSel.modifiers[1].CreateFace #(11,8,7)
|
||||
tempSel.modifiers[1].CreateFace #(7,12,11)
|
||||
tempSel.modifiers[1].CreateFace #(3,4, 10)
|
||||
tempSel.modifiers[1].CreateFace #(3, 9,10)
|
||||
tempSel.modifiers[1].CreateFace #(9,14,12)
|
||||
tempSel.modifiers[1].CreateFace #(11,12,14)
|
||||
tempSel.modifiers[1].CreateFace #(14,13,11)
|
||||
tempSel.modifiers[1].CreateFace #(10,13,14)
|
||||
tempSel.modifiers[1].CreateFace #(10,14,9)
|
||||
tempSel.modifiers[1].CreateFace #(10,13,11)
|
||||
|
||||
tempSel.modifiers[1].SetSelection #Vertex #{}
|
||||
tempSel.modifiers[1].SetEPolySelLevel #Object
|
||||
|
||||
tempSel.wireColor = (color 255 0 0)
|
||||
|
||||
tempSel.modifiers[1].Commit()
|
||||
|
||||
biped.setTransform $Bip01 #rotation tempSaveRot true
|
||||
|
||||
$Bip01.controller.figureMode = false
|
||||
|
||||
setCommandPanelTaskMode tempPanel
|
||||
|
||||
cryTools.cryAnim._f.resetLocator()
|
||||
|
||||
redrawviews()
|
||||
)catch (print "Error Creating Locator_Locomotion")
|
||||
)
|
||||
)
|
||||
)
|
||||
else
|
||||
messageBox "No Biped in Scene." title:"Error Creating Locator_Locomotion"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnCreate.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Bip01 != undefined then
|
||||
(
|
||||
if queryBox "Delete Locator_Locomotion?" title:"Locator_Locomotion" == true then
|
||||
(
|
||||
undo "delete Locator_Locomotion" on
|
||||
(
|
||||
try
|
||||
(
|
||||
$Bip01.controller.figureMode = true
|
||||
$Bip01.controller.prop1Exists = false
|
||||
$Bip01.controller.figureMode = false
|
||||
) catch ( print "Error Deleting Locatot_Locomtion" )
|
||||
)
|
||||
)
|
||||
)
|
||||
else
|
||||
messageBox "No Biped in Scene." title:"Error Deleting Locator_Locomotion"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnDelete.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnResetLocator pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Locator_Locomotion != undefined then
|
||||
undo "Reset Locator" on
|
||||
cryTools.cryAnim._f.resetLocator()
|
||||
else print "No Locator in Scene."
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnResetLocator.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnAutoLoc pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Locator_Locomotion != undefined then
|
||||
undo "Auto Locator" on
|
||||
try ( fileIn (cryTools.buildPathFull + "Tools\\maxscript\\cryAnim\\ui\\batch\\Scripts\\AutoLoc.ms") ) catch()
|
||||
else print "No Locator in Scene."
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnAutoLoc.pressed" )
|
||||
)
|
||||
|
||||
on btnSetToBodyMass pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Locator_Locomotion != undefined then
|
||||
undo "Move to BodyMass" on
|
||||
try ( cryTools.cryAnim._f.moveToBodyMass() ) catch( print "Can't execute: Move to Body Mass")
|
||||
else print "No Locator in Scene."
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.locatorRO.btnSetToBodyMass.pressed" )
|
||||
)
|
||||
|
||||
)
|
||||
logOutput "> Created locatorRO rollout"
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row2 locatorRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 locatorRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding locatorRO to main dialog" )
|
||||
locatorRO = undefined
|
||||
|
||||
|
||||
logOutput ">> locator.ms loaded"
|
||||
@@ -0,0 +1,651 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control models and items
|
||||
--###############################################################################
|
||||
rollout modelsRO "Models"
|
||||
(
|
||||
button btnLoadModel "Load Model" pos:[8,8] width:142 height:20 toolTip:"Loads often used models and shows dialog to edit them"
|
||||
|
||||
groupBox gbItems " Items " pos:[2,35] width:153 height:50
|
||||
dropDownList ddItemSelect "" pos:[8,55] width:142 height:21
|
||||
|
||||
|
||||
|
||||
on modelsRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Models" "").open = cryTools.cryAnim.base.iniFile #get #modelsRO) catch()
|
||||
|
||||
cryTools.cryAnim.UI.main.models._v.itemList = cryTools.cryAnim.UI.main.models._f.selectItem "" #getList
|
||||
|
||||
local tempListArray = cryTools.cryAnim.UI.main.models._v.itemList
|
||||
local tempListArray2 = #()
|
||||
|
||||
for i = 1 to tempListArray.count do
|
||||
tempListArray2[i] = tempListArray[i].name
|
||||
|
||||
|
||||
join tempListArray2 #("-------------------------------------------", "Edit Entries")
|
||||
|
||||
ddItemSelect.items = tempListArray2
|
||||
|
||||
|
||||
if (local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex) != 0 then
|
||||
ddItemSelect.selection = tempVar
|
||||
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.open" )
|
||||
)
|
||||
|
||||
on modelsRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #modelsRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #modelsRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on ddItemSelect selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if value < (ddItemSelect.items.count - 1) then
|
||||
(
|
||||
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem value #set
|
||||
if tempVar == false then
|
||||
ddItemSelect.selection = 1
|
||||
)
|
||||
else
|
||||
ddItemSelect.selection = ddItemSelect.items.count
|
||||
|
||||
|
||||
if ddItemSelect.selection == ddItemSelect.items.count then
|
||||
(
|
||||
try ( destroyDialog cryTools.cryAnim.UI.main.models.editItemList ) catch()
|
||||
|
||||
rollout editItemListRO "Edit Item List"
|
||||
(
|
||||
activeXControl lbItems "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
|
||||
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save item list"
|
||||
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Adds new entry"
|
||||
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
|
||||
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
|
||||
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit item list"
|
||||
|
||||
|
||||
|
||||
on editItemListRO open do
|
||||
(
|
||||
lbItems.GridLines = true
|
||||
lbItems.MousePointer = #ccArrow
|
||||
lbItems.AllowColumnReorder = true
|
||||
lbItems.view = #lvwReport
|
||||
lbItems.LabelEdit = #lvwManual
|
||||
lbItems.Sorted = true
|
||||
lbItems.FullRowSelect = true
|
||||
|
||||
lbItems.columnHeaders.Add text:"ID"
|
||||
lbItems.columnHeaders.Add text:"Name"
|
||||
lbItems.columnHeaders.Add text:"External"
|
||||
lbItems.columnHeaders.Add text:"Model"
|
||||
lbItems.columnHeaders.Add text:"Reference"
|
||||
lbItems.columnHeaders.Add text:"Parent"
|
||||
lbItems.columnHeaders.Add text:"Rotation"
|
||||
lbItems.columnHeaders.Add text:"Position"
|
||||
|
||||
lbItems.columnHeaders[1].width = 600
|
||||
|
||||
|
||||
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
|
||||
(
|
||||
local lbItemsEntry = lbItems.listItems.Add text:(i as String)
|
||||
lbItemsEntry.listSubItems.Add text:cryTools.cryAnim.UI.main.models._v.itemList[i].name
|
||||
lbItemsEntry.listSubItems.Add text:cryTools.cryAnim.UI.main.models._v.itemList[i].external
|
||||
|
||||
local maxCount = cryTools.cryAnim.UI.main.models._v.itemList[i].model.count
|
||||
tempStringArray = #("","","","","")
|
||||
|
||||
|
||||
for f = 1 to maxCount do
|
||||
(
|
||||
tempStringArray[1] += cryTools.cryAnim.UI.main.models._v.itemList[i].model[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[2] += cryTools.cryAnim.UI.main.models._v.itemList[i].reference[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[3] += cryTools.cryAnim.UI.main.models._v.itemList[i].parent[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[4] += cryTools.cryAnim.UI.main.models._v.itemList[i].rotation[f] as String + (if f < maxCount then ";" else "")
|
||||
tempStringArray[5] += cryTools.cryAnim.UI.main.models._v.itemList[i].position[f] as String + (if f < maxCount then ";" else "")
|
||||
)
|
||||
|
||||
|
||||
lbItemsEntry.listSubItems.Add text:tempStringArray[1]
|
||||
lbItemsEntry.listSubItems.Add text:tempStringArray[2]
|
||||
lbItemsEntry.listSubItems.Add text:tempStringArray[3]
|
||||
lbItemsEntry.listSubItems.Add text:tempStringArray[4]
|
||||
lbItemsEntry.listSubItems.Add text:tempStringArray[5]
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
|
||||
|
||||
on lbItems DblClick do
|
||||
(
|
||||
|
||||
screenPos = getCursorPos lbItems
|
||||
tempItem = lbItems.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
|
||||
|
||||
if tempItem != undefined then
|
||||
(
|
||||
try ( destroyDialog cryTools.cryAnim.UI.main.models.editDetails ) catch()
|
||||
|
||||
rollout entryDetailsRO "Entry Details"
|
||||
(
|
||||
label labID "ID :" pos:[8,10]
|
||||
label labName "Name :" pos:[8,30]
|
||||
label labExternal "External :" pos:[8,50]
|
||||
label labModel "Model :" pos:[8,70]
|
||||
label labReference "Reference :" pos:[8,90]
|
||||
label labParent "Parent :" pos:[8,110]
|
||||
label labRotation "Rotation :" pos:[8,130]
|
||||
label labPosition "Position :" pos:[8,150]
|
||||
|
||||
edittext edID "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.index as String) pos:[70,10] fieldWidth:300
|
||||
edittext edName "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[1].text pos:[70,30] fieldWidth:300
|
||||
edittext edExternal "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[2].text pos:[70,50] fieldWidth:300
|
||||
edittext edModel "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[3].text pos:[70,70] fieldWidth:300
|
||||
edittext edReference "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[4].text pos:[70,90] fieldWidth:300
|
||||
edittext edParent "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[5].text pos:[70,110] fieldWidth:300
|
||||
edittext edRotation "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[6].text pos:[70,130] fieldWidth:300
|
||||
edittext edPosition "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem.ListSubItems[7].text pos:[70,150] fieldWidth:300
|
||||
|
||||
button btnSave "Save" pos:[40,180] height:20 width:80 toolTip:"Save item to item list"
|
||||
button btnSetOffset "Set Offset" pos:[150,180] height:20 width:80 toolTip:"Generates new offset of the selected item"
|
||||
button btnCancel "Cancel" pos:[260,180] height:20 width:80 toolTip:"Aborts edit dialog for the selected item"
|
||||
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem
|
||||
|
||||
tempItem.text = edID.text
|
||||
tempItem.ListSubItems[1].text = edName.text
|
||||
tempItem.ListSubItems[2].text = edExternal.text
|
||||
tempItem.ListSubItems[3].text = edModel.text
|
||||
tempItem.ListSubItems[4].text = edReference.text
|
||||
tempItem.ListSubItems[5].text = edParent.text
|
||||
tempItem.ListSubItems[6].text = edRotation.text
|
||||
tempItem.ListSubItems[7].text = edPosition.text
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnSetOffset pressed do
|
||||
(
|
||||
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.SelectedItem
|
||||
if tempItem != undefined then
|
||||
(
|
||||
local refArray = filterString tempItem.ListSubItems[4].text ";"
|
||||
local parentArray = filterString tempItem.ListSubItems[5].text ";"
|
||||
local rotString = ""
|
||||
local posString = ""
|
||||
|
||||
for i = 1 to refArray.count do
|
||||
(
|
||||
|
||||
|
||||
local tempObj = (cryTools.cryAnim._f.createSnapshot object:(getNodeByName refArray[i]))[1]
|
||||
local tempParent = getNodeByName parentArray[i]
|
||||
|
||||
if (tempObj != undefined) and (tempParent != undefined) then
|
||||
(
|
||||
if tempParent.classID[1] != 37157 then
|
||||
(
|
||||
rotString += (in coordsys tempObj tempParent.rotation) as String + (if i < refArray.count then ";" else "")
|
||||
posString += (in coordsys tempObj tempParent.pos) as String + (if i < refArray.count then ";" else "")
|
||||
)
|
||||
)
|
||||
|
||||
try (delete tempObj)catch()
|
||||
)
|
||||
|
||||
edRotation.text = rotString
|
||||
edPosition.text = posString
|
||||
)
|
||||
else
|
||||
(
|
||||
messageBox "No Item selected." title:"Reset Offset"
|
||||
)
|
||||
index = undefined
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.entryDetails = entryDetailsRO
|
||||
entryDetailsRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.entryDetails 385 210
|
||||
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on btnAdd pressed do
|
||||
(
|
||||
local tempStringArray = (itemStruct name:"" external:"" model:"" reference:"" parent:"" rotation:"" position:"")
|
||||
local tempArray = #()
|
||||
|
||||
|
||||
local objArray = selectByName title:("Select Nodes to be added") showHidden:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterNode
|
||||
|
||||
if objArray != undefined then
|
||||
(
|
||||
local objLink = #()
|
||||
|
||||
for obj in objArray do
|
||||
(
|
||||
global tempObj = obj
|
||||
|
||||
objLink = selectByName title:("Select " + obj.name + " Reference") showHidden:true single:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterParent
|
||||
if objLink != undefined then
|
||||
(
|
||||
objRotation = (in coordsys objLink obj.rotation) as String
|
||||
objPosition = (in coordsys objLink obj.position) as String
|
||||
|
||||
objLink = objLink.name
|
||||
)
|
||||
else
|
||||
(
|
||||
objLink = ""
|
||||
objRotation = ""
|
||||
objPosition = ""
|
||||
)
|
||||
|
||||
if obj.parent != undefined then
|
||||
objParent = obj.parent.name
|
||||
else
|
||||
objParent = ""
|
||||
|
||||
append tempArray (itemStruct name:obj.name model:obj.name external:obj.name parent:objParent reference:objLink rotation:objRotation position:objPosition )
|
||||
)
|
||||
tempObj = undefined
|
||||
)
|
||||
|
||||
if tempArray.count > 0 then
|
||||
(
|
||||
tempStringArray.name = tempArray[1].name
|
||||
tempStringArray.external = tempArray[1].external
|
||||
|
||||
for i = 1 to tempArray.count do
|
||||
(
|
||||
tempStringArray.model += tempArray[i].model + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.reference += tempArray[i].reference as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.parent += tempArray[i].parent as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.rotation += tempArray[i].rotation as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.position += tempArray[i].position as String + (if i != tempArray.count then ";" else "")
|
||||
)
|
||||
|
||||
local lbItemsEntry = lbItems.ListItems.Add text:((lbItems.ListItems.count + 1) as String)
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.name
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.external
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.model
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.reference
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.parent
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.rotation
|
||||
lbItemsEntry.ListSubItems.Add text:tempStringArray.position
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempArray = #()
|
||||
local tempList = #()
|
||||
|
||||
for i = 1 to lbItems.ListItems.count do
|
||||
(
|
||||
local tempItemArray = #()
|
||||
local tempItem = lbItems.ListItems[i]
|
||||
for d = 1 to tempItem.ListSubItems.count do
|
||||
(
|
||||
if tempItem.ListSubItems[d].text != "" then tempItemArray[d] = tempItem.ListSubItems[d].text else tempItemArray[d] = " "
|
||||
)
|
||||
|
||||
append tempArray (itemStruct name:tempItemArray[1] external:tempItemArray[2] model:(filterString tempItemArray[3] ";") reference:(filterString tempItemArray[4] ";") parent:(filterString tempItemArray[5] ";") rotation:(filterString tempItemArray[6] ";") position:(filterString tempItemArray[7] ";"))
|
||||
|
||||
for f = 1 to tempArray[tempArray.count].model.count do
|
||||
(
|
||||
tempArray[tempArray.count].rotation[f] = execute (tempArray[tempArray.count].rotation[f])
|
||||
tempArray[tempArray.count].position[f] = execute (tempArray[tempArray.count].position[f])
|
||||
)
|
||||
)
|
||||
|
||||
cryTools.cryAnim.base.iniFile #set #items value:tempArray
|
||||
|
||||
cryTools.cryAnim.UI.main.models._v.itemList = tempArray
|
||||
|
||||
|
||||
|
||||
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
|
||||
append tempList cryTools.cryAnim.UI.main.models._v.itemList[i].name
|
||||
|
||||
join tempList #("-------------------------------------------", "Edit Entries")
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items = tempList
|
||||
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
|
||||
|
||||
)
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
deleteIndex = 0
|
||||
for i = 1 to lbItems.ListItems.count do
|
||||
(
|
||||
try
|
||||
(
|
||||
if lbItems.ListItems[i].selected == true then
|
||||
lbItems.ListItems.Remove i
|
||||
)
|
||||
catch()
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
|
||||
on btnDeleteAll pressed do
|
||||
(
|
||||
lbItems.ListItems.clear()
|
||||
)
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
|
||||
)
|
||||
|
||||
|
||||
on editItemListRO close do
|
||||
(
|
||||
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex
|
||||
|
||||
if tempVar != 0 then
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = tempVar
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.editItemList = editItemListRO
|
||||
editItemListRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.editItemList 443 220
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.ddItemSelect.selected" )
|
||||
)
|
||||
|
||||
|
||||
on btnLoadModel pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
rcmenu loadModelRC
|
||||
(
|
||||
|
||||
menUItem mi1 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 1))
|
||||
menUItem mi2 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 2))
|
||||
menUItem mi3 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 3))
|
||||
menUItem mi4 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 4))
|
||||
menUItem mi5 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 5))
|
||||
menUItem mi6 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 6))
|
||||
menUItem mi7 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 7))
|
||||
menUItem mi8 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 8))
|
||||
menUItem mi9 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 9))
|
||||
menUItem mi10 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 10))
|
||||
menUItem mi11 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 11))
|
||||
menUItem mi12 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 12))
|
||||
menUItem mi13 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 13))
|
||||
menUItem mi14 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 14))
|
||||
menUItem mi15 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 15))
|
||||
menUItem mi16 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 16))
|
||||
menUItem mi17 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 17))
|
||||
menUItem mi18 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 18))
|
||||
menUItem mi19 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 19))
|
||||
menUItem mi20 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 20))
|
||||
|
||||
|
||||
seperator miSep checked:false
|
||||
menUItem miEdit "Edit Entries" checked:false
|
||||
|
||||
|
||||
on loadModelRC open do
|
||||
(
|
||||
local tempPathArray = #()
|
||||
local tempArray = cryTools.cryAnim.base.iniFile #get #models
|
||||
if tempArray != "" and tempArray != undefined then
|
||||
(
|
||||
mi1.text = cryTools.cryAnim.UI.main.models._f.getEntries 1 tempArray
|
||||
mi2.text = cryTools.cryAnim.UI.main.models._f.getEntries 2 tempArray
|
||||
mi3.text = cryTools.cryAnim.UI.main.models._f.getEntries 3 tempArray
|
||||
mi4.text = cryTools.cryAnim.UI.main.models._f.getEntries 4 tempArray
|
||||
mi5.text = cryTools.cryAnim.UI.main.models._f.getEntries 5 tempArray
|
||||
mi6.text = cryTools.cryAnim.UI.main.models._f.getEntries 6 tempArray
|
||||
mi7.text = cryTools.cryAnim.UI.main.models._f.getEntries 7 tempArray
|
||||
mi8.text = cryTools.cryAnim.UI.main.models._f.getEntries 8 tempArray
|
||||
mi9.text = cryTools.cryAnim.UI.main.models._f.getEntries 9 tempArray
|
||||
mi10.text = cryTools.cryAnim.UI.main.models._f.getEntries 10 tempArray
|
||||
mi11.text = cryTools.cryAnim.UI.main.models._f.getEntries 11 tempArray
|
||||
mi12.text = cryTools.cryAnim.UI.main.models._f.getEntries 12 tempArray
|
||||
mi13.text = cryTools.cryAnim.UI.main.models._f.getEntries 13 tempArray
|
||||
mi14.text = cryTools.cryAnim.UI.main.models._f.getEntries 14 tempArray
|
||||
mi15.text = cryTools.cryAnim.UI.main.models._f.getEntries 15 tempArray
|
||||
mi16.text = cryTools.cryAnim.UI.main.models._f.getEntries 16 tempArray
|
||||
mi17.text = cryTools.cryAnim.UI.main.models._f.getEntries 17 tempArray
|
||||
mi18.text = cryTools.cryAnim.UI.main.models._f.getEntries 18 tempArray
|
||||
mi19.text = cryTools.cryAnim.UI.main.models._f.getEntries 19 tempArray
|
||||
mi20.text = cryTools.cryAnim.UI.main.models._f.getEntries 20 tempArray
|
||||
)
|
||||
|
||||
cryTools.cryAnim._v.various[17] = tempArray
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on mi1 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][1])
|
||||
on mi2 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][2])
|
||||
on mi3 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][3])
|
||||
on mi4 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][4])
|
||||
on mi5 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][5])
|
||||
on mi6 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][6])
|
||||
on mi7 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][7])
|
||||
on mi8 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][8])
|
||||
on mi9 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][9])
|
||||
on mi10 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][10])
|
||||
on mi11 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][11])
|
||||
on mi12 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][12])
|
||||
on mi13 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][13])
|
||||
on mi14 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][14])
|
||||
on mi15 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][15])
|
||||
on mi16 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][16])
|
||||
on mi17 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][17])
|
||||
on mi18 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][18])
|
||||
on mi19 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][19])
|
||||
on mi20 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][20])
|
||||
|
||||
|
||||
on miEdit picked do
|
||||
(
|
||||
rollout editModelListRO "Edit Model List"
|
||||
(
|
||||
activeXControl lbModels "MSComctlLib.ListViewCtrl" pos:[1,1] height:185 width:440
|
||||
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save model list"
|
||||
button btnDelete "Delete" pos:[150,195] height:20 width:60 toolTip:"Deletes selected entry"
|
||||
button btnDeleteAll "Delete All" pos:[220,195] height:20 width:60 toolTip:"Clears whole list"
|
||||
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit model list"
|
||||
|
||||
|
||||
|
||||
on editModelListRO open do
|
||||
(
|
||||
lbModels.GridLines = true
|
||||
lbModels.MousePointer = #ccArrow
|
||||
lbModels.AllowColumnReorder = true
|
||||
lbModels.view = #lvwReport
|
||||
lbModels.LabelEdit = #lvwAutomatic
|
||||
lbModels.Sorted = true
|
||||
lbModels.FullRowSelect = true
|
||||
|
||||
tempArray = cryTools.cryAnim.base.iniFile #get #models
|
||||
if tempArray != "" and tempArray != undefined then
|
||||
(
|
||||
for i = 1 to tempArray.count do
|
||||
(
|
||||
local lbModelsEntry = lbModels.listItems.Add text:tempArray[i].name
|
||||
lbModelsEntry.listSubItems.Add text:tempArray[i].path
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
lbModels.columnHeaders.Add text:"Name"
|
||||
lbModels.columnHeaders.Add text:"Path"
|
||||
)
|
||||
|
||||
on lbModels DblClick do
|
||||
(
|
||||
screenPos = getCursorPos lbModels
|
||||
tempItem = lbModels.hittest ((screenPos.x-2)*15) ((screenPos.y-2)*15)
|
||||
if tempItem != undefined then
|
||||
(
|
||||
for i = 1 to lbModels.ListItems.count do
|
||||
(
|
||||
if lbModels.listItems[i].selected == true then
|
||||
(
|
||||
tempValue = getOpenFileName caption:"Select Model to open" filename:lbModels.ListItems[i].listSubItems[1].text types:"3ds max (*.max)|*.max"
|
||||
if (tempValue != false) and (tempValue != undefined) then
|
||||
(
|
||||
lbModels.ListItems[i].listSubItems[1].text = tempValue
|
||||
lbModels.ListItems[i].text = cryTools.cryAnim.base.perforce tempValue #getFilename
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
lastIndex = lbModels.ListItems.count
|
||||
if lbModels.ListItems.count > 0 then
|
||||
tempPath = lbModels.ListItems[lastIndex].listSubItems[1].text
|
||||
else
|
||||
tempPath = maxFilePath + maxFileName
|
||||
|
||||
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
|
||||
if (tempValue != false) and (tempValue != undefined) then
|
||||
(
|
||||
local tempEntry = lbModels.ListItems.Add text:(cryTools.cryAnim.base.perforce tempValue #getFilename)
|
||||
tempEntry.ListSubItems.Add text:tempValue
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempArray = #()
|
||||
for i = 1 to lbModels.ListItems.count do
|
||||
append tempArray (modelPathStruct name:lbModels.ListItems[i].text path:lbModels.ListItems[i].ListSubItems[1].text)
|
||||
|
||||
cryTools.cryAnim.base.iniFile #set #models value:tempArray
|
||||
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
|
||||
)
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
deleteIndex = 0
|
||||
for i = 1 to lbModels.ListItems.count do
|
||||
(
|
||||
try
|
||||
(
|
||||
if lbModels.ListItems[i].selected == true then
|
||||
lbModels.ListItems.Remove i
|
||||
)
|
||||
catch()
|
||||
)
|
||||
)
|
||||
|
||||
on btnDeleteAll pressed do
|
||||
(
|
||||
lbModels.ListItems.clear()
|
||||
)
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
|
||||
)
|
||||
|
||||
on lbModels BeforeLabelEdit cancel do
|
||||
(
|
||||
enableAccelerators = false
|
||||
)
|
||||
|
||||
on lbModels AfterLabelEdit cancel newString do
|
||||
(
|
||||
enableAccelerators = true
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.editModelList = editModelListRO
|
||||
editModelListRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.editModelList 443 220
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.loadModelRC = loadModelRC
|
||||
loadModelRC = undefined
|
||||
|
||||
registerRightClickMenu cryTools.cryAnim.UI.main.models.loadModelRC
|
||||
|
||||
popUpMenu cryTools.cryAnim.UI.main.models.loadModelRC pos:[(mouse.screenpos[1] - 10), (mouse.screenpos[2] - 10)]
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.btnLoadModel.pressed" )
|
||||
)
|
||||
|
||||
)
|
||||
logOutput "> Created modelsRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding modelsRO to main dialog" )
|
||||
modelsRO = undefined
|
||||
|
||||
|
||||
logOutput ">> models8.ms loaded"
|
||||
@@ -0,0 +1,641 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control models and items
|
||||
--###############################################################################
|
||||
rollout modelsRO "Models"
|
||||
(
|
||||
button btnLoadModel "Load Model" pos:[8,8] width:142 height:20 toolTip:"Loads often used models and shows dialog to edit them"
|
||||
|
||||
groupBox gbItems " Items " pos:[2,35] width:153 height:50
|
||||
dropDownList ddItemSelect "" pos:[8,55] width:142 height:21
|
||||
|
||||
|
||||
|
||||
on modelsRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Models" "").open = cryTools.cryAnim.base.iniFile #get #modelsRO) catch()
|
||||
|
||||
cryTools.cryAnim.UI.main.models._v.itemList = cryTools.cryAnim.UI.main.models._f.selectItem "" #getList
|
||||
|
||||
local tempListArray = cryTools.cryAnim.UI.main.models._v.itemList
|
||||
local tempListArray2 = #()
|
||||
|
||||
for i = 1 to tempListArray.count do
|
||||
tempListArray2[i] = tempListArray[i].name
|
||||
|
||||
|
||||
join tempListArray2 #("-------------------------------------------", "Edit Entries")
|
||||
|
||||
ddItemSelect.items = tempListArray2
|
||||
|
||||
|
||||
if (local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex) != 0 then
|
||||
ddItemSelect.selection = tempVar
|
||||
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.open" )
|
||||
)
|
||||
|
||||
on modelsRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #modelsRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #modelsRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on ddItemSelect selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if value < (ddItemSelect.items.count - 1) then
|
||||
(
|
||||
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem value #set
|
||||
if tempVar == false then
|
||||
ddItemSelect.selection = 1
|
||||
)
|
||||
else
|
||||
ddItemSelect.selection = ddItemSelect.items.count
|
||||
|
||||
|
||||
if ddItemSelect.selection == ddItemSelect.items.count then
|
||||
(
|
||||
try ( destroyDialog cryTools.cryAnim.UI.main.models.editItemList ) catch()
|
||||
|
||||
rollout editItemListRO "Edit Item List"
|
||||
(
|
||||
dotNetControl lbItems "System.Windows.Forms.ListView" pos:[1,1] height:185 width:440
|
||||
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save item list"
|
||||
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Adds new entry"
|
||||
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
|
||||
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
|
||||
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit item list"
|
||||
|
||||
|
||||
|
||||
on editItemListRO open do
|
||||
(
|
||||
lbItems.GridLines = true
|
||||
lbItems.AllowColumnReorder = true
|
||||
lbItems.View = lbItems.View.Details
|
||||
lbItems.LabelEdit = false
|
||||
lbItems.LabelWrap = true
|
||||
lbItems.FullRowSelect = true
|
||||
lbItems.HideSelection = false
|
||||
lbItems.Sorting = lbItems.Sorting.Ascending
|
||||
|
||||
lbItems.Columns.Add "ID"
|
||||
lbItems.Columns.Add "Name"
|
||||
lbItems.Columns.Add "External"
|
||||
lbItems.Columns.Add "Model"
|
||||
lbItems.Columns.Add "Reference"
|
||||
lbItems.Columns.Add "Parent"
|
||||
lbItems.Columns.Add "Rotation"
|
||||
lbItems.Columns.Add "Position"
|
||||
|
||||
|
||||
|
||||
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
|
||||
(
|
||||
local lbItemsEntry = lbItems.Items.Add (i as String)
|
||||
lbItemsEntry.SubItems.Add cryTools.cryAnim.UI.main.models._v.itemList[i].name
|
||||
lbItemsEntry.SubItems.Add cryTools.cryAnim.UI.main.models._v.itemList[i].external
|
||||
|
||||
local maxCount = cryTools.cryAnim.UI.main.models._v.itemList[i].model.count
|
||||
tempStringArray = #("","","","","")
|
||||
|
||||
|
||||
for f = 1 to maxCount do
|
||||
(
|
||||
tempStringArray[1] += cryTools.cryAnim.UI.main.models._v.itemList[i].model[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[2] += cryTools.cryAnim.UI.main.models._v.itemList[i].reference[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[3] += cryTools.cryAnim.UI.main.models._v.itemList[i].parent[f] + (if f < maxCount then ";" else "")
|
||||
tempStringArray[4] += cryTools.cryAnim.UI.main.models._v.itemList[i].rotation[f] as String + (if f < maxCount then ";" else "")
|
||||
tempStringArray[5] += cryTools.cryAnim.UI.main.models._v.itemList[i].position[f] as String + (if f < maxCount then ";" else "")
|
||||
)
|
||||
|
||||
lbItemsEntry.SubItems.Add tempStringArray[1]
|
||||
lbItemsEntry.SubItems.Add tempStringArray[2]
|
||||
lbItemsEntry.SubItems.Add tempStringArray[3]
|
||||
lbItemsEntry.SubItems.Add tempStringArray[4]
|
||||
lbItemsEntry.SubItems.Add tempStringArray[5]
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtent()
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
|
||||
|
||||
on lbItems DoubleClick do
|
||||
(
|
||||
|
||||
tempItem = lbItems.FocusedItem
|
||||
tempItem.checked = not tempItem.checked
|
||||
|
||||
if tempItem != undefined then
|
||||
(
|
||||
try ( destroyDialog cryTools.cryAnim.UI.main.models.editDetails ) catch()
|
||||
|
||||
rollout entryDetailsRO "Entry Details"
|
||||
(
|
||||
label labID "ID :" pos:[8,10]
|
||||
label labName "Name :" pos:[8,30]
|
||||
label labExternal "External :" pos:[8,50]
|
||||
label labModel "Model :" pos:[8,70]
|
||||
label labReference "Reference :" pos:[8,90]
|
||||
label labParent "Parent :" pos:[8,110]
|
||||
label labRotation "Rotation :" pos:[8,130]
|
||||
label labPosition "Position :" pos:[8,150]
|
||||
|
||||
edittext edID "" text:cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.text pos:[70,10] fieldWidth:300
|
||||
edittext edName "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 1).text pos:[70,30] fieldWidth:300
|
||||
edittext edExternal "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 2).text pos:[70,50] fieldWidth:300
|
||||
edittext edModel "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 3).text pos:[70,70] fieldWidth:300
|
||||
edittext edReference "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 4).text pos:[70,90] fieldWidth:300
|
||||
edittext edParent "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 5).text pos:[70,110] fieldWidth:300
|
||||
edittext edRotation "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 6).text pos:[70,130] fieldWidth:300
|
||||
edittext edPosition "" text:(cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem.SubItems.item 7).text pos:[70,150] fieldWidth:300
|
||||
|
||||
button btnSave "Save" pos:[40,180] height:20 width:80 toolTip:"Save item to item list"
|
||||
button btnSetOffset "Set Offset" pos:[150,180] height:20 width:80 toolTip:"Generates new offset of the selected item"
|
||||
button btnCancel "Cancel" pos:[260,180] height:20 width:80 toolTip:"Aborts edit dialog for the selected item"
|
||||
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem
|
||||
|
||||
tempItem.text = edID.text
|
||||
(tempItem.SubItems.item 1).text = edName.text
|
||||
(tempItem.SubItems.item 2).text = edExternal.text
|
||||
(tempItem.SubItems.item 3).text = edModel.text
|
||||
(tempItem.SubItems.item 4).text = edReference.text
|
||||
(tempItem.SubItems.item 5).text = edParent.text
|
||||
(tempItem.SubItems.item 6).text = edRotation.text
|
||||
(tempItem.SubItems.item 7).text = edPosition.text
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtent()
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
|
||||
)
|
||||
|
||||
|
||||
on btnSetOffset pressed do
|
||||
(
|
||||
local tempItem = cryTools.cryAnim.UI.main.models.editItemList.lbItems.FocusedItem
|
||||
if tempItem != undefined then
|
||||
(
|
||||
local refArray = filterString (tempItem.SubItems.item 4).text ";"
|
||||
local parentArray = filterString (tempItem.SubItems.item 5).text ";"
|
||||
local rotString = ""
|
||||
local posString = ""
|
||||
|
||||
for i = 1 to refArray.count do
|
||||
(
|
||||
|
||||
|
||||
local tempObj = (cryTools.cryAnim._f.createSnapshot object:(getNodeByName refArray[i]))[1]
|
||||
local tempParent = getNodeByName parentArray[i]
|
||||
|
||||
if (tempObj != undefined) and (tempParent != undefined) then
|
||||
(
|
||||
if tempParent.classID[1] != 37157 then
|
||||
(
|
||||
rotString += (in coordsys tempObj tempParent.rotation) as String + (if i < refArray.count then ";" else "")
|
||||
posString += (in coordsys tempObj tempParent.pos) as String + (if i < refArray.count then ";" else "")
|
||||
)
|
||||
)
|
||||
|
||||
try (delete tempObj)catch()
|
||||
)
|
||||
|
||||
edRotation.text = rotString
|
||||
edPosition.text = posString
|
||||
)
|
||||
else
|
||||
(
|
||||
messageBox "No Item selected." title:"Reset Offset"
|
||||
)
|
||||
index = undefined
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.entryDetails
|
||||
)
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.entryDetails = entryDetailsRO
|
||||
entryDetailsRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.entryDetails 385 210
|
||||
|
||||
)
|
||||
tempItem = undefined
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnAdd pressed do
|
||||
(
|
||||
local tempStringArray = (itemStruct name:"" external:"" model:"" reference:"" parent:"" rotation:"" position:"")
|
||||
local tempArray = #()
|
||||
|
||||
|
||||
local objArray = selectByName title:("Select Nodes to be added") showHidden:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterNode
|
||||
|
||||
if objArray != undefined then
|
||||
(
|
||||
local objLink = #()
|
||||
|
||||
for obj in objArray do
|
||||
(
|
||||
global tempObj = obj
|
||||
|
||||
objLink = selectByName title:("Select " + obj.name + " Reference") showHidden:true single:true filter:cryTools.cryAnim.UI.main.models._f.selectByNameFilterParent
|
||||
if objLink != undefined then
|
||||
(
|
||||
objRotation = (in coordsys objLink obj.rotation) as String
|
||||
objPosition = (in coordsys objLink obj.position) as String
|
||||
|
||||
objLink = objLink.name
|
||||
)
|
||||
else
|
||||
(
|
||||
objLink = ""
|
||||
objRotation = ""
|
||||
objPosition = ""
|
||||
)
|
||||
|
||||
if obj.parent != undefined then
|
||||
objParent = obj.parent.name
|
||||
else
|
||||
objParent = ""
|
||||
|
||||
append tempArray (itemStruct name:obj.name model:obj.name external:obj.name parent:objParent reference:objLink rotation:objRotation position:objPosition )
|
||||
)
|
||||
tempObj = undefined
|
||||
)
|
||||
|
||||
if tempArray.count > 0 then
|
||||
(
|
||||
tempStringArray.name = tempArray[1].name
|
||||
tempStringArray.external = tempArray[1].external
|
||||
|
||||
for i = 1 to tempArray.count do
|
||||
(
|
||||
tempStringArray.model += tempArray[i].model + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.reference += tempArray[i].reference as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.parent += tempArray[i].parent as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.rotation += tempArray[i].rotation as String + (if i != tempArray.count then ";" else "")
|
||||
tempStringArray.position += tempArray[i].position as String + (if i != tempArray.count then ";" else "")
|
||||
)
|
||||
|
||||
local lbItemsEntry = lbItems.Items.Add ((lbItems.Items.count + 1) as String)
|
||||
lbItemsEntry.SubItems.Add tempStringArray.name
|
||||
lbItemsEntry.SubItems.Add tempStringArray.external
|
||||
lbItemsEntry.SubItems.Add tempStringArray.model
|
||||
lbItemsEntry.SubItems.Add tempStringArray.reference
|
||||
lbItemsEntry.SubItems.Add tempStringArray.parent
|
||||
lbItemsEntry.SubItems.Add tempStringArray.rotation
|
||||
lbItemsEntry.SubItems.Add tempStringArray.position
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtent()
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempArray = #()
|
||||
local tempList = #()
|
||||
|
||||
for i = 0 to (lbItems.Items.count - 1) do
|
||||
(
|
||||
local tempItemArray = #()
|
||||
local tempItem = lbItems.Items.item i
|
||||
for d = 1 to (tempItem.SubItems.count - 1) do
|
||||
(
|
||||
if (tempItem.SubItems.item d).text != "" then tempItemArray[d] = (tempItem.SubItems.item d).text else tempItemArray[d] = " "
|
||||
)
|
||||
|
||||
append tempArray (itemStruct name:tempItemArray[1] external:tempItemArray[2] model:(filterString tempItemArray[3] ";") reference:(filterString tempItemArray[4] ";") parent:(filterString tempItemArray[5] ";") rotation:(filterString tempItemArray[6] ";") position:(filterString tempItemArray[7] ";"))
|
||||
|
||||
for f = 1 to tempArray[tempArray.count].model.count do
|
||||
(
|
||||
tempArray[tempArray.count].rotation[f] = execute (tempArray[tempArray.count].rotation[f])
|
||||
tempArray[tempArray.count].position[f] = execute (tempArray[tempArray.count].position[f])
|
||||
)
|
||||
)
|
||||
|
||||
cryTools.cryAnim.base.iniFile #set #items value:tempArray
|
||||
|
||||
cryTools.cryAnim.UI.main.models._v.itemList = tempArray
|
||||
|
||||
|
||||
|
||||
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
|
||||
append tempList cryTools.cryAnim.UI.main.models._v.itemList[i].name
|
||||
|
||||
join tempList #("-------------------------------------------", "Edit Entries")
|
||||
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items = tempList
|
||||
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
|
||||
|
||||
|
||||
)
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
if lbItems.FocusedItem != undefined then
|
||||
lbItems.FocusedItem.remove()
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtent()
|
||||
cryTools.cryAnim.UI.main.models._f.sortList()
|
||||
)
|
||||
|
||||
on btnDeleteAll pressed do
|
||||
(
|
||||
lbItems.Items.clear()
|
||||
)
|
||||
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = (cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").items.count - 1
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editItemList
|
||||
)
|
||||
|
||||
|
||||
on editItemListRO close do
|
||||
(
|
||||
try
|
||||
(
|
||||
local tempVar = cryTools.cryAnim.UI.main.models._f.selectItem "" #getIndex
|
||||
|
||||
if tempVar != 0 then
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Models" "ddItemSelect").selection = tempVar
|
||||
)catch()
|
||||
)
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.editItemList = editItemListRO
|
||||
editItemListRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.editItemList 443 220
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.ddItemSelect.selected" )
|
||||
)
|
||||
|
||||
|
||||
on btnLoadModel pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
rcmenu loadModelRC
|
||||
(
|
||||
|
||||
menUItem mi1 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 1))
|
||||
menUItem mi2 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 2))
|
||||
menUItem mi3 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 3))
|
||||
menUItem mi4 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 4))
|
||||
menUItem mi5 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 5))
|
||||
menUItem mi6 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 6))
|
||||
menUItem mi7 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 7))
|
||||
menUItem mi8 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 8))
|
||||
menUItem mi9 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 9))
|
||||
menUItem mi10 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 10))
|
||||
menUItem mi11 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 11))
|
||||
menUItem mi12 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 12))
|
||||
menUItem mi13 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 13))
|
||||
menUItem mi14 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 14))
|
||||
menUItem mi15 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 15))
|
||||
menUItem mi16 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 16))
|
||||
menUItem mi17 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 17))
|
||||
menUItem mi18 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 18))
|
||||
menUItem mi19 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 19))
|
||||
menUItem mi20 "None" checked:false filter:(fn temp = (cryTools.cryAnim.UI.main.models._f.setVisible 20))
|
||||
|
||||
|
||||
seperator miSep checked:false
|
||||
menUItem miEdit "Edit Entries" checked:false
|
||||
|
||||
|
||||
on loadModelRC open do
|
||||
(
|
||||
tempPathArray = #()
|
||||
tempArray = cryTools.cryAnim.base.iniFile #get #models
|
||||
if tempArray != "" and tempArray != undefined then
|
||||
(
|
||||
mi1.text = cryTools.cryAnim.UI.main.models._f.getEntries 1 tempArray
|
||||
mi2.text = cryTools.cryAnim.UI.main.models._f.getEntries 2 tempArray
|
||||
mi3.text = cryTools.cryAnim.UI.main.models._f.getEntries 3 tempArray
|
||||
mi4.text = cryTools.cryAnim.UI.main.models._f.getEntries 4 tempArray
|
||||
mi5.text = cryTools.cryAnim.UI.main.models._f.getEntries 5 tempArray
|
||||
mi6.text = cryTools.cryAnim.UI.main.models._f.getEntries 6 tempArray
|
||||
mi7.text = cryTools.cryAnim.UI.main.models._f.getEntries 7 tempArray
|
||||
mi8.text = cryTools.cryAnim.UI.main.models._f.getEntries 8 tempArray
|
||||
mi9.text = cryTools.cryAnim.UI.main.models._f.getEntries 9 tempArray
|
||||
mi10.text = cryTools.cryAnim.UI.main.models._f.getEntries 10 tempArray
|
||||
mi11.text = cryTools.cryAnim.UI.main.models._f.getEntries 11 tempArray
|
||||
mi12.text = cryTools.cryAnim.UI.main.models._f.getEntries 12 tempArray
|
||||
mi13.text = cryTools.cryAnim.UI.main.models._f.getEntries 13 tempArray
|
||||
mi14.text = cryTools.cryAnim.UI.main.models._f.getEntries 14 tempArray
|
||||
mi15.text = cryTools.cryAnim.UI.main.models._f.getEntries 15 tempArray
|
||||
mi16.text = cryTools.cryAnim.UI.main.models._f.getEntries 16 tempArray
|
||||
mi17.text = cryTools.cryAnim.UI.main.models._f.getEntries 17 tempArray
|
||||
mi18.text = cryTools.cryAnim.UI.main.models._f.getEntries 18 tempArray
|
||||
mi19.text = cryTools.cryAnim.UI.main.models._f.getEntries 19 tempArray
|
||||
mi20.text = cryTools.cryAnim.UI.main.models._f.getEntries 20 tempArray
|
||||
)
|
||||
|
||||
cryTools.cryAnim._v.various[17] = tempArray
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on mi1 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][1])
|
||||
on mi2 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][2])
|
||||
on mi3 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][3])
|
||||
on mi4 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][4])
|
||||
on mi5 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][5])
|
||||
on mi6 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][6])
|
||||
on mi7 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][7])
|
||||
on mi8 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][8])
|
||||
on mi9 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][9])
|
||||
on mi10 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][10])
|
||||
on mi11 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][11])
|
||||
on mi12 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][12])
|
||||
on mi13 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][13])
|
||||
on mi14 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][14])
|
||||
on mi15 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][15])
|
||||
on mi16 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][16])
|
||||
on mi17 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][17])
|
||||
on mi18 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][18])
|
||||
on mi19 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][19])
|
||||
on mi20 picked do (cryTools.cryAnim.UI.main.models._f.loadModel cryTools.cryAnim._v.various[17][20])
|
||||
|
||||
|
||||
on miEdit picked do
|
||||
(
|
||||
rollout editModelListRO "Edit Model List"
|
||||
(
|
||||
dotNetControl lbModels "System.Windows.Forms.ListView" pos:[1,1] height:185 width:440
|
||||
button btnSave "Save" pos:[8,195] height:20 width:80 toolTip:"Save model list"
|
||||
button btnAdd "Add" pos:[120,195] height:20 width:60 toolTip:"Add new entry"
|
||||
button btnDelete "Delete" pos:[190,195] height:20 width:60 toolTip:"Deletes selected entry"
|
||||
button btnDeleteAll "Delete All" pos:[260,195] height:20 width:60 toolTip:"Clears whole list"
|
||||
button btnCancel "Cancel" pos:[350,195] height:20 width:80 toolTip:"Aborts dialog to edit model list"
|
||||
|
||||
|
||||
|
||||
on editModelListRO open do
|
||||
(
|
||||
lbModels.GridLines = true
|
||||
lbModels.AllowColumnReorder = true
|
||||
lbModels.View = lbModels.View.Details
|
||||
lbModels.LabelEdit = true
|
||||
lbModels.LabelWrap = true
|
||||
lbModels.FullRowSelect = true
|
||||
lbModels.HideSelection = false
|
||||
lbModels.Sorting = lbModels.Sorting.Ascending
|
||||
|
||||
tempArray = cryTools.cryAnim.base.iniFile #get #models
|
||||
if tempArray != "" and tempArray != undefined then
|
||||
(
|
||||
for i = 1 to tempArray.count do
|
||||
(
|
||||
local lbModelsEntry = lbModels.Items.Add tempArray[i].name
|
||||
lbModelsEntry.SubItems.Add tempArray[i].path
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
lbModels.Columns.Add "Name"
|
||||
lbModels.Columns.Add "Path"
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
|
||||
)
|
||||
|
||||
on lbModels DoubleClick do
|
||||
(
|
||||
tempItem = lbModels.FocusedItem
|
||||
|
||||
if tempItem != undefined then
|
||||
(
|
||||
tempValue = getOpenFileName caption:"Select Model to open" filename:(lbModels.FocusedItem.SubItems.item 1).text types:"3ds max (*.max)|*.max"
|
||||
if (tempValue != false) and (tempValue != undefined) then
|
||||
(
|
||||
(lbModels.FocusedItem.SubItems.item 1).text = tempValue
|
||||
lbModels.FocusedItem.text = cryTools.cryAnim.base.perforce tempValue #getFilename
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
lastIndex = lbModels.ListItems.count
|
||||
if lbModels.ListItems.count > 0 then
|
||||
tempPath = lbModels.ListItems[lastIndex].listSubItems[1].text
|
||||
else
|
||||
tempPath = maxFilePath + maxFileName
|
||||
|
||||
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
|
||||
if (tempValue != false) and (tempValue != undefined) then
|
||||
(
|
||||
local tempEntry = lbModels.ListItems.Add text:(cryTools.cryAnim.base.perforce tempValue #getFilename)
|
||||
tempEntry.ListSubItems.Add text:tempValue
|
||||
)
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
|
||||
)
|
||||
|
||||
on btnAdd pressed do
|
||||
(
|
||||
lastIndex = (lbModels.Items.count - 1)
|
||||
if lbModels.Items.count > 0 then
|
||||
tempPath = ((lbModels.Items.item lastIndex).SubItems.item 1).text
|
||||
else
|
||||
tempPath = maxFilePath + maxFileName
|
||||
|
||||
tempValue = getOpenFileName caption:"Select Model to open" filename:tempPath types:"3ds max (*.max)|*.max"
|
||||
if (tempValue != false) and (tempValue != undefined) then
|
||||
(
|
||||
local tempEntry = lbModels.Items.Add (cryTools.cryAnim.base.perforce tempValue #getFilename)
|
||||
tempEntry.SubItems.Add tempValue
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.models._f.updateExtentModel()
|
||||
)
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
local tempArray = #()
|
||||
for i = 0 to (lbModels.Items.count - 1) do
|
||||
append tempArray (modelPathStruct name:(lbModels.Items.item i).text path:((lbModels.Items.item i).SubItems.item 1).text)
|
||||
|
||||
cryTools.cryAnim.base.iniFile #set #models value:tempArray
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
|
||||
)
|
||||
|
||||
on btnDelete pressed do
|
||||
(
|
||||
if lbModels.FocusedItem != undefined then
|
||||
lbModels.FocusedItem.remove()
|
||||
)
|
||||
|
||||
on btnDeleteAll pressed do
|
||||
(
|
||||
lbModels.Items.clear()
|
||||
)
|
||||
|
||||
on btnCancel pressed do
|
||||
(
|
||||
destroyDialog cryTools.cryAnim.UI.main.models.editModelList
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.editModelList = editModelListRO
|
||||
editModelListRO = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.models.editModelList 443 220
|
||||
)
|
||||
|
||||
)
|
||||
cryTools.cryAnim.UI.main.models.loadModelRC = loadModelRC
|
||||
loadModelRC = undefined
|
||||
|
||||
|
||||
registerRightClickMenu cryTools.cryAnim.UI.main.models.loadModelRC
|
||||
|
||||
popUpMenu cryTools.cryAnim.UI.main.models.loadModelRC pos:[(mouse.screenpos[1] - 10), (mouse.screenpos[2] - 10)]
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.modelsRO.btnLoadModel.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created modelsRO rollout"
|
||||
|
||||
|
||||
--try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 modelsRO
|
||||
)
|
||||
--catch ( logOutput "!!> Error adding modelsRO to main dialog" )
|
||||
modelsRO = undefined
|
||||
|
||||
|
||||
logOutput ">> models9.ms loaded"
|
||||
@@ -0,0 +1,263 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control models, weapons and other things like nanoMuscles
|
||||
--###############################################################################
|
||||
rollout musclesRO "Muscles"
|
||||
(
|
||||
groupBox gbMuscles " Muscles " pos:[2,2] width:153 height:62
|
||||
|
||||
|
||||
checkBox chkAutomateMuscles "Auto-Muscles" pos:[8,18] width:90 height:20 checked:true fieldWidth:0
|
||||
checkBox chkUseMusclesKeys "Use Keys" pos:[8,38] width:90 height:20 enabled:false fieldWidth:0
|
||||
button btnCreateMuscles "Create" pos:[100,16] width:50 height:20 toolTip:"Creates the nano muscles rig on Bip01"
|
||||
button btnBakeMuscles "Bake" pos:[100,36] width:50 height:20 toolTip:"Bakes down all keys of the muscle bones"
|
||||
|
||||
on musclesRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Muscles" "").open = cryTools.cryAnim.base.iniFile #get #musclesRO) catch()
|
||||
|
||||
global automateAnimateMuscles = undefined
|
||||
global useMuscleKeys = undefined
|
||||
|
||||
|
||||
nanoConPosArray = #("_Bip01 L rear deltoid01_Con", "_Bip01 L rear deltoid02_Con", "_Bip01 L clavicular deltoid01_Con", "_Bip01 R rear deltoid01_Con", "_Bip01 R rear deltoid02_Con", "_Bip01 R clavicular deltoid01_Con")
|
||||
nanoConRotArray = #("_Bip01 L knee_Con", "_Bip01 R knee_Con")
|
||||
|
||||
errorOutput = undefined
|
||||
|
||||
for i = 1 to nanoConPosArray.count do
|
||||
if (getNodeByName nanoConPosArray[i]) == undefined then
|
||||
errorOutput = true
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.open" )
|
||||
)
|
||||
|
||||
on musclesRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #muscles) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #muscles
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on chkAutomateMuscles changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if chkAutomateMuscles.checked == true then
|
||||
global automateAnimateMuscles = undefined
|
||||
else
|
||||
global automateAnimateMuscles = false
|
||||
|
||||
chkUseMusclesKeys.enabled = not chkAutomateMuscles.checked
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.chkAutomateMuscles.changed" )
|
||||
)
|
||||
|
||||
on chkUseMusclesKeys changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if chkUseMusclesKeys.checked == true then
|
||||
global useMuscleKeys = true
|
||||
else
|
||||
global useMuscleKeys = undefined
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.chkUseMusclesKeys.changed" )
|
||||
)
|
||||
|
||||
on btnBakeMuscles pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $'_Bip01 L clavicular deltoid01_LA' != undefined then
|
||||
(
|
||||
if (queryBox "Bake all Muscle Bones?" title:"Muscle Rig") == true then
|
||||
cryTools.cryAnim.UI.main.loadSave._f.bakeMuscleBones()
|
||||
)
|
||||
else
|
||||
messageBox "No Muscle Rig on Bip01" title:"Muscle Rig"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.btnBakeMuscles.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnCreateMuscles pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $Bip01 != undefined then
|
||||
(
|
||||
if (queryBox "Create MuscleRig for Bip01?" title:"Muscle Rig") == true then
|
||||
(
|
||||
|
||||
undo "createMuscleRig" on
|
||||
(
|
||||
$Bip01.controller.figureMode = true
|
||||
completeRedraw()
|
||||
|
||||
saveSelection = getCurrentSelection()
|
||||
saveSliderTime = sliderTime
|
||||
|
||||
clearSelection()
|
||||
|
||||
|
||||
with redraw off
|
||||
(
|
||||
|
||||
Bip01_R_rear_deltoid02_LA = dummy name:"_Bip01 R rear deltoid02_LA" boxsize:[2,2,2]
|
||||
Bip01_R_clavicular_deltoid01_LA = dummy name:"_Bip01 R clavicular deltoid01_LA" boxsize:[2,2,2]
|
||||
Bip01_R_rear_deltoid01_LA = dummy name:"_Bip01 R rear deltoid01_LA" boxsize:[2,2,2]
|
||||
|
||||
Bip01_L_rear_deltoid02_LA = dummy name:"_Bip01 L rear deltoid02_LA" boxsize:[2,2,2]
|
||||
Bip01_L_clavicular_deltoid01_LA = dummy name:"_Bip01 L clavicular deltoid01_LA" boxsize:[2,2,2]
|
||||
Bip01_L_rear_deltoid01_LA = dummy name:"_Bip01 L rear deltoid01_LA" boxsize:[2,2,2]
|
||||
|
||||
Bip01_R_Clavicle_Con = dummy name:"_Bip01 R Clavicle_Con" pos:$'Bip01 R UpperArm'.transform.pos boxsize:[6,6,6]
|
||||
Bip01_L_Clavicle_Con = dummy name:"_Bip01 L Clavicle_Con" pos:$'Bip01 L UpperArm'.transform.pos boxsize:[6,6,6]
|
||||
|
||||
Bip01_R_Clavicle_Con.parent = $'Bip01 R Clavicle'
|
||||
Bip01_L_Clavicle_Con.parent = $'Bip01 L Clavicle'
|
||||
|
||||
|
||||
Bip01_R_knee_rotDif = dummy name:"_Bip01 R knee_rotDif" rotation:(inverse($'Bip01 R Calf'.transform.rotation)) pos:$'Bip01 R Calf'.transform.pos boxsize:[3,3,3]
|
||||
Bip01_L_knee_rotDif = dummy name:"_Bip01 L knee_rotDif" rotation:$'Bip01 L Calf'.transform.rotation pos:$'Bip01 L Calf'.transform.pos boxsize:[3,3,3]
|
||||
|
||||
Bip01_R_knee_rotDif.parent = $'Bip01 R Calf'
|
||||
Bip01_L_knee_rotDif.parent = $'Bip01 L Calf'
|
||||
|
||||
|
||||
|
||||
|
||||
Bip01_R_knee_Con = dummy name:"_Bip01 R knee_Con" pos:$'Bip01 R Thigh'.transform.pos boxsize:[3,3,3]
|
||||
Bip01_L_knee_Con = dummy name:"_Bip01 L knee_Con" pos:$'Bip01 L Thigh'.transform.pos boxsize:[3,3,3]
|
||||
|
||||
Bip01_R_knee_Con.parent = $'Bip01 R Thigh'
|
||||
Bip01_L_knee_Con.parent = $'Bip01 L Thigh'
|
||||
|
||||
|
||||
|
||||
|
||||
Bip01_R_rear_deltoid01_Con = dummy name:"_Bip01 R rear deltoid01_Con" boxsize:[3,3,3]
|
||||
Bip01_R_rear_deltoid02_Con = dummy name:"_Bip01 R rear deltoid02_Con" boxsize:[3,3,3]
|
||||
Bip01_R_clavicular_deltoid01_Con = dummy name:"_Bip01 R clavicular deltoid01_Con" boxsize:[3,3,3]
|
||||
|
||||
Bip01_L_rear_deltoid01_Con = dummy name:"_Bip01 L rear deltoid01_Con" boxsize:[3,3,3]
|
||||
Bip01_L_rear_deltoid02_Con = dummy name:"_Bip01 L rear deltoid02_Con" boxsize:[3,3,3]
|
||||
Bip01_L_clavicular_deltoid01_Con = dummy name:"_Bip01 L clavicular deltoid01_Con" boxsize:[3,3,3]
|
||||
|
||||
Bip01_R_rear_deltoid01_Con.position.controller = position_script() ; Bip01_R_rear_deltoid01_Con.position.controller.script = "RRear01 = (getVert $NanoSUIt 4068) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R rear deltoid01_LA'.pos = RRear01 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R rear deltoid01_LA'.pos = RRear01 ) else RRear01 )"
|
||||
Bip01_R_rear_deltoid02_Con.position.controller = position_script() ; Bip01_R_rear_deltoid02_Con.position.controller.script = "RRear02 = (getVert $NanoSUIt 4221) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R rear deltoid02_LA'.pos = RRear02 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R rear deltoid02_LA'.pos = RRear02 ) else RRear02 )"
|
||||
Bip01_R_clavicular_deltoid01_Con.position.controller = position_script() ; Bip01_R_clavicular_deltoid01_Con.position.controller.script = "RFront = (getVert $NanoSUIt 4064) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 R clavicular deltoid01_LA'.pos = RFront ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 R clavicular deltoid01_LA'.pos = RFront ) else RFront )"
|
||||
|
||||
Bip01_L_rear_deltoid01_Con.position.controller = position_script() ; Bip01_L_rear_deltoid01_Con.position.controller.script = "LRear01 = (getVert $NanoSUIt 3809) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L rear deltoid01_LA'.pos = LRear01 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L rear deltoid01_LA'.pos = LRear01 ) else LRear01 )"
|
||||
Bip01_L_rear_deltoid02_Con.position.controller = position_script() ; Bip01_L_rear_deltoid02_Con.position.controller.script = "LRear02 = (getVert $NanoSUIt 3962) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L rear deltoid02_LA'.pos = LRear02 ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L rear deltoid02_LA'.pos = LRear02 ) else LRear02 )"
|
||||
Bip01_L_clavicular_deltoid01_Con.position.controller = position_script() ; Bip01_L_clavicular_deltoid01_Con.position.controller.script = "LFront = (getVert $NanoSUIt 3805) if automateAnimateMuscles == undefined then ( with animate off $'_Bip01 L clavicular deltoid01_LA'.pos = LFront ) else ( if useMuscleKeys == undefined then ( with animate on $'_Bip01 L clavicular deltoid01_LA'.pos = LFront ) else LFront )"
|
||||
|
||||
|
||||
|
||||
|
||||
Bip01_L_knee_Con.rotation.controller = rotation_script() ; Bip01_L_knee_Con.rotation.controller.script = "fn LKneeMuscles = ( LKneeOriginRot = (quat -0.461687 0.548192 -0.440465 -0.540667) ; LKneeOriginPos = [43.0243,-0.746225,0.291201] ; LrotDiff = (in coordsys $'Bip01 L Thigh' $'_Bip01 L knee_rotDif'.rotation) as eulerangles ; in coordsys $'Bip01 L Thigh' ( $'Bip01 L knee'.rotation = LKneeOriginRot ; $'Bip01 L knee'.pos = LKneeOriginPos ) in coordsys $'Bip01 L knee' (rotate $'Bip01 L knee' (eulerangles (LrotDiff.z / -2) 0 0)) ) if automateAnimateMuscles == undefined then ( with animate off LKneeMuscles() ) else ( if useMusclesKeys == undefined then ( with animate on LKneeMuscles() ) ) ; $'Bip01 L Thigh'.transform.rotation"
|
||||
Bip01_R_knee_Con.rotation.controller = rotation_script() ; Bip01_R_knee_Con.rotation.controller.script = "fn RKneeMuscles = ( RKneeOriginRot = (quat -0.530717 -0.393879 0.549399 -0.511233) ; RKneeOriginPos = [43.0243,-0.746225,0.291201] ; RrotDiff = (in coordsys $'Bip01 R Thigh' $'_Bip01 R knee_rotDif'.rotation) as eulerangles ; in coordsys $'Bip01 R Thigh' ( $'Bip01 R knee'.rotation = RKneeOriginRot ; $'Bip01 R knee'.pos = RKneeOriginPos ) in coordsys $'Bip01 R knee' (rotate $'Bip01 R knee' (eulerangles (RrotDiff.z / -2) 0 0)) ) if automateAnimateMuscles == undefined then ( with animate off RKneeMuscles() ) else ( if useMusclesKeys == undefined then ( with animate on RKneeMuscles() ) ) ; $'Bip01 R Thigh'.transform.rotation"
|
||||
|
||||
|
||||
|
||||
Bip01_R_Clavicle_Con.isHidden = true
|
||||
Bip01_L_Clavicle_Con.isHidden = true
|
||||
Bip01_R_knee_Con.isHidden = true
|
||||
Bip01_L_knee_Con.isHidden = true
|
||||
Bip01_R_knee_rotDif.isHidden = true
|
||||
Bip01_L_knee_rotDif.isHidden = true
|
||||
|
||||
Bip01_R_rear_deltoid01_Con.isHidden = true
|
||||
Bip01_R_rear_deltoid02_Con.isHidden = true
|
||||
Bip01_R_clavicular_deltoid01_Con.isHidden = true
|
||||
|
||||
Bip01_L_rear_deltoid01_Con.isHidden = true
|
||||
Bip01_L_rear_deltoid02_Con.isHidden = true
|
||||
Bip01_L_clavicular_deltoid01_Con.isHidden = true
|
||||
|
||||
|
||||
-- LOOKAT-SETUP --
|
||||
$'Bip01 R rear deltoid01'.transform = (matrix3 [0.800769,0.401167,0.444785] [-0.104045,-0.638128,0.762868] [0.589868,-0.657158,-0.469253] [-15.3582,10.8964,154.478])
|
||||
$'Bip01 R rear deltoid02'.transform = (matrix3 [0.864961,0.479963,0.14655] [0.0248794,-0.33268,0.942711] [0.501221,-0.811763,-0.299696] [-13.2617,14.8806,147.713])
|
||||
$'Bip01 R clavicular deltoid01'.transform = (matrix3 [0.879667,-0.134998,0.456029] [0.448849,-0.0813437,-0.889898] [0.157229, 0.987502,-0.0109619] [-11.1466,-5.93142,154.513])
|
||||
|
||||
|
||||
$'Bip01 L rear deltoid01'.transform = (matrix3 [0.800769,-0.401167,-0.444785] [-0.104045,0.638128,-0.762868] [0.589868,0.657159,0.469254] [15.3582,10.8963,154.478])
|
||||
$'Bip01 L rear deltoid02'.transform = (matrix3 [0.864962,-0.479963,-0.14655] [0.0248793,0.33268,-0.942712] [0.501221,0.811763,0.299697] [13.2617,14.8806,147.713])
|
||||
$'Bip01 L clavicular deltoid01'.transform = (matrix3 [0.879666,0.134998,-0.456029] [0.448849,0.0813439,0.889898] [0.157229,-0.987501,0.0109618] [11.1466,-5.93141,154.513])
|
||||
|
||||
|
||||
|
||||
|
||||
$'Bip01 R rear deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
$'Bip01 R rear deltoid02'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
$'Bip01 R clavicular deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
|
||||
$'Bip01 L rear deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
$'Bip01 L rear deltoid02'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
$'Bip01 L clavicular deltoid01'.rotation.controller = LookAt_constraint lookat_vector_length:0 upnode_world:false pickUpNode:$'_Bip01 R Clavicle_Con' relative:true
|
||||
|
||||
|
||||
|
||||
|
||||
$'Bip01 R rear deltoid01'.rotation.controller.appendTarget $'_Bip01 R rear deltoid01_LA' 100
|
||||
$'Bip01 R rear deltoid02'.rotation.controller.appendTarget $'_Bip01 R rear deltoid02_LA' 100
|
||||
$'Bip01 R clavicular deltoid01'.rotation.controller.appendTarget $'_Bip01 R clavicular deltoid01_LA' 100
|
||||
|
||||
$'Bip01 L rear deltoid01'.rotation.controller.appendTarget $'_Bip01 L rear deltoid01_LA' 100
|
||||
$'Bip01 L rear deltoid02'.rotation.controller.appendTarget $'_Bip01 L rear deltoid02_LA' 100
|
||||
$'Bip01 L clavicular deltoid01'.rotation.controller.appendTarget $'_Bip01 L clavicular deltoid01_LA' 100
|
||||
|
||||
)
|
||||
|
||||
completeRedraw()
|
||||
|
||||
$Bip01.controller.figureMode = false
|
||||
|
||||
if sliderTime != animationRange.end then
|
||||
sliderTime += 1
|
||||
else
|
||||
sliderTime -= 1
|
||||
|
||||
|
||||
sliderTime = saveSliderTime
|
||||
|
||||
for obj in saveSelection do
|
||||
selectMore obj
|
||||
|
||||
)
|
||||
|
||||
)
|
||||
)
|
||||
else
|
||||
(
|
||||
messageBox "No Bip01 in Scene" title:"Error Generating MuscleRig"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.musclesRO.btnCreateMuscles.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created muscleRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row2 musclesRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 musclesRO rolledUp:true
|
||||
)
|
||||
catch ( logOutput "!!> Error adding musclesRO to main dialog" )
|
||||
musclesRO = undefined
|
||||
|
||||
|
||||
logOutput ">> muscle.ms loaded"
|
||||
@@ -0,0 +1,332 @@
|
||||
--###############################################################################
|
||||
--// rollout to control several operations
|
||||
--###############################################################################
|
||||
rollout operationRO "Operation"
|
||||
(
|
||||
|
||||
button btnStart "Start" pos:[8,8] width:45 height:20 toolTip:"Sets the start time of process"
|
||||
button btnStop "Stop" pos:[60,8] width:45 height:20 toolTip:"Sets the end time of process"
|
||||
spinner spnBegin "" pos:[6,35] range:[0,9999,0] type:#integer fieldWidth:35 scale:1
|
||||
spinner spnEnd "" pos:[58,35] range:[0,9999,0] type:#integer fieldWidth:35 scale:1
|
||||
spinner spnSteps "" pos:[112,35] range:[0,50,1] type:#integer fieldWidth:25 scale:1
|
||||
label labSteps "Steps" pos:[115,12]
|
||||
|
||||
--checkbox chkOnlyExistingKeys "Only existing Keys" pos:[8,60] enabled:false
|
||||
label labSetRange "Set Range:" pos:[6,60]
|
||||
button btnSetRangeSelection "Selection" pos:[70,57] height:20 width:50
|
||||
button btnSetRangeAll "All" pos:[123,57] height:20 width:30
|
||||
|
||||
groupBox gbOperation "Operation" pos:[2,80] width:153 height:77
|
||||
dropDownList ddOperation "" pos:[8,99] width:142 height:21
|
||||
label labOperation "To :" pos:[15,124] visible:false
|
||||
label labDistanceDirection "" pos:[15,124] visible:false align:#left
|
||||
dropDownList ddOperationTo "" pos:[8,140] width:142 height:21 visible:false
|
||||
spinner spnDistance "" pos:[8,140] width:142 height:21 range:[-1000,1000,0] visible:false
|
||||
spinner spnDirection "" pos:[8,140] width:142 height:21 range:[-360,360,180] visible:false
|
||||
|
||||
button btnApply "Apply" pos:[8,129] width:33 height:20 toolTip:"Applies the Operation once"
|
||||
button btnApplyBeginEnd "Start/Stop" pos:[46,129] width:59 height:20 toolTip:"Applies the Operation for the selected range"
|
||||
button btnApplyRange "Range" pos:[110,129] width:39 height:20 toolTip:"Applies the Operation for the animation range"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on operationRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Operation" "").open = cryTools.cryAnim.base.iniFile #get #operationRO) catch()
|
||||
|
||||
|
||||
operationRO.height = 161
|
||||
|
||||
ddOperation.items = cryTools.cryAnim.UI.main.operation._f.updateDialog output:#ddOp
|
||||
ddOperationTo.items = cryTools.cryAnim.UI.main.operation._f.updateDialog output:#ddOpTo
|
||||
spnBegin.value = animationRange.start.frame
|
||||
spnEnd.value = animationRange.end.frame
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.open" )
|
||||
)
|
||||
|
||||
|
||||
on operationRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #operationRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #operationRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on chkOnlyExistingKeys changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
spnSteps.enabled = not value
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.chkOnlyExistingKeys.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnStart pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
spnBegin.value = sliderTime
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.btnStart.pressed" )
|
||||
)
|
||||
|
||||
on btnStop pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
spnEnd.value = sliderTime
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.btnStop.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on spnSteps changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
local diffStartEnd = spnEnd.value - spnBegin.value
|
||||
if diffStartEnd < 0 then
|
||||
diffStartEnd -= (diffStartEnd * 2)
|
||||
|
||||
if value > diffStartEnd then
|
||||
spnSteps.value = diffStartEnd
|
||||
if spnSteps.value == 0 then spnSteps.value = 1
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.spnSteps.changed" )
|
||||
)
|
||||
|
||||
|
||||
on btnSetRangeSelection pressed do
|
||||
(
|
||||
if selection.count > 0 then
|
||||
(
|
||||
local firstKey = 0
|
||||
local lastKey = 0
|
||||
for obj in selection do
|
||||
(
|
||||
if obj.classID[1] == 37157 then
|
||||
(
|
||||
try
|
||||
(
|
||||
local tempFirstKey = obj.transform.controller.keys[1].time.frame
|
||||
if tempFirstKey < firstKey then
|
||||
firstKey = tempFirstKey
|
||||
)catch()
|
||||
|
||||
try
|
||||
(
|
||||
local tempLastkey = obj.transform.controller.keys[obj.transform.controller.keys.count].time.frame
|
||||
if tempLastKey > lastKey then
|
||||
lastKey = tempLastKey
|
||||
)catch()
|
||||
|
||||
)
|
||||
else
|
||||
(
|
||||
|
||||
for i = 1 to 3 do
|
||||
(
|
||||
try
|
||||
(
|
||||
|
||||
local tempFirstKey = obj.controller[i].keys[1].time.frame
|
||||
if tempFirstKey < firstKey then
|
||||
firstKey = tempFirstKey
|
||||
)
|
||||
catch()
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
local tempLastkey = obj.controller[i].keys[obj.controller[i].keys.count].time.frame
|
||||
if tempLastKey > lastKey then
|
||||
lastKey = tempLastKey
|
||||
)
|
||||
catch()
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if firstKey != lastKey then
|
||||
animationRange = interval firstKey lastKey
|
||||
else
|
||||
print "Error setting new Range"
|
||||
)
|
||||
else
|
||||
print "Nothing selected."
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnSetRangeAll pressed do
|
||||
(
|
||||
local firstKey = 0
|
||||
local lastKey = 0
|
||||
for obj in Objects do
|
||||
(
|
||||
if obj.classID[1] == 37157 then
|
||||
(
|
||||
try
|
||||
(
|
||||
local tempFirstKey = obj.transform.controller.keys[1].time.frame
|
||||
if tempFirstKey < firstKey then
|
||||
firstKey = tempFirstKey
|
||||
)catch()
|
||||
|
||||
try
|
||||
(
|
||||
local tempLastkey = obj.transform.controller.keys[obj.transform.controller.keys.count].time.frame
|
||||
if tempLastKey > lastKey then
|
||||
lastKey = tempLastKey
|
||||
)catch()
|
||||
|
||||
)
|
||||
else
|
||||
(
|
||||
|
||||
for i = 1 to 3 do
|
||||
(
|
||||
try
|
||||
(
|
||||
|
||||
local tempFirstKey = obj.controller[i].keys[1].time.frame
|
||||
if tempFirstKey < firstKey then
|
||||
firstKey = tempFirstKey
|
||||
)
|
||||
catch()
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
local tempLastkey = obj.controller[i].keys[obj.controller[i].keys.count].time.frame
|
||||
if tempLastKey > lastKey then
|
||||
lastKey = tempLastKey
|
||||
)
|
||||
catch()
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
if firstKey != lastKey then
|
||||
animationRange = interval firstKey lastKey
|
||||
else
|
||||
print "Error setting new Range"
|
||||
|
||||
)
|
||||
|
||||
|
||||
|
||||
on ddOperation selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
case value of
|
||||
(
|
||||
4: ddOperation.selection -= 1
|
||||
7: ddOperation.selection -= 1
|
||||
11: ddOperation.selection -= 1
|
||||
)
|
||||
cryTools.cryAnim.UI.main.operation._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.ddOperation.selected" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on btnApply pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.operation._f.applyOperation ddOperation.selection ddOperationTo.selection sliderTime.frame sliderTime.frame 1
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.btnApply.pressed" )
|
||||
)
|
||||
|
||||
on btnApplyBeginEnd pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if spnBegin.value == spnEnd.value then
|
||||
(
|
||||
messageBox ("'Start' must be unequal to 'End'") title:"Begin/End Operation"
|
||||
return false
|
||||
)
|
||||
|
||||
if spnBegin.value > spnEnd.value then
|
||||
(
|
||||
tempValue = spnBegin.value
|
||||
spnBegin.value = spnEnd.value
|
||||
spnEnd.value = tempValue
|
||||
)
|
||||
|
||||
local diffBeginEnd = spnEnd.value - spnBegin.value
|
||||
if diffBeginEnd < 0 then
|
||||
diffBeginEnd -= (diffBeginEnd * 2)
|
||||
|
||||
if spnSteps.value > diffBeginEnd then
|
||||
spnSteps.value = diffBeginEnd
|
||||
|
||||
undo "BeginEndOperation" on
|
||||
(
|
||||
local tempAnimationRange = animationRange
|
||||
animationRange = interval spnBegin.value spnEnd.value
|
||||
|
||||
local tempBool = cryTools.cryAnim.UI.main.operation._f.applyOperation ddOperation.selection ddOperationTo.selection spnBegin.value spnEnd.value spnSteps.value
|
||||
if tempBool != false then
|
||||
cryTools.cryAnim.UI.main.operation._f.applyOperation ddOperation.selection ddOperationTo.selection spnEnd.value spnEnd.value 1
|
||||
|
||||
animationRange = tempAnimationRange
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.btnApplyBeginEnd.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnApplyRange pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
undo "RangeOperation" on
|
||||
(
|
||||
tempBool = cryTools.cryAnim.UI.main.operation._f.applyOperation ddOperation.selection ddOperationTo.selection animationRange.start.frame animationRange.end.frame spnSteps.value
|
||||
if tempBool != false then
|
||||
cryTools.cryAnim.UI.main.operation._f.applyOperation ddOperation.selection ddOperationTo.selection animationRange.end.frame animationRange.end.frame 1
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.operationRO.btnApplyRange.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created operationRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 operationRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 operationRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding operationRO to main dialog" )
|
||||
operationRO = undefined
|
||||
|
||||
|
||||
logOutput ">> operation.ms loaded"
|
||||
@@ -0,0 +1,154 @@
|
||||
--###############################################################################
|
||||
--// rollout with all the file control _f like Load Biped File, Save, Export etc.
|
||||
--###############################################################################
|
||||
rollout perforceRO "Perforce"
|
||||
(
|
||||
timer clock interval:0 active:false
|
||||
|
||||
checkbox chkAutoUpdate "AutoUpdate" pos:[8,8] checked:true
|
||||
spinner spnAutoUpdateTime "Time " pos:[104,8] range:[0,999,0] width:50 scale:1 type:#integer
|
||||
|
||||
groupBox grpOpen " Open For Edit " pos:[2,33] width:153 height:120
|
||||
|
||||
label labOpenY "Yes" pos:[82,53]
|
||||
label labOpenN "No" pos:[107,53]
|
||||
label labOpenA "Ask" pos:[129,53]
|
||||
|
||||
label labOpenLoad "Load" pos:[14,68]
|
||||
label labOpenSave "Save" pos:[14,88]
|
||||
label labOpenExport "Export" pos:[14,108]
|
||||
label labOpenSaveExport "Save/Export" pos:[14,128]
|
||||
|
||||
radiobuttons radLoadOpen pos:[85,68] labels:#("","","") columns:3 default:3
|
||||
radiobuttons radSaveOpen pos:[85,88] labels:#("","","") columns:3 default:3
|
||||
radiobuttons radExportOpen pos:[85,108] labels:#("","","") columns:3 default:3
|
||||
radiobuttons radSaveExportOpen pos:[85,128] labels:#("","","") columns:3 default:3
|
||||
|
||||
groupBox grpAdd " Add to Source Control " pos:[2,163] width:153 height:100
|
||||
|
||||
label labAddY "Yes" pos:[82,183]
|
||||
label labAddN "No" pos:[107,183]
|
||||
label labAddA "Ask" pos:[129,183]
|
||||
|
||||
label labAddSave "Save" pos:[14,198]
|
||||
label labAddExport "Export" pos:[14,218]
|
||||
label labAddSaveExport "Save/Export" pos:[14,238]
|
||||
|
||||
radiobuttons radSaveAdd pos:[85,198] labels:#("","","") columns:3 default:3
|
||||
radiobuttons radExportAdd pos:[85,218] labels:#("","","") columns:3 default:3
|
||||
radiobuttons radSaveExportAdd pos:[85,238] labels:#("","","") columns:3 default:3
|
||||
|
||||
|
||||
|
||||
on perforceRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Perforce" "").open = cryTools.cryAnim.base.iniFile #get #perforceRO) catch()
|
||||
|
||||
try chkAutoUpdate.checked = cryTools.cryAnim.base.iniFile #get #autoUpdate catch()
|
||||
spnAutoUpdateTime.enabled = chkAutoUpdate.checked
|
||||
try spnAutoUpdateTime.value = cryTools.cryAnim.base.iniFile #get #autoUpdateTime catch()
|
||||
clock.interval = spnAutoUpdateTime.value * 60000
|
||||
|
||||
try radLoadOpen.state = cryTools.cryAnim.base.iniFile #get #loadOpen catch()
|
||||
try radSaveOpen.state = cryTools.cryAnim.base.iniFile #get #saveOpen catch()
|
||||
try radExportOpen.state = cryTools.cryAnim.base.iniFile #get #exportOpen catch()
|
||||
try radSaveExportOpen.state = cryTools.cryAnim.base.iniFile #get #saveExportOpen catch()
|
||||
|
||||
try radSaveAdd.state = cryTools.cryAnim.base.iniFile #get #saveAdd catch()
|
||||
try radExportAdd.state = cryTools.cryAnim.base.iniFile #get #exportAdd catch()
|
||||
try radSaveExportAdd.state = cryTools.cryAnim.base.iniFile #get #saveExportAdd catch()
|
||||
|
||||
clock.active = chkAutoUpdate.checked
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.perforceRO.open" )
|
||||
)
|
||||
|
||||
|
||||
on perforceRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #perforceRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #perforceRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.perforceRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on chkAutoUpdate changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
clock.active = value
|
||||
spnAutoUpdateTime.enabled = value
|
||||
cryTools.cryAnim.base.iniFile #set #autoUpdate
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.perforceRO.chkAutoUpdate.changed" )
|
||||
)
|
||||
|
||||
on clock tick do
|
||||
(
|
||||
try
|
||||
(
|
||||
if spnAutoUpdateTime.value > 0 then
|
||||
if (local tempVar = cryTools.cryAnim.base.perforce "" #checkLoading) != false then
|
||||
if cryTools.suppressWarnings == false then
|
||||
cryTools.cryAnim.base.perforce tempVar #messageOnUpdate
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.perforceRO.clock" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on spnAutoUpdateTime changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
clock.interval = value * 60000
|
||||
cryTools.cryAnim.base.iniFile #set #autoUpdateTime
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.perforceRO.spnAutoUpdateTime.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on radLoadOpen changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #loadOpen
|
||||
|
||||
on radSaveOpen changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #saveOpen
|
||||
|
||||
on radExportOpen changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #exportOpen
|
||||
|
||||
on radSaveExportOpen changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #saveExportOpen
|
||||
|
||||
on radSaveAdd changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #saveAdd
|
||||
|
||||
on radExportAdd changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #exportAdd
|
||||
|
||||
on radSaveExportAdd changed value do
|
||||
cryTools.cryAnim.base.iniFile #set #saveExportAdd
|
||||
)
|
||||
logOutput "> Created perforceRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row4 perforceRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 perforceRO rolledUp:true
|
||||
)
|
||||
catch ( logOutput "!!> Error adding perforceRO to main dialog" )
|
||||
perforceRO = undefined
|
||||
|
||||
|
||||
logOutput ">> perforce.ms loaded"
|
||||
@@ -0,0 +1,155 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control the pivot align _f
|
||||
--###############################################################################
|
||||
rollout pivotRO "Pivot"
|
||||
(
|
||||
button btnPivotSelect "Select Pivot" pos:[8,8] width:142 height:20 toolTip:"Creates pivot point selection tool"
|
||||
groupBox grpPivPos "Pivot Point" pos:[2,38] width:153 height:50
|
||||
button btnCreatePivPoint "Create" pos:[8,60] width:65 height:20 toolTip:"Creates pivot point on the selected node"
|
||||
button btnDeletePivPoint "Delete" pos:[83,60] width:65 height:20 toolTip:"Deletes pivot point of the selected node"
|
||||
|
||||
groupBox gbSnapshot " Snapshot " pos:[2,100] width:153 height:50
|
||||
|
||||
button btnSingleSnapshot "Single" pos:[8,123] width:66 height:20 toolTip:"Creates snapshot of the current selection"
|
||||
button btnChildrenSnapshot "+ Children" pos:[84,123] width:66 height:20 toolTip:"Creates grouped snapshot of the current selection with children"
|
||||
|
||||
|
||||
on pivotRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Pivot" "").open = cryTools.cryAnim.base.iniFile #get #pivotRO
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.open" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on pivotRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #pivotRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #pivotRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnPivotSelect pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (local selectedBipPart = cryTools.cryAnim._f.getSelectedBipPart() ) != undefined then
|
||||
(
|
||||
if selectedBipPart.object.isPivot == true then
|
||||
(
|
||||
undo off
|
||||
cryTools.cryAnim.align._f.callPivotSelect()
|
||||
)
|
||||
else
|
||||
print "Pivot Selection not available for this Object"
|
||||
)
|
||||
else
|
||||
(
|
||||
if selection.count > 0 then
|
||||
print "No Biped Object selected."
|
||||
else
|
||||
print "Nothing selected."
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.btnPivotSelect.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnCreatePivPoint pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (selectedBipPart = cryTools.cryAnim._f.getSelectedBipPart() ) != undefined then
|
||||
(
|
||||
if selectedBipPart.pivotSel.index == undefined then
|
||||
messageBox "Select a Pivot first" title:"Pivot Point" beep:false
|
||||
else
|
||||
if (cryTools.cryAnim.UI.main.pivot._f.pivotPoint #check) == true then
|
||||
(
|
||||
if (queryBox "Set new Pivot Point?" title:"Pivot Point" beep:false) == true then
|
||||
if (cryTools.cryAnim.UI.main.pivot._f.pivotPoint #delete) == true then
|
||||
cryTools.cryAnim.UI.main.pivot._f.pivotPoint #create
|
||||
)
|
||||
else
|
||||
cryTools.cryAnim.UI.main.pivot._f.pivotPoint #create
|
||||
)
|
||||
else
|
||||
(
|
||||
if selection.count > 0 then
|
||||
print "No Biped Object selected."
|
||||
else
|
||||
print "Nothing selected"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.btnCreatePivPoint.pressed" )
|
||||
)
|
||||
|
||||
on btnDeletePivPoint pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (selectedBipPart = cryTools.cryAnim._f.getSelectedBipPart() ) != undefined then
|
||||
if selectedBipPart.pivotSel.pivPoint.name != undefined then
|
||||
if (queryBox "Delete Pivot Point?" title:"Pivot Point" beep:false) == true then
|
||||
cryTools.cryAnim.UI.main.pivot._f.pivotPoint #delete
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.btnDeletePivPoint.pressed" )
|
||||
)
|
||||
|
||||
on btnSingleSnapshot pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
with animate off
|
||||
(
|
||||
if cryTools.cryAnim._f.createSnapshot() == undefined then
|
||||
print "Nothing selected"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.btnSingleSnapshot.pressed" )
|
||||
)
|
||||
|
||||
on btnChildrenSnapshot pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
with animate off
|
||||
(
|
||||
local baseArray = cryTools.cryAnim._f.createSnapshot children:true
|
||||
|
||||
if baseArray == undefined then
|
||||
print "Nothing selected"
|
||||
else
|
||||
group baseArray prefix:"Snapshot_"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.pivotRO.btnChildrenSnapshot.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created pivotRO rollout"
|
||||
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 pivotRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 pivotRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding pivotRO to main dialog" )
|
||||
pivotRO = undefined
|
||||
|
||||
|
||||
logOutput ">> pivot.ms loaded"
|
||||
@@ -0,0 +1,307 @@
|
||||
--###############################################################################
|
||||
--// rollout with elements to control the locator
|
||||
--###############################################################################
|
||||
rollout poseRO "Pose Manager"
|
||||
(
|
||||
groupbox gbCharacters " Characters " pos:[2,5] width:153 height:43
|
||||
editText edCharacter "" pos:[29,22] width:80 height:17
|
||||
dropdownlist ddCharacter "" pos:[32,20] width:94 height:10
|
||||
button btnCreateCharacter "" pos:[8,20] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,6,6,20,20) width:29 height:29 toolTip:"Creates a new Character"
|
||||
button btnDeleteCharacter "" pos:[128,20] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,8,8,17,17) width:29 height:29 toolTip:"Deletes selected Character"
|
||||
|
||||
|
||||
groupbox gbCollections " Collections " pos:[2,55] width:153 height:43
|
||||
editText edCollection "" pos:[29,72] width:80 height:17
|
||||
dropdownlist ddCollection "" pos:[32,70] width:94 height:10
|
||||
button btnCreateCollection "" pos:[8,70] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,6,6,20,20) width:29 height:29 toolTip:"Creates a new Collection"
|
||||
button btnDeleteCollection "" pos:[128,70] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,8,8,17,17) width:29 height:29 toolTip:"Deletes selected Collection"
|
||||
|
||||
|
||||
groupbox gbPoses " Poses " pos:[2,105] width:153 height:63
|
||||
editText edPose "" pos:[29,122] width:80 height:17
|
||||
dropdownlist ddPose "" pos:[32,120] width:94 height:20
|
||||
button btnCreatePose "" pos:[8,120] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,6,6,20,20) width:29 height:29 toolTip:"Creates a new Pose"
|
||||
button btnDeletePose "" pos:[128,120] width:21 height:21 images:#((getDir #maxroot + "UI\\Icons\\ParameterCollector_i.bmp"), undefined, 28,8,8,17,17) width:29 height:29 toolTip:"Deletes selected Pose"
|
||||
button btnPastePose "Paste" pos:[38,145] width:80 height:20
|
||||
|
||||
|
||||
groupbox gbPaste " Paste " pos:[2,185] width:153 height:75
|
||||
checkbox chkPastePosition "Position" pos:[12,200] checked:true
|
||||
checkbox chkPasteRotation "Rotation" pos:[12,220] checked:true
|
||||
checkbox chkControllerValue "Controller Value" pos:[12,240] checked:true
|
||||
checkbox chkBoneOnly "Nodes Only" pos:[76,200] width:75
|
||||
checkbox chkByVelocity "By Velocity" pos:[76,220]
|
||||
|
||||
|
||||
groupbox gbPreview " Preview " pos:[2,273] width:153 height:150
|
||||
bitmap bmpPreview "" pos:[7,289] width:144 height:110
|
||||
checkbox chkNodesOnly "Only Nodes visible" pos:[12,403] checked:true
|
||||
|
||||
groupbox gbNodes " Nodes " pos:[2,435] width:153 height:169
|
||||
multilistbox lbNodes "" pos:[7,455] width:143 height:9
|
||||
button btnAddNode "Add" pos:[7,578] width:72 height:20 toolText:"Adds new node to the list"
|
||||
button btnDeleteNode "Delete" pos:[79,578] width:71 height:20 toolText:"Deletes selected node/s"
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on poseRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Pose Manager" "").open = cryTools.cryAnim.base.iniFile #get #poseRO) catch()
|
||||
|
||||
cryTools.cryAnim.UI.main.poseManager._f.inputINI()
|
||||
cryTools.cryAnim.UI.main.poseManager._f.updateList #character initial:true
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.open" )
|
||||
)
|
||||
|
||||
|
||||
on poseRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #poseRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #poseRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on ddCharacter selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.updateList #character
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.ddCharacter.selected" )
|
||||
)
|
||||
|
||||
|
||||
on ddCollection selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.updateList #collection
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.ddCollection.selected" )
|
||||
)
|
||||
|
||||
|
||||
on ddPose selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.updateList #default
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.ddPose.selected" )
|
||||
)
|
||||
|
||||
|
||||
on btnCreateCharacter pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.createEntry "Character"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnCreateCharacter.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnDeleteCharacter pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.deleteEntry "Character"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnDeleteCharacter.pressed" )
|
||||
)
|
||||
|
||||
on btnCreateCollection pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.createEntry "Collection"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnCreateCollection.pressed" )
|
||||
)
|
||||
|
||||
on btnDeleteCollection pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.deleteEntry "Collection"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnDeleteCollection.pressed" )
|
||||
)
|
||||
|
||||
on btnCreatePose pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.createEntry "Pose"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnCreatePose.pressed" )
|
||||
)
|
||||
|
||||
on btnDeletePose pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.deleteEntry "Pose"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnDeletePose.pressed" )
|
||||
)
|
||||
|
||||
on edCharacter changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddCharacter.items.count > 0 then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.renameEntry "Character"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.edCharacter.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on edCollection changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddCollection.items.count > 0 then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.renameEntry "Collection"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.edCollection.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on edPose changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddPose.items.count > 0 then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.poseManager._f.renameEntry "Pose"
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.edPose.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnPastePose pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddPose.items.count > 0 then
|
||||
(
|
||||
undo "Paste Pose" on
|
||||
cryTools.cryAnim.UI.main.poseManager._f.applyPose()
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnPastePose.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnAddNode pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if ddCharacter.items.count > 0 then
|
||||
(
|
||||
if selection.count == 0 then
|
||||
local tempVar = selectByName title:"Add Character Nodes" showHidden:true single:false --filter:filterNodes --// somehow crashes max...
|
||||
else
|
||||
local tempVar = getCurrentSelection()
|
||||
|
||||
if classOf tempVar == Array and tempVar.count > 0 then
|
||||
(
|
||||
local tempArray = cryTools.cryAnim.UI.main.poseManager._v.poses[ddCharacter.selection].nodes
|
||||
for i = 1 to tempVar.count do
|
||||
if (findItem tempArray tempVar[i].name) == 0 then
|
||||
append tempArray tempVar[i].name
|
||||
|
||||
tempArray = cryTools.sortRootChildren tempArray
|
||||
|
||||
lbNodes.items = tempArray
|
||||
cryTools.cryAnim.UI.main.poseManager._v.poses[ddCharacter.selection].nodes = tempArray
|
||||
|
||||
cryTools.cryAnim.UI.main.poseManager._f.outputINI()
|
||||
)
|
||||
else
|
||||
messageBox "No nodes selected." title:"Error Adding Nodes"
|
||||
|
||||
)
|
||||
else
|
||||
messageBox "No Character in List " title:"Error adding Nodes"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnAddNode.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnDeleteNode pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if lbNodes.items.count > 0 then
|
||||
(
|
||||
local poses = cryTools.cryAnim.UI.main.poseManager._v.poses
|
||||
local saveSelection = lbNodes.selection as Array
|
||||
local newSelection = (lbNodes.selection as Array)[1]
|
||||
|
||||
lbNodes.selection = #{newSelection}
|
||||
if newSelection == lbNodes.items.count then lbNodes.selection = #{lbNodes.items.count - 1}
|
||||
if newSelection == 0 then lbNodes.selection = #{1}
|
||||
|
||||
local newList = #()
|
||||
local tempArray = cryTools.cryAnim.UI.main.poseManager._v.poses[ddCharacter.selection].nodes
|
||||
for i = 1 to tempArray.count do
|
||||
if (findItem saveSelection i) == 0 then
|
||||
append newList tempArray[i]
|
||||
|
||||
if newList.count > 1 then
|
||||
newList = cryTools.sortRootChildren newList
|
||||
|
||||
|
||||
|
||||
lbNodes.items = newList
|
||||
cryTools.cryAnim.UI.main.poseManager._v.poses[ddCharacter.selection].nodes = newList
|
||||
|
||||
cryTools.cryAnim.UI.main.poseManager._f.outputINI()
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryAnim.UI.main.dialog.poseRO.btnDeleteNode.pressed" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created poseRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row3 poseRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 poseRO rolledUp:true
|
||||
)
|
||||
catch ( logOutput "!!> Error adding poseRO to main dialog" )
|
||||
poseRO = undefined
|
||||
|
||||
|
||||
logOutput ">> pose.ms loaded"
|
||||
@@ -0,0 +1,711 @@
|
||||
--###############################################################################
|
||||
--// rollout with all the file control _f like Load Biped File, Save, Export etc.
|
||||
--###############################################################################
|
||||
rollout loadSaveRO "Load / Save / Export"
|
||||
(
|
||||
groupBox gbLoad " Load " pos:[2,8] width:153 height:50
|
||||
button btnLoad "Load Biped File" pos:[8,31] width:142 height:20 toolTip:"Loads biped file from the working directory or last used file"
|
||||
|
||||
groupBox gbSave " Save / Export " pos:[2,70] width:153 height:315
|
||||
|
||||
button btnBegin "Start" pos:[8,92] width:46 height:20 toolTip:"Sets the start time to save/export"
|
||||
button btnEnd "End" pos:[60,92] width:46 height:20 toolTip:"Sets the end time to save/export"
|
||||
button btnRange "Range" pos:[110,92] width:40 height:20 toolTip:"Sets the range for save/export"
|
||||
button btnAll "All" pos:[110,113] width:40 height:20 toolTip:"Sets the animation range for save/export"
|
||||
|
||||
spinner spnBegin "" pos:[6,113] range:[0,9999,0] type:#integer fieldWidth:36
|
||||
spinner spnEnd "" pos:[58,113] range:[0,9999,0] type:#integer fieldWidth:36
|
||||
|
||||
|
||||
checkbox chkGlobalHuman " GlobalHuman.cal" pos:[12,140] tooltip:"Creates entry in GlobalHuman.cal" checked:false enabled:false
|
||||
|
||||
button btnExportAdd "Add" pos:[8,165] width:66 height:20 toolTip:"Adds a new node to the exporter list"
|
||||
button btnExportDelete "Delete" pos:[84,165] width:66 height:20 enabled:false toolTip:"Deletes selected node from the exporter list"
|
||||
listbox lbExport "" pos:[8,190] width:142 height:2 items:#("Bip01") selection:0 enabled:false
|
||||
|
||||
button btnSave "Save" pos:[8,235] width:66 height:20 toolTip:"Saves the biped file"
|
||||
button btnExport "Export" pos:[84,235] width:66 height:20 toolTip:"Exports to .caf"
|
||||
button btnSaveExport "Save / Export" pos:[8,265] width:142 height:20 toolTip:"Saves to biped file and exports to .caf"
|
||||
button btnBatchProcess "Batch Process" pos:[8,360] width:142 height:20 toolTip:"Opens the Batch Process"
|
||||
|
||||
listbox lbStatus "" pos:[8,290] width:142 height:4
|
||||
listbox lbStatusFilepath "" pos:[0,0] width:1 height:1 visible:false
|
||||
|
||||
|
||||
|
||||
on loadSaveRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try (if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "").open = cryTools.cryAnim.base.iniFile #get #loadSaveRO) catch()
|
||||
try cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = cryTools.cryAnim.base.iniFile #get #loadBiped catch()
|
||||
|
||||
spnBegin.value = animationRange.start.frame
|
||||
spnEnd.value = animationRange.end.frame
|
||||
if $Bip01 != undefined then
|
||||
(
|
||||
lbExport.items = #($Bip01.name)
|
||||
lbExport.selection = 0
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.open" )
|
||||
)
|
||||
|
||||
on loadSaveRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #loadSaveRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #loadSaveRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
on btnBegin pressed do
|
||||
(
|
||||
try
|
||||
spnBegin.value = sliderTime
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnBegin.pressed" )
|
||||
)
|
||||
|
||||
on btnEnd pressed do
|
||||
(
|
||||
try
|
||||
spnEnd.value = sliderTime
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnEnd.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on btnRange pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
spnBegin.value = animationRange.start.frame
|
||||
spnEnd.value = animationRange.end.frame
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnRange.pressed" )
|
||||
)
|
||||
|
||||
on btnAll pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
baseBip = cryTools.cryAnim._f.getBaseBip()
|
||||
if baseBip != undefined then
|
||||
(
|
||||
tempInterval = biped.getCurrentRange baseBip.controller
|
||||
|
||||
spnBegin.value = tempInterval.start.frame
|
||||
spnEnd.value = tempInterval.end.frame
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnAll.pressed" )
|
||||
)
|
||||
|
||||
on btnExportAdd pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $selection.count > 0 then
|
||||
(
|
||||
local tempArray = lbExport.items
|
||||
|
||||
for obj in $selection do
|
||||
(
|
||||
local exist = false
|
||||
for i = 1 to lbExport.items.count do
|
||||
if obj.name == lbExport.items[i] then
|
||||
exist = true
|
||||
|
||||
if exist == false then
|
||||
append tempArray obj.name
|
||||
|
||||
)
|
||||
|
||||
sort tempArray
|
||||
lbExport.items = tempArray
|
||||
if tempArray.count > 1 then
|
||||
|
||||
|
||||
if tempArray.count > 1 then
|
||||
(
|
||||
local tempInt = findItem tempArray "Bip01"
|
||||
if tempInt != 0 then
|
||||
(
|
||||
deleteItem tempArray tempInt
|
||||
lbExport.enabled = true
|
||||
)
|
||||
|
||||
lbExport.items = tempArray
|
||||
|
||||
lbExport.selection = 0
|
||||
btnExportDelete.enabled = false
|
||||
)
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnExportAdd.pressed" )
|
||||
)
|
||||
|
||||
on btnExportDelete pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if lbExport.selection > 0 then
|
||||
(
|
||||
local tempArray = lbExport.items
|
||||
deleteItem tempArray lbExport.selection
|
||||
sort tempArray
|
||||
lbExport.items = tempArray
|
||||
)
|
||||
if lbExport.items.count == 0 then
|
||||
lbExport.items = #($Bip01.name)
|
||||
|
||||
if lbExport.items[1] == "Bip01" then
|
||||
lbExport.enabled = false
|
||||
else
|
||||
lbExport.enabled = true
|
||||
|
||||
lbExport.selection = 0
|
||||
btnExportDelete.enabled = false
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnExportDelete.pressed" )
|
||||
)
|
||||
|
||||
on lbExport selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if lbExport.items.count <= 1 and lbExport.items[1] == "Bip01" then
|
||||
(
|
||||
lbExport.selection = 0
|
||||
btnExportDelete.enabled = false
|
||||
)
|
||||
else
|
||||
btnExportDelete.enabled = true
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.lbExport.selected" )
|
||||
)
|
||||
|
||||
|
||||
on btnLoad pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
local baseBip = cryTools.cryAnim._f.getBaseBip op:#load
|
||||
local loadedBiped = undefined
|
||||
|
||||
if baseBip != undefined then
|
||||
(
|
||||
if cryTools.cryAnim.UI.batchProcess._v.fileQue == undefined then
|
||||
filepath = getOpenFileName filename:cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath types:"Biped (*.bip)|*.bip"
|
||||
else
|
||||
filepath = cryTools.cryAnim.UI.batchProcess._v.fileQue
|
||||
|
||||
if filepath != undefined then
|
||||
(
|
||||
tempStatus = undefined
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radLoadOpen").state of
|
||||
(
|
||||
1: tempStatus = cryTools.cryAnim.base.perforce filepath #open
|
||||
2: tempStatus = false
|
||||
3: tempStatus = cryTools.cryAnim.base.perforce filepath #checkForLoad
|
||||
)
|
||||
)
|
||||
else
|
||||
tempStatus = false
|
||||
|
||||
if tempStatus != undefined then
|
||||
(
|
||||
local tempFilterFilename = cryTools.cryAnim.base.perforce filepath #getFilename
|
||||
local tempUndoString = ("L - " + cryTools.cryAnim.base.perforce filepath #getFilename)
|
||||
undo tempUndoString on
|
||||
(
|
||||
if (loadedBiped = biped.loadBipFile baseBip.controller filepath) == true then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = filepath
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipSavePath = filepath
|
||||
|
||||
cryTools.cryAnim.base.iniFile #set #loadBiped
|
||||
|
||||
if (exportPath = cryTools.cryAnim.UI.main._f.checkExport #ProductionToGame filepath) != false then
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = exportPath
|
||||
|
||||
--cryTools.cryAnim.UI.checkExport #createFolder exportPath
|
||||
|
||||
tempInterval = biped.getCurrentRange baseBip.controller
|
||||
if tempInterval.start == tempInterval.end then
|
||||
tempInterval.end += 1
|
||||
|
||||
spnBegin.value = tempInterval.start.frame
|
||||
spnEnd.value = tempInterval.end.frame
|
||||
|
||||
animationRange = tempInterval
|
||||
|
||||
try (animationRange = biped.getCurrentRange baseBip.controller) catch ( )
|
||||
|
||||
local itemFound = false
|
||||
for i = 1 to cryTools.cryAnim.UI.main.models._v.itemList.count do
|
||||
(
|
||||
if (findString filepath cryTools.cryAnim.UI.main.models._v.itemList[i].external) != undefined then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.models._f.selectItem i #set
|
||||
itemFound = true
|
||||
)
|
||||
)
|
||||
if itemFound == false then
|
||||
cryTools.cryAnim.UI.main.models._f.selectItem 1 #set
|
||||
|
||||
|
||||
|
||||
tempArray = lbStatus.items
|
||||
|
||||
tempStatusString = ""
|
||||
if tempStatus == true then
|
||||
tempStatusString = "L+o"
|
||||
else
|
||||
tempStatusString = "L"
|
||||
|
||||
append tempArray (tempStatusString + " - " + tempFilterFilename)
|
||||
|
||||
lbStatus.items = tempArray
|
||||
lbStatus.selection = tempArray.count
|
||||
|
||||
tempFileArray = lbStatusFilepath.items
|
||||
append tempFileArray filepath
|
||||
lbStatusFilepath.items = tempFileArray
|
||||
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
return #(true, loadedBiped)
|
||||
)
|
||||
else
|
||||
return #(false, loadedBiped)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnLoad.pressed" )
|
||||
)
|
||||
|
||||
on btnSave pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
with undo off
|
||||
(
|
||||
local baseBip = cryTools.cryAnim._f.getBaseBip()
|
||||
if baseBip != undefined then
|
||||
(
|
||||
if cryTools.cryAnim.UI.main.loadSave._v.bipSavePath == (cryTools.cryAnim.UI.main._v.bipWorkingDir + "*.bip") or ((cryTools.cryAnim.UI.main._f.getUI "Settings" "radSavePrompt").state == 1) then
|
||||
filepath = getSaveFileName filename:cryTools.cryAnim.UI.main.loadSave._v.bipSavePath types:"Biped (*.bip)|*.bip"
|
||||
else
|
||||
filepath = cryTools.cryAnim.UI.main.loadSave._v.bipSavePath
|
||||
|
||||
|
||||
if filepath != undefined then
|
||||
(
|
||||
local tempFilterFilename = filterString filepath "\\" ; tempFilterFilename = tempFilterFilename[tempFilterFilename.count]
|
||||
local tempBool = true
|
||||
|
||||
local tempStatus = undefined
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveOpen").state of
|
||||
(
|
||||
1: tempStatus = cryTools.cryAnim.base.perforce filepath #open
|
||||
2: ( tempStatus = false ; cryTools.cryAnim.base.perforce filepath #setReadMessage )
|
||||
3: tempStatus = cryTools.cryAnim.base.perforce filepath #checkForSave
|
||||
)
|
||||
)
|
||||
else
|
||||
tempStatus = false
|
||||
|
||||
if tempStatus != undefined then
|
||||
(
|
||||
if (animationRange.start != spnBegin.value) or (animationRange.end != spnEnd.value) then
|
||||
(
|
||||
tempInterval = cryTools.cryAnim.UI.main.loadSave._f.checkRange spnBegin.value spnEnd.value
|
||||
spnBegin.value = tempInterval.start
|
||||
spnEnd.value = tempInterval.end
|
||||
)
|
||||
|
||||
tempBool = biped.saveBipFileSegment baseBip.controller filepath spnBegin.value spnEnd.value #keyPerFrame
|
||||
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipSavePath = filepath
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = filepath
|
||||
|
||||
if (exportPath = cryTools.cryAnim.UI.main._f.checkExport #ProductionToGame filepath) != false then
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = exportPath
|
||||
|
||||
tempArray = lbStatus.items
|
||||
|
||||
local tempStatusString = ""
|
||||
if tempStatus == true then
|
||||
tempStatusString = "S+o"
|
||||
else
|
||||
tempStatusString = "S"
|
||||
|
||||
append tempArray (tempStatusString + " - " + tempFilterFilename)
|
||||
lbStatus.items = tempArray
|
||||
lbStatus.selection = tempArray.count
|
||||
|
||||
tempFileArray = lbStatusFilepath.items
|
||||
append tempFileArray filepath
|
||||
lbStatusFilepath.items = tempFileArray
|
||||
|
||||
if (cryTools.cryAnim.UI.main._f.checkExport #save filepath) == true then
|
||||
(
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveAdd").state of
|
||||
(
|
||||
1: cryTools.cryAnim.base.perforce filepath #add
|
||||
3: cryTools.cryAnim.base.perforce filepath #checkForAdd
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnSave.pressed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on btnExport pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
local baseBip = cryTools.cryAnim._f.getBaseBip()
|
||||
if baseBip != undefined then
|
||||
(
|
||||
|
||||
if (cryTools.cryAnim.UI.main.loadSave._v.cafSavePath == (crytools.BuildPathFull + "Game\Animations\human\*.caf")) or ((cryTools.cryAnim.UI.main._f.getUI "Settings" "radExportPrompt").state == 1) then
|
||||
filepath = getSaveFileName filename:cryTools.cryAnim.UI.main.loadSave._v.cafSavePath types:"Crytek Bone Animation File (*.caf)|*.caf"
|
||||
else
|
||||
filepath = cryTools.cryAnim.UI.main.loadSave._v.cafSavePath
|
||||
|
||||
|
||||
|
||||
|
||||
if filepath != undefined then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = filepath
|
||||
|
||||
if (cryTools.cryAnim.UI.main._f.checkExport #export filepath) == true then
|
||||
(
|
||||
local tempStatus = undefined
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radExportOpen").state of
|
||||
(
|
||||
1: tempStatus = cryTools.cryAnim.base.perforce filepath #open
|
||||
2: ( tempStatus = false ; cryTools.cryAnim.base.perforce filepath #setReadMessage )
|
||||
3: tempStatus = cryTools.cryAnim.base.perforce filepath #checkForSave
|
||||
)
|
||||
)
|
||||
else
|
||||
tempStatus = false
|
||||
|
||||
if tempStatus != undefined then
|
||||
(
|
||||
try( if $'Bip01 R ForeTwist'.parent != $'Bip01 R Forearm' then $'Bip01 R ForeTwist'.parent = $'Bip01 R Forearm' ) catch()
|
||||
try( if $'Bip01 L ForeTwist'.parent != $'Bip01 L Forearm' then $'Bip01 L ForeTwist'.parent = $'Bip01 L Forearm' ) catch()
|
||||
|
||||
try (cryTools.cryAnim.UI.main.loadSave._f.bakeMuscleBones() ) catch()
|
||||
|
||||
local tempMode = getCommandPanelTaskMode()
|
||||
UtilityPanel.OpenUtility CryEngine2_Exporter
|
||||
local boneList = #()
|
||||
for i = 1 to lbExport.items.count do
|
||||
append boneList (getNodeByName lbExport.items[i])
|
||||
|
||||
csexport.set_bone_list boneList
|
||||
local tempBool = (csexport.export.export_anim filepath)
|
||||
while tempBool != OK do ( escapeEnable = true ; sleep 0.1 )
|
||||
|
||||
local tempFilterFilename = filterString filepath "\\"
|
||||
|
||||
tempArray = lbStatus.items
|
||||
tempStatusString = ""
|
||||
if tempStatus == true then
|
||||
tempStatusString = "E+o"
|
||||
else
|
||||
tempStatusString = "E"
|
||||
|
||||
append tempArray (tempStatusString + " - " + tempFilterFilename[tempFilterFilename.count])
|
||||
lbStatus.items = tempArray
|
||||
lbStatus.selection = tempArray.count
|
||||
|
||||
tempFileArray = lbStatusFilepath.items
|
||||
append tempFileArray filepath
|
||||
lbStatusFilepath.items = tempFileArray
|
||||
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = filepath
|
||||
setCommandPanelTaskMode mode:tempMode
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radExportAdd").state of
|
||||
(
|
||||
1: cryTools.cryAnim.base.perforce filepath #add
|
||||
3: cryTools.cryAnim.base.perforce filepath #checkForAdd
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnExport.pressed" )
|
||||
)
|
||||
|
||||
on btnSaveExport pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
baseBip = cryTools.cryAnim._f.getBaseBip()
|
||||
if baseBip != undefined then
|
||||
(
|
||||
if (cryTools.cryAnim.UI.main.loadSave._v.bipSavePath == (substring crytools.BuildPathFull 1 (crytools.BuildPathFull.count - 1)) + "_Production\Art\Animation\Human\*.bip") or ((cryTools.cryAnim.UI.main._f.getUI "Settings" "radSaveExportPrompt").state == 1) then
|
||||
filepath = getSaveFileName filename:cryTools.cryAnim.UI.main.loadSave._v.bipSavePath types:"Biped (*.bip)|*.bip"
|
||||
else
|
||||
filepath = cryTools.cryAnim.UI.main.loadSave._v.bipSavePath
|
||||
|
||||
if filepath != undefined then
|
||||
(
|
||||
if (cryTools.cryAnim.UI.main._f.checkExport #saveExport filepath) == true then
|
||||
(
|
||||
local printBool = #(false,false)
|
||||
|
||||
if (exportPath = cryTools.cryAnim.UI.main._f.checkExport #ProductionToGame filepath) != false then
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = exportPath
|
||||
|
||||
local tempFilename = ""
|
||||
|
||||
local tempStatus = undefined
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveExportOpen").state of
|
||||
(
|
||||
1: tempStatus = cryTools.cryAnim.base.perforce filepath #open
|
||||
2: ( tempStatus = false ; cryTools.cryAnim.base.perforce filepath #setReadMessage )
|
||||
3: tempStatus = cryTools.cryAnim.base.perforce filepath #checkForSave
|
||||
)
|
||||
)
|
||||
else
|
||||
tempStatus = false
|
||||
|
||||
if tempStatus != undefined then
|
||||
(
|
||||
tempFilterFilename = filterString filepath "\\"
|
||||
|
||||
if (animationRange.start != spnBegin.value) or (animationRange.end != spnEnd.value) then
|
||||
(
|
||||
local tempInterval = cryTools.cryAnim.UI.main.loadSave._f.checkRange spnBegin.value spnEnd.value
|
||||
spnBegin.value = tempInterval.start
|
||||
spnEnd.value = tempInterval.end
|
||||
)
|
||||
|
||||
biped.saveBipFileSegment baseBip.controller filepath spnBegin.value spnEnd.value #keyPerFrame
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipSavePath = filepath
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = filepath
|
||||
|
||||
|
||||
|
||||
|
||||
printBool[1] = true
|
||||
tempFilename = tempFilterFilename[tempFilterFilename.count]
|
||||
|
||||
if (cryTools.cryAnim.UI.main._f.checkExport #save filepath) == true then
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveExportAdd").state of
|
||||
(
|
||||
1: cryTools.cryAnim.base.perforce filepath #add
|
||||
3: cryTools.cryAnim.base.perforce filepath #checkForAdd
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
local tempStatus = undefined
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveExportOpen").state of
|
||||
(
|
||||
1: tempStatus = cryTools.cryAnim.base.perforce exportPath #open
|
||||
2: ( tempStatus = false ; cryTools.cryAnim.base.perforce exportPath #setReadMessage )
|
||||
3: tempStatus = cryTools.cryAnim.base.perforce exportPath #checkForSave
|
||||
)
|
||||
)
|
||||
else
|
||||
tempStatus = false
|
||||
|
||||
if tempStatus != undefined then
|
||||
(
|
||||
/*
|
||||
tempDirFilter = filterString exportPath "\\"
|
||||
tempDirString = ""
|
||||
for i = 1 to (tempDirFilter.count - 1) do
|
||||
(
|
||||
tempDirString += tempDirFilter[i] + "\\"
|
||||
makeDir tempDirString
|
||||
)
|
||||
*/
|
||||
|
||||
cryTools.cryAnim.UI.main._f.checkExport #createFolder exportPath
|
||||
|
||||
if $'Bip01 R ForeTwist'.parent != $'Bip01 R Forearm' then $'Bip01 R ForeTwist'.parent = $'Bip01 R Forearm'
|
||||
if $'Bip01 R ForeTwist'.parent != $'Bip01 L Forearm' then $'Bip01 L ForeTwist'.parent = $'Bip01 L Forearm'
|
||||
|
||||
try ( cryTools.cryAnim.UI.main.loadSave._f.bakeMuscleBones() ) catch()
|
||||
|
||||
|
||||
local tempMode = getCommandPanelTaskMode()
|
||||
UtilityPanel.OpenUtility CryEngine2_Exporter
|
||||
|
||||
local boneList = #()
|
||||
for i = 1 to lbExport.items.count do
|
||||
append boneList (getNodeByName lbExport.items[i])
|
||||
|
||||
csexport.set_bone_list boneList
|
||||
|
||||
local tempBool = (csexport.export.export_anim exportPath)
|
||||
while tempBool != OK do ( escapeEnable = true ; sleep 0.1 )
|
||||
|
||||
tempFilterFilename = filterString exportPath "\\"
|
||||
|
||||
printBool[2] = true
|
||||
|
||||
setCommandPanelTaskMode mode:tempMode
|
||||
|
||||
if cryTools.cryAnim._v.perforceDir != undefined then
|
||||
(
|
||||
case (cryTools.cryAnim.UI.main._f.getUI "Perforce" "radSaveExportAdd").state of
|
||||
(
|
||||
1: cryTools.cryAnim.base.perforce exportPath #add
|
||||
3: cryTools.cryAnim.base.perforce exportPath #checkForAdd
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
local tempArray = lbStatus.items
|
||||
local tempString = ""
|
||||
|
||||
if printBool[1] != printBool[2] then
|
||||
(
|
||||
if printBool[1] == true then tempString = "S"
|
||||
if printBool[2] == true then tempString = "E"
|
||||
)
|
||||
else
|
||||
(
|
||||
tempString = "SE"
|
||||
)
|
||||
|
||||
append tempArray (tempString + " - " + tempFilename)
|
||||
lbStatus.items = tempArray
|
||||
lbStatus.selection = tempArray.count
|
||||
|
||||
tempFileArray = lbStatusFilepath.items
|
||||
append tempFileArray filepath
|
||||
lbStatusFilepath.items = tempFileArray
|
||||
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.btnSaveExport.pressed" )
|
||||
)
|
||||
|
||||
|
||||
on lbStatus doubleClicked value do
|
||||
(
|
||||
try
|
||||
(
|
||||
try (destroyDialog cryTools.cryAnim.UI.main.loadSave.showSelectedFile) catch()
|
||||
|
||||
rollout showSelectedFile "SelectedFile"
|
||||
(
|
||||
edittext edFilename "" width:(cryTools.cryAnim.UI.main.loadSave._f.getStatusExtents() + 40)
|
||||
edittext edFilepath "" width:(cryTools.cryAnim.UI.main.loadSave._f.getStatusExtents() + 40)
|
||||
label labPerforce "Perforce Path:"
|
||||
edittext edFilepathPerforce "" width:(cryTools.cryAnim.UI.main.loadSave._f.getStatusExtents() + 40)
|
||||
|
||||
on showSelectedFile open do
|
||||
(
|
||||
if cryTools.cryAnim._v.perforceDir == undefined then
|
||||
(
|
||||
labPerforce.visible = false
|
||||
edFilepathPerforce.visible = false
|
||||
)
|
||||
|
||||
local tempSLB = cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "lbStatus"
|
||||
local tempSFLB = cryTools.cryAnim.UI.main._f.getUI "Load / Save / Export" "lbStatusFilepath"
|
||||
|
||||
local tempSize = getTextExtent tempSFLB.items[tempSLB.selection]
|
||||
|
||||
cryTools.cryAnim.UI.main.loadSave.showSelectedFile.width = (cryTools.cryAnim.UI.main.loadSave._f.getStatusExtents() + 70)
|
||||
|
||||
local tempString = filterString tempSLB.items[tempSLB.selection] " "
|
||||
local tempString = tempString[tempString.count]
|
||||
|
||||
edFilename.text = tempString
|
||||
edFilepath.text = tempSFLB.items[tempSLB.selection]
|
||||
|
||||
edFilepathPerforce.text = cryTools.cryAnim.base.perforce tempSFLB.items[tempSLB.selection] #localToDepot
|
||||
)
|
||||
)
|
||||
cryTools.cryAnim.UI.main.loadSave.showSelectedFile = showSelectedFile
|
||||
showSelectedFile = undefined
|
||||
|
||||
createDialog cryTools.cryAnim.UI.main.loadSave.showSelectedFile pos:[(mouse.pos[1]),(mouse.pos[2] + 70)]
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.loadSaveRO.lbStatus.doubleClicked" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
on btnbatchProcess pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.batchProcess._f.callDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error loading batchProcess ms" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created loadSaveRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row2 loadSaveRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 loadSaveRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding loadSaveRO to main dialog" )
|
||||
loadSaveRO = undefined
|
||||
|
||||
|
||||
logOutput ">> save.ms loaded"
|
||||
@@ -0,0 +1,186 @@
|
||||
--###############################################################################
|
||||
--// rollout with the selection list and what axes to use or if there is an offset
|
||||
--###############################################################################
|
||||
rollout targetRO "Target"
|
||||
(
|
||||
dropDownList ddSelection "" pos:[8,8] width:144 height:21
|
||||
|
||||
groupBox grpAxis "Used Axis" pos:[2,37] enabled:false width:153 height:85 --85 -- 107 -- 125
|
||||
label labX "X" pos:[38,57] enabled:false
|
||||
label labY "Y" pos:[65,57] enabled:false
|
||||
label labZ "Z" pos:[92,57] enabled:false
|
||||
label labOffset "Offset" pos:[117,57] enabled:false
|
||||
label labPos "Pos" pos:[10,75] enabled:false
|
||||
checkbox chkX pos:[36,75] height:16 enabled:false
|
||||
checkbox chkY pos:[63,75] height:16 enabled:false
|
||||
checkbox chkZ pos:[90,75] height:16 enabled:false
|
||||
checkbox chkPosOffset pos:[117,75] height:16 width:15 enabled:false
|
||||
|
||||
label labRot "Rot" pos:[10,98] enabled:false
|
||||
checkbox chkXRot pos:[36,98] height:16 enabled:false
|
||||
checkbox chkYRot pos:[63,98] height:16 enabled:false
|
||||
checkbox chkZRot pos:[90,98] height:16 enabled:false
|
||||
checkbox chkRotOffset pos:[117,98] height:16 width:15 enabled:false
|
||||
|
||||
button btnSetOffset "S" pos:[137,76] height:37 width:15 enabled:false toolTip:"Retrieve the offset of selected node and selection in the list"
|
||||
|
||||
label labEditOffset1 "1" pos:[8,122] height:20 width:40 visible:false
|
||||
label labEditOffset2 "2" pos:[8,140] height:20 width:40 visible:false
|
||||
edittext edOffset1 "" pos:[30,120] fieldWidth:118 visible:false
|
||||
edittext edOffset2 "" pos:[30,138] fieldWidth:118 visible:false
|
||||
|
||||
timer clock interval:10000 active:true
|
||||
|
||||
label labChange "" pos:[0,0] height:1 enabled:false
|
||||
|
||||
|
||||
|
||||
on targetRO close do
|
||||
(
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim._v.various[10] == undefined then
|
||||
cryTools.cryAnim.base.iniFile #set #visible value:"0"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.close" )
|
||||
)
|
||||
|
||||
on targetRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #targetRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #targetRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on targetRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try ( if (cryTools.cryAnim.base.iniFile #get #rolloutStates) == true then (cryTools.cryAnim.UI.main._f.getUI "Target" "").open = cryTools.cryAnim.base.iniFile #get #targetRO) catch()
|
||||
(cryTools.cryAnim.UI.main._f.getUI "Target" "").height =128
|
||||
|
||||
cryTools.cryAnim.UI.main.target._f.updateDDSelection()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.open" )
|
||||
)
|
||||
|
||||
on ddSelection selected value do
|
||||
(
|
||||
try
|
||||
(
|
||||
groupArray = #(\
|
||||
grpAxis, labX, labY, labZ, labOffset, \
|
||||
labPos, chkX, chkY, chkZ, chkPosOffset, \
|
||||
labRot, chkXRot, chkYRot, chkZRot, chkRotOffset )
|
||||
|
||||
|
||||
if ddSelection.selection <= 3 then
|
||||
(
|
||||
cryTools.cryAnim.UI.main.target._f.updateDDSelection op:false
|
||||
ddSelection.selection = 1
|
||||
|
||||
if (findString labChange.text "1") == undefined then
|
||||
labChange.text = "1:Changed"
|
||||
else
|
||||
labChange.text = "1:Unchanged"
|
||||
|
||||
|
||||
)
|
||||
else
|
||||
(
|
||||
cryTools.cryAnim.UI.main.target._f.updateDDSelection op:true
|
||||
|
||||
if (findString labChange.text "2") == undefined then
|
||||
labChange.text = "2:Changed"
|
||||
else
|
||||
labChange.text = "2:Unchanged"
|
||||
)
|
||||
|
||||
cryTools.cryAnim.UI.main.operation._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.ddSelection.selected" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on btnSetOffset pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if $selection.count > 0 then
|
||||
(
|
||||
cryTools.cryAnim._v.various[35] = #()
|
||||
|
||||
local tempSnap = cryTools.cryAnim._f.createSnapshot()
|
||||
for obj in tempSnap do
|
||||
(
|
||||
in coordsys (getNodeByName (cryTools.cryAnim.UI.main._f.getUI "Target" "").ddSelection.selected)
|
||||
append cryTools.cryAnim._v.various[35] (rotPosStruct rotation:obj.rotation position:obj.pos)
|
||||
)
|
||||
for obj in tempSnap do
|
||||
delete obj
|
||||
|
||||
cryTools.cryAnim.UI.main.target._f.updateOffset()
|
||||
|
||||
)
|
||||
else
|
||||
messageBox "No Node selected." title:"Set Offset"
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.btnSetOffset.pressed" )
|
||||
)
|
||||
|
||||
on chkPosOffset changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.UI.main.target._f.updateOffset()
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.chkPosOffset.changed" )
|
||||
)
|
||||
|
||||
on chkRotOffset changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.UI.main.target._f.updateOffset()
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.chkRotOffset.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on edOffset1 entered value do
|
||||
(
|
||||
try
|
||||
setManualOffset labEditOffset1 edOffset1
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.edOffset1.entered" )
|
||||
)
|
||||
|
||||
on edOffset2 entered value do
|
||||
(
|
||||
try
|
||||
setManualOffset labEditOffset2 edOffset2
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.targetRO.edOffset2.entered" )
|
||||
)
|
||||
)
|
||||
logOutput "> Created targetRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 targetRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 targetRO
|
||||
)
|
||||
catch ( logOutput "!!> Error adding targetRO to main dialog" )
|
||||
targetRO = undefined
|
||||
|
||||
|
||||
logOutput ">> target.ms loaded"
|
||||
@@ -0,0 +1,204 @@
|
||||
--###############################################################################
|
||||
--// rollout with internal control _f like Promt for File when saving, exporting, save+export, or reloading the whole script as well as the perforce control
|
||||
--###############################################################################
|
||||
rollout settingsRO "Settings"
|
||||
(
|
||||
button btnReload "Reload CryAnim" pos:[8,8] width:142 height:20 toolTip:"Reloads the whole cryAnim script and dialog"
|
||||
|
||||
groupBox grpLoadingDialog " Promt for File " pos:[2,40] width:153 height:100
|
||||
|
||||
label labPromptN "Yes" pos:[105,60]
|
||||
label labPromptA "No" pos:[129,60]
|
||||
|
||||
label labPromptSave "Save" pos:[14,75]
|
||||
label labPromptExport "Export" pos:[14,95]
|
||||
label labPromptSaveExport "Save/Export" pos:[14,115]
|
||||
|
||||
radiobuttons radSavePrompt pos:[108,75] labels:#("","") columns:2 default:1
|
||||
radiobuttons radExportPrompt pos:[108,95] labels:#("","") columns:2 default:1
|
||||
radiobuttons radSaveExportPrompt pos:[108,115] labels:#("","") columns:2 default:1
|
||||
|
||||
|
||||
label labWorkingDir "Biped Working Directory :" pos:[10,150]
|
||||
edittext edWorkingDir "" pos:[4,170] fieldWidth:140
|
||||
button btnPickWorkingDir "Pick" pos:[8,190] height:20 width:65 toolTip:"Get the path for the biped working directory"
|
||||
button btnSetWorkingDir "Set" pos:[85,190] height:20 width:65 toolTip:"Set the path as biped working directory"
|
||||
|
||||
checkbox chkMultiRow "Multi Row Dialog" pos:[10,230] checked:true
|
||||
checkbox chkRolloutStates "Use Rollout States" pos:[10,250] checked:false
|
||||
checkbox chkReadOnly "Notify File Attribute" pos:[10,270] checked:true
|
||||
|
||||
--button btnCustomizeRollouts "Customize Rollouts" pos:[8,290] width:142 height:20
|
||||
|
||||
|
||||
|
||||
on settingsRO open do
|
||||
(
|
||||
try
|
||||
(
|
||||
try radLoadOpen.state = cryTools.cryAnim.base.iniFile #get #loadOpen catch()
|
||||
try radSaveOpen.state = cryTools.cryAnim.base.iniFile #get #saveOpen catch()
|
||||
try radExportOpen.state = cryTools.cryAnim.base.iniFile #get #exportOpen catch()
|
||||
try radSaveExportOpen.state = cryTools.cryAnim.base.iniFile #get #saveExportOpen catch()
|
||||
|
||||
try radSaveAdd.state = cryTools.cryAnim.base.iniFile #get #saveAdd catch()
|
||||
try radExportAdd.state = cryTools.cryAnim.base.iniFile #get #exportAdd catch()
|
||||
try radSaveExportAdd.state = cryTools.cryAnim.base.iniFile #get #saveExportAdd catch()
|
||||
|
||||
try radSavePrompt.state = cryTools.cryAnim.base.iniFile #get #savePrompt catch()
|
||||
try radExportPrompt.state = cryTools.cryAnim.base.iniFile #get #exportPrompt catch()
|
||||
try radSaveExportPrompt.state = cryTools.cryAnim.base.iniFile #get #saveExportPrompt catch()
|
||||
try edWorkingDir.text = cryTools.cryAnim.base.iniFile #get #workingDir catch()
|
||||
if edWorkingDir.text == "" then
|
||||
edWorkingDir.text = cryTools.buildPathFull + "Game\\Animations\\"
|
||||
|
||||
cryTools.cryAnim.UI.main._v.bipWorkingDir = edWorkingDir.text
|
||||
cryTools.cryAnim.UI.main._v.cafWorkingDir = subString crytools.cbapath 1 (crytools.cbapath.count - 14)
|
||||
|
||||
if cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath == "" then
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = cryTools.cryAnim.UI.main._v.bipWorkingDir + "*.bip"
|
||||
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipSavePath = cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath
|
||||
cryTools.cryAnim.UI.main.loadSave._v.cafSavePath = cryTools.cryAnim.UI.main._v.cafWorkingDir + "*.caf"
|
||||
|
||||
try local multiRow = cryTools.cryAnim.base.iniFile #get #multiRow catch()
|
||||
if multiRow != "" then chkMultiRow.checked = multiRow
|
||||
|
||||
try chkRolloutStates.checked = cryTools.cryAnim.base.iniFile #get #rolloutStates catch()
|
||||
try chkReadOnly.checked = cryTools.cryAnim.base.iniFile #get #readOnly catch()
|
||||
|
||||
|
||||
if chkRolloutStates.checked == true then
|
||||
try ( (cryTools.cryAnim.UI.main._f.getUI "Tools" "").open = cryTools.cryAnim.base.iniFile #get #settingsRO ) catch()
|
||||
|
||||
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.open" )
|
||||
)
|
||||
|
||||
|
||||
on settingsRO rolledUp value do
|
||||
(
|
||||
try
|
||||
(
|
||||
if (cryTools.cryAnim.base.iniFile #get #settingsRO) != value then
|
||||
cryTools.cryAnim.base.iniFile #set #settingsRO
|
||||
|
||||
cryTools.cryAnim.UI.main._f.updateDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.rolledUp" )
|
||||
)
|
||||
|
||||
|
||||
on btnReload pressed do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.reloadScript()
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.btnReload.pressed" )
|
||||
)
|
||||
|
||||
on btnPickWorkingDir pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.UI.main._v.bipWorkingDir == "" then
|
||||
local tempVar = (getSavePath caption:"Project Directory" initialDir:crytools.BuildPathFull)
|
||||
else
|
||||
local tempVar = (getSavePath caption:"Project Directory" initialDir:cryTools.cryAnim.UI.main._v.bipWorkingDir)
|
||||
|
||||
if tempVar != undefined then
|
||||
(
|
||||
if tempVar[tempVar.count] != "\\" then
|
||||
append tempVar "\\"
|
||||
|
||||
edWorkingDir.text = tempVar
|
||||
)
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.btnPickWorkingDir.pressed" )
|
||||
)
|
||||
|
||||
on btnSetWorkingDir pressed do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.UI.main._v.bipWorkingDir = edWorkingDir.text
|
||||
cryTools.cryAnim.UI.main.loadSave._v.bipOpenPath = edWorkingDir.text + ".bip"
|
||||
cryTools.cryAnim.base.iniFile #set #workingDir
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.btnSetWorkingDir.pressed" )
|
||||
)
|
||||
|
||||
on chkMultiRow changed value do
|
||||
(
|
||||
try
|
||||
(
|
||||
cryTools.cryAnim.base.iniFile #set #multiRow
|
||||
cryTools.cryAnim.UI.main._f.callDialog()
|
||||
)
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.chkMultiRow.changed" )
|
||||
)
|
||||
|
||||
on chkRolloutStates changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #rolloutStates
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.chkRolloutStates.changed" )
|
||||
)
|
||||
|
||||
on chkReadOnly changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #readOnly
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.chkReadOnly.changed" )
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
on radSavePrompt changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #savePrompt
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.radSavePromt.changed" )
|
||||
)
|
||||
|
||||
on radExportPrompt changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #exportPrompt
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.radExportPrompt.changed" )
|
||||
)
|
||||
|
||||
on radSaveExportPrompt changed value do
|
||||
(
|
||||
try
|
||||
cryTools.cryAnim.base.iniFile #set #saveExportPrompt
|
||||
catch ( logOutput "!!> Error in cryTools.cryAnim.UI.main.dialog.settingsRO.radSaveExportPrompt.changed" )
|
||||
)
|
||||
|
||||
|
||||
on btnCustomizeRollouts pressed do
|
||||
(
|
||||
cryTools.cryAnim.UI.main.settings._f.callCustomizeDialog()
|
||||
)
|
||||
|
||||
|
||||
)
|
||||
logOutput "> Created settingsRO rollout"
|
||||
|
||||
|
||||
try
|
||||
(
|
||||
if cryTools.cryAnim.base.iniFile #get #multiRow == true then
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row4 settingsRO
|
||||
else
|
||||
addSubRollout cryTools.cryAnim.UI.main.dialog.row1 settingsRO rolledUp:true
|
||||
)
|
||||
catch ( logOutput "!!> Error adding settingsRO to main dialog" )
|
||||
settingsRO = undefined
|
||||
|
||||
|
||||
logOutput ">> tools.ms loaded"
|
||||
Reference in New Issue
Block a user