BabylonJS / BlenderExporter

Exports From Blender to Babylon.JS in JSON / .babylon format
Apache License 2.0
292 stars 47 forks source link

Exception: error, no selected mesh objects #15

Open AwokeKnowing opened 4 years ago

AwokeKnowing commented 4 years ago

Hi guys, I got this trying to export my scene in blender 2.81 (first time I tried the tool). It exported a bunch of images, but for some reason the mesh part fails it seems.

Traceback (most recent call last):
  File "/home/james/.config/blender/2.81/scripts/addons/babylon_js/__init__.py", line 65, in execute
    exporter.execute(context, self.filepath)
  File "/home/james/.config/blender/2.81/scripts/addons/babylon_js/json_exporter.py", line 111, in execute
    mesh = Mesh(object, scene, self)
  File "/home/james/.config/blender/2.81/scripts/addons/babylon_js/mesh.py", line 146, in __init__
    recipe = BakingRecipe(bpyMesh, exporter)
  File "/home/james/.config/blender/2.81/scripts/addons/babylon_js/materials/baking_recipe.py", line 105, in __init__
    self.bakedMaterial.bake(bpyMesh, self)
  File "/home/james/.config/blender/2.81/scripts/addons/babylon_js/materials/material.py", line 138, in bake
    bpy.ops.uv.smart_project(angle_limit = 66.0, island_margin = 0.0, user_area_weight = 1.0, use_aspect = True, stretch_to_bounds = True)
  File "/home/james/Downloads/blender-2.81-linux-glibc217-x86_64/2.81/scripts/modules/bpy/ops.py", line 201, in __call__
    ret = op_call(self.idname_py(), None, kw)
RuntimeError: Error: Traceback (most recent call last):
  File "/home/james/Downloads/blender-2.81-linux-glibc217-x86_64/2.81/scripts/startup/bl_operators/uvcalc_smart_project.py", line 1032, in execute
    self.stretch_to_bounds,
  File "/home/james/Downloads/blender-2.81-linux-glibc217-x86_64/2.81/scripts/startup/bl_operators/uvcalc_smart_project.py", line 744, in main
    raise Exception("error, no selected mesh objects")
Exception: error, no selected mesh objects

location: /home/james/Downloads/blender-2.81-linux-glibc217-x86_64/2.81/scripts/modules/bpy/ops.py:201

location: <unknown location>:-1

I noticed there were no export settings. It said something about finding the settings in the properties panel

Palmer-JC commented 4 years ago

Basically, your material is not directly represent-able in BJS's implementation of PBR, It is trying to bake right in the export itself. Have not tried baking 2.81. Wonder if it is changed?

The exporter is trying to add a UV, since there is none. You might look further up the log to find the mesh it was working on, and add the UV yourself. Even better would be to see what node is was complaining about & adjust. Principled is your friend.

There are property subsections for the exporter all inside world, mesh, cameras, lights, materials.