Announcement

Collapse
No announcement yet.

Assigning objects to vrayobjectproperties in mayapy

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

  • Assigning objects to vrayobjectproperties in mayapy

    I’ve been having some troubles with membership of vrayobjectproperties lately.
    I am trying to build a scene in the commandprompt (mayapy), but when I reference in a shader and assign it to the components of a mesh, I am no longer able to assign the mesh to vrayobjectproperties. Querying the membership of vrayobjectproperties displays the mesh as being a member, but when I open the scene through the UI it is not.
    When I do the exact same thing in the scriptEditor (running maya with ui) it seems to work just fine.

    A workaround for this is to create a new set after creating the vrayobjectproperties, but I thought I would just share this with you so you don’t have to go through the same headache.
    I’ve written a bit of code to demonstrate:
    http://mortenbohne.dk/maya/bugReport...pertiesTest.py

    Note that the script will create a folder (vrayPropertiesSets) in your userPrefsDir containing 3 files: refshader.mb, setsTest.mb, setsTest_extraset.mb

    refshader.mb is the shader being referenced in to the other files, setsTest.mb is the setup where meshes were added directly to the vrayobjectproperties (note that the plane has componentshading from a referenced shader, and is not part of vrayobjectproperties) setsTest_extraset.mb has a set holding the members, making all meshes part of vrayobjectproperties.

    I'm running maya 2016SP5.
    V-Ray for Maya version 3.10.01 from Jul 18 2015, 10:56:00
    V-Ray core version is 3.25.01

    Would be nice to be able to expect the same behavior no matter how you build your scene

    cheers!

  • #2
    Woops, further testing shows that my 'workaround' only works for the first object with component shading... This means that the vrayobjectproperties acts, as should be expected, in the exact same way that ordinary sets in maya, and these when run through mayapy doesn't work when assigning multiple meshes with component-shading of referenced shaders... i guess that i could make a sub-sets for every object in my scene and assign them to the vrayobjectproperties node, but it doesn't really seem like the most elegant solution.
    oh well, back to the drawing board

    Comment

    Working...
    X