fn CreatePointsD Nombre= ( global PUNTOS_D = #() global BASE_CADERA_D = point name: (Nombre + "_" + "PT_Base_Cadera_D") pos: [40,0,135] size: 5 wirecolor: green append PUNTOS_D BASE_CADERA_D global CADERA_D = point name: (Nombre + "_" + "PT_Cadera_D") pos: [40,0,120] size: 5 wirecolor: green CADERA_D.parent = BASE_CADERA_D append PUNTOS_D CADERA_D global RODILLA_D = point name: (Nombre + "_" + "PT_Rodilla_D") pos: [40,-10,60] size: 5 wirecolor: green RODILLA_D.parent = CADERA_D append PUNTOS_D RODILLA_D global TOBILLO_D = point name: (Nombre + "_" + "PT_Tobillo_D") pos: [40,0,10] size: 5 wirecolor: green TOBILLO_D.parent = RODILLA_D append PUNTOS_D TOBILLO_D global BALL_D = point name: (Nombre + "_" + "PT_Ball_D") pos: [40,-15,0] size: 5 wirecolor: green BALL_D.parent = TOBILLO_D append PUNTOS_D BALL_D global TOE_D = point name: (Nombre + "_" + "PT_Toe_D") pos: [40,-25,0] size: 5 wirecolor: green TOE_D.parent = BALL_D append PUNTOS_D TOE_D global TOE_END_D = point name: (Nombre + "_" + "PT_Toe_end_D") pos: [40,-28,0] size: 5 wirecolor: green TOE_END_D.parent = TOE_D append PUNTOS_D TOE_END_D global CTRL_TOE_D= point name: (Nombre + "_" + "PT_Ctrl_Toe_D") pos: [40,-25,20] size: 5 wirecolor: red CTRL_TOE_D.PARENT = TOE_D global CTRL_PUNTA_D = point name: (Nombre + "_" + "PT_Ctrl_Punta_D") pos: [40,-28,-5] size: 5 wirecolor: red CTRL_PUNTA_D.PARENT = TOE_D global CTRL_TALON_D = point name: (Nombre + "_" + "PT_Ctrl_Talon_D") pos: [40,0,-5] size: 5 wirecolor: red CTRL_TALON_D.PARENT = TOBILLO_D --for o= 1 to PUNTOS_D.count do print (PUNTOS_D[o].name) ) fn CreatePointsI Nombre= ( global PUNTOS_I = #() global BASE_CADERA_I = point name: (Nombre + "_" + "PT_Base_Cadera_I") pos: BASE_CADERA_D.pos size: 5 wirecolor: green append PUNTOS_I BASE_CADERA_I global CADERA_I = point name: (Nombre + "_" + "PT_Cadera_I") pos: CADERA_D.pos size: 5 wirecolor: green CADERA_I.PARENT = BASE_CADERA_I append PUNTOS_I CADERA_I global RODILLA_I = point name: (Nombre + "_" + "PT_Rodilla_I") pos: RODILLA_D.POS size: 5 wirecolor: green RODILLA_I.PARENT = CADERA_I append PUNTOS_I RODILLA_I global TOBILLO_I = point name: (Nombre + "_" + "PT_Tobillo_I") pos: TOBILLO_D.POS size: 5 wirecolor: green TOBILLO_I.PARENT = RODILLA_I append PUNTOS_I TOBILLO_I global BALL_I = point name: (Nombre + "_" + "PT_Ball_I") pos: BALL_D.POS size: 5 wirecolor: green BALL_I.PARENT = TOBILLO_I append PUNTOS_I BALL_I global TOE_I = point name: (Nombre + "_" + "PT_Toe_I") pos: TOE_D.POS size: 5 wirecolor: green TOE_I.PARENT = BALL_I append PUNTOS_I TOE_I global TOE_END_I = point name: (Nombre + "_" + "PT_Toe_end_I") pos: TOE_END_D.POS size: 5 wirecolor: green TOE_END_I.parent = TOE_I append PUNTOS_I TOE_END_I global CTRL_TOE_I= point name: (Nombre + "_" + "PT_Ctrl_Toe_I") pos: CTRL_TOE_D.POS size: 5 wirecolor: red CTRL_TOE_I.PARENT = TOE_I global CTRL_PUNTA_I = point name: (Nombre + "_" + "PT_Ctrl_Punta_I") pos: CTRL_PUNTA_D.POS size: 5 wirecolor: red CTRL_PUNTA_I.PARENT = TOE_I global CTRL_TALON_I = point name: (Nombre + "_" + "PT_Ctrl_Talon_I") pos: CTRL_TALON_D.POS size: 5 wirecolor: red CTRL_TALON_I.PARENT = TOBILLO_I BASE_CADERA_I.transform =BASE_CADERA_I.transform * (ScaleMatrix [-1,1,1]) for o= 1 to PUNTOS_I.count do print (PUNTOS_I[o].name) ) fn CreaHuesosD ANCHO ALTO SIDES FRONTS BACKS TAPERSITO COLORES BOXMODE TIPO_CADENA IK_S NOMBRE= ( PIERNA_D = #() for i= 1 to ((PUNTOS_D.count)-1) do ( HUESOS_PIERNA_D = bonesys.createbone (PUNTOS_D[i].pos) (PUNTOS_D[i+1].pos) (cross PUNTOS_D[I].dir [1,0,0]) HUESOS_PIERNA_D.width = ANCHO HUESOS_PIERNA_D.height = ALTO HUESOS_PIERNA_D.sidefins =SIDES HUESOS_PIERNA_D.frontfin= FRONTS HUESOS_PIERNA_D.backfin=BACKS HUESOS_PIERNA_D.name = (NOMBRE + "_Bn_"+TIPO_CADENA + i as string + "_D") HUESOS_PIERNA_D.Taper=TAPERSITO HUESOS_PIERNA_D.wirecolor=COLORES HUESOS_PIERNA_D.boxmode= BOXMODE append PIERNA_D HUESOS_PIERNA_D ) for i= 1 to (PIERNA_D.count) do ( if PIERNA_D[i] != PIERNA_D[1] then PIERNA_D[i].parent = PIERNA_D[i-1] ) --TODO LO CORRESPONDIENTE AL IK if IK_S== true then ( --CREA EL SWIVLE SwivelIK_leg_D= circle pos: PIERNA_D[3].pos name:(NOMBRE + "_"+"SwivelIK_Leg_D") radius: 5 move SwivelIK_leg_D [0,-30,0] --CREA EL IK 1 IK_LEG_1_D = IKSys.ikChain PIERNA_D[2] PIERNA_D[4] "IKHISolver" IK_LEG_1_D.name = (NOMBRE + "_ik_chain_" as string + "IK_LEG_1_D") IK_LEG_1_D.transform.controller.VHTarget = SwivelIK_leg_D --CREA EL IK 2 IK_LEG_2_D = IKSys.ikChain PIERNA_D[4] PIERNA_D[5] "IKHISolver" IK_LEG_2_D.name = (NOMBRE + "_ik_chain_" as string + "IK_LEG_2_D") --IK_LEG_2_D.transform.controller.SAParent = 0 --CREA EL IK 2 IK_LEG_3_D = IKSys.ikChain PIERNA_D[5] PIERNA_D[6] "IKHISolver" IK_LEG_3_D.name = (NOMBRE + "_ik_chain_" + i as string + "IK_LEG_3_D") --CREA EL CONTROL DEL TOBILLO CTRL_TOBILLO= circle radius:(ANCHO *1) pos: PIERNA_D[4].pos name:(NOMBRE + "_"+"Ctrl_Tobillo" + "_D") in coordsys PIERNA_D[4] CTRL_TOBILLO.rotation = eulerangles 0 0 0 --CREA EL CONTROL DEL BALL CTRL_BALL_D= circle radius:(ANCHO *1) pos: PIERNA_D[5].pos name:(NOMBRE + "_"+"Ctrl_Ball" + "_D") in coordsys PIERNA_D[5] CTRL_BALL_D.rotation = eulerangles 0 0 0 --CREA EL CONTROL GENERAL DEL PIE CTRL_PIERNA_D= rectangle length:50 width:25 pos:CTRL_TALON_D.pos name:(NOMBRE +"_"+ "Ctrl_PIE_IK" + "_D") --CREA EL CONTROL DEL TOE Circ_CTRL_TOE_D = circle radius:(ANCHO *1) pos: CTRL_TOE_D.pos name:(NOMBRE + "_"+"Ctrl_Toe" + "_D") --CREA EL CONTROL DE LA PUNTA Circ_CTRL_PUNTA_D= circle radius:(ANCHO *1) pos: CTRL_PUNTA_D.pos name:(NOMBRE + "_"+"Ctrl_Punta" + "_D") --CREA EL CONTROL DEK TALON Circ_CTRL_TALON_D= circle radius:(ANCHO *1) pos: CTRL_TALON_D .pos name:(NOMBRE + "_"+"Ctrl_Talon" + "_D") --CAMBIA EL PIVOTE DEL CTRL TOE Circ_CTRL_TOE_D.pivot = PIERNA_D[5].pos --LINKEA EL CTRL TOE A CTRL PUNTA Circ_CTRL_TOE_D.parent = Circ_CTRL_PUNTA_D --LINKEA CTRL BALL A CTRL PUNTA CTRL_BALL_D.parent = Circ_CTRL_PUNTA_D --LINKEA CTRL PUNTA A CONTROL TALON Circ_CTRL_PUNTA_D.parent = Circ_CTRL_TALON_D --LINKEA CONTROL TALON A CONTROL TOBILLO Circ_CTRL_TALON_D.parent= CTRL_TOBILLO --linkea el iksolver 1 al control ball IK_LEG_1_D.parent = CTRL_BALL_D --LINKEA EL IKSOLVER 2 AL CTRL TOE IK_LEG_2_D.parent = Circ_CTRL_PUNTA_D --linkea el iksolver 3 al control punta IK_LEG_3_D.parent = Circ_CTRL_TOE_D --linkea el control tobillo al rectangulo CTRL_TOBILLO.parent =CTRL_PIERNA_D --AŅADE LOS CUSTOM ATTRIBUTES ModificadorPie_D= emptymodifier() addmodifier CTRL_PIERNA_D ModificadorPie_D ) else 0 ) fn CreaHuesosI ANCHO ALTO SIDES FRONTS BACKS TAPERSITO COLORES BOXMODE TIPO_CADENA IK_S NOMBRE= ( PIERNA_I = #() for i= 1 to ((PUNTOS_I.count)-1) do ( HUESOS_PIERNA_I = bonesys.createbone (PUNTOS_I[i].pos) (PUNTOS_I[i+1].pos) (cross PUNTOS_I[i].dir [1,0,0]) HUESOS_PIERNA_I.width = ANCHO HUESOS_PIERNA_I.height = ALTO HUESOS_PIERNA_I.sidefins =SIDES HUESOS_PIERNA_I.frontfin= FRONTS HUESOS_PIERNA_I.backfin=BACKS HUESOS_PIERNA_I.name = (NOMBRE + "_Bn_"+TIPO_CADENA + i as string + "_I") HUESOS_PIERNA_I.Taper=TAPERSITO HUESOS_PIERNA_I.wirecolor=COLORES HUESOS_PIERNA_I.boxmode= BOXMODE append PIERNA_I HUESOS_PIERNA_I ) for i= 1 to (PIERNA_I.count) do ( if PIERNA_I[i] != PIERNA_I[1] then PIERNA_I[i].parent = PIERNA_I[i-1] ) --TODO LO CORRESPONDIENTE AL IK if IK_S== true then ( --CREA EL SWIVLE SwivelIK_leg_I= circle pos: PIERNA_I[3].pos name:(NOMBRE + "_"+"SwivelIK_Leg_I") radius: 5 move SwivelIK_leg_I [0,-30,0] --CREA EL IK 1 IK_LEG_1_I = IKSys.ikChain PIERNA_I[2] PIERNA_I[4] "IKHISolver" IK_LEG_1_I.name = (NOMBRE + "_ik_chain_" as string + "IK_LEG_1_I") IK_LEG_1_I.transform.controller.VHTarget = SwivelIK_leg_I --CREA EL IK 2 IK_LEG_2_I = IKSys.ikChain PIERNA_I[4] PIERNA_I[5] "IKHISolver" IK_LEG_2_I.name = (NOMBRE + "_ik_chain_" as string + "IK_LEG_2_I") --IK_LEG_2_D.transform.controller.SAParent = 0 --CREA EL IK 2 IK_LEG_3_I = IKSys.ikChain PIERNA_I[5] PIERNA_I[6] "IKHISolver" IK_LEG_3_I.name = (NOMBRE + "_ik_chain_" + i as string + "IK_LEG_3_I") --CREA EL CONTROL DEL TOBILLO CTRL_TOBILLO_I= circle radius:(ANCHO *1) pos: PIERNA_I[4].pos name:(NOMBRE + "_"+"Ctrl_Tobillo" + "_I") in coordsys PIERNA_I[4] CTRL_TOBILLO_I.rotation = eulerangles 0 0 0 --CREA EL CONTROL DEL BALL CTRL_BALL_I= circle radius:(ANCHO *1) pos: PIERNA_I[5].pos name:(NOMBRE + "_"+"Ctrl_Ball" + "_I") in coordsys PIERNA_I[5] CTRL_BALL_I.rotation = eulerangles 0 0 0 --CREA EL CONTROL GENERAL DEL PIE CTRL_PIERNA_I= rectangle length:50 width:25 pos:CTRL_TALON_I.pos name:(NOMBRE +"_"+ "Ctrl_PIE_IK" + "_I") --CREA EL CONTROL DEL TOE Circ_CTRL_TOE_I = circle radius:(ANCHO *1) pos: CTRL_TOE_I.pos name:(NOMBRE + "_"+"Ctrl_Toe" + "_I") --CREA EL CONTROL DE LA PUNTA Circ_CTRL_PUNTA_I= circle radius:(ANCHO *1) pos: CTRL_PUNTA_I.pos name:(NOMBRE + "_"+"Ctrl_Punta" + "_I") --CREA EL CONTROL DEK TALON Circ_CTRL_TALON_I= circle radius:(ANCHO *1) pos: CTRL_TALON_I .pos name:(NOMBRE + "_"+"Ctrl_Talon" + "_I") --CAMBIA EL PIVOTE DEL CTRL TOE Circ_CTRL_TOE_I.pivot = PIERNA_I[5].pos --LINKEA EL CTRL TOE A CTRL PUNTA Circ_CTRL_TOE_I.parent = Circ_CTRL_PUNTA_I --LINKEA CTRL BALL A CTRL PUNTA CTRL_BALL_I.parent = Circ_CTRL_PUNTA_I --LINKEA CTRL PUNTA A CONTROL TALON Circ_CTRL_PUNTA_I.parent = Circ_CTRL_TALON_I --LINKEA CONTROL TALON A CONTROL TOBILLO Circ_CTRL_TALON_I.parent= CTRL_TOBILLO_I --linkea el iksolver 1 al control ball IK_LEG_1_I.parent = CTRL_BALL_I --LINKEA EL IKSOLVER 2 AL CTRL TOE IK_LEG_2_I.parent = Circ_CTRL_PUNTA_I --linkea el iksolver 3 al control punta IK_LEG_3_I.parent = Circ_CTRL_TOE_I --linkea el control tobillo al rectangulo CTRL_TOBILLO_I.parent =CTRL_PIERNA_I --AŅADE LOS CUSTOM ATTRIBUTES ModificadorPie_I= emptymodifier() addmodifier CTRL_PIERNA_I ModificadorPie_I ) else 0 ) try (destroydialog AUTOLEG) catch () rollout AUTOLEG "AUTO LEG" ( label lb_prefijo "Prefijo" --pos:[24,16] width:78 height:12 editText UI_Prefijo "" --pos:[16,32] width:98 height:20 spinner UI_ANCHO "Ancho" range: [2,100,3] spinner UI_ALTO "Alto" range: [2,100,3] radioButtons UI_LEGS "Legs" width:69 height:46 labels:#("Leg Right", "Leg Left") default:1 columns:1 group "Creacion" ( button UI_createPoints "Create Points" --pos:[32,152] width:88 height:24 button UI_CreateLeg "Create Leg" --pos:[32,184] width:88 height:24 ) on UI_createPoints pressed do with undo on ( case UI_LEGS.state of ( 1:(CreatePointsD (UI_Prefijo.text)) 2:(CreatePointsI (UI_Prefijo.text)) ) ) on UI_CreateLeg pressed do with undo on ( case UI_LEGS.state of ( 1:( --CREACION FK --CreaHuesosD (UI_ANCHO.value) (UI_ALTO.value) false true true 0 blue off ("FK") (false) (UI_Prefijo.text) --CREACION IK CreaHuesosD ((UI_ANCHO.value)*2) ((UI_ALTO.value)*2) false false false 90 red off ("IK") (true) (UI_Prefijo.text) --CREACION MAIN --CreaHuesosD (UI_ANCHO.value*1.3) (UI_ALTO.value*1.3) false false false 0 green off ("MAIN") (false) (UI_Prefijo.text) ) 2:( --CREACION FK --CreaHuesosI (UI_ANCHO.value) (UI_ALTO.value) false true true 0 blue off ("FK") (false) (UI_Prefijo.text) --CREACION IK CreaHuesosI ((UI_ANCHO.value)*2) ((UI_ALTO.value)*2) false false false 90 red off ("IK") (true) (UI_Prefijo.text) --CREACION MAIN --CreaHuesosI (UI_ANCHO.value*1.3) (UI_ALTO.value*1.3) false false false 0 green off ("MAIN") (false) (UI_Prefijo.text) ) ) ) ) createDialog AUTOLEG