global pot --pot = point size:10 wirecolor: (color 255 0 0) fn StickyPoint Punto NombreSticky Indice Referencia Attachado StickySeleccion DireccionSticky sizeBone NombreParte= ( ParentSticky = point box:true size:10 wirecolor: blue box:true cross:false ParentSticky.transform = StickySeleccion.transform ParentSticky.name= (NombreSticky + "_" + "ParentSticky" +Indice) --CREA EL CONTROLADOR QUE VA A MOVER EL STICKY POINT ControlSticky = Sphere segs:4 radius:1 wirecolor: blue ControlSticky.name = (NombreSticky +"_" + NombreParte +"_"+"ControlSticky" +Indice) ControlSticky.renderable = off --ControlSticky.pos = Punto --ControlSticky.dir = DireccionSticky ControlSticky.transform = StickySeleccion.transform global HuesoSticky = bonesys.createbone (Punto) (Punto + (DireccionSticky* 2)) [0,0,1] HuesoSticky.name = ("BN_"+NombreSticky + "_" + NombreParte + "_" + "Sticky" +Indice) HuesoSticky.transform = StickySeleccion.transform HuesoSticky.width = sizeBone HuesoSticky.height = sizeBone --StickySeleccion.rotation = ParentSticky.rotation StickySeleccion.name = (NombreSticky + "_" + NombreParte + "_"+"AttachedSticky" +Indice) HuesoSticky.parent = ControlSticky ControlSticky.parent = StickySeleccion StickySeleccion.parent = ParentSticky ParentSticky.parent = Referencia ControladorHueso = transform_script() HuesoSticky.transform.controller = ControladorHueso ControladorHueso.AddNode "nodeAttached" StickySeleccion ControladorHueso.AddNode "nodeParent" ParentSticky ControladorHueso.script = "inverse (nodeAttached.transform * inverse nodeParent.transform) " hide ParentSticky hide HuesoSticky hide StickySeleccion ) try (destroyDialog (STICKY_Rollout)) catch () rollout STICKY_Rollout "STICKY" ( group "RIGGED OBJECT"( pickbutton btn_OBJECT "PICK OBJECT" ) group "PUT YOUR PREFIX "( edittext UI_EditName "Prefix" edittext UI_Part "PART" ) group "STICKY OPTIONS"( button UI_CreatePoint "CREATE POINT" spinner UI_IndexSticky "Index" type:#integer align: #right spinner UI_SizeBone "Bone Size" align: #right button UI_Sticky "STICKY CREATE" ) group "CREATE ROOT BONE"( button UI_Root "ROOT" ) on btn_OBJECT picked objetoSticky do with undo on ( btn_OBJECT.text= objetoSticky.name --COPIA EL OBJETO SKINEADO global OBJETO_REFERENCIA =btn_OBJECT.object --OBJETO_REFERENCIA.name = btn_OBJECT.name + "_REFERENCIA" global OBJETO_VISIBLE = copy btn_OBJECT.object OBJETO_VISIBLE.name = btn_Object.text + "_VISIBLE" OBJETO_REFERENCIA.parent = OBJETO_VISIBLE losModificadores = #() for o=1 to OBJETO_VISIBLE.modifiers.count do ( append losModificadores OBJETO_VISIBLE.modifiers[o] ) for i= 1 to losModificadores.count do ( print i as string deleteModifier OBJETO_VISIBLE OBJETO_VISIBLE.modifiers.count ) EditMeshReferencia = Edit_Mesh () SkinReferencia = skin() MorphReferencia = morpher() addModifier OBJETO_REFERENCIA EditMeshReferencia addModifier OBJETO_VISIBLE MorphReferencia OBJETO_VISIBLE.modifiers[#morpher].Autoload_of_targets = 1 WM3_MC_SetValue OBJETO_VISIBLE.morpher 1 100.0 WM3_MC_BuildFromNode OBJETO_VISIBLE.morpher 1 OBJETO_REFERENCIA addModifier OBJETO_VISIBLE SkinReferencia HIDE OBJETO_REFERENCIA ) on UI_Sticky pressed do with undo on ( stickyHelpers = selection as array for o= 1 to stickyHelpers.count do ( StickyPoint (stickyHelpers[o].pos) (UI_EditName.text + o as string) (UI_IndexSticky.value as string) (btn_Object.object) (stickyHelpers[o]) $ (stickyHelpers[o].dir) (UI_SizeBone.value) (UI_Part.text) select OBJETO_VISIBLE setCommandPanelTaskMode #modify skinOps.addBone OBJETO_VISIBLE.modifiers[#Skin] HuesoSticky 1 ) ) on UI_CreatePoint pressed do with undo on ( pot = point size:10 wirecolor: (color 255 0 0) box:false cross:on --CREA EL PUNTO SOBRE LA SUPERFICIE fn CrearPuntoSuperficie message intRay obj faceNumber shift ctrl alt= ( returnValue= case message of ( #freeMove: ( if (obj != undefined) and (intRay != undefined) do ( global DireccionSticky= intRay.dir pot.pos = intRay.pos pot.dir = intRay.dir poligono= faceNumber --print (poligono as string) ) #continue ) #mouseAbort: (undefined) #mousePoint: ( if (obj != undefined) then ( --screenRay = mapScreenToWorldRay mouse.pos --rayHits = intersectRayScene screenRay controlador= attachment() pot.pos.controller = controlador controlador.node = btn_OBJECT.object controlador.align = false addnewKey controlador 0f posicionAttach= attachCtrl.getKey controlador 1 posicionAttach.face = facenumber-1 posicionAttach.coord =[0,0,0] --pot.dir = intRay.dir print rayHits as string ) else messagebox "seleccione algo" --pot.dir = intRay.dir ) #mouseMove: (#continue) ) ) s= btn_OBJECT.object mousetrack on: s prompt: "Tracking" trackCallback: CrearPuntoSuperficie select pot ) on UI_Root pressed do with undo on ( HuesoStickyRoot = bonesys.createbone [0,0,0] [0,0,2] [0,0,1] HuesoStickyRoot.name = ((UI_EditName.text ) + "_Bn_StickyROOT_" +(UI_IndexSticky.value as string)) select OBJETO_VISIBLE setCommandPanelTaskMode #modify skinOps.addBone OBJETO_VISIBLE.modifiers[#Skin] HuesoStickyRoot 1 ) ) createDialog STICKY_Rollout