Announcement

Collapse
No announcement yet.

2 problems with instanced meshes

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

  • 2 problems with instanced meshes

    Hi,

    I think i encountered 2 bugs in export of instanced meshes:
    (by instance i mean multiple blender objects that share same object data)

    1- some inverted normals :

    meshes with negative scaling render wrong (inverted) normals : happens when you use mirror (ctrl+M , not the modifier ) on an instanced mesh .

    2- if multiple instances have different modifiers they are all rendered identical .

    if i make a cube , duplicate it instanced with alt+D , then add to each one a different modifier or same modifier with different parameters ... in render i see 2 identical objects .

    Not sure what's the solution (a switch to disable instances ? or checking for each mesh if it's really identical to other instances .. )
    In the python exporter i tried a crude fix .. exporting objects by ob.name instead of ob.data.name ..disables instances totally but worked.

    Thanks,
    Keep up the great work!

  • #2
    Re: 2 problems with instanced meshes

    1. Blender problem itself.
    2. This is how my instance track works (yep, simply by name . In V-Ray instance is a completely same geometry. In Blender if objects has same mesh, but different modifiers they actually has different render meshes so in our case they are not instances. May be this a little inconvenient sometimes, but really speedup export and render when using a lot of same geometry.
    So, instances in Blender are not fully instances, for me instance is a full duplicate (including modifier instance etc - all props).

    In the python exporter i tried a crude fix .. exporting objects by ob.name instead of ob.data.name ..disables instances totally but worked.
    I could add a GUI control for this (or you can try to do is yourself and I will add patch).
    V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
    andrei.izrantcev@chaos.com
    Support Request

    Comment


    • #3
      Re: 2 problems with instanced meshes

      Hi,
      about normals problem : ok, indeed disabling instance doesn't fix it.

      So .. i don't know what the problem is , and what blender is doing wrong .. but this might interest you : same thing happened with blender FBX exporter , but we later discovered that 3dsmax imported those files correctly while some other apps had that same normals problem .. so i guess blender FBX exporter handles that correctly (but ..again just a guess )

      For the 2nd problem ,I'm a total newbie in scripting ..but here's my attempt:

      --added "instances" button under sytem , default on , if off objects are exported as uniques (by ob.name)
      -- toggle affects all objects ...maybe it'd be better make affect only chosen objects ? hmm.. would be more flexible but also confusing (to use , and for me to script)
      -- instances off doesn't work with custom build : some objects disappear (sry.. i can't help with C exporter)

      i attach the .py script and the patch (first patch file i ever made ..might be wrong)
      [attachment=1:20up80y8]vrayexport.py[/attachment:20up80y8]
      [attachment=0:20up80y8]vrayblender2.49.13instances.rar[/attachment:20up80y8]
      Attached Files

      Comment


      • #4
        Re: 2 problems with instanced meshes

        @nizu, Yep, I'll need to recompile my builds, this will take some time. I could do this next week may be later. Btw, you are using experimental 2.49.13 exporter, you should better use 2.49.12 from the Download page.
        V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
        andrei.izrantcev@chaos.com
        Support Request

        Comment


        • #5
          Re: 2 problems with instanced meshes

          Yes, right .. i noticed now that .13 uses new materials

          oh i also placed the "Instances" in same space of "log window" button (linux only) , it should be placed elsewhere ..

          Better if you do the proper fixes to script ..thanks.

          Comment


          • #6
            Re: 2 problems with instanced meshes

            I attach here the instances toggle applied to 2.49.12 stable exporter.
            Instances turned off don't work with custom build and might have other issues ..
            But this could still be useful to someone, while Andrey does the proper fix.

            [attachment=0:71g224z4]vrayexport_2.49.12 instances toggle.py[/attachment:71g224z4]
            Attached Files

            Comment


            • #7
              Re: 2 problems with instanced meshes

              nizu
              win32 build for tests: http://slil.ru/28772448
              Fixed exporter: http://vray.cgdo.ru/files/vrayexport_2.49.12.py (i hope it still works with first build =)
              V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
              andrei.izrantcev@chaos.com
              Support Request

              Comment


              • #8
                Re: 2 problems with instanced meshes

                Hi,

                New build is working with all my scenes ,
                no problems with the new script + old build (of course , "instances" must be ON with old build )

                thanks ! rapid bug fix as usual !

                Comment


                • #9
                  Re: 2 problems with instanced meshes

                  Hi,

                  I have some problems with the instances. When exporting with "instances" on It renders as expected and all meshes use the same modifier:
                  [attachment=1:1rtcpoz1]instances_on.png[/attachment:1rtcpoz1]
                  When exporting without "instances" switch on the camera looks at the wrong position (used TrackTo constraint):
                  [attachment=0:1rtcpoz1]instances_off.png[/attachment:1rtcpoz1]
                  Also the roofing tiles are at the wrong position.


                  btw: the source link of 2.49 build is broken, so I couldn't compile again.

                  Using:
                  * VRay: V-Ray Standalone, version 0.10.15 for x64
                  * VRay/Blender: 2.49.12.60
                  * Blender: 2.49b custom build SVN-26257 (self compiled)

                  any thoughts, or a workaround?

                  maces
                  Attached Files

                  Comment


                  • #10
                    Re: 2 problems with instanced meshes

                    btw: the source link of 2.49 build is broken, so I couldn't compile again.
                    This is the correct link: http://vray.cgdo.ru/build/src/vrayblend ... rc.tar.bz2
                    V-Ray For Houdini | V-Ray Hydra Delegate | VRayScene
                    andrei.izrantcev@chaos.com
                    Support Request

                    Comment


                    • #11
                      Re: 2 problems with instanced meshes

                      Thx.

                      btw: You should change the builddir in user-config.py to /tmp/.. or something else

                      It's compiling now. Are there any changes since the first release of 2.49 custom build?

                      maces

                      Comment


                      • #12
                        Re: 2 problems with instanced meshes

                        Cool, it's working:

                        [attachment=0:24yqkb37]instances_off_working.png[/attachment:24yqkb37]

                        Thx for this fast help.

                        maces
                        Attached Files

                        Comment

                        Working...
                        X