Announcement

Collapse
No announcement yet.

Shave 7.18, Vray Hair3 - Writing .vrscenes

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

  • Shave 7.18, Vray Hair3 - Writing .vrscenes

    Since I turned HT threading off, Shave and Hair3 have been fantastic. The softness and speed with Hair3 and GI are amazing.

    Click image for larger version

Name:	testFur.png
Views:	1
Size:	394.8 KB
ID:	877170

    I have a workflow issue I need some help with:

    I need to write the hair into the .vrscene file for each frame. Our pipeline is based on writing out .vrscene files for the standalone. When I translate a scene, it writes the data to the .vrscene for the first frame, but is static from that point forward.

    I tried putting shaveRender -frameStart; shaveRender -vrayKeyframe in the Pre Render Frame Mel, but no luck.

    From looking at the .vrscene with shave hair, there seems to be a description of the hair node with the shader assignment:

    Code:
    Node pSolidShape1@node {
      transform=Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0));
      geometry=pSolidShape1@mesh2;
      material=VRayMtlHair31@mtlsingle;
      nsamples=1;
      visible=1;
      user_attributes="";
    }
    And this looks like the generator for the hair. I assume the draData is the hair primitive description. (I've removed most of the data for this post)

    Code:
    hairVRayShader pSolidShape1@mesh2 {
      stackId=0;
      instanced=0;
      ownshader=0;
      squirrel=0;
      tipfade=1;
      spectint=Color(1, 0.4029851, 0);
      spectint2=Color(0, 0, 0);
      draFile="";
      libPath="K:\Public\Pipeline\vray_builds\deploy\Maya2012\vray\vrayplugins";
      numFacesPerInst=0;
      numUVSets=0;
      uvs=List(
      );
      draData=ListInt(
        615018,-1476788224,......a bunch of stuff......0);
      draSize=76400;
      cameraVisibility=1;
      lightVisibility=1;
      GiVisibility=1;
    }
    I've also seen that there is a draFile option in the shaveGlobals, also written into the .vrscene file. I don't see an option to write that file, but shave/vray definitely tries to read it if you specify. Could that be a mechanism to store the data?

    from looking at the .vrscene

    Code:
    // Frame at time 1
    the Node pSolidShape1 never gets updated.


    here are the shaveRender available commands:
    Code:
    Synopsis: shaveRender [flags]
    Flags:
       -q -query
     -cdf -createDRAFile    String
      -ee -exportEnd       
      -es -exportStart      String
      -fe -frameEnd        
      -fs -frameStart      
     -occ -occlusionsInDRA 
      -re -renderEnd       
      -rs -renderStart     
      -sw -swatch           String UnsignedInt String
      -tr -targetRenderer   UnsignedInt
      -vr -vrayKeyframe    
    
    
    Command Type: Command

    Ideas?


    Thanks,

    Zach
    Last edited by Zach Gray; 25-01-2013, 01:52 PM.

  • #2
    Or would it be possible to write the shave hair to a proxy, then reference that in the .vrscene?

    Comment


    • #3
      I think I see a way to write a dra file using

      Code:
      shaveRender -cdf  "D:/temp_01.dra"
      In a rudimentary test, I've got that working for a single frame.

      Code:
      hairVRayShader pSolidShape1@mesh2 {
        //previous removed for simplicity
        draFile="d:/temp_01.dra";
        libPath="K:\Public\Pipeline\vray_builds\deploy\Maya2012\vray\vrayplugins";
        numFacesPerInst=0;
        numUVSets=0;
        uvs=List(
        );
        //draData=ListInt(
        //  615018,-1476788224,......a bunch of stuff......0);
        //draSize=76400;
        // following removed for simplicity
      }
      I'm lost trying to figure out how to describe the data for subsequent frames. I can follow what is happening for geometry with anim on it, but this is tricky.

      Code:
      //the mesh object gets described, with the @mesh2
      hairVRayShader pSolidShape1@mesh2 {}
      
      //the node for processing by the renderer?
      //shader assignment, etc
      Node pSolidShape1@node {
        transform=Transform(Matrix(Vector(1, 0, 0), Vector(0, 1, 0), Vector(0, 0, 1)), Vector(0, 0, 0));
        geometry=pSolidShape1@mesh2;
        material=VRayMtlHair31@mtlsingle;
        nsamples=1;
        visible=1;
        user_attributes="";
      }
      From looking at geometry, it looks like animated values get overloaded from it's inital state. I'm pretty sure I wouldn't want to create a unique mesh object using the hairVRayShader per frame, but somehow update that description per frame, from the .dra file.

      Code:
      // Frame at time 2
      
      Node pPlaneShape1@node{}

      Am I overthinking this and I just overload per frame similar to this?

      Code:
      // Frame at time 3
      hairVRayShader pSolidShape1@mesh2 {
        draFile="d:/temp_03.dra";
      }
      Which doesn't work, as shown because it needs to use the hairVRayShader to generate the new mesh. 3. In my testing, only the last reference to the .dra file gets used in the scene if I update hairVRayShader pSolidShape1@mesh2

      Code:
      Node pSolidShape1@node{
        geometry=pSolidShape1@mesh2;
      }
      So all of that is a complicated way of asking:

      1. How to get the hairVRayShader to kick in at each frame to update the geometry.
      2. Is my 'overloading' concept accurate -- you only change the data you need to touch per frame.
      Last edited by Zach Gray; 26-01-2013, 11:42 PM.

      Comment


      • #4
        In case folks who knew the answer but were scared off by the rambling below, here is a concise question.

        How can I get a vrayPlugin to generate at each frame in a .vrscene?

        Code:
        hairVRayShader pSolidShape1@mesh2 {}
        
        Node pSolidShape1@node{
          geometry=pSolidShape1@mesh2;
        }
        The hairVRayShader needs to be reconstructed in memory at each frame in the vrscene, but it only happens once.

        Comment


        • #5
          My guess is that for the moment, you'll just have to export each frame separately. V-Ray needs to know that a plugin parameter is animated in order to export it properly in the .vrscene file, and the Shave plugin doesn't provide this information. I need to explain to Joe how to implement this.

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

          Comment


          • #6
            The other solution of course is to render through Maya batch.

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

            Comment


            • #7
              Originally posted by vlado View Post
              The other solution of course is to render through Maya batch.

              Best regards,
              Vlado
              I was hoping to avoid that , since spending a bunch of time getting a pipeline built around .vrscenes + alembic/proxy. This throws a wrench into to that.

              Comment


              • #8
                Originally posted by vlado View Post
                My guess is that for the moment, you'll just have to export each frame separately.
                I was trying this post translate python approach after talking with Joe. He does the fur generation via mayabatch to keep things distributed, but for our workflow, we are pretty invested in writing out .vrscenes, and in leiu of alembic support for fur/shave/vray, I thought this might be useful for others as well.

                I was hoping to just hack the vrscene via the post translate.

                Originally posted by vlado View Post
                V-Ray needs to know that a plugin parameter is animated in order to export it properly in the .vrscene file, and the Shave plugin doesn't provide this information. I need to explain to Joe how to implement this.
                Is there a way to just add a tag to the plugin description in the .vrscene, or does that need to be done via the plugin?

                ... that would be great, and get us up and running. (That is if blur, etc works properly

                I guess I wanted to build something more akin to a .rib file rather than relying on mayabatch.

                Comment


                • #9
                  Originally posted by vlado View Post
                  V-Ray needs to know that a plugin parameter is animated in order to export it properly in the .vrscene file, and the Shave plugin doesn't provide this information.
                  This is a dead end, right?

                  Looking at an export of maya hair, I can follow the structure of

                  Code:
                  attribute=interpolate(
                    (stateAtPreviousFrame/frameIndex, newState)
                  );

                  It doesn't seem possible to interp betwen string attrs... heh heh.

                  Code:
                  // Frame at time 2
                  hairVRayShader pSolidShape1@mesh3 {
                    draFile=interpolate(
                      (1, "shaveDRA.02.dra")
                    );
                  }
                  Because shave only populates the ListInt data in single frame mode...

                  Code:
                  draData=ListInt(
                      615018,-1476788224,382861312,382861312, //+thousands more);
                    draSize=76400;
                  Then you could use the interpolate, I assume.

                  That's a shame. I was hoping it was as simple as associating the correct .dra file with each frame.

                  Comment


                  • #10
                    Hm, I thought that animated string parameters work - that's how we export animated metadata for OpenEXR files. Whether they work for Shave, that's another matter...

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

                    Comment


                    • #11
                      Wow, thank you! Got it working once I referred to the syntax from the animated metadata for OpenExr!

                      I can't believe it works!

                      Code:
                      // Frame at time 2
                      hairVRayShader pSolidShape1@mesh3 {
                        draFile=interpolate(
                          (1, "D:/shaveDRA.02.dra")
                          );
                      }
                      But then I realized that the vray Scene Access doesn't seem to be able to create data at frame indicies.

                      I just need to jam that code fragment in at each // Frame at time #, with the appropriate #.dra file, but I don't see a way to do it unless I fopen/regex the .vrscene with python.

                      I just want to be sure I'm not missing the intent of how to use scene access.
                      Last edited by Zach Gray; 29-01-2013, 12:04 AM.

                      Comment


                      • #12
                        You might be able to write a simple Python script that writes the animated string file names in a text file; you can then #include it in your main .vrscene file (or inject it using the Python callback before translating the rest of the scene).

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

                        Comment


                        • #13
                          Just checking on this thread, is it not possible without custom code to render shave hair with standalone? We're seeing these errors on the farm

                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "relements_separate_rgba" in object "vraySettingsOutput"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "misc_useCachedAssets" in object "vraySettingsOptions"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "misc_transferAssets" in object "vraySettingsOptions"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "misc_abortOnMissingAsset" in object "vraySettingsOptions"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "gi_texFilteringMultiplier" in object "vraySettingsOptions"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Failed to create object of type "CameraDefault"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "write_integer_ids" in object "vraySettingsEXR"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "interleaved" in object "vraySettingsTIFF"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Failed to create object of type "SettingsVFB"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "first_poly_vertices" in object "ManeGuideHairs_polySurface1Shape@mesh1"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "preserve_map_borders" in object "ManeGuideHairs_polySurface1Shape@mesh1@subdivGeom etry"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Unknown property "first_poly_vertices" in object "pPlaneShape1@mesh2"
                          0: STDOUT: [2013/Feb/13|16:05:36] warning: Failed to create object of type "hairVRayShader"
                          0: STDOUT: [2013/Feb/13|16:05:36] Scene created successfully.

                          Comment


                          • #14
                            ok, realized that was due to not having the shave plugins installed for vrstandalone. We now get no errors.. but no hair rendering.

                            0: STDOUT: SHAVE: Shave and A Haircut for V-Ray (v1.0.15)
                            0: STDOUT: SHAVE: Shave core (7.0v14)
                            0: STDOUT: SHAVE: (c) 2010-2012 Joe Alter Inc.
                            0: STDOUT: [2013/Feb/13|16:14:03] warning: Unknown property "GiVisibility" in object "pSolidShape1@mesh3"
                            0: STDOUT: [2013/Feb/13|16:14:03] warning: Unknown property "lightVisibility" in object "pSolidShape1@mesh3"
                            0: STDOUT: [2013/Feb/13|16:14:03] warning: Unknown property "cameraVisibility" in object "pSolidShape1@mesh3"
                            0: STDOUT: [2013/Feb/13|16:14:03] Scene created successfully.
                            0: STDOUT: [2013/Feb/13|16:14:03] Objects in scene: 50
                            0: STDOUT: [2013/Feb/13|16:14:03] Starting render sequence.
                            0: STDOUT: [2013/Feb/13|16:14:03] Preparing renderer...
                            0: STDOUT: Preparing scene for rendering...: 0.00% [126h 2m 9.8s] [ 0h 0m 0.0s est]
                            0: STDOUT: [2013/Feb/13|16:14:03] Creating bitmap manager
                            0: STDOUT: [2013/Feb/13|16:14:03] Preparing scene for rendering...: done [ 0h 0m 0.0s]

                            Comment


                            • #15
                              I would get only the first frame when writing a vrscene, even though shave would grind thru each frame.

                              I think if you use maya batch, it will generate each frame, but I didn't even try that.

                              We render directly from vrscenes, so I hacked together a standalone solution. There is an advantage of pre baking the fur that we have discovered that is actually a benefit... Once it is cached, you don't need to regenerate unless you change the sim, style, or count. So if you need to tweak a light or texture, there is no overhead for fur regeneration.

                              If you think you might use it, I can share what I cobbled together. I haven't cleaned it up yet but it works for our testing.

                              Comment

                              Working...
                              X