CGTalk > Software > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 11-21-2013, 11:31 PM   #16
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 486
So your animators never need to make an animation preview before exporting to FBX?

Last edited by Archangel35757 : 11-22-2013 at 12:56 AM.
 
Old 11-22-2013, 05:18 PM   #17
Mambo4
not a jedi yet
 
Mambo4's Avatar
portfolio
Logan Bender
Game Technical Artist
Greater Seattle, USA
 
Join Date: Nov 2010
Posts: 432
Nope, we export and review in the engine.
 
Old 11-22-2013, 09:20 PM   #18
Mambo4
not a jedi yet
 
Mambo4's Avatar
portfolio
Logan Bender
Game Technical Artist
Greater Seattle, USA
 
Join Date: Nov 2010
Posts: 432
I posted a similar question at tech-art.org and got a clever solution that avoids change scripts entirely, using a scale script controller on a proxy object.
 
Old 02-05-2014, 09:06 PM   #19
Mambo4
not a jedi yet
 
Mambo4's Avatar
portfolio
Logan Bender
Game Technical Artist
Greater Seattle, USA
 
Join Date: Nov 2010
Posts: 432
a late thread bump. The solution linked to above worked quite well.
It basically involved 'cheating' with a scale script controller on an unrelated object.
I condensed the solution into a fn that I can pass the bone, ctrl object, and script holding object. It seems to be working quite well.

Code:
fn radiusCtrlLimit theCtrl theBone theHolder=( /* theCtrl = object you wish to constrain to a radius theBone = a bone with w/ rotation lookat constrained to theCtrl, whose length will determine the radius theHolder = the object that will hold the script. objects and lookat constraints created elsewhere */ ScriptString= @"if distance bone point != bone_length then ( with animate off ( point.pos = (normalize (point.pos - bone.pos))*bone_length + bone.pos ) ) [1, 1, 1]" sc=scale_script() sc.addobject "point" theCtrl sc.addobject "bone" theBone sc.addconstant "bone_length" theBone.length sc.script=scriptString theHolder.scale.controller=sc ),
 
Old 02-05-2014, 10:06 PM   #20
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
as i said earlier i'm not a fan of this type of rig but everything could be done much easier
Code:
delete objects s = geosphere radius:20 d = dummy boxsize:[10,10,10] pos:[s.radius,0,0] p = d.pos.controller = position_list() p.weight[1] = 0 sc = p.available.controller = position_script() sc.addtarget "radius" s.baseobject[#radius] sc.addobject "pos" p[1] sc.setexpression "(normalize pos.value)*radius" /* it's optional... if you want to constraint dummy to the sphere position */ d = p.available.controller = s.pos.controller
 
Old 02-06-2014, 12:27 AM   #21
Mambo4
not a jedi yet
 
Mambo4's Avatar
portfolio
Logan Bender
Game Technical Artist
Greater Seattle, USA
 
Join Date: Nov 2010
Posts: 432
Code:
sc.addobject "pos" p[1]


So instead of a third object to hold a hacked script, you are using a position_list
adding the position script d.pos.controller[2], and
passing the value of d.pos.controller[1]( position_XYZ ) to the script?

very clever, and simple. It is not obvious at all that this was possible, though I guess it makes sense.

Last edited by Mambo4 : 02-06-2014 at 12:30 AM.
 
Old 02-06-2014, 12:33 AM   #22
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
as i told... it's not a good practice to use some controller with not its real purpose. in your case it's a scale controller... unfortunately this technique was shown in the mxs help and some script developers copied it in their tutorials. but as i said - this is wrong!

Last edited by denisT : 02-06-2014 at 03:55 AM.
 
Old 02-06-2014, 12:41 AM   #23
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by Mambo4
Code:
sc.addobject "pos" p[1]


So instead of a third object to hold a hacked script, you are using a position_list
adding the position script d.pos.controller[2], and
passing the value of d.pos.controller[1]( position_XYZ ) to the script?

very clever, and simple. It is not obvious at all that this was possible, though I guess it makes sense.


and probably i wouldn't use extra object just for 'radius' control. i would add a custom attribute with 'radius' parameter to the constrainted object. this way will give you full control by only using this object's parameters(and controllers).

Last edited by denisT : 02-06-2014 at 03:57 AM.
 
Old 02-06-2014, 12:45 AM   #24
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
another good thing about my setup is that you can easily disable this constraint... if you set expression controller weight to 0, but real position controller's weight to 100...
 
Old 02-06-2014, 02:05 AM   #25
hazmondo
Expert
 
hazmondo's Avatar
portfolio
Harry
Rigging TD
Axis Animation
Glasgow, United Kingdom
 
Join Date: Jan 2013
Posts: 333
Denis' solution is nice and it gives you the circular arcs that you seem to be looking for and doesn't cause any "lagging" like the method I posted on Tech-Artist (I wasn't really sure what you were going for).

-Harry
__________________
LinkedIn | Website | Vimeo | YouTube | Twitter | Facebook
 
Old 02-06-2014, 02:32 AM   #26
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by hazmondo
solution is nice and it gives you the circular arcs that you seem to be looking for and doesn't cause any "lagging" like the method I posted on Tech-Artist (I wasn't really sure what you were going for).

i haven't read your post on tech-art yet...

but my solution of course has to be improved. try to animate my solution and check the trajectory you will get.
you will see that the gotten path is not smooth. and, which is much more worth, it's not predictable.
the question is - what do we have to add to be able control 'smoothness' of on surface sliding?
 
Old 02-06-2014, 03:08 AM   #27
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
now i've read your post...

"this hack open a lot of doors and can be used to get round any dependency loop"

it's the big mistake. really it shuts doors by hiding or camouflaging the real dependency loop. i think this 'trick' has to be wiped from the mxs help.

i don't really know why and how it came to the max. probably it was born by someone 'maya driven'. in the maya everything is based on a 'node'. that's why 'maya' basic human skeleton is about 300 nodes, where the max's one is ~100.
 
Old 02-06-2014, 03:21 AM   #28
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
BTW does any one know or guess why the scale controller is usually picked as an 'accomplice' of this hack?
 
Old 02-06-2014, 09:48 PM   #29
Archangel35757
Expert
portfolio
Michael Lawler
Engineer
Madison, USA
 
Join Date: Jan 2008
Posts: 486
Quote:
Originally Posted by denisT
BTW does any one know or guess why the scale controller is usually picked as an 'accomplice' of this hack?


Because it's the last one evaluated when calculating the node transform and thus can modify the previous rotation or position controller values???
 
Old 02-06-2014, 10:03 PM   #30
denisT
MAX Doctor
 
denisT's Avatar
portfolio
Denis Trofimov
CA, USA
 
Join Date: Jul 2009
Posts: 9,637
Send a message via ICQ to denisT
Quote:
Originally Posted by Archangel35757
Because it's the last one evaluated when calculating the node transform and thus can modify the previous rotation or position controller values???

correct!
..and also because people think that the scale is most useless controller
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 12:00 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.