Announcement

Collapse
No announcement yet.

MEL to change image format on the fly.

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

  • MEL to change image format on the fly.

    Simply trying to change the image format in the render settings.

    This is what the script editor kicks out.

    Code:
    setAttr "vraySettings.imageFormatStr" 6;
    When I use it in a script it says....

    // Error: line 1: setAttr: 'vraySettings.imageFormatStr' is not a simple numeric attribute. Its values must be set with a -type flag. //

    I did this..

    Code:
    setAttr "vraySettings.imageFormatStr" -type 6;
    Which gives no error but doesn't update the render settings or change the image format.

    These two commands are kicked out when I manually use the drop down.

    Code:
    vrayChangeImageFormat;
    vrayUpdateImageFormatControl;
    Any help so I can just set the image format from MEL correctly appreciated.
    ------
    KC

  • #2
    Like the name suggests, this is actually a string attribute:

    setAttr -type "string" "vraySettings.imageFormatStr" "exr (multichannel)";

    Not sure why the script editor is showing this command.
    V-Ray/PhoenixFD for Maya developer

    Comment


    • #3
      Like ivaylo says, you're meant to set the data type, not the image-type, with the -type flag.

      So if you do what ivaylo suggested,exr (multichannel) can be subtituded for png, tif or exr as long as it's spelled like it is in the dropdown you should be good!

      Good luck!

      /D

      Comment


      • #4
        I didn't put quotes around the exr (multichannel) at the end to make it work like a string. Thanks it works fine now.

        ------
        KC

        Comment

        Working...
        X