Announcement

Collapse
No announcement yet.

2d Texture Switch w/ VrayUserScalar

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

  • 2d Texture Switch w/ VrayUserScalar

    So I'm trying to switch between 2D Textures. My go-to was the vray switch material (of course), but I couldn't get it to work for this application. I figure the vray switch material is more setup to switch between full shaders as opposed to elements which make up a shader (wishlist that this changes and perhaps an alpha output would be added too. Would be nice to switch between remap nodes, vrayFresnel nodes, etc.).

    I then moved to utilizing an animated VrayScaler linked up to condition nodes, linked up to a LayeredTexture node (no textures blended in this node, but visibility is toggled on and off by conditional nodes). See attached image for preview of node setup (recreated this issue in a different scene, hence the simplicity)-

    Click image for larger version

Name:	prevError.jpg
Views:	1
Size:	370.7 KB
ID:	883134

    The textures however are not switching at render time. Something isn't updating. I have the base scene archived and can be downloaded by following the link below (https://www.wetransfer.com/)-

    http://we.tl/P4kkEIbLIC

    Many thanks,
    Clayton

    Win7 64bit
    Maya 2016 64bit Extension 1 + SP4
    Vray 3.1


    EDIT: I should also add that everything works as planned if I were to render each from individually with animation turned off. This is what leads me to believe this might be a bug.
    Last edited by 9k_JHT; 04-12-2015, 08:40 AM. Reason: additional information (at bottom)

  • #2
    Sorry, but the visible attribute of the layer texture can't be animated currently. We have a texture that can directly do this, but it doesn't have an UI, and the "create from vray plugin" would not work for it. So the only way left is to use the "image sequence" feature of the file node.
    V-Ray/PhoenixFD for Maya developer

    Comment


    • #3
      Originally posted by ivaylo.ivanov View Post
      Sorry, but the visible attribute of the layer texture can't be animated currently. We have a texture that can directly do this, but it doesn't have an UI, and the "create from vray plugin" would not work for it. So the only way left is to use the "image sequence" feature of the file node.
      Thank you for getting back to me. I'll look into using the "image sequence" feature in the file node as you recommend.

      Comment


      • #4
        you can probably use a blend node for that purpose too no?
        Dmitry Vinnik
        Silhouette Images Inc.
        ShowReel:
        https://www.youtube.com/watch?v=qxSJlvSwAhA
        https://www.linkedin.com/in/dmitry-v...-identity-name

        Comment


        • #5
          Originally posted by Morbid Angel View Post
          you can probably use a blend node for that purpose too no?
          I just tried with the VrayBlendMaterial. I do not think that this node was intended (or is set up) to handle 2D textures, but instead full shaders. So unless someone can add to the conversation, I'm going to say that this is not possible with the current VrayBlendMaterial from where I'm standing. If you were suggesting the "blend colors" node, then perhaps that is a viable solution, but only for 2 textures (png, tiff, jpeg, etc..) (which does not help me in my case).

          Comment


          • #6
            You can plug the filenodes into a ramp and use a userScalar plugged into the vCoord (if it's a vRamp) of the ramp.

            Alternatively, if the filenodes are all the same apart from the file path, you can use vrayUserString attributes to replace paths in the filenode with the <> tags.

            Or is it something else you're after?
            Last edited by Dan Andersen; 08-12-2015, 07:34 AM.

            Comment


            • #7
              Originally posted by Dan Andersen View Post
              You can plug the filenodes into a ramp and use a userScalar plugged into the vCoord (if it's a vRamp) of the ramp.

              Alternatively, if the filenodes are all the same apart from the file path, you can use vrayUserString attributes to replace paths in the filenode with the <> tags.

              Or is it something else you're after?
              The ramp with the VrayUserScaler worked out very well. Only thing that it's missing is transfer of an alpha channel as well (just made another ramp to handle alphas). I could not find the VryaUserString you mentioned. Although I don't need it right now since the ramp is working well, it would be neat to have in the arsenal.

              Thanks much,
              Clayton

              Comment


              • #8
                Happy to hear it worked out. Regarding the vrayUserString, have at look at the last section of this page: http://docs.chaosgroup.com/display/V...itmap+Textures

                So basically you create a vrayUserString_myFile attribute on the same objects you're now adding scalars to, then put the unique part of the file path/name into this attribute, and link it in the path of the file node inside brackets like this: <myFile>

                So you could have:

                dir/dir/dir/fileA.jpg
                dir/dir/dir/fileB.jpg
                dir/dir/dir/fileC.jpg

                and then switch out the A/B/C with <myFile> and put those letters into your vrayUserString instead. This will allow you to load a different texture per object from a single filenode. Should handle the alpha too, so if you don't need unique file nodes, this is a very flexible way of working.
                Last edited by Dan Andersen; 08-12-2015, 12:40 PM.

                Comment


                • #9
                  Originally posted by Dan Andersen View Post
                  Happy to hear it worked out. Regarding the vrayUserString, have at look at the last section of this page: http://docs.chaosgroup.com/display/V...itmap+Textures

                  So basically you create a vrayUserString_myFile attribute on the same objects you're now adding scalars to, then put the unique part of the file path/name into this attribute, and link it in the path of the file node inside brackets like this: <myFile>

                  So you could have:

                  dir/dir/dir/fileA.jpg
                  dir/dir/dir/fileB.jpg
                  dir/dir/dir/fileC.jpg

                  and then switch out the A/B/C with <myFile> and put those letters into your vrayUserString instead. This will allow you to load a different texture per object from a single filenode. Should handle the alpha too, so if you don't need unique file nodes, this is a very flexible way of working.
                  Very cool. Thank you for the replies.

                  Comment


                  • #10
                    Indeed it is. I use this method, I run small script on selected geo and add the desired attrs to that geo then read that as Dan mentioned. It can be in any part of your path string.

                    string $phx[]= `ls -sl`;

                    int $num = size ($phx);

                    for ( $i=0; $i<$num; ++$i )
                    {


                    catchQuiet (`addAttr -ln "vrayUserString_ver" -dt "string" $phx[$i]`);
                    catchQuiet (`setAttr -type "string" (($phx[$i]) + ".vrayUserString_ver") "v01"`);


                    catchQuiet (`addAttr -ln "vrayUserScalar_wolfId" -at double $phx[$i]`);
                    catchQuiet (`setAttr (($phx[$i]) + ".vrayUserScalar_wolfId")1`);



                    };
                    Dmitry Vinnik
                    Silhouette Images Inc.
                    ShowReel:
                    https://www.youtube.com/watch?v=qxSJlvSwAhA
                    https://www.linkedin.com/in/dmitry-v...-identity-name

                    Comment

                    Working...
                    X