0
votes

I'm exporting a simple scene from blender to three. Aside from the texture not showing up (which I'm also fighting with), I have a weird problem with the positions of objects. Here's how it looks in blender:

render result in blender

and this is how it renders in three

render result in three

as you can see, elements are stacked up on each other (and the skybox texture is missing, even though it's referenced properly in the json, embedded as a base64 image). I'm using Three.js exporter v 1.5.0, three.js v84 and blender v 2.77

this is my configuration:

blender configuration

here's the code loading the scene:

  var loader = new THREE.ObjectLoader();

  loader.load(
      '../dist/landscape.json',
      function ( obj ) {
        scene.add(obj)
      }
  );

now, I do realise that this way I'm adding a scene to a scene but for some reason, if I try to extract children from it like this:

loader.load(
  '../dist/landscape.json',
  function ( obj ) {
    obj.children.forEach(function(elem) {
       scene.add(elem)
    }
  }
)

I only get half of the objects. No idea why. Besides the objects are still stacked up on each other. I checked the positions in the result versus the original values in blender, and aside from the standard y/z swap x values are reversed (though that's not the cause of the problem), and rotation is removed from the bridge which causes it to render upside down. I'm completely lost

Also, here are the .blend and .json files:

http://www.filehosting.org/file/details/653174/landscape.blend http://www.filehosting.org/file/details/653175/landscape.json

EDIT: Partial solution: Scale was set to 10 in exporter, caused the objects to look as if they were misplaced. The thing is, they are still rotated and there's still some mismatch compared to the original. picture here:

scale 1.0 applied

1
I had a similar issue and as you've mentioned setting the scale to 1 in the Blender three.js exporter settings helped. This means it is virtually invisible in the three.js scene but I just scaled it up and all was fine.AlexKempton
Yes, but as I've written in the end, I did manage to solve this part. The rotation part was not fixed, though.evil professeur

1 Answers

0
votes

I've just come across this issue for myself once again. Having the scale setting at 1 didn't fix it. The issue was that I hadn't applied object transformations in Blender.

  1. Select all problematic objects in your blender file (or just all with A)
  2. Press CTRL+A
  3. Select Rotation & Scale
  4. Repeat for Location if necessary