Permalink #1 
Shaderhacker's Avatar
Join Date: Aug 2008
Posts: 58
Member
    My Mood: Busy
    Thanks: 0
    Thanked 6 Times in 6 Posts

    Default RenderView application done in wxPython!


    All:

    I've been mulling over this for sometime now. I'm trying to figure out what should be the best way to introduce programmers out there on some really powerful tools that can be made using python. C/C++ is the way of the old barbarians living back in 50B.C. I only use it when I absolutely HAVE to..

    Anyway, I developed a Renderview application very similar to Maya's own RenderView a few months back because our fellow Mental Image friends wouldn't give out the source code to the tool named "imf_disp" (it's ok, I forgive you ). We wanted to basically have a RenderView that did 3 very important things that Maya's Renderview doesn't:

    1) Gamma correction.

    2) Mental Ray Satellite rendering.

    3) Ability to change/customize the GUI whenever we felt like it.

    I made this tool using nothing but wxPython but it branches out into several other scripts for a full rendering pipeline (i.e. mel scripts and other python scripts).

    I'd like to release at least some of the source on how to get someone going making their own RenderView tool, but without *ALL* the source code, the demonstration and tutorial would be unusable out-the-box. Should I come up with a mock interface and just lead the programmer on the path to a pipeline or just scrap the idea since most people would either A) write their own proprietary GUI, or B) use what's already in Maya?

    Thoughts?

    -M

    Last edited by Shaderhacker; 09-24-2008 at 08:59 PM.
    The Following User Says Thank You to Shaderhacker For This Useful Post:
      Permalink #2 
    marcobauriedel's Avatar
    Join Date: Aug 2008
    Posts: 10
    Junior Member
      Thanks: 0
      Thanked 1 Time in 1 Post

      Hey that sounds fantastic,

      I`d really like to get deeper into phyton and see the possibilities so it would be great to see the ideas and commands you use to approach such a task. Scraping the idea by showing the most important ways on how to solve major problems would be already very helpful.

      cheers,
      Marco
      The Following User Says Thank You to marcobauriedel For This Useful Post:
        Permalink #3 
      Shaderhacker's Avatar
      Join Date: Aug 2008
      Posts: 58
      Member
        My Mood: Busy
        Thanks: 0
        Thanked 6 Times in 6 Posts

        Quote:
        Originally Posted by marcobauriedel View Post
        Hey that sounds fantastic,

        I`d really like to get deeper into phyton and see the possibilities so it would be great to see the ideas and commands you use to approach such a task. Scraping the idea by showing the most important ways on how to solve major problems would be already very helpful.

        cheers,
        Marco
        Thanks Marco!

        Yes, this will be something long term. I'm a thorough person and very specific, so I'm hoping to present some basic solutions to the problems I've come across at the various studios.
        The Following User Says Thank You to Shaderhacker For This Useful Post:
          Permalink #4 
        Shaderhacker's Avatar
        Join Date: Aug 2008
        Posts: 58
        Member
          My Mood: Busy
          Thanks: 0
          Thanked 6 Times in 6 Posts

          As I promised, here are some images of a render view application implemented in our studio using just python and MEL. I will be starting a tutorial on how to get started with implementing your own render view application soon, but for now, here are some images of the tool:

          Screen 1: Overall tool layout


          Screen 2: Taking snapshots from Maya


          Screen 3: Render regions


          Screen 4: Alpha Channels (and Luminance)


          Screen 5: Rendering Options Interface


          Screen 6: Gamma settings (not in Maya's renderview)


          Screen 7: Framebuffer Images from a render


          Screen 8: Viewing the Ambient Occlusion Pass


          Screen 9: Viewing the Depth Pass


          Stay tuned for more!!

          -M

          Last edited by Shaderhacker; 09-24-2008 at 08:01 PM.
          The Following User Says Thank You to Shaderhacker For This Useful Post:
            Permalink #5 
          cloudcatcher's Avatar
          Join Date: Oct 2008
          Posts: 1
          Junior Member
            Thanks: 0
            Thanked 1 Time in 1 Post

            Nice one, why use wxPython and not just python ?
            How long did it take you to develop ?
            The Following User Says Thank You to cloudcatcher For This Useful Post:
              Permalink #6 
            Shaderhacker's Avatar
            Join Date: Aug 2008
            Posts: 58
            Member
              My Mood: Busy
              Thanks: 0
              Thanked 6 Times in 6 Posts

              Quote:
              Originally Posted by cloudcatcher View Post
              Nice one, why use wxPython and not just python ?
              How long did it take you to develop ?
              wxPython is just a windowing API module for python. In python, there is no built-in function to create a window (and all of it's widgets) in it's native language, so you need modules that allow you to gain access to functions that creates the GUI.

              It's similar to C/C++ in that you can't create a window with any one built-in function unless you have a win32API, or OpenGL API that you include.

              Hope this helps,

              -M

              It took me a few months to make this interface. A lot of experimentation and trial and error.
              The Following User Says Thank You to Shaderhacker For This Useful Post:
                Permalink #7 
              goofoo's Avatar
              Join Date: Nov 2008
              Posts: 1
              Junior Member
                Thanks: 0
                Thanked 1 Time in 1 Post

                hello Marlin. Very interesting work. Now i began too use python in maya, but this is hard especially when i try make gui python. Maybe you can send me some source code from your work for study.
                Big thanx Marlin and sorry for my bad english
                The Following User Says Thank You to goofoo For This Useful Post:
                  Permalink #8 
                Shaderhacker's Avatar
                Join Date: Aug 2008
                Posts: 58
                Member
                  My Mood: Busy
                  Thanks: 0
                  Thanked 6 Times in 6 Posts

                  Quote:
                  Originally Posted by goofoo View Post
                  hello Marlin. Very interesting work. Now i began too use python in maya, but this is hard especially when i try make gui python. Maybe you can send me some source code from your work for study.
                  Big thanx Marlin and sorry for my bad english
                  Will do soon..
                  The Following User Says Thank You to Shaderhacker For This Useful Post:
                    Permalink #9 
                  kattkieru's Avatar
                  Join Date: Jun 2009
                  Posts: 1
                  Junior Member
                    Thanks: 0
                    Thanked 1 Time in 1 Post

                    First post!

                    I know this is an old thread, but I was wondering Shaderhacker -- have you put up any of the code / demonstration stuff for this render viewer?

                    I'm currently the TD at a place in Toronto, and we've inherited a lot of tools that were written in a combination of MEL, Maya Python, and Visual Basic. None of them work properly, and I'm looking at wxPython as a way to sidestep a lot of the hassle of getting some nicer tools up and running; the main thing right now is seeing how people do communication with Maya. It might end up that I have to write a custom UI for the pipeline tool we're looking at, as well as replacements for the tools mentioned above, but I'd like to do from within Maya if possible instead of using less-dependable commandPort trickery.

                    Anyway, if this project is still going for you, or if you have some good links on getting wxPython running in Maya 2008 on Mac or PC, that would be stellar.
                    The Following User Says Thank You to kattkieru For This Useful Post:
                      Permalink #10 
                    Shaderhacker's Avatar
                    Join Date: Aug 2008
                    Posts: 58
                    Member
                      My Mood: Busy
                      Thanks: 0
                      Thanked 6 Times in 6 Posts

                      Quote:
                      Originally Posted by kattkieru View Post
                      First post!

                      I know this is an old thread, but I was wondering Shaderhacker -- have you put up any of the code / demonstration stuff for this render viewer?

                      I'm currently the TD at a place in Toronto, and we've inherited a lot of tools that were written in a combination of MEL, Maya Python, and Visual Basic. None of them work properly, and I'm looking at wxPython as a way to sidestep a lot of the hassle of getting some nicer tools up and running; the main thing right now is seeing how people do communication with Maya. It might end up that I have to write a custom UI for the pipeline tool we're looking at, as well as replacements for the tools mentioned above, but I'd like to do from within Maya if possible instead of using less-dependable commandPort trickery.

                      Anyway, if this project is still going for you, or if you have some good links on getting wxPython running in Maya 2008 on Mac or PC, that would be stellar.
                      Hello!

                      I'm so sorry for not replying earlier. I haven't had much time for anything outside of work.

                      The RenderView is done. We've come a long way since I began this article and we are now looking at implementing some kind of IPR functionality to take advantage of MR's new progressive mode.

                      Anyway, in answer to your question - I haven't gone through and spliced out code that can be made to the masses. Our RenderView ties to Maya only on the global rendering settings front-end and not the application itself.

                      We basically create a shell in Maya (from a MEL script) and call our python script from there. It will launch a session. We've found a way to work with the CommandPort functionality so that you can have multiple Maya's open and multiple RenderViews open for each Maya session. It's still not as glamorous as having Maya call wxPython, but it works. One disadvantage to having the RenderView be dependent on Maya is if Maya crashes, so will the RenderView. If an artist has a lot of cached images in the queue, they are wiped out.

                      If you want to know a little more details on our implementation, just let me know.

                      -M

                      Last edited by Shaderhacker; 08-09-2009 at 03:12 PM.
                      The Following User Says Thank You to Shaderhacker For This Useful Post:


                      Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
                       

                      Posting Rules
                      Smilies are On
                      [IMG] code is On
                      HTML code is Off

                      Similar Threads
                      Thread Thread Starter Forum Replies Last Post
                      Criterion Games Application - Portfolio Advice Needed!!!! Wheeler Jobs 2 05-02-2009 09:13 AM
                      A RenderView application in Python! Shaderhacker Mental Ray 0 09-24-2008 08:17 PM
                      A RenderView application in Python! Shaderhacker Python 0 09-24-2008 08:16 PM