PDA

View Full Version : Post Your best Max Programing tuts. here!


grafiti
03-02-2005, 10:27 PM
Hey everyone ...:buttrock:

...Lets put all your best 3ds max programing here for newbs, intermediate, advenced, and expert users..

Lets all help everyone here//:applause:

grafiti
03-08-2005, 05:27 PM
Isnt anyone Gonna Help :eek:

.... waiting!

Tak Tak
03-08-2005, 05:59 PM
OK here comes! This script will create simple resizeble "Face control UI" (sorry it's still beta). I want to thank Phatdaddy to give me some inspiration!

-- TakTools, Face_CTRL_Maker


rollout faceCTRLmaker "Face CTRL Maker"

(
local newname, newsize

label name_lab "Name : " pos:[5,6]
label size_lab "Size : " pos:[5,31]

editText edt1 "" pos:[40,3] width:160 height:20
on edt1 changed arg do
newname = arg


spinner Size_spn "" pos:[43,30] width:50 range:[25,250,25] type:#integer
on Size_spn changed val do
newsize = val


button Create_btn "Create" pos:[160,29] height:17 width:40
on Create_btn pressed do

(
--disableSceneRedraw()
myText01 = text size:(newsize/5) transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,(newsize/1.9)])
myText01.name = "CTRL_" + newname + "_name"
myText01.text = newname
myText01.wirecolor = color 0 255 0


myRectangle01 = Rectangle length:(newsize/5) width:(newsize/5) cornerRadius:0 transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [(newsize/2),0,(newsize/2)]) isSelected: off
myRectangle01.name = "CTRL_" + newname + "_master"
myRectangle01.wirecolor = color 255 255 0


myRectangle02 = Rectangle length:newsize width:newsize cornerRadius:0 transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0])
myRectangle02.name = "CTRL_" + newname + "_cage"
myRectangle02.wirecolor = color 0 255 0


myCircle = Circle radius:(newsize/15) transform:(matrix3 [1,0,0] [0,0,1] [0,-1,0] [0,0,0])
myCircle.name = "CTRL_" + newname + "_point"
myCircle.wirecolor = color 255 0 0


myText01.parent = myRectangle01
myCircle.parent = myRectangle02
myRectangle02.parent = myRectangle01

myIK = iksys.ikchain myRectangle02 myCircle "IKHISolver"
myIK.parent = myRectangle01
myIK.name = "IKChain"
myIK.transform.controller.goalSize = 3
hide myIK
clearSelection()

myRectangle02.transform.controller.RotXActive = off
myRectangle02.transform.controller.RotYActive = off
myRectangle02.transform.controller.RotZActive = off

myCircle.transform.controller.PosXActive = on
myCircle.transform.controller.PosXLimited = on
myCircle.transform.controller.PosXLLimited = on
myCircle.transform.controller.PosXULimited = on
myCircle.transform.controller.PosYActive = on
myCircle.transform.controller.PosYLimited = on
myCircle.transform.controller.PosYLLimited = on
myCircle.transform.controller.PosYULimited = on
myCircle.transform.controller.PosZActive = on
myCircle.transform.controller.PosZLimited = on
myCircle.transform.controller.PosZLLimited = on
myCircle.transform.controller.PosZULimited = on

myCircle.transform.controller.PosXLLimit = (-newsize/2)
myCircle.transform.controller.PosXULimit = (newsize/2)
myCircle.transform.controller.PosYLLimit = (-newsize/2)
myCircle.transform.controller.PosYULimit = (newsize/2)
myCircle.transform.controller.PosZLLimit = 0
myCircle.transform.controller.PosZULimit = 0

myRectangle02.showFrozenInGray = off
myText01.showFrozenInGray = off
freeze myRectangle02
freeze myText01

--enableSceneRedraw()
--redrawViews()
)
on faceCTRLmaker open do newsize=Size_spn.value
)

createDialog faceCTRLmaker 205 50

Martin Andersen
03-10-2005, 11:10 AM
Great!

How do you link that to a morph target ?

Tak Tak
03-10-2005, 06:48 PM
I'll link it manualy with reactor controller. Maybe I should discover marktsang's Morph Control script. He's script will connect all targets automaticly.

grafiti,
Check this thread -> http://www.cgtalk.com/showthread.php?p=2035380#post2035380

Martin Andersen
03-10-2005, 07:01 PM
ok, what is the differenc between using the Reactor controller and Wire Parameter

ofer_z
03-10-2005, 07:19 PM
ok, what is the differenc between using the Reactor controller and Wire Parameter

the most important difference, IMHO, is speed. reactor controller is much, much faster than wire parameters (which is pretty much like script controllers.) I usually preffer to use reactor controller where possible. On the other hand, wire parameters (and script controllers) are much more flexible. where reactor controller is limited to generating value as a reaction to a different value, in wire parameters, you can control the value's behaviour completly, since it's maxscript based.

hOpe this helps,
o

CGTalk Moderation
03-10-2005, 07:19 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.