+ 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" )
+ #}
+ #}
+#}