Announcement

Collapse
No announcement yet.

vrmesh format

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

  • vrmesh format

    Hi,
    I'm currently trying to understand the structure of the vrmesh format but got stuck at the point querying channel 0 ID. The value I'm getting back ( 65536) has no particular meaning to me but it keeps occurring in a few examples I've tested so far. Could somebody please explain how should I match the value with one of predefined channel number IDs.
    As a testing case I started with the cube.vrmesh example:
    http://spot3d.com/vray/help/maya/sdk....html#examples

    A similar problem shows up with consecutive fields "dependency channel ID" (17) and the "flags" (12). My impression with the latter is that I need to decompose the value into a binary form and read each bit field independently. This is a blind guess though and I might be totally wrong here, so could someone verify this please?
    Since I don't know what the flags are I can not verify if I am dealing with compressed data or not. This stops me from moving on to the next channel in order to check what ID value it will return.
    I would much appreciate any hints..

    And a few related questions...
    1.It looks like render voxel (exported from Maya) stores by default 7 channels in total, in what order the channel appears?
    2.Does Maya by default outputs compressed vraymesh files? If so, is there any way to set it off.
    3.How can I tell from the voxel table, if I have moved from frame 0 to frame 1

    Thank you,
    Kuba

  • #2
    It might be easier to use the V-Ray SDK (meshes_s.lib) to read and write .vrmesh files. Also look at the mesh_file.h from the V-Ray SDK (or here: http://spot3d.com/vray/help/maya/sdk...h_channel.html) for the exact definitions (f.e. the MeshChannel structure) of the fields and their types - I don't guarantee that I copied everything correctly. In fact, looking at the header, I notice that the channelID and depChannelID fields are 16-bit (2 bytes) instead of 4 bytes as I wrote in the docs page.

    The compression is always enabled when exporting from Maya; I don't think there is a way to turn it off.

    I don't understand the 3rd question - each frame begins with the number of voxels in it; when those voxels end, you get the number of voxels in the next frame and so on.

    Best regards,
    Vlado
    Last edited by vlado; 29-06-2012, 09:15 AM.
    I only act like I know everything, Rogers.

    Comment


    • #3
      Hi Vlado,
      Thanks for getting back so fast and sorry for unclear question.
      I don't understand the 3rd question - each frame begins with the number of voxels in it; when those voxels end, you get the number of voxels in the next frame and so on.
      What I meant here was that if we store an animation, how do we know which frame the current voxel belongs to. When reading a voxel table I assume now that as soon as I read the last voxel from frame 0 I move on to the next frame. But perhaps there is a specific value which tells us that this section of a voxel table corresponds to the frame 1.
      From your answer I can see my assumption was right
      The compression is always enabled.
      Fair enough, and how about ply2vrmesh tool?
      It might be easier to use the V-Ray SDK (meshes_s.lib) to read and write .vrmesh files.
      Well, let me briefly describe what I am doing. My plan is to export meshes with custom attributes (geometry level material attributes in particular) from Houdini directly to Vray. I'm not 100% sure but using ply2vrmesh to convert geo, bgeo files does not preserve custom primitive attributes (speaking houdini's terms). I would like to use one of these attributes to be converted to material id channel and be able to reference more then one material with a vrmesh. At the moment I've been poking around with python, I don't really care bout the performance....for now. In fact I don't mind using SDK but unfortunately this introduce slower development cycles which I don't have time for right now. I wonder have you ever considered introducing some sort of python API to some parts of the SDK (vrmesh creation, materials etc.). This might be really useful in some custom pipelines where more then one package is used.

      Thanks again,
      kuba

      Comment


      • #4
        Originally posted by JAKUB_ROTH View Post
        Fair enough, and how about ply2vrmesh tool?
        Compression is always enabled there too.

        Well, let me briefly describe what I am doing. My plan is to export meshes with custom attributes (geometry level material attributes in particular) from Houdini directly to Vray. I'm not 100% sure but using ply2vrmesh to convert geo, bgeo files does not preserve custom primitive attributes (speaking houdini's terms).
        We preserve primitive groups so that you can assign different materials to them (to do that, use the -materialIDs option for ply2vrmesh). We also support float1, float2 and float3 attributes which come in as color sets in Maya.

        I would like to use one of these attributes to be converted to material id channel and be able to reference more then one material with a vrmesh.
        I see; however creating a .vrmesh writer from scratch in Python might be an overkill for the task... I could get you the sources of ply2vrmesh though, if you email me to vlado@chaosgroup.com - it might speed up your development cycle

        I wonder have you ever considered introducing some sort of python API to some parts of the SDK (vrmesh creation, materials etc.).
        It is an interesting idea; to be honest you are the first to request it - so far people have found ways to do what they need without resorting to the low-level API. There is also Alembic now which we will support in the next builds (though .abc files tend to be somewhat slower to process than .vrmesh'es).

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

        Comment


        • #5
          Originally posted by vlado View Post
          It is an interesting idea; to be honest you are the first to request it - so far people have found ways to do what they need without resorting to the low-level API. There is also Alembic now which we will support in the next builds (though .abc files tend to be somewhat slower to process than .vrmesh'es).

          Best regards,
          Vlado
          +1 for me.
          I am not a developer, just a lighting/lookDev TD, i don't know C++ or C, but Python/Mel/PyMel (like a lot of TD), i use a lot the "Python V-Ray Scene Access". Have a python API to some parts of the SDK is a very great idea.
          www.deex.info

          Comment


          • #6
            We preserve primitive groups so that you can assign different materials to them (to do that, use the -materialIDs option for ply2vrmesh). We also support float1, float2 and float3 attributes which come in as color sets in Maya.
            I could get you the sources of ply2vrmesh though, if you email me to vlado@chaosgroup.com - it might speed up your development cycle
            Sweet!, I didn't know about materialIDs flag, this actually might be something I'm looking for.... Let me try this first and I will get back if this approach fall short.

            Thanks again for sharing so much valuable info.
            Cheers,
            Kuba

            Comment


            • #7
              Hey Vlado, materialID works great! This does exactly what I'm after. (for now ... )

              Comment


              • #8
                Very well then Let us know if there is anything else.

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

                Comment

                Working...
                X