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
else: colour = colourwait
px = (cur + (i)*sfsub) * sf
- px1 = (cur + (i+1.0)*sfsub) * sf - 0.003
+ px1 = (cur + (i+1.0)*sfsub) * sf
i += 1
verts += [(px,0), (px, h), (px1, 0.0), (px1,h)]
def _buildsolid( cmd ):
nonlocal m
+
+ print( F"{vmfinfo.brush_count} :: {cmd['object'].name}" )
baked = mesh_cxr_format( cmd['object'] )
world = libcxr_decompose.call( baked, None )
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
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:
# Convexer jobs
static.JOBID = 0
static.JOBINFO = []
-
- static.JOBINFO += [{
- "title": "Convexer",
- "w": 20,
- "colour": (1.0,0.3,0.1,1.0),
- "exec": cxr_export_vmf,
- "jobs": [(sceneinfo,output_vmf)]
- }]
- if len(image_jobs) > 0:
- static.JOBINFO += [{
- "title": "Textures",
- "w": 40,
- "colour": (0.1,1.0,0.3,1.0),
- "exec": compile_image,
- "jobs": image_jobs
- }]
-
- # FBX stage
-
- if len(sceneinfo['heros']) > 0:
- static.JOBINFO += [{
- "title": "Batches",
- "w": 25,
- "colour": (0.5,0.5,1.0,1.0),
- "exec": cxr_export_modelsrc,
- "jobs": [(h['collection'], h['origin'], asset_dir, \
- settings.project_name, h['transform']) for h in \
- sceneinfo['heros']]
+ if settings.comp_vmf:
+ static.JOBINFO += [{
+ "title": "Convexer",
+ "w": 20,
+ "colour": (1.0,0.3,0.1,1.0),
+ "exec": cxr_export_vmf,
+ "jobs": [(sceneinfo,output_vmf)]
}]
- # VBSP stage
+ if settings.comp_textures:
+ if len(image_jobs) > 0:
+ static.JOBINFO += [{
+ "title": "Textures",
+ "w": 40,
+ "colour": (0.1,1.0,0.3,1.0),
+ "exec": compile_image,
+ "jobs": image_jobs
+ }]
+
game = 'z:'+settings.subdir.replace('/','\\')
args = [ \
'-game', game, settings.project_name
]
+
+ # FBX stage
+ if settings.comp_models:
+ if len(sceneinfo['heros']) > 0:
+ static.JOBINFO += [{
+ "title": "Batches",
+ "w": 25,
+ "colour": (0.5,0.5,1.0,1.0),
+ "exec": cxr_export_modelsrc,
+ "jobs": [(h['collection'], h['origin'], asset_dir, \
+ settings.project_name, h['transform']) for h in \
+ sceneinfo['heros']]
+ }]
- if len(qc_jobs) > 0:
+ if len(qc_jobs) > 0:
+ static.JOBINFO += [{
+ "title": "StudioMDL",
+ "w": 20,
+ "colour": (0.8,0.1,0.1,1.0),
+ "exec": "studiomdl",
+ "jobs": [[settings[F'exe_studiomdl']] + [\
+ '-nop4', '-game', game, qc] for qc in qc_jobs],
+ "cwd": asset_dir
+ }]
+
+ # VBSP stage
+ if settings.comp_compile:
static.JOBINFO += [{
- "title": "StudioMDL",
- "w": 20,
- "colour": (0.8,0.1,0.1,1.0),
- "exec": "studiomdl",
- "jobs": [[settings[F'exe_studiomdl']] + [\
- '-nop4', '-game', game, qc] for qc in qc_jobs],
- "cwd": asset_dir
+ "title": "VBSP",
+ "w": 25,
+ "colour": (0.1,0.2,1.0,1.0),
+ "exec": "vbsp",
+ "jobs": [[settings[F'exe_vbsp']] + args],
+ "cwd": directory
+ }]
+
+ static.JOBINFO += [{
+ "title": "VVIS",
+ "w": 25,
+ "colour": (0.9,0.5,0.5,1.0),
+ "exec": "vvis",
+ "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']] + vrad_opt + args ],
+ "cwd": directory
}]
- static.JOBINFO += [{
- "title": "VBSP",
- "w": 25,
- "colour": (0.1,0.2,1.0,1.0),
- "exec": "vbsp",
- "jobs": [[settings[F'exe_vbsp']] + args],
- "cwd": directory
- }]
-
- static.JOBINFO += [{
- "title": "VVIS",
- "w": 25,
- "colour": (0.9,0.5,0.5,1.0),
- "exec": "vvis",
- "jobs": [[settings[F'exe_vvis']] + args],
- "cwd": directory
- }]
-
- static.JOBINFO += [{
- "title": "VRAD",
- "w": 25,
- "colour": (0.9,0.2,0.3,1.0),
- "exec": "vrad",
- "jobs": [[settings[F'exe_vrad']] + args],
- "cwd": directory
- }]
-
- static.JOBINFO += [{
- "title": "CXR",
- "w": 5,
- "colour": (0.0,1.0,0.4,1.0),
- "exec": cxr_patchmap,
- "jobs": [(F"{directory}/{settings.project_name}.bsp",\
- F"{settings.subdir}/maps/{settings.project_name}.bsp")]
- }]
+ static.JOBINFO += [{
+ "title": "CXR",
+ "w": 5,
+ "colour": (0.0,1.0,0.4,1.0),
+ "exec": cxr_patchmap,
+ "jobs": [(F"{directory}/{settings.project_name}.bsp",\
+ F"{settings.subdir}/maps/{settings.project_name}.bsp")]
+ }]
static.USER_EXIT=False
static.TIMER=wm.event_timer_add(0.1,window=context.window)
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()
+ row.prop(settings,"comp_vmf")
+ row.prop(settings,"comp_textures")
+ row.prop(settings,"comp_models")
+ row.prop(settings,"comp_compile")
text = "Compile" if CXR_COMPILER_CHAIN.TIMER == None else "Cancel"
row = box.row()
image_quality: bpy.props.IntProperty(name="Texture Quality (0-18)",\
default=8, min=0, max=18 )
+ comp_vmf: bpy.props.BoolProperty(name="VMF",default=True)
+ comp_models: bpy.props.BoolProperty(name="Models",default=True)
+ comp_textures: bpy.props.BoolProperty(name="Textures",default=True)
+ comp_compile: bpy.props.BoolProperty(name="Compile",default=True)
classes = [ CXR_RELOAD, CXR_DEV_OPERATOR, CXR_INTERFACE, \
CXR_MATERIAL_PANEL, CXR_IMAGE_SETTINGS,\