浏览代码

Blender Exporter 3.0.1
- Blender 2.75.0 documented as needed
- Checking for .blend requiring baking, but no UVEditor
- Bug for Nodes being checked as sources for instances error

Jeff Palmer 10 年之前
父节点
当前提交
3ddaca473a
共有 2 个文件被更改,包括 10 次插入4 次删除
  1. 9 4
      Exporters/Blender/io_export_babylon.py
  2. 1 0
      dist/preview release - alpha/what's new.md

+ 9 - 4
Exporters/Blender/io_export_babylon.py

@@ -1,8 +1,8 @@
 bl_info = {
     'name': 'Babylon.js',
     'author': 'David Catuhe, Jeff Palmer',
-    'version': (3, 0, 0),
-    'blender': (2, 72, 0),
+    'version': (3, 0, 1),
+    'blender': (2, 75, 0),
     'location': 'File > Export > Babylon.js (.babylon)',
     'description': 'Export Babylon.js scenes (.babylon)',
     'wiki_url': 'https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender',
@@ -206,7 +206,8 @@ class Main(bpy.types.Operator, bpy_extras.io_utils.ExportHelper):
 # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     def getSourceMeshInstance(self, dataName):
         for mesh in self.meshesAndNodes:
-            if mesh.dataName == dataName:
+            # nodes have no 'dataName', cannot be instanced in any case
+            if hasattr(mesh, 'dataName') and mesh.dataName == dataName:
                 return mesh
 
         return None
@@ -681,7 +682,6 @@ class Mesh(FCurveAnimatable):
             self.physicsFriction = object.rigid_body.friction
             self.physicsRestitution = object.rigid_body.restitution
 
-
         # process all of the materials required
         maxVerts = MAX_VERTEX_ELEMENTS # change for multi-materials
         recipe = BakingRecipe(object)
@@ -1668,6 +1668,11 @@ class BakingRecipe:
                     if mtex.use_map_color_spec:
                         self.specularBaking = True
         self.multipleRenders = blenderRender and self.cyclesRender
+        
+        # check for really old .blend file, eg. 2.49, to ensure that everything requires exists
+        if self.needsBaking and bpy.data.screens.find('UV Editing') == -1:
+            Main.warn('Contains material requiring baking, but resources not available.  Probably .blend very old', 2)
+            self.needsBaking = False     
 #===============================================================================
 # Not intended to be instanced directly
 class Material:

+ 1 - 0
dist/preview release - alpha/what's new.md

@@ -1,5 +1,6 @@
 - 2.2.0:
   - **Major updates**
+    - Blender can now bake Procedural textures & Cycles materials.  Plus more. See [documentation here](https://github.com/BabylonJS/Babylon.js/tree/master/Exporters/Blender) [Palmer-JC](https://github.com/Palmer-JC)
     - Meshes can now be attached to bones. See [documentation here](http://babylondoc.azurewebsites.net/page.php?p=22421) and [sample here](http://www.babylonjs-playground.com/#11BH6Z#18) [deltakosh](https://github.com/deltakosh)
     - HDR Rendering pipeline. See [demo here]() [julien-moreau](https://github.com/julien-moreau)
     - New rewored StandardMaterial.isReady for better memory usage and performance [deltakosh](https://github.com/deltakosh)