+#}
+
+class CV_BONE_SETTINGS(bpy.types.PropertyGroup):
+#{
+ collider: bpy.props.EnumProperty(
+ name="Collider Type",
+ items = [
+ ('collider_none', "collider_none", "", 0),
+ ('collider_box', "collider_box", "", 1),
+ ('collider_capsule', "collider_capsule", "", 2),
+ ])
+
+ v0: bpy.props.FloatVectorProperty(name="v0",size=3)
+ v1: bpy.props.FloatVectorProperty(name="v1",size=3)
+
+ con0: bpy.props.BoolProperty(name="Constriant 0",default=False)
+ mins: bpy.props.FloatVectorProperty(name="mins",size=3)
+ maxs: bpy.props.FloatVectorProperty(name="maxs",size=3)
+
+ conevx: bpy.props.FloatVectorProperty(name="conevx",size=3)
+ conevy: bpy.props.FloatVectorProperty(name="conevy",size=3)
+ coneva: bpy.props.FloatVectorProperty(name="coneva",size=3)
+ conet: bpy.props.FloatProperty(name="conet")
+#}
+
+class CV_BONE_PANEL(bpy.types.Panel):
+#{
+ bl_label="Bone Config"
+ bl_idname="SCENE_PT_cv_bone"
+ bl_space_type='PROPERTIES'
+ bl_region_type='WINDOW'
+ bl_context='bone'
+
+ def draw(_,context):
+ #{
+ active_object = context.active_object
+ if active_object == None: return
+
+ bone = active_object.data.bones.active
+ if bone == None: return
+
+ _.layout.prop( bone.cv_data, "collider" )
+ _.layout.prop( bone.cv_data, "v0" )
+ _.layout.prop( bone.cv_data, "v1" )
+
+ _.layout.label( text="Angle Limits" )
+ _.layout.prop( bone.cv_data, "con0" )
+
+ _.layout.prop( bone.cv_data, "conevx" )
+ _.layout.prop( bone.cv_data, "conevy" )
+ _.layout.prop( bone.cv_data, "coneva" )
+ _.layout.prop( bone.cv_data, "conet" )
+ #}
+#}
+
+class CV_SCENE_SETTINGS(bpy.types.PropertyGroup):
+#{
+ use_hidden: bpy.props.BoolProperty( name="use hidden", default=False )
+ export_dir: bpy.props.StringProperty( name="Export Dir", subtype='DIR_PATH' )
+#}
+
+class CV_COLLECTION_SETTINGS(bpy.types.PropertyGroup):
+#{
+ pack_textures: bpy.props.BoolProperty( name="Pack Textures", default=False )
+#}
+
+class CV_MATERIAL_SETTINGS(bpy.types.PropertyGroup):
+#{
+ shader: bpy.props.EnumProperty(
+ name="Format",
+ items = [
+ ('standard',"standard","",0),
+ ('standard_cutout', "standard_cutout", "", 1),
+ ('terrain_blend', "terrain_blend", "", 2),
+ ('vertex_blend', "vertex_blend", "", 3),
+ ('water',"water","",4),
+ ])
+
+ surface_prop: bpy.props.EnumProperty(
+ name="Surface Property",
+ items = [
+ ('concrete','concrete','',0),
+ ('wood','wood','',1),
+ ('grass','grass','',2)
+ ])
+
+ collision: bpy.props.BoolProperty( \
+ name="Collisions Enabled",\
+ default=True,\
+ description = "Can the player collide with this material"\
+ )
+ skate_surface: bpy.props.BoolProperty( \
+ name="Skate Surface", \
+ default=True,\
+ description = "Should the game try to target this surface?" \
+ )
+ grind_surface: bpy.props.BoolProperty( \
+ name="Grind Surface", \
+ default=False,\
+ description = "Grind face?" \
+ )
+ grow_grass: bpy.props.BoolProperty( \
+ name="Grow Grass", \
+ default=False,\
+ description = "Spawn grass sprites on this surface?" \
+ )
+ blend_offset: bpy.props.FloatVectorProperty( \
+ name="Blend Offset", \
+ size=2, \
+ default=Vector((0.5,0.0)),\
+ description="When surface is more than 45 degrees, add this vector " +\
+ "to the UVs" \
+ )
+ sand_colour: bpy.props.FloatVectorProperty( \
+ name="Sand Colour",\
+ subtype='COLOR',\
+ min=0.0,max=1.0,\
+ default=Vector((0.79,0.63,0.48)),\
+ description="Blend to this colour near the 0 coordinate on UP axis"\
+ )
+ shore_colour: bpy.props.FloatVectorProperty( \
+ name="Shore Colour",\
+ subtype='COLOR',\
+ min=0.0,max=1.0,\
+ default=Vector((0.03,0.32,0.61)),\
+ description="Water colour at the shoreline"\
+ )
+ ocean_colour: bpy.props.FloatVectorProperty( \
+ name="Ocean Colour",\
+ subtype='COLOR',\
+ min=0.0,max=1.0,\
+ default=Vector((0.0,0.006,0.03)),\
+ description="Water colour in the deep bits"\
+ )
+#}
+
+class CV_MATERIAL_PANEL(bpy.types.Panel):
+#{
+ bl_label="Skate Rift material"
+ bl_idname="MATERIAL_PT_cv_material"
+ bl_space_type='PROPERTIES'
+ bl_region_type='WINDOW'
+ bl_context="material"
+
+ def draw(_,context):
+ #{
+ active_object = bpy.context.active_object
+ if active_object == None: return
+ active_mat = active_object.active_material
+ if active_mat == None: return
+
+ info = material_info( active_mat )
+
+ if 'tex_diffuse' in info:
+ #{
+ _.layout.label( icon='INFO', \
+ text=F"{info['tex_diffuse'].name} will be compiled" )
+ #}
+
+ _.layout.prop( active_mat.cv_data, "shader" )
+ _.layout.prop( active_mat.cv_data, "surface_prop" )
+ _.layout.prop( active_mat.cv_data, "collision" )
+
+ if active_mat.cv_data.collision:
+ _.layout.prop( active_mat.cv_data, "skate_surface" )
+ _.layout.prop( active_mat.cv_data, "grind_surface" )
+ _.layout.prop( active_mat.cv_data, "grow_grass" )
+
+ if active_mat.cv_data.shader == "terrain_blend":
+ #{
+ box = _.layout.box()
+ box.prop( active_mat.cv_data, "blend_offset" )
+ box.prop( active_mat.cv_data, "sand_colour" )
+ #}
+ elif active_mat.cv_data.shader == "vertex_blend":
+ #{
+ box = _.layout.box()
+ box.label( icon='INFO', text="Uses vertex colours, the R channel" )
+ box.prop( active_mat.cv_data, "blend_offset" )
+ #}
+ elif active_mat.cv_data.shader == "water":
+ #{
+ box = _.layout.box()
+ box.label( icon='INFO', text="Depth scale of 16 meters" )
+ box.prop( active_mat.cv_data, "shore_colour" )
+ box.prop( active_mat.cv_data, "ocean_colour" )
+ #}
+ #}
+#}