Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

[MXS] Assign Controller to multiple objects

5 REPLIES 5
SOLVED
Reply
Message 1 of 6
Pearl43
1194 Views, 5 Replies

[MXS] Assign Controller to multiple objects

Is there a way to Assign Controller to multiple objects at once? It would seem i have to go through them one by one and assign them, problem with that is i have hundreds of objects to do this to - and this wont be the last time i will need to do this. I originally Googled for this answer but couldnt find any soloution.

 

Any help would be greatly appreciated.

 

Cheers.

5 REPLIES 5
Message 2 of 6
Steve_Curley
in reply to: Pearl43

There is - via Maxscript, which is fairly straightforward. If you want to pursue that I'll move this thread to the Programming forum as it's not really a Modeling question (or won't be).

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 3 of 6
Pearl43
in reply to: Steve_Curley

That would be great, thanks.

Message 4 of 6
Steve_Curley
in reply to: Pearl43

First thing is which controller do you want to replace, and which controller do you want to replace it with.
Example. To replace the (default) Rotation controller (Euler_XYZ) with a TCB rotation controller (TCB_Rotation), assuming the necessary objects are already selected :-

(
for o in selection do 
   (
   o.rotation.controller = TCB_Rotation()
   )
)

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Message 5 of 6
Pearl43
in reply to: Steve_Curley

Hey mate, that worked great. I just need one for the position if you could help me out?

 

Position XYZ

Euler_XYZ Rotation XYZ

to TCB

 

 

Thanks mate i really appreciate it! 🙂

 

 

EDIT; I copied what you did and changed it to position and now it works fine.

 

Thanks very very much mate! 😄

 

(
for o in selection do 
   (
   o.position.controller = TCB_Position()
   )
)
(
for o in selection do 
   (
   o.rotation.controller = TCB_Rotation()
   )
)

 

Message 6 of 6
Steve_Curley
in reply to: Pearl43

That was just an example - I must be psychic 😉
You can do both at the same time, if that's what you need :-

(
for o in selection do 
   (
   o.position.controller = TCB_Position()
   o.rotation.controller = TCB_Rotation()
   )
)

You could (but only if you're certain it's what you want) change the default Position Controller to TCB_Position and the default rotation Controller to TCB_Rotation, but remember that if you do it will affect ALL newly created objects in ALL scenes, not just the one you're working on currently.
Create a temporary object, manually assign the controller you want, but instead of clicking OK click Make Default and agree with the warning (which most people seem to ignore and then get into a real mess), then click OK.

Max 2016 (SP1/EXT1)
Win7Pro x64 (SP1). i5-3570K @ 4.4GHz, 8Gb Ram, DX11.
nVidia GTX760 (2GB) (Driver 430.86).

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report