Announcement

Collapse
No announcement yet.

Python scene access list

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Python scene access list

    Hi everybody,

    I'm new in this forum so let me introduce myself.
    My name is Maxime, I'm Lighting TD at Supamonks .

    We're currently experimenting on Vray Python Access but we've encountered some difficulties with lists... I've sent an e-mail to chaos group support but I haven't got feedback regarding this point.

    We've tried to set lists (like colors in a ramp) with the post translate script but it returns the following error :

    def postTranslateScript():
    import vray.utils
    ramp = vray.utils.findByName('ramp1')[0]

    if 0:
    colors = ramp.get('colors')
    colors.pop()
    # This line will warm: // Warning: line 1: Invalid value given for parameter "colors" in plugin "ramp1". //
    ramp.set('colors', colors)

    else:
    # This line will warm two: // Warning: line 1: Invalid value given for parameter "colors" in plugin "ramp1". //
    vray.utils.pluginmodifier._setParam(ramp._name, 'colors', (12, ['ramp1_color_0', 'ramp1_color_1']))

    So, it seems that lists cannot be used in python scene access...
    Am I right ?

    Thanks,

    Max

  • #2
    We do support lists in general; can you tell me which V-Ray version you are using?

    Best regards,
    Vlado
    I only act like I know everything, Rogers.

    Comment


    • #3
      Oh ! Sorry, I forgot to mention it ^^'
      We're using vray 2.40 with maya 2012.

      Thanks,
      Max
      Last edited by CGMas; 21-01-2014, 05:40 AM.

      Comment


      • #4
        It is a bug with ramp in Python access ^^
        www.deex.info

        Comment


        • #5
          Yes, the Python script can't export list of textures. Will fix this.
          V-Ray/PhoenixFD for Maya developer

          Comment


          • #6
            Ok, thank you all for your answers !
            Would you have an idea of when we could expect this fix ?

            Comment


            • #7
              It will be in the next nightly. But this means 2.45.
              V-Ray/PhoenixFD for Maya developer

              Comment


              • #8
                We have access to nightlies version so it's a really great news !!
                I may have some further questions regarding python scene access, can I ask these questions here ?
                For example, we would like to kill a render process using python.
                Is there a way to do it ?

                Comment


                • #9
                  When do you want to kill it? In some of the callbacks or from the script editor while rendering?
                  V-Ray/PhoenixFD for Maya developer

                  Comment


                  • #10
                    Actually, we would like to be able to stop it with the post translate python script in case there's something wrong.

                    Comment


                    • #11
                      I thought that there is a standard way to send "abort" signal to the renderer (like clicking Esc), but it seems there isn't. We can extend the vrend command with something like "-abort". Currently it can abort only IPR rendering.
                      V-Ray/PhoenixFD for Maya developer

                      Comment


                      • #12
                        It could be great !
                        So, this mean that the vrend command is callable during the execution of python post translate script ?
                        And, if you extend the vrend command would it be possible to add a flag to translate only selected objects ?

                        Comment


                        • #13
                          vrend can be executed in the post translate, but with limited functionality since you are already rendering. It's ok to abort rendering. Will be in the next nightly.
                          There is a way to render and translate only selected objects, but it's not very convinient:

                          optionVar -iv renderViewRenderSelectedObj 1;

                          And you must not forget to restore it to 0. This can be set before rendering using a script or a prerender MEL. And restored with a postrender MEL.
                          V-Ray/PhoenixFD for Maya developer

                          Comment


                          • #14
                            It would be very great if we can have something like : vrend -selectedObjects MyList

                            Premel and PostMel are a hell in production (and it can be very dangerous. Imagine if we have an error (crash, network...) during rendering, we will break the optionVar of the user).
                            www.deex.info

                            Comment


                            • #15
                              Originally posted by bigbossfr View Post
                              It would be very great if we can have something like : vrend -selectedObjects MyList

                              Premel and PostMel are a hell in production (and it can be very dangerous. Imagine if we have an error (crash, network...) during rendering, we will break the optionVar of the user).
                              I totally agree with that ! ^^

                              Comment

                              Working...
                              X