Announcement

Collapse
No announcement yet.

VRay MultiSubTex as Switch

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

  • VRay MultiSubTex as Switch

    Hello, I've manually defined 12 different colors. the switch works as planned when rendering but the object only reflects the "DefTexture" color in the viewport. Is there a way to make the switch Out Color redefine the DefTexture color automatically? I have several characters with different colors and each time i switch the color of the character, i have to manually invoke some mel to make the DefTexture reflect what will render. Should I make some kind of scriptNode to do it? I wanted it to work when used as a reference, but my MEL breaks when references because of namespaces. It'd be best if it was hard wired, but wiring it to itself does not update the viewport either. Curious what you all would do.
    -Joel
    -Joel E
    https://www.biglittlepictures.com

  • #2
    If in switch mode, the OutColor auto-repopulated the DefTexture from within the node code, that would be idea for viewport previews. For some reason outColor is not updating, only during rendering or IPR.
    Last edited by joelly3d; 20-12-2019, 01:34 PM.
    -Joel E
    https://www.biglittlepictures.com

    Comment


    • #3
      Update: I got some Python code to work as a solution which works even if referenced, but it would be much nicer if the "out color" was just accurate in viewport... one less step to manually fire per character. Figured I'd mention it as I am sure it may come up again.
      -Joel E
      https://www.biglittlepictures.com

      Comment


      • #4
        There shouldn't be a need for any scripting, unless you want to do something very specific. Let me try and explain the usage for the MultiSubTex, with the hope that it's what you're trying to do. If not, do let me know and I'll try and come up with some ideas on how to get what you're after.

        The switch mode is actually intended to work with an input that defines the 'switch' (the output of the texture remains outColor always).
        The 'switch' mode allows you to use a float value 'switch texture' so if you enter 1.0 all objects with this texture will get the color from item 1 in the texture.
        However, you can connect a texture to the 'switch texture' float field and use a UserScalar or UserInteger texture to read in custom attributes so that your items are assigned to different pieces of geometry based on custom attributes assigned to these pieces of geometry.
        The usage is very similar to how the SwitchMtl works, shown in this video: https://www.youtube.com/watch?v=7OD_N4S0JqM
        The multiSubTex just does the same ( in 'switch' mode) but for textures, not materials.
        The video is using the GPU, but it works the same in both the regular V-Ray and V-Ray GPU.
        Alex Yolov
        Product Manager
        V-Ray for Maya, Chaos Player
        www.chaos.com

        Comment


        • #5
          Yep I have a root attribute piped in which controls the switch and works fine, i just noticed that the viewport feedback for colorOut is not enabled, it always just shows DefTexture. So i made a script which updates the DefTexture with the color of the colorOut when it is changed, in order to get viewport feedback in non-IPR modes.
          -Joel E
          https://www.biglittlepictures.com

          Comment


          • #6
            Ultimately i made a scriptNode an ScriptJob combo to remedy this, but would be better if the node was just corrected. Seems like it should be an easy fix to make it compatyible with "6" or "textures in viewport" mode.
            -Joel E
            https://www.biglittlepictures.com

            Comment

            Working...
            X