Announcement

Collapse
No announcement yet.

How to use vray commands in python?

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

  • How to use vray commands in python?

    Is there an equivalent of mel.eval("vray objectProperties add_single VRayDisplacement") but in clean python code?

    ...for example:

    import vray.utils as vr
    myVrayDisplNode = vr.create("VrayDisplacement", add_single=True)


    I noticed this crashes Maya:

    import vray.utils as vr
    myVrayDisplNode = vr.create("VrayDisplacement", "thisWouldProbablyBeTheNameOfTheCreatedNode")
    Best Regards,
    Fredrik

  • #2
    Originally posted by Fredrik Averpil View Post
    Is there an equivalent of mel.eval("vray objectProperties add_single VRayDisplacement") but in clean python code?
    No unfortunately. We only have the MEL commands.

    import vray.utils as vr
    myVrayDisplNode = vr.create("VrayDisplacement", "thisWouldProbablyBeTheNameOfTheCreatedNode")
    The vrayDisplacement node is a Maya node, not a V-Ray plugin, so this won't work. In the V-Ray scene, displacement is translated in a completely different way. The crash itself should be fixed for newer builds, but don't expect this command to do anything meaningful.

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

    Comment


    • #3
      Ok, thank you.
      Best Regards,
      Fredrik

      Comment


      • #4
        So I presume this won't work either?

        Code:
        import vray.utils as vr
        vr.create("texture", "ColorCorrection")
        Is there currently any way to create this texture via either Python or MEL?
        Best Regards,
        Fredrik

        Comment


        • #5
          This code works only in the post translate callback.

          The mel code for creating such texture is something like:
          Code:
          vrayCreateNodeFromDll("tex", "texture", "ColorCorrect", 2);
          V-Ray developer

          Comment


          • #6
            Ah, many thanks!
            Best Regards,
            Fredrik

            Comment

            Working...
            X