.cc
[convexer.git] / __init__.py
index 53149b6afde21ac6f52a813ea4d5dd7c2f108ab0..c5fb285828b0e881ecb443448687940f9b5887e4 100644 (file)
@@ -89,11 +89,11 @@ def cxr_ui(_,context):
          blf.draw(0,ln[:-1])
          py += 16
 
-   if CXR_PREVIEW_OPERATOR.LASTERR != None:
-      blf.position(0,2,80,0)
-      blf.size(0,50,48)
-      blf.color(0,1.0,0.2,0.2,0.9)
-      blf.draw(0,"This is a stoopid error\nWIthiuawdnaw")
+   #if CXR_PREVIEW_OPERATOR.LASTERR != None:
+   #   blf.position(0,2,80,0)
+   #   blf.size(0,50,48)
+   #   blf.color(0,1.0,0.2,0.2,0.9)
+   #   blf.draw(0,"Invalid geometry")
 
    # Something is off with TIMER,
    # this forces the viewport to redraw before we can continue with our
@@ -1565,6 +1565,11 @@ class CXR_COMPILER_CHAIN(bpy.types.Operator):
          for brush in sceneinfo['geo']:
             for ms in brush['object'].material_slots:
                a_materials.add( ms.material )
+               if ms.material.cxr_data.shader == 'VertexLitGeneric':
+                  errmat = ms.material.name
+                  errnam = brush['object'].name
+                  print( F"Vertex shader {errmat} used on {errnam}")
+                  return {'CANCELLED'}
          
          for ent in sceneinfo['entities']:
             if isinstance(ent['object'],bpy.types.Collection): continue
@@ -1580,6 +1585,13 @@ class CXR_COMPILER_CHAIN(bpy.types.Operator):
             for obj in hero['collection'].objects:
                for ms in obj.material_slots:
                   a_materials.add( ms.material )
+                  if ms.material.cxr_data.shader == 'LightMappedGeneric' or \
+                     ms.material.cxr_data.shader == 'WorldVertexTransition':
+
+                     errmat = ms.material.name
+                     errnam = obj.name
+                     print( F"Lightmapped shader {errmat} used on {errnam}")
+                     return {'CANCELLED'}
          
          # Collect images
          for mat in a_materials:
@@ -1663,16 +1675,17 @@ class CXR_COMPILER_CHAIN(bpy.types.Operator):
                "w": 25,
                "colour": (0.9,0.5,0.5,1.0),
                "exec": "vvis",
-               "jobs": [[settings[F'exe_vvis']] + args],
+               "jobs": [[settings[F'exe_vvis']] + ['-fast'] + args ],
                "cwd": directory
             }]
             
+            vrad_opt = settings.opt_vrad.split()
             static.JOBINFO += [{
                "title": "VRAD",
                "w": 25,
                "colour": (0.9,0.2,0.3,1.0),
                "exec": "vrad",
-               "jobs": [[settings[F'exe_vrad']] + args],
+               "jobs": [[settings[F'exe_vrad']] + vrad_opt + args ],
                "cwd": directory
             }]
 
@@ -1772,6 +1785,7 @@ class CXR_INTERFACE(bpy.types.Panel):
       box.prop(settings, "exe_vbsp")
       box.prop(settings, "exe_vvis")
       box.prop(settings, "exe_vrad")
+      box.prop(settings, "opt_vrad")
 
       box = box.box()
       row = box.row()