Inside Sabertooth
Learn how Sabertooth uses 3ds Max to create 3D interactive projects, including HBO Go’s Game of Thrones interactive experience
  • 1/3
You are here: Forum Home / Autodesk® Maya® / MEL / Relationship between alphabet and numbers?
  RSS 2.0 ATOM  

Relationship between alphabet and numbers?
Rate this thread
 
62152
 
Permlink of this thread  
avatar
  • Total Posts: 194
  • Joined: 11 March 2011 08:40 AM

can I set up a script that will know that if I say 4 or 5, I mean D or E.
say: I have a joint chain: jt_spineA, jt_spineB, etc.
I like having the alphabet instead of jt_spine01 because its not proper to have numbers at the end of a chain. but for the purposes of a script that sets up auto IK’s with a for loop, I need numbers.
??



Replies: 0
avatar
  • 3D Druid
  • Posted: 21 November 2011 01:27 PM

I don’t know MEL, but most script/programming languages allow you to convert a character to an ascii value ie A is 65, B is 66 etc, the problem with using this approach instead of numbers is you only have 26 characters, so what do you do when you get to Z do then use AA to AZ etc, then you need a routine to calculate how many numbered letters you are using to determine the correct value. Whereas when you use 001 it is very easy to calculate and you have got 999 numbered items, need more numbers and another 0 which gives you a starting point of 0001 and you have 9999 items which is very easy to calculate a value from.



Digital Entertainment Creation Suite 2010, 2011, 2012

Replies: 0
avatar
  • ldunham1
  • Posted: 21 November 2011 09:01 PM

it is possible, a way that springs to mind would be using a dictionary with python, however i completely agree with 3D Druid as this is an instance where numbers should be used, limitations for one, and usability with scripts for another.
If it is purely for aesthetic reasons, animators aren’t really going to care what joints are called, or how most of the rig works in fact, they just want it to work, so best advice would be to stick to numbering.



Lee Dunham | Character TD
ldunham.blogspot.com

Replies: 0