Page 5 of 49 FirstFirst ... 3456715 ... LastLast
Results 41 to 50 of 484
  1. #41
    Join Date
    Apr 2010
    Location
    Munich / Germany
    Posts
    8
    http://docs.python.org/
    http://docs.python.org/tutorial/cont...#if-statements
    ----------
    i cant say a lot from here ... but
    i think <maya Console> just means "maya" , because your python-code is called from within your "maya"-session .

    the <module> error might occur "inside" the "module" - you just imported ( with __import__ ), but i am not sure ,if it might be because you did not yet have set your "path" right ??? or have you already set in in your "maya.env" ??? or can you now see the "we are in the constructor" being printed out ? ( what you descriped in the "MAC OSX"-thread )


    there might be something wrong in this line of code
    mod = __import__('Blueprint.'+module,(),(),[module])

    be sure you don't get the brackets wrong !!! some are () , some are [] , and some are {}

    -----
    overall i really suggest , you need to follow each single lesson very precisely , and in the meanwhile always pause your media-player in order to compare code from video to your own editor - in some cases , if you are not familiar with pythons basic syntax - you really need to take a good look at all the spelling

    and always try to get your bugs fixed , before you continue on to the next lesson .
    Last edited by sim.on; 06-12-2010 at 07:16 AM.

  2. #42
    Join Date
    Jun 2010
    Posts
    42
    Thanks a lot Simon.

    I did get my "we are in the constructor" being printed out. I even got my blueprint Ui to show up until the Util.py is called in so I'm thinking it's that. I'm check out those links on if statemnts.

    I'm going through a few begginners tutorials and ebooks now. It's really exciting understand this stuff.

    I've been looking at some pyChecker type programs as well to help finding syntax errors.

    In Maya script editor it says that line 71 is the problem but I'm sure it's the same, so could that mean that a function, value etc line 71 points to is wrong as well yeah?

    I know it's hard for you to say anything for sure causes it's my mess, but your thoughts make a huge difference because there's so much info out there and you're working through the same systems.

    Cheers Mate!

  3. #43
    Join Date
    Jul 2006
    Posts
    11
    Hey all,

    I'm at video 16 from the first dvd, "016 - Blueprint Installation Translation Controls.avi" and right after I've added the translation controls, this error pops up:
    # Error: AttributeError: ModuleA instance has no attribute 'container' #
    I'm using 2010 x32 and x64

    My .py files
    [edited by Steve - please don't post entire Python files from the product in the forums. Thank you ]
    Last edited by stevetwist; 06-14-2010 at 02:39 PM.

  4. #44
    Join Date
    Jul 2006
    Posts
    11
    Defined an empty function "container" to satisfy the error, which gave me another type of error:
    # Error: TypeError: Object <bound method ModuleA.container of <Blueprint.module_a.ModuleA instance at 0x0E1F6A58>> is invalid #

    Read something about when a parent to an object dies in python, the object dies too, and I'm very new to python, but that adress 0x0E.. sounds like an abandoned path to me. Anyone?

  5. #45
    Join Date
    Jul 2006
    Posts
    11
    Where are you guys?

  6. #46
    Join Date
    May 2002
    Location
    UK
    Posts
    2,807
    Hey everyone,

    Sorry I've not been about much recently, I've got crazy deadlines on other projects right now!

    Firstly, with regards to Maya 2011, I'm glad to see you guys helping each other out. I don't have access to 2011, so I'm not able to test the code, or help debug etc., so I'm very glad to see everyone helping out to get the code working on 2011.

    Ok... nukualofa - The error you're getting is caused by line 74 in module_a.py. You're trying to add a node to the container, which you're refering to as "self.container" (the first argument to cmds.container()). However, the container name is stored in the data member "self.containerName", not "self.container". Because your class (ModuleA) doesn't have a member "self.container", you're getting the error. Also, please in future don't post entire code files on the forums, as that's against 3DBuzz policy (due to people being able to grab the code without purchasing the product etc.). Hope that helps you out

    If anyone else is still having problems with errors etc. that they mentioned earlier, please speak up, and I'll try and take a look at them the next free minute I get

    Thanks for being patient everyone
    Steve

  7. #47
    Join Date
    Jul 2006
    Posts
    11
    Sorry about that Steve, I'll stick to short segments whenever I need help again. Thanks for your help, things are functioning again. Funny, I redid that chapter and apparently did the same typo as last time. Nonetheless, thanks!

  8. #48
    Join Date
    May 2002
    Location
    UK
    Posts
    2,807
    No worries, you weren't to know

    Glad that got things working for ya!

    Steve

  9. #49
    Join Date
    Jun 2010
    Posts
    42
    Hey steve I was wondering which version of python you're using and does it matter which version we use?

    Cause I noticed that some syntax has changed.

    ie

    print "hello world"
    doesn't work in 3.1 you need to do
    print ( "hello world" )

    So I'm wondering if it would make my life easier to use the same version of python as you?

    I'm on snow leopard OSX and maya 2011.

    Thanks
    Jason

  10. #50
    Join Date
    May 2002
    Location
    UK
    Posts
    2,807
    Hi Jason,

    Whilst there are some changes from Python 2.x to 3.x, those changes (to the best of my knowledge) are quite minor.

    To find out which version of Python the Maya Python interpreter is using, run the following in the Python script editor:

    Code:
    import platform
    print platform.python_version()
    For me, in Maya 2010, it tells me I'm using Python 2.6.1.

    I'm not sure how you can change the version of Python Maya uses (I'd have thought it would use it's own version, which it would install when you install Maya, rather than the system version... but I could be wrong). If you can get 2011 to use Python 2.6, I imagine you'd have a slightly easier time following along . That said, if you can't change version, it should be fairly easy to port the code to Python 3, as it appears there are very few areas where the syntax has changed:

    What's new in Python 3.0
    What's new in Python 3.1

    Cheers,
    Steve

Page 5 of 49 FirstFirst ... 3456715 ... LastLast

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •