Introduction to Maya - Modeling Fundamentals Vol 1
This course will look at the fundamentals of modeling in Maya with an emphasis on creating good topology. We'll look at what makes a good model in Maya and why objects are modeled in the way they are.
# 1 28-12-2011 , 08:11 PM
Registered User
Join Date: Dec 2007
Posts: 124

Loading a Python script on a Mac ...

I found a cool free little script for creating a dynamic chain in Maya called "Create Dynamic Chain From Curve 1.2.1". However, it's a Python script and I'm just not familiar enough with Python to be able to get it to work. I'm not a scripts guy. I'm kind of ok with MEL, but Python ... not so much. Can anyone walk me through getting this script to function on my Mac? Feel free to treat me like a 6 year old since my adventures into Python have pretty much knocked me down to about that level anyway (apologies to all you Python writing 6 year olds). A step-by step outline would be great.
Thanks in advance to anyone who would waste time on this.

# 2 28-12-2011 , 08:44 PM
daverave's Avatar
The thin red line
Join Date: Aug 2009
Location: England
Posts: 4,472
Have you tried loading the script into the script editor python tab...........dave




Avatar Challenge Winner 2010
# 3 28-12-2011 , 09:04 PM
Registered User
Join Date: Dec 2007
Posts: 124
Yes. But I don't think it's as easy as loading MEL. When I did a search on the web for info it seems it's a bit more complicated. I tried to put some of the info I found to use but I'm missing something. Most of the sites I visited I think assume you have a basic working knowledge of Python scripting ... I do not, unfortunately.

# 4 29-12-2011 , 01:44 PM
LauriePriest's Avatar
Moderator
Join Date: May 2003
Location: London
Posts: 1,001
It is just as simple as mel.
You can execute the scripts in the same way.
If you get no error then it has worked, if nothing has happend then the script probably creates functions to call on objects in maya. The function will probably be listed in the script comments or in a seperate readme.

If you get an error can you post it, if you don't get an error and don't know what to do can you link us to the script.


FX supervisor - double negative
# 5 29-12-2011 , 05:27 PM
Registered User
Join Date: Dec 2007
Posts: 124

Attached Thumbnails
# 6 29-12-2011 , 06:13 PM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
I grabbed it but the .pyc file is like in binary or something and is totally unreadable so I cannot figure out what it does or how it works

Attached Thumbnails

"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675

Last edited by ctbram; 29-12-2011 at 06:15 PM.
# 7 29-12-2011 , 10:42 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988
You can get it running by performing the following:

Code:
import sys
sys.path.append("<PATH TO FOLDER HOLDING SCRIPT>")

from chainCreator import *
chainCreator()
However I don't have Maya 2012, so it won't let me run it. PYC files are a pain, as they're compiled (binary) versions of the code.


Imagination is more important than knowledge.
# 8 30-12-2011 , 04:11 AM
ctbram's Avatar
Moderator
Join Date: Jan 2004
Location: Michigan, USA
Posts: 2,998
ah I was wondering what was going on. I am lua guy and have just a tiny bit of python experience. I have never seen a .pyc file before.


"If I have seen further it is by standing on the shoulders of giants." Sir Isaac Newton, 1675
# 9 30-12-2011 , 03:34 PM
Registered User
Join Date: Dec 2007
Posts: 124
Thanks for your input NextDesign. Is the bit of code you supplied run from the command line or from the script editor. I'm assuming it doesn't matter ... either/or, right?

# 10 30-12-2011 , 03:59 PM
Registered User
Join Date: Dec 2007
Posts: 124
This is what I'm typing in and the error message I'm getting back ...

Attached Thumbnails
# 11 30-12-2011 , 05:33 PM
NextDesign's Avatar
Technical Director
Join Date: Feb 2004
Posts: 2,988

This is what I'm typing in and the error message I'm getting back ...

You need a / before Users, and 2012, instead of 2102. The code I provided is used when the script is not in Maya's script paths.

Do you absolutely need this script? It may be that the script is just broken. There are many others out there.


Imagination is more important than knowledge.

Last edited by NextDesign; 30-12-2011 at 05:35 PM.
# 12 30-12-2011 , 06:19 PM
Registered User
Join Date: Dec 2007
Posts: 124
Sweet ... that did it. Do you know how long I've mucking around with this thing. Someday I may brush up on my Python knowledge but in the mean time targeted help like this will have to do. Again ... thanks so much for your time.

Cheers, and Happy New Year !

Posting Rules Forum Rules
You may not post new threads | You may not post replies | You may not post attachments | You may not edit your posts | BB code is On | Smilies are On | [IMG] code is On | HTML code is Off

Similar Threads