c_libcxr_log_callback = None
c_libcxr_line_callback = None
-libcxr_decompose = None
+libcxr_write_test_data = None
libcxr_context_reset = None
libcxr_set_offset = None
libcxr_set_scale_factor = None
print( F"libcxr build time: {build_time.value}" )
# Public API
- global libcxr_decompose
- global libcxr_convert_mesh_to_vmf
+ global libcxr_write_test_data, libcxr_convert_mesh_to_vmf
- libcxr_decompose = libcxr.cxr_decompose
- libcxr_decompose.argtypes = [\
+ libcxr_write_test_data = libcxr.cxr_write_test_data
+ libcxr_write_test_data.argtypes = [\
POINTER(cxr_input_mesh)
]
- libcxr_decompose.restype = c_int32
+ libcxr_write_test_data.restype = c_int32
libcxr_convert_mesh_to_vmf = libcxr.cxr_convert_mesh_to_vmf
libcxr_convert_mesh_to_vmf.argtypes = [\
kvs = ent_baseclass([ent_origin],\
{
"_distance": (0.0 if obj.data.cxr_data.realtime else -1.0),
- "_light": [int(pow(obj.data.color[i],1.0/2.2)*255.0) for i in range(3)] + \
- [int(obj.data.energy * bpy.context.scene.cxr_data.light_scale) ],
+ "_light": [int(pow(obj.data.color[i],1.0/2.2)*255.0) for i in range(3)] +\
+ [int(obj.data.energy * bpy.context.scene.cxr_data.light_scale)],
"_lightHDR": '-1 -1 -1 1',
"_lightscaleHDR": 1
})
kvs['pitch'] = math.asin(fwd[2]) * 57.295779513
kvs['angles'] = [ 0.0, math.atan2(fwd[1],fwd[0]) * 57.295779513, 0.0 ]
- kvs['_quadratic_attn'] = 0.0 # Source spotlights + quadratic falloff look awful.
- # Blender's default has a much more 'accurate' look
- # They appear correct when using linear scale.
+ kvs['_quadratic_attn'] = 0.0 # Source spotlights + quadratic falloff look
+ # Really bad...
+ #
+ # Blender's default has a much more 'nice'
+ # look.
kvs['_linear_attn'] = 1.0
elif obj.data.type == 'POINT':
_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, \
- context.scene.cxr_data.skybox_offset )
+ 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, \
+ context.scene.cxr_data.skybox_offset )
if 'main' in bpy.data.collections:
_collect( bpy.data.collections['main'], transform_main )
return {'FINISHED'}
-class CXR_DECOMPOSE_SOLID(bpy.types.Operator):
- bl_idname="convexer.decompose_solid"
- bl_label="Decompose Solid"
+class CXR_DEV_OPERATOR(bpy.types.Operator):
+ bl_idname="convexer.dev_test"
+ bl_label="Export development data"
def execute(_,context):
libcxr_use()
mesh_src = mesh_cxr_format(context.active_object)
libcxr_reset_debug_lines()
- libcxr_decompose( pointer(mesh_src) )
+ libcxr_write_test_data( pointer(mesh_src) )
libcxr_batch_debug_lines()
scene_redraw()
def draw(_,context):
_.layout.operator("convexer.reload")
- _.layout.operator("convexer.decompose_solid")
+ _.layout.operator("convexer.dev_test")
_.layout.operator("convexer.write_vmf")
settings = context.scene.cxr_data
expandview = True
drawthis = True
- if 'shaders' in pdef and properties.shader not in pdef['shaders']:
+ if ('shaders' in pdef) and \
+ (properties.shader not in pdef['shaders']):
continue
if ptype == 'intrinsic':
else:
# hidden intrinsic value.
# Means its a float array or something not an image
- thisnode.label( text=F"-- hidden intrinsic '{decl}' --" )
+ thisnode.label(text=F"-- hidden intrinsic '{decl}' --")
else:
thisnode.prop(properties,decl)
if expandview: _mview(pdef,thisnode)
if active_object == None: return
- default_context = cxr_object_context( bpy.context.scene.cxr_data.scale_factor, 0.0 )
+ default_context = cxr_object_context( \
+ bpy.context.scene.cxr_data.scale_factor, 0.0 )
+
ecn = cxr_intrinsic_classname( active_object )
classname = cxr_custom_class( active_object )
if ecn == None:
- if active_object.type == 'MESH': _.layout.prop( active_object.cxr_data, 'brushclass' )
+ if active_object.type == 'MESH':
+ _.layout.prop( active_object.cxr_data, 'brushclass' )
else: _.layout.prop( active_object.cxr_data, 'classname' )
if classname == 'NONE':
opt_vrad: bpy.props.StringProperty( name="args" )
debug: bpy.props.BoolProperty(name="Debug",default=False)
- scale_factor: bpy.props.FloatProperty(name="VMF Scale factor",default=32.0,min=1.0)
- skybox_scale_factor: bpy.props.FloatProperty(name="Sky Scale factor",default=1.0,min=0.01)
+ scale_factor: bpy.props.FloatProperty( name="VMF Scale factor", \
+ default=32.0,min=1.0)
+ skybox_scale_factor: bpy.props.FloatProperty( name="Sky Scale factor", \
+ default=1.0,min=0.01)
+
skybox_offset: bpy.props.FloatProperty(name="Sky offset",default=-4096.0)
light_scale: bpy.props.FloatProperty(name="Light Scale",default=1.0/5.0)
- displacement_cardinal: bpy.props.BoolProperty(name="Cardinal displacements",default=True)
- include_names: bpy.props.BoolProperty(name="Append original file names",default=True)
- lightmap_scale: bpy.props.IntProperty(name="Global Lightmap Scale",default=12)
+ include_names: bpy.props.BoolProperty(name="Append original file names",\
+ default=True)
+ lightmap_scale: bpy.props.IntProperty(name="Global Lightmap Scale",\
+ default=12)
class CXR_DETECT_COMPILERS(bpy.types.Operator):
bl_idname="convexer.detect_compilers"
return {'FINISHED'}
-classes = [ CXR_RELOAD, CXR_DECOMPOSE_SOLID, CXR_INTERFACE, \
+classes = [ CXR_RELOAD, CXR_DEV_OPERATOR, CXR_INTERFACE, \
CXR_WRITE_VMF, CXR_MATERIAL_PANEL, CXR_IMAGE_SETTINGS,\
CXR_MODEL_SETTINGS, CXR_ENTITY_SETTINGS, CXR_CUBEMAP_SETTINGS,\
CXR_LIGHT_SETTINGS, CXR_SCENE_SETTINGS, CXR_DETECT_COMPILERS,\
'') for _ in cxr_shaders],\
default = next(iter(cxr_shaders)))
- annotations_dict["asset_id"] = bpy.props.IntProperty(name="intl_assetid",default=0)
+ annotations_dict["asset_id"] = bpy.props.IntProperty(name="intl_assetid",\
+ default=0)
_dvmt_propogate( cxr_shader_params )
vmt_param_dynamic_class = type(