Announcement

Collapse
No announcement yet.

reading vrmesh files

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

  • reading vrmesh files

    Hi,

    I try to load a vrmesh with the fallowing code:

    VUtils::MeshFile* pMesh1 = VUtils::newDefaultMeshFile();

    pMesh1->init("C:\\Program Files\\Chaos Group\\V-Ray\\3dsmax 2015 for x64\\docs\\meshes\\armadillo.vrmesh");

    int numvoxels = pMesh1->getNumVoxels();

    VUtils::Box b = pMesh1->getVoxelBBox(0);

    VR::MeshVoxel *voxel = pMesh1->getVoxel(0);

    I do get the numvoxels and VoxelBBox, but in the next line 3ds max crashes on all vrmesh files. With Alembic file it works fine and the voxel holds the data...

    is there some other step necessary?

    thanks,
    Stefan
    Freelance 3D Artist

    https://www.deepframes.com

  • #2
    Which V-Ray version is this?

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

    Comment


    • #3
      Hi vlado,

      I use

      vray 2.5.01
      max 2015
      Visual Studio 2012

      I also tried the Meshfile2 class but same issue...

      regards,
      Stefan
      Freelance 3D Artist

      https://www.deepframes.com

      Comment


      • #4
        Hm, this works fine for me - here is the .cpp file I'm using, which completes successfully and prints out 55 voxels:
        Code:
        #include "utils.h"
        #include "mesh_file.h"
        
        using namespace VUtils;
        
        int main(void) {
        	const char *fname="C:\\Program Files\\Chaos Group\\V-Ray\\3dsmax 2015 for x64\\docs\\meshes\\armadillo.vrmesh";
        	MeshFile* pMesh1 = VUtils::newDefaultMeshFile();
        	pMesh1->init(fname);
        	int numvoxels = pMesh1->getNumVoxels();
        	Box b = pMesh1->getVoxelBBox(0);
        	MeshVoxel *voxel = pMesh1->getVoxel(0);	
        		
        	printf("Number of voxels: %i\n", numvoxels);
        		
        	deleteDefaultMeshFile(pMesh1);
        }
        The build command is this:
        Code:
        set VRAY_SDK=c:\Program Files\Chaos Group\V-Ray\3dsmax 2015 for x64
        
        cl main.cpp /I "%VRAY_SDK%\include" /MD /link meshes_s.lib alembic_s.lib vutils_s.lib putils_s.lib zlib_s.lib user32.lib advapi32.lib /libpath:"%VRAY_SDK%\lib\x64\vc11" /libpath:"%VRAY_SDK%\lib\x64"
        What is your build configuration?

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

        Comment


        • #5
          Hi vlado,

          I use the build configuration from the vraymeshgeom sample because I try to modify the sample. I tried to put these lines in the MeshTest::init function (I also tried the MeshTest::MeshTest constructor), it compiles but when the function is called it crashes.

          A console application (as you did) works fine on my computer as it should.

          I also transfered all compiler and linker options from the vraymeshgeom sample to the console application and the console app still works fine...

          Could it be somehow unsafe to use vrmesh related functions in vraymeshgeom in the init function?
          Last edited by STEFAN_HAEHNLEIN; 07-08-2014, 03:20 AM.
          Freelance 3D Artist

          https://www.deepframes.com

          Comment


          • #6
            Originally posted by STEFAN_HAEHNLEIN View Post
            Could it be somehow unsafe to use vrmesh related functions in vraymeshgeom in the init function?
            No, at least I don't see how... If you like, you can send me the source code you are trying to compile to vlado@chaosgroup.com and I'll try to see if I get the crash here.

            My guess is that there could be a mismatch between some compiler/linker settings, but I've no idea what it might be right away.

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

            Comment


            • #7
              The crash is due to a class from the sample project - VoxelInfo - having the same name as another class in the V-Ray SDK. The Visual Studio 2012 linker calls the constructor of the wrong class.

              If you replace "VoxelInfo" in the sample project with, for example, "MyVoxelInfo" things will be fine.

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

              Comment

              Working...
              X