Announcement

Collapse
No announcement yet.

plugin for vrscene to blend between vrmeshes

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

  • plugin for vrscene to blend between vrmeshes

    Hi,
    This is more of a vray standalone question...
    I'm wondering how much trouble it would be to code a vray standalone plugin to read two single frame vrmeshes with identical point count and polygon info, and do a simple linear interpolation between the points. Though I have limited c++ experience, (i've made some other plugins to read custom geometry files etc) It looks pretty straightforward from browsing through the sdk documentation. I'm on a really tight timeline with my current project though, and I don't have any time for r&d at the moment. If anyone had something I could drop in to do the job, or even give a basic outline of how I could structure the code, that would be really convenient. or if it was something that would take the developers here a few minutes to make, that would be awesome too. Thanks!

  • #2
    So, I've looked into this further, and I'm trying to compile a copy of the vray_GeomMeshFile from the sdk samples, which I have called "Mix_GeomMeshFile". I have not modified the code at all, except for renaming all the occurances of "GeomMeshFile" to "Mix_GeomMeshFile". I have successfully built and compiled a version of it, which returns no errors. When I try to use it in a vrscene, in place of a "GeomMeshFile" it says "warning: Failed to create object of type "Mix_GeomMeshFile"

    Any suggestions of how to troubleshoot this? Thanks.

    Comment


    • #3
      Did you change the plugin ID for your plugin? Is your plugin file loaded at all?

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

      Comment


      • #4
        I just changed the plugin ID, and copied the dll into the proper location, and now its working. Thank you Vlado!

        Comment


        • #5
          I'm digging through the geom_mesh_file.cpp example, and unless I misunderstand it, it looks to me like the MeshFileInstance::setIntersectionData can't easily access another arbitrary vrmesh, since it looks up the owner of the mesh for a certain rayhit during the rendering. Am I understanding this correctly? If I can get another mesh in as another file parameter, how can I check to see which point on another vrmesh corresponds to the one which is being processed?

          Comment


          • #6
            Originally posted by sypa View Post
            I'm digging through the geom_mesh_file.cpp example, and unless I misunderstand it, it looks to me like the MeshFileInstance::setIntersectionData can't easily access another arbitrary vrmesh, since it looks up the owner of the mesh for a certain rayhit during the rendering. Am I understanding this correctly? If I can get another mesh in as another file parameter, how can I check to see which point on another vrmesh corresponds to the one which is being processed?
            No idea, that's up to you and depends on what you want to do. If the .vrmesh files have only one voxel, you can probably use the face index and the barycentric coordinates, similar to how we do it for reference mapping. Otherwise, you can also simply bake the data that you are interested in (e.g. the original position of the mesh vertices) as a color set or UVW channel when creating the .vrmesh file.

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

            Comment


            • #7
              Thanks, that is helpful. I have a couple more related questions:

              1. I'm exporting vrmeshes from max using the default mesh export script in the interface. It is a selection of objects with different materials and material IDs. Can I ensure that such a vrmesh consists of just one voxel? Or do I need to write some sort of custom vrmesh exporter?

              2. It seems there are two MeshFileInstance::setIntersectionData functions with different parameters in the examples. Are both of them needed for the Vray production renderer, or is the one with "const RayBunchParams&" always implemented just for vrayRT?

              3. Is it possible to load the vrmesh as a static object like in the example geom_meshloader.cpp, therefore making the setIntersectionData and rayserver stuff unnecessary?
              Last edited by sypa; 27-10-2011, 08:50 AM.

              Comment


              • #8
                Originally posted by sypa View Post
                1. I'm exporting vrmeshes from max using the default mesh export script in the interface. It is a selection of objects with different materials and material IDs. Can I ensure that such a vrmesh consists of just one voxel? Or do I need to write some sort of custom vrmesh exporter?
                Internally there is an option how many faces to store in a single voxel, but unfortunately it looks like it is not accessible from 3ds Max right now. We can do that if necessary.

                2. It seems there are two MeshFileInstance::setIntersectionData functions with different parameters in the examples. Are both of them needed for the Vray production renderer, or is the one with "const RayBunchParams&" always implemented just for vrayRT?
                For the moment, ray bunches are only used for V-Ray RT.

                3. Is it possible to load the vrmesh as a static object like in the example geom_meshloader.cpp, therefore making the setIntersectionData and rayserver stuff unnecessary?
                You could create a "GeomMeshFile" plugin instead of "GeomStaticMesh" and pass to it the name of a .vrmesh file.

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

                Comment


                • #9
                  I'll have to return to this project later due to lack of time, but eventually I will need to have that option exposed (setting how many faces to store in a single voxel). I used the preview mesh as a workaround for now, as I was able to set the number of faces for that voxel in the export interface.

                  Comment

                  Working...
                  X