From: <ben...@us...> - 2016-12-04 06:45:42
|
Revision: 16799 http://sourceforge.net/p/supertuxkart/code/16799 Author: benaustk Date: 2016-12-04 06:45:40 +0000 (Sun, 04 Dec 2016) Log Message: ----------- Allow grass and alpha test shader to be configurable for colorization Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stkdata/stk_material_parameters.xml Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2016-12-04 04:50:38 UTC (rev 16798) +++ media/trunk/blender_25/stk_material_export.py 2016-12-04 06:45:40 UTC (rev 16799) @@ -116,7 +116,7 @@ #'water_shader_speed_1' : {'default': 6.6667, 'parent': ('graphical_effect','water_shader'), 'type': 'number'}, #'water_shader_speed_2' : {'default': 4.0, 'parent': ('graphical_effect','water_shader'), 'type': 'number'}, 'water_splash' : {'default': "N", 'parent': None, 'type': 'bool'}, - 'colorizable' : {'default': "N", 'parent': ('shader','solid'), 'type': 'bool'}, + 'colorizable' : {'default': "N", 'parent': None, 'type': 'bool'}, 'colorization_factor' : {'default': "", 'parent': 'colorizable', 'type': 'number'}, 'colorization_mask' : {'default': "", 'parent': 'colorizable', 'type': 'string'}, 'hue_settings' : {'default': "", 'parent': 'colorizable', 'type': 'string'} Modified: media/trunk/blender_25/stkdata/stk_material_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_material_parameters.xml 2016-12-04 04:50:38 UTC (rev 16798) +++ media/trunk/blender_25/stkdata/stk_material_parameters.xml 2016-12-04 06:45:40 UTC (rev 16799) @@ -19,7 +19,7 @@ doc="Set the minimun resulting saturation of the new color, 0 means using the original saturation from texture"/> <StringProp id="colorization_mask" name="Colorization mask" default="" doc="Determine which part of texture to be affected by colorization"/> <StringProp id="hue_settings" name="Hue settings for colorization" default="" - doc="Define list of hue for colorization, from > 0.0 to (or equal) 1, separated by spaces, STK will randomly pick one hue for colorization"/> + doc="Define list of hue for colorization, from 0.0 to (or equal) 1 (0.0 means original color), separated by spaces, STK will randomly pick one hue for colorization"/> </BoolProp> </EnumChoice> @@ -31,6 +31,14 @@ <StringProp id="gloss_map" name="Gloss map" default=""/> <StringProp id="normal_map" name="Normal map" default="" doc="Use normal maps for this material (the model must be exported as tangent for this to work)"/> --> + <BoolProp id="colorizable" name="Colorizable (for library objects)" default="false" + doc="Used to determine whether this texture can be colorized by STK (for library objects)"> + <FloatProp id="colorization_factor" name="Colorization factor" default="0.0" min="0.0" max="1.0" + doc="Set the minimun resulting saturation of the new color, 0 means using the original saturation from texture"/> + <StringProp id="colorization_mask" name="Colorization mask" default="" doc="Determine which part of texture to be affected by colorization"/> + <StringProp id="hue_settings" name="Hue settings for colorization" default="" + doc="Define list of hue for colorization, from 0.0 to (or equal) 1 (0.0 means original color), separated by spaces, STK will randomly pick one hue for colorization"/> + </BoolProp> </EnumChoice> <!-- Alpha blending --> @@ -64,6 +72,14 @@ <LabelProp id="grass_help3" name="Use tones of grey to make vertices move more softly."/> <FloatProp id="grass_speed" name="Waving speed" default="1.5" min="0.0" max="5.0" doc="Speed modifier for grass"/> <FloatProp id="grass_amplitude" name="Waving amplitude" default="0.25" min="0.0" max="1.0" doc="Amplitude for grass movement"/> + <BoolProp id="colorizable" name="Colorizable (for library objects)" default="false" + doc="Used to determine whether this texture can be colorized by STK (for library objects)"> + <FloatProp id="colorization_factor" name="Colorization factor" default="0.0" min="0.0" max="1.0" + doc="Set the minimun resulting saturation of the new color, 0 means using the original saturation from texture"/> + <StringProp id="colorization_mask" name="Colorization mask" default="" doc="Determine which part of texture to be affected by colorization"/> + <StringProp id="hue_settings" name="Hue settings for colorization" default="" + doc="Define list of hue for colorization, from 0.0 to (or equal) 1 (0.0 means original color), separated by spaces, STK will randomly pick one hue for colorization"/> + </BoolProp> </EnumChoice> <!-- Water --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sam...@us...> - 2016-12-24 21:45:28
|
Revision: 16846 http://sourceforge.net/p/supertuxkart/code/16846 Author: samuncle Date: 2016-12-24 21:45:26 +0000 (Sat, 24 Dec 2016) Log Message: ----------- Add support to geometry detail check issue #2046 for more information Modified Paths: -------------- media/trunk/blender_25/stk_track.py media/trunk/blender_25/stkdata/stk_object_parameters.xml Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2016-12-24 02:18:48 UTC (rev 16845) +++ media/trunk/blender_25/stk_track.py 2016-12-24 21:45:26 UTC (rev 16846) @@ -221,7 +221,26 @@ lAnimTextures.append( (anim_texture, dx, dy, dt, use_anim_texture_by_step) ) return lAnimTextures + # ------------------------------------------------------------------------------ +# Checks if there are any animated textures in any of the objects in the +# list l. +def checkForGeometryDetail(lObjects): + lGeometryDetail = [] + for obj in lObjects: + use_geometry_detail = getObjectProperty(obj, "enable_geo_detail", "false") + if use_geometry_detail != 'true': continue + + geometry_detail_level = getObjectProperty(obj, "geo_detail_level", 0) + + if int(geometry_detail_level) < 0 or int(geometry_detail_level) > 2: + log_warning("object %s has an invalid geometry level configuration" % obj.name) + continue + + lGeometryDetail.append( geometry_detail_level ) + return lGeometryDetail + +# ------------------------------------------------------------------------------ def writeAnimatedTextures(f, lAnimTextures): for (name, dx, dy, dt, use_anime_texture_by_step) in lAnimTextures: @@ -238,7 +257,12 @@ if name is None or len(name) == 0: continue f.write(" <animated-texture name=\"%s\"%s%s%s/>\n"%(name, sdx, sdy, sdt) ) - + +def writeGeometryDetail(f, lGeometryDetail): + for level in lGeometryDetail: + f.write(" <geometry-detail level=\"%s\"/>\n"%(level) ) + + # ------------------------------------------------------------------------------ def Round(f): r = round(f,6) # precision set to 10e-06 @@ -365,6 +389,7 @@ speed = getObjectProperty(obj, "speed", None ) length = getObjectProperty(obj, "length", None ) lAnim = checkForAnimatedTextures([obj]) + lGeometryDetail = checkForGeometryDetail([obj]) b3d_name = self.m_parent_track_exporter.exportLocalB3D(obj, self.m_export_path, name, True) s = " <water model=\"%s\" %s" % (b3d_name, getXYZHPRString(obj)) if height: s = "%s height=\"%.2f\""%(s, float(height)) @@ -2271,6 +2296,7 @@ flags.append("if=\"%s\""%if_condition) lAnim = checkForAnimatedTextures([obj]) + lGeometryDetail = checkForGeometryDetail([obj]) if parent and parent.type=="ARMATURE": f.write(" <object id=\"%s\" type=\"%s\" %s %s>\n"% (obj.name, objectType, getXYZHPRString(parent), ' '.join(flags))) @@ -2280,6 +2306,9 @@ if lAnim: writeAnimatedTextures(f, lAnim) + if lGeometryDetail: + writeGeometryDetail(f, lGeometryDetail) + writeIPO(f, ipo) f.write(" </object>\n") @@ -2337,6 +2366,7 @@ # are cached so it can be avoided to export two or more identical # objects. lAnim = checkForAnimatedTextures([obj]) + lGeometryDetail = checkForGeometryDetail([obj]) name = getObjectProperty(obj, "name", obj.name) if len(name) == 0: name = obj.name @@ -2380,9 +2410,14 @@ f.write(" <static-object %s>\n" % ' '.join(attributes)) writeAnimatedTextures(f, lAnim) f.write(" </static-object>\n") + if lGeometryDetail: + f.write(" <static-object %s>\n" % ' '.join(attributes)) + writeGeometryDetail(f, lGeometryDetail) + f.write(" </static-object>\n") else: f.write(" <static-object %s/>\n" % ' '.join(attributes)) writeAnimatedTextures(f, lAnimTextures) + writeGeometryDetail(f, lGeometryDetail) # -------------------------------------------------------------------------- # Get LOD string for a given object (returns an empty string if object is not LOD) @@ -2673,6 +2708,7 @@ lOtherObjects.append(obj) lAnimTextures = checkForAnimatedTextures(lTrack) + lGeometryDetail = checkForGeometryDetail(lTrack) if len(lLODModels.keys()) > 0: f.write(' <lod>\n') Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2016-12-24 02:18:48 UTC (rev 16845) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2016-12-24 21:45:26 UTC (rev 16846) @@ -9,11 +9,22 @@ <FloatProp id="anim_dt" name="time between two frames" default="1.0" min="0.0" max="10.0"/> </BoolProp> </BoolProp> + + + <BoolProp id="enable_geo_detail" name="Enable geometry visibility details" default="false" doc="Allows the engine to know if an object can be hidden for performances reason"> + <EnumProp id="geo_detail_level" name="Visibility" default="0" doc="By default all objects are displayed. You can specify the level at witch the object will be visible"> + <EnumChoice id="0" label="Always visible" /> + <EnumChoice id="1" label="Visible when Medium quality or above" /> + <EnumChoice id="2" label="Visible when High quality" /> + </EnumProp> + </BoolProp> <!-- ********************************************************************* --> <!-- ************************** STK Object Type ************************** --> <!-- ********************************************************************* --> <EnumProp id="type" name="Type" default="none" doc="SuperTuxKart Object Type"> + + <!-- ************* OBJECTS AND LOD ************* --> <EnumChoice id="__category__objects" label="Objects and LOD"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sam...@us...> - 2017-01-23 01:22:25
|
Revision: 16943 http://sourceforge.net/p/supertuxkart/code/16943 Author: samuncle Date: 2017-01-23 01:22:22 +0000 (Mon, 23 Jan 2017) Log Message: ----------- Add support to day/night notion to trigger some effects Modified Paths: -------------- media/trunk/blender_25/stk_track.py media/trunk/blender_25/stkdata/stk_panel_parameters.xml Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2017-01-21 16:13:45 UTC (rev 16942) +++ media/trunk/blender_25/stk_track.py 2017-01-23 01:22:22 UTC (rev 16943) @@ -2047,6 +2047,8 @@ has_cloud_shadows = (getSceneProperty(scene, "clouds", "false") == "true") #has_lens_flare = (getSceneProperty(scene, "sunlensflare", "false") == "true") has_shadows = (getSceneProperty(scene, "shadows", "false") == "true") + + day_time = getSceneProperty(scene, "duringday", "") #has_colorlevel = (getSceneProperty(scene, "colorlevel", "false") == "true") #colorlevel_inblack = getSceneProperty(scene, "colorlevel_inblack", "0.0") @@ -2143,6 +2145,11 @@ #else: # f.write(" lens-flare = \"N\"\n") + if day_time == "day": + f.write(" is-during-day = \"Y\"\n") + else: + f.write(" is-during-day = \"N\"\n") + if has_shadows: f.write(" shadows = \"Y\"\n") else: Modified: media/trunk/blender_25/stkdata/stk_panel_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_panel_parameters.xml 2017-01-21 16:13:45 UTC (rev 16942) +++ media/trunk/blender_25/stkdata/stk_panel_parameters.xml 2017-01-23 01:22:22 UTC (rev 16943) @@ -105,7 +105,12 @@ <FloatProp id="colorlevel_outwhite" name="Output white" doc="The white output level" default="255.0" min="0.0" max="255.0"/> </BoolProp> --> - <BoolProp id="shadows" name="Dynamic shadows (STK 0.8.2)" default="true" doc="Whether to enable dynamic shadows"/> + <BoolProp id="shadows" name="Dynamic shadows" default="true" doc="Whether to enable dynamic shadows"/> + <EnumProp id="duringday" name="Track time" default="day" doc="Useful to turn on/off some lighting effect"> + <EnumChoice id="day" label="Day" /> + <EnumChoice id="night" label="Night" /> + </EnumProp> + <BoolProp id="fog" name="Fog" default="false" doc="Whether to enable fog in the track"> <ColorProp id="fog_color" name="Fog Color" default="0 0 0" doc="Click here to pick the color of the fog"/> <FloatProp id="fog_start" name="Fog Start" default="50.0" min="0.0" max="1000.0" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2017-01-24 01:12:37
|
Revision: 16945 http://sourceforge.net/p/supertuxkart/code/16945 Author: auria Date: 2017-01-24 01:12:34 +0000 (Tue, 24 Jan 2017) Log Message: ----------- Add support of headlight models to karts Modified Paths: -------------- media/trunk/blender_25/stk_kart.py media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml Modified: media/trunk/blender_25/stk_kart.py =================================================================== --- media/trunk/blender_25/stk_kart.py 2017-01-23 02:07:55 UTC (rev 16944) +++ media/trunk/blender_25/stk_kart.py 2017-01-24 01:12:34 UTC (rev 16945) @@ -90,7 +90,36 @@ f.write(' <nitro-emitter-b position = "%f %f %f" />\n' \ % (lNitroEmitter[1].location.x, lNitroEmitter[1].location.z, lNitroEmitter[1].location.y)) f.write(' </nitro-emitter>\n') + +# ------------------------------------------------------------------------------ +def saveHeadlights(f, lHeadlights, path): + if len(lHeadlights) == 0: + return + if 'b3d_export' not in dir(bpy.ops.screen): + log_error("Cannot find the B3D exporter, make sure you installed it properly") + return + + f.write(' <headlights>\n') + for obj in lHeadlights: + f.write(' <object position="%f %f %f" model="%s.b3d"/>\n' \ + % (obj.location.x, obj.location.z, obj.location.y, obj.name)) + + lOldPos = Vector([obj.location.x, obj.location.y, obj.location.z]) + obj.location = Vector([0, 0, 0]) + + global the_scene + the_scene.obj_list = [obj] + + bpy.ops.screen.b3d_export(localsp=False, mipmap=True, lights=False, vcolors=True, + vnormals=True, cameras=False, filepath=path + "/" + obj.name, + overwrite_without_asking=True) + the_scene.obj_list = [] + + obj.location = lOldPos + + f.write(' </headlights>\n') + # ------------------------------------------------------------------------------ # Save speed weighted def saveSpeedWeighted(f, lSpeedWeighted, path): @@ -301,6 +330,7 @@ lKart = [] lNitroEmitter = [] lSpeedWeighted = [] + lHeadlights = [] for obj in lObj: stktype = getProperty(obj, "type", "").strip().upper() name = obj.name.upper() @@ -312,6 +342,8 @@ lSpeedWeighted.append(obj) elif stktype=="IGNORE": pass + elif stktype=="HEADLIGHT": + lHeadlights.append(obj) # For backward compatibility #elif name in ["WHEELFRONT.R","WHEELFRONT.L", \ # "WHEELREAR.R", "WHEELREAR.L" ]: @@ -376,6 +408,7 @@ saveWheels(f, lWheels, path) saveNitroEmitter(f, lNitroEmitter, path) saveSpeedWeighted(f, lSpeedWeighted, path) + saveHeadlights(f, lHeadlights, path) hat_offset = "0.0 1.0 0.0" if 'hat_offset' in the_scene and len(the_scene['hat_offset']) > 0: Modified: media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml 2017-01-23 02:07:55 UTC (rev 16944) +++ media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml 2017-01-24 01:12:34 UTC (rev 16945) @@ -17,5 +17,6 @@ <FloatProp id="speed-weighted-texture-speed-x" name="Texture speed X" default="0.0" doc="Texture speed X direction (0.0 for no animation on the X axis)" min="-1000.0" max="1000.0"/> <FloatProp id="speed-weighted-texture-speed-y" name="Texture speed Y" default="0.0" doc="Texture speed Y direction (0.0 for no animation on the Y axis)" min="-1000.0" max="1000.0"/> </EnumChoice> + <EnumChoice id="headlight" label="Headlight" doc="Headlights (visible only during day)" /> </EnumProp> </Properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <ben...@us...> - 2017-08-09 04:20:45
|
Revision: 17083 http://sourceforge.net/p/supertuxkart/code/17083 Author: benaustk Date: 2017-08-09 04:20:42 +0000 (Wed, 09 Aug 2017) Log Message: ----------- Add missing export for scripting Modified Paths: -------------- media/trunk/blender_25/stk_track.py media/trunk/blender_25/stkdata/stk_material_parameters.xml Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2017-08-09 01:54:00 UTC (rev 17082) +++ media/trunk/blender_25/stk_track.py 2017-08-09 04:20:42 UTC (rev 17083) @@ -624,10 +624,12 @@ # f.write(" <check-sphere xyz=\"%.2f %.2f %.2f\" radius=\"%.2f\"/>\n" % \ # (obj.location[0], obj.location[2], obj.location[1], radius) ) if trigger_type == "point": - f.write(' <object type="action-trigger" trigger-type="point" id=\"%s\" action="%s" distance="%s" %s/>\n' %\ + f.write(' <object type="action-trigger" trigger-type="point" id=\"%s\" action="%s" distance="%s" reenable-timeout="%s" triggered-object="%s" %s/>\n' %\ (obj.name, getObjectProperty(obj, "action", ""), getObjectProperty(obj, "trigger_distance", 5.0), + getObjectProperty(obj, "reenable_timeout", 999999.9), + getObjectProperty(obj, "triggered_object", ""), originXYZ)) elif trigger_type == "cylinder": radius = (obj.dimensions.x + obj.dimensions.y)/4 # divide by 2 to get average size, divide by 2 to get radius from diameter Modified: media/trunk/blender_25/stkdata/stk_material_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_material_parameters.xml 2017-08-09 01:54:00 UTC (rev 17082) +++ media/trunk/blender_25/stkdata/stk_material_parameters.xml 2017-08-09 04:20:42 UTC (rev 17083) @@ -82,10 +82,6 @@ </BoolProp> </EnumChoice> - <EnumChoice id="displace" label="Displace Shader" - doc="A shader to simulate light reflexions and moving waves on this surface"> - </EnumChoice> - <!-- Sphere map --> <EnumChoice id="spheremap" label="Reflection (Sphere mapping)"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <sam...@us...> - 2017-08-11 16:47:04
|
Revision: 17088 http://sourceforge.net/p/supertuxkart/code/17088 Author: samuncle Date: 2017-08-11 16:47:02 +0000 (Fri, 11 Aug 2017) Log Message: ----------- Add basic support of PBR to the exporter be able to test in game Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stkdata/stk_material_parameters.xml Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2017-08-11 03:38:48 UTC (rev 17087) +++ media/trunk/blender_25/stk_material_export.py 2017-08-11 16:47:02 UTC (rev 17088) @@ -95,6 +95,7 @@ 'disable_z_write' : {'default': "N", 'parent': None, 'type': 'bool'}, 'falling_effect' : {'default': "N", 'parent': None, 'type': 'bool'}, 'gloss_map' : {'default': "", 'parent': None, 'type': 'string'}, + 'combined_map' : {'default': "", 'parent': None, 'type': 'string'}, 'grass_speed' : {'default': 0.4, 'parent': ('shader','grass'), 'type': 'number'}, 'grass_amplitude' : {'default': 0.25, 'parent': ('shader','grass'), 'type': 'number'}, 'ignore' : {'default': "N", 'parent': None, 'type': 'bool'}, Modified: media/trunk/blender_25/stkdata/stk_material_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_material_parameters.xml 2017-08-11 03:38:48 UTC (rev 17087) +++ media/trunk/blender_25/stkdata/stk_material_parameters.xml 2017-08-11 16:47:02 UTC (rev 17088) @@ -22,6 +22,14 @@ doc="Define list of hue for colorization, from 0.0 to (or equal) 1 (0.0 means original color), separated by spaces, STK will randomly pick one hue for colorization, no need to define for karts."/> </BoolProp> </EnumChoice> + + <!-- Generic PBR solid --> + <EnumChoice id="solid_pbr" label="Generic PBR (solid)"> + <LabelProp id="solid_pbr_help" name="Experimental feature (use with caution)"/> + <StringProp id="combined_map" name="Metal/Rough/Emit map" default=""/> + <StringProp id="normal_map" name="Normal map" default="" doc="Use normal maps for this material"/> + </EnumChoice> + <!-- Alpha testing --> <EnumChoice id="alphatest" label="Cutout transparency (alpha test)"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |