Notifications
Clear all

[Closed] Linking scene objects?

I am trying to link scene objects at a specific frame and will be running that script in the background.

I have come up with something like this


if sliderTime == 421f then $Pistol.parent = $RHTHand
HTML] 
 
But this is not working.
Please advice.
 
Thanks
13 Replies

what you do is completely wrong. link in max is not animatable, and the ‘linking’ at a specific frame doesn’t make sense. look at Link_Constraint… that’s the way how to do this thing.

1 Reply
(@sumchans)
Joined: 11 months ago

Posts: 0

Thanks for pointing me to the right direction .Tried out the link constraint, but a few problems again.
I link constrained a gun to the gun holder of the character at frame 0 and then later on to the right hand at frame 425 using the “Add Link” option of the link constarint. This is the time when the character is picking up the gun. For some reason the linking to the right hand doesn’t seem to work.

Please advise.

Thanks again.

Oh, thanks Denis, dint know that

what key_mode of the Link_Constraint do you set? in your case it probably has to be 2. (default is 0)

It was set to the default, but I changed it to option 2 which is the “Key nodes” with child selected, still doesn’t make any difference.
Please advise.

Thanks for the speedy reply.

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

no more max for today… tomorrow i will try to find a time to make a snippet. but… there is my other post that shows how the link_constraint works: http://forums.cgsociety.org/showpost.php?p=7368794&postcount=23

Ok no problem, Thanks again.


 delete objects
body = box name:"body" width:20 length:2 height:2 wirecolor:yellow
in body
(
	larm = sphere name:"larm" pos:[10,0,1] radius:3 wirecolor:blue
	rarm = sphere name:"rarm" pos:[-10,0,1] radius:3 wirecolor:green
)
gun = converttopoly (box name:"gun" pos:[10,0,-5] width:1 length:1 height:20 heightsegs:15 wirecolor:orange)
polyop.extrudefaces gun #{18..28} 1
polyop.extrudefaces gun #{18,19} 4
polyop.extrudefaces gun #{25} 8

c = gun.controller = Link_Constraint key_mode:2
c.addtarget larm 0
c.addtarget undefined 10
c.addtarget rarm 30
c.addtarget undefined 50
c.addtarget larm 70

animate on
(
	at time 10 rotate body (eulerangles 0 0 -90)
	at time 20 rotate body (eulerangles 0 0 90)
	at time 30 rotate body (eulerangles 0 0 90)	
	at time 40 rotate body (eulerangles 0 0 -90)	
	at time 50 rotate body (eulerangles 0 0 90)	
	at time 60 rotate body (eulerangles 0 0 -90)	
	at time 70 rotate body (eulerangles 0 0 -90)	
	at time 80 rotate body (eulerangles 0 0 90)	
)

animationrange = interval 0 80
slidertime = 0
playAnimation()
 

edit: Gun was improved!

I really thank you for the time you took for this snippet. Will try it out and let you know soon?

Just curious to know.
Why is it we have to script for the link constraint to work? Why the max link constraint not working?

1 Reply
(@mgernot)
Joined: 10 months ago

Posts: 0

You don`t have to use a script for that and the link-contraint is working just fine. Everything is exposed in the 3dsmax UI.
Take a look at this tutorial:
http://www.youtube.com/watch?v=b0SHfWUScic&feature=BFa&list=PL97BBB1A9955A9DD1

It`s just that this is the 3dsmax SDK/Script section of this board, so denis assumed that you would like a scripted solution.

Also hit (F1) for help.

Thanks MGernot,

I would prefer doing this procedure through the maxes command panel, but for some reason the linking to an object after a while in the animation, doesn’t seem to work and that’s why I am guessing Denis opted this scripted solution.

Just want to know whether its a bug with 3ds Max.

Like i said, i never had a problem with link-contraint.
Could it be something with your scene setup?

I found another nice tutorial from Autodesk:
http://www.youtube.com/watch?v=lK9mJ1pfhZo&list=PL97BBB1A9955A9DD1&index=4&feature=plcp

Does this work for you?

Page 1 / 2