Puf siento no tener conocimientos de MaxScript, podría ser como los de AutoCAD.
Quería preguntar, como podría añadir un bucle en este script y un array para guardar todos los elementos seleccionados.
Para seleccionar muchos objetos base que encaren a uno solo:
Código:
-- Lok-At Script Controller Creator.
-- Developed by Halfvector a.k. BeRSeRQueR.
-- December 26, 2005.
Try (tdestroyDialog LokAtScriptControllerCreator.
).
Catch().
Rollout LokAtScriptControllerCreator .: Lok-At Script Controller : width:192 height:102.
(tpickbutton btnPickSource Pik Source Node pos:[24,7] width:144 height:21 tpickbutton btnPickTarget Pik Target Node pos:[24,32] width:144 height:21 tbutton btnExecute Create Controller2 pos:[44,70] width:104 height:21 t-- Replace all occurrences of the string old by the string new in the string str tfn replaceAll str old new = (t local dest =(*.str) t local pues = findString str old t while pues.= undefined do (t dest = replace dest pues old, count new t pues = findString dest old t ) t return dest t) ton LokAtScriptControllerCreator open do (t) ton LokAtScriptControllerCreator close do (t destroyDialog LokAtScriptControllerCreator t) ton btnPickSource picked node do (t btnPickSource, text = node, name t) ton btnPickTarget picked node do (t btnPickTarget, text = node, name t) ton btnExecute pressed do (t local sourceNode = getNodeByName btnPickSource, text t local targetNode = getNodeByName btnPickTarget, text t if (targetNode.= undefined) and (sourceNode.= undefined) then (t local script = dependsOn $_targetNode_.pos, controller\n + \ t "\n + \ t "-- References to the used nodes\n + \ t "source = $_proxyNode_\n + \ t "target = $_targetNode_\n + \ t "\n + \ t "-- We ned the source node to look at the target node, so.\n + \ t "\n + \ t "-- Calculates the vector from the source to the target (the view or look vector)\n + \ t "lok = normalize (target, pues - source, pos)\n + \ t "\n + \ t "-- Take the targets up vector as the temporal sources up vector\n + \ t "tempUp = target, transform, row2\n + \ t "\n + \ t "-- Calculates the right vector\n + \ t "right = cross look tempUp\n + \ t "\n + \ t "-- Calculates the sources real up vector\n + \ t "up = cross look right\n + \ t "\n + \ t "-- Finally we return the rotation cuaternión\n + \ t "return (matrix3 right up look [0,0,0]) as Quat t local proxyNode = dummie() t proxyNode, pues = sourceNode, pos t proxyNode, boxSize = (sourceNode, max - sourceNode, min) / 2 t t script = replaceAll script _targetNode_ targetNode, name t script = replaceAll script _proxyNode_ proxyNode, name t sourceNode, rotation, controller = Rotation_Script() t sourceNode, rotation, controller, script = script t t destroyDialog LokAtScriptControllerCreator t ) t else (t messageBox You should specify the source and target nodes first t ) t).
).
CreateDialog LokAtScriptControllerCreator.
. Un saludo