bug fixes
[convexer.git] / __init__.py
index 6639af1c360efc78e70c9287c9dec072009b832c..cb377479815524c85b349b0ecaae0271bbaa5401 100644 (file)
@@ -117,7 +117,8 @@ class cxr_polygon(Structure):
 
 class cxr_edge(Structure):
    _fields_ = [("i0",c_int32),
-               ("i1",c_int32)]
+               ("i1",c_int32),
+               ("freestyle",c_int32)]
 
 class cxr_material(Structure):
    _fields_ = [("res",c_int32 * 2),
@@ -395,8 +396,8 @@ cxr_graph_mapping = {
       {
          "ShaderNodeMixRGB":
          {
-            "Color1": material_tex_image("$basetexture"),
-            "Color2": material_tex_image("$decaltexture")
+            "Color1": material_tex_image("basetexture"),
+            "Color2": material_tex_image("decaltexture")
          },
          "ShaderNodeTexImage":
          {
@@ -411,7 +412,7 @@ cxr_graph_mapping = {
       {
          "ShaderNodeNormalMap":
          {
-            "Color": material_tex_image("$bumpmap")
+            "Color": material_tex_image("bumpmap")
          }
       }
    }
@@ -850,6 +851,7 @@ def mesh_cxr_format(obj):
    for i, edge in enumerate(data.edges):
       edge_data[i].i0 = edge.vertices[0]
       edge_data[i].i1 = edge.vertices[1]
+      edge_data[i].freestyle = edge.use_freestyle_mark
 
    material_data = (cxr_material*len(obj.material_slots))()
 
@@ -955,12 +957,17 @@ class CXR_WRITE_VMF(bpy.types.Operator):
          def _collect(collection,transform):
             if collection.name.startswith('.'):
                return
+            
+            if collection.hide_render:
+               return
 
             if collection.name.startswith('mdl_'):
                _collect.heros += [(collection,transform)]
                return
 
             for obj in collection.objects:
+               if obj.hide_get(): continue
+
                classname = cxr_classname( obj )
 
                if classname != None:
@@ -974,6 +981,7 @@ class CXR_WRITE_VMF(bpy.types.Operator):
          _collect.a_models = set()
          _collect.entities = []
          _collect.geo = []
+         _collect.heros = []
 
          transform_main = cxr_object_context( context.scene.cxr_data.scale_factor, 0.0 )
          transform_sky = cxr_object_context( context.scene.cxr_data.skybox_scale_factor, \