From: <au...@us...> - 2011-09-05 00:00:03
|
Revision: 9747 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9747&view=rev Author: auria Date: 2011-09-04 23:59:56 +0000 (Sun, 04 Sep 2011) Log Message: ----------- Improve exporters a bit, show nicer icons in log and warn if an arena doesn't have at least 4 start positions Modified Paths: -------------- media/trunk/blender_25/stk_kart.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_kart.py =================================================================== --- media/trunk/blender_25/stk_kart.py 2011-09-04 23:44:27 UTC (rev 9746) +++ media/trunk/blender_25/stk_kart.py 2011-09-04 23:59:56 UTC (rev 9747) @@ -450,10 +450,10 @@ row.label(msg, icon='INFO') elif type == 'WARNING': row = box.row() - row.label("WARNING: " + msg, icon='GREASEPENCIL') + row.label("WARNING: " + msg, icon='ERROR') elif type == 'ERROR': row = box.row() - row.label("ERROR: " + msg, icon='ERROR') + row.label("ERROR: " + msg, icon='CANCEL') row = box.row() row.operator("screen.stk_kart_clean_log", text="Clear Log", icon='X') Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-09-04 23:44:27 UTC (rev 9746) +++ media/trunk/blender_25/stk_track.py 2011-09-04 23:59:56 UTC (rev 9747) @@ -1515,6 +1515,10 @@ dId2Obj[id] = obj l = dId2Obj.keys() + + if len(l) < 4 and getIdProperty(scene, "arena", "false") == "true": + log_warning("You should define at least 4 start positions") + #l.sort() # sorting not needed AFAICT, the dictionary keeps the keys sorted for i in l: f.write(" <start %s/>\n"%getXYZHString(dId2Obj[i])) @@ -1812,7 +1816,6 @@ lItems.append(obj) continue elif stktype[:5]=="START": - # Start empties are called start1, start2, ... lStart.append(obj) continue elif stktype=="PARTICLE_EMITTER": @@ -2052,10 +2055,10 @@ row.label(msg, icon='INFO') elif type == 'WARNING': row = box.row() - row.label("WARNING: " + msg, icon='GREASEPENCIL') + row.label("WARNING: " + msg, icon='ERROR') elif type == 'ERROR': row = box.row() - row.label("ERROR: " + msg, icon='ERROR') + row.label("ERROR: " + msg, icon='CANCEL') row = box.row() row.operator("screen.stk_track_clean_log", text="Clear Log", icon='X') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-09-05 20:24:21
|
Revision: 9759 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9759&view=rev Author: auria Date: 2011-09-05 20:24:15 +0000 (Mon, 05 Sep 2011) Log Message: ----------- Add fog control to panel and exporter Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2011-09-05 20:17:03 UTC (rev 9758) +++ media/trunk/blender_25/stk_material_export.py 2011-09-05 20:24:15 UTC (rev 9759) @@ -81,6 +81,7 @@ lTextureDefaults = { 'light' : ("Y", None), + 'fog' : ("Y", None), 'backface_culling' : ("Y", None), 'below_surface' : ("N", None), 'compositing' : ('none', None), @@ -102,7 +103,7 @@ } lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", - "falling_effect", "crash_reset", + "falling_effect", "crash_reset", "fog", "anisotropic","backface_culling","ignore","disable_z_write","reset", "sfx_positional"] Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-09-05 20:17:03 UTC (rev 9758) +++ media/trunk/blender_25/stk_panel.py 2011-09-05 20:24:15 UTC (rev 9759) @@ -818,8 +818,10 @@ CRASH_RESET_PROPERTIES = [StkProperty( id='crash_reset_particles', name="Particles on hit", default="")] STK_MATERIAL_PROPERTIES = [ + StkBoolProperty( id='fog', name="Affected by fog (if any)", default="true", contextLevel=CONTEXT_MATERIAL, + doc="Whether this material is affected by fog (if there is fog in this track)"), StkBoolProperty( id='light', name="Affected by lights", default="true", contextLevel=CONTEXT_MATERIAL, - doc="Whether this material is affected by lgihts and shadows"), + doc="Whether this material is affected by lights and shadows"), StkBoolProperty( id='backface_culling', name="Backface Culling", default="true", contextLevel=CONTEXT_MATERIAL, doc="If checked, this material will only be visible on the side of the normal"), StkBoolProperty( id='below_surface', name="Below Surface", default="false", contextLevel=CONTEXT_MATERIAL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-09-12 23:54:30
|
Revision: 9814 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9814&view=rev Author: auria Date: 2011-09-12 23:54:23 +0000 (Mon, 12 Sep 2011) Log Message: ----------- Require blender 2.59 for scripts Modified Paths: -------------- media/trunk/blender_25/B3DExport.py media/trunk/blender_25/stk_kart.py media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/B3DExport.py =================================================================== --- media/trunk/blender_25/B3DExport.py 2011-09-12 23:39:59 UTC (rev 9813) +++ media/trunk/blender_25/B3DExport.py 2011-09-12 23:54:23 UTC (rev 9814) @@ -2,7 +2,7 @@ """ Name: 'B3D Exporter (.b3d)...' -Blender: 258 +Blender: 259 Group: 'Export' Tooltip: 'Export to Blitz3D file format (.b3d)' """ @@ -39,7 +39,7 @@ "description": "Exports a blender scene or object to the B3D (BLITZ3D) format", "author": "Diego 'GaNDaLDF' Parisi, Joerg Henrichs, Marianne Gagnon", "version": (3,0), - "blender": (2, 5, 8), + "blender": (2, 5, 9), "api": 31236, "location": "File > Export", "warning": '', # used for warning icon and text in addons panel Modified: media/trunk/blender_25/stk_kart.py =================================================================== --- media/trunk/blender_25/stk_kart.py 2011-09-12 23:39:59 UTC (rev 9813) +++ media/trunk/blender_25/stk_kart.py 2011-09-12 23:54:23 UTC (rev 9814) @@ -5,7 +5,7 @@ """ Name: 'STK Kart Exporter (.irrkart)...' -Blender: 248a +Blender: 259 Group: 'Export' Tooltip: 'Export a SuperTuxKart kart' """ @@ -22,7 +22,7 @@ "description": "Exports a blender character/kart to SuperTuxKart", "author": "Joerg Henrichs, Marianne Gagnon, Xapantu", "version": (3,0), - "blender": (2, 5, 7), + "blender": (2, 5, 9), "api": 31236, "location": "File > Export", "warning": '', # used for warning icon and text in addons panel Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2011-09-12 23:39:59 UTC (rev 9813) +++ media/trunk/blender_25/stk_material_export.py 2011-09-12 23:54:23 UTC (rev 9814) @@ -1,6 +1,6 @@ """ Name: 'STK Material Exporter...' -Blender: 258 +Blender: 259 Group: 'Export' Tooltip: 'Export a SuperTuxKart track scene' """ @@ -15,7 +15,7 @@ "description": "Exports image properties to the SuperTuxKart track format", "author": "Joerg Henrichs, Marianne Gagnon", "version": (1,0), - "blender": (2, 5, 8), + "blender": (2, 5, 9), "api": 31236, "location": "File > Export", "warning": '', # used for warning icon and text in addons panel Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-09-12 23:39:59 UTC (rev 9813) +++ media/trunk/blender_25/stk_panel.py 2011-09-12 23:54:23 UTC (rev 9814) @@ -4,7 +4,7 @@ "description": "Allows editing object, scene and material properties for SuperTuxKart", "author": "Joerg Henrichs, Marianne Gagnon, Asciimonster", "version": (2,0), - "blender": (2, 5, 7), + "blender": (2, 5, 9), "api": 31236, "location": "Properties Panel", "warning": '', # used for warning icon and text in addons panel Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-09-12 23:39:59 UTC (rev 9813) +++ media/trunk/blender_25/stk_track.py 2011-09-12 23:54:23 UTC (rev 9814) @@ -2,7 +2,7 @@ """ Name: 'STK Track Exporter (.track)...' -Blender: 257RC1 +Blender: 259 Group: 'Export' Tooltip: 'Export a SuperTuxKart track scene' """ @@ -35,7 +35,7 @@ "description": "Exports a blender scene to the SuperTuxKart track format", "author": "Joerg Henrichs, Marianne Gagnon", "version": (1,0), - "blender": (2, 5, 7), + "blender": (2, 5, 9), "api": 31236, "location": "File > Export", "warning": '', # used for warning icon and text in addons panel This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-09-29 13:23:29
|
Revision: 9914 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9914&view=rev Author: auria Date: 2011-09-29 13:23:16 +0000 (Thu, 29 Sep 2011) Log Message: ----------- Add reset support to objects Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-09-29 05:52:56 UTC (rev 9913) +++ media/trunk/blender_25/stk_panel.py 2011-09-29 13:23:16 UTC (rev 9914) @@ -578,7 +578,9 @@ ], doc="The player will be able to move this object around by pushing it") }, contextLevel=CONTEXT_OBJECT, default='static', - doc="How this object should interact with other objects in the physics engine") + doc="How this object should interact with other objects in the physics engine"), + StkBoolProperty(id='reset', name='Reset', default="false", contextLevel=CONTEXT_OBJECT, + subproperties=[], doc="Reset the kart if it touches this object") ] # The 'type' property Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-09-29 05:52:56 UTC (rev 9913) +++ media/trunk/blender_25/stk_track.py 2011-09-29 13:23:16 UTC (rev 9914) @@ -1090,6 +1090,12 @@ shape="shape=\"%s\""%shape if not ipo: ipo=[] + reset = getProperty(obj, "reset", "") + if reset and reset == 'true': + reset = " reset=\"y\"" + else: + reset = "" + lodstring = self.getLODString(obj) if type == "lod_instance": @@ -1098,11 +1104,11 @@ model_string = "model=\"%s\" " % name if parent and parent.type=="ARMATURE": - f.write(" <object type=\"animation\" %s%s %s%s%s>\n"% \ - (model_string, getXYZHPRString(parent), shape, looped, lodstring)) + f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ + (model_string, getXYZHPRString(parent), shape, looped, lodstring, reset)) else: - f.write(" <object type=\"animation\" %s%s %s%s%s>\n"% \ - (model_string, getXYZHPRString(obj), shape, looped, lodstring)) + f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ + (model_string, getXYZHPRString(obj), shape, looped, lodstring, reset)) self.writeIPO(f, ipo) f.write(" </object>\n") @@ -1480,6 +1486,12 @@ mass = getProperty(obj, "mass", 10) lodstring = self.getLODString(obj) + reset = getProperty(obj, "reset", "") + if reset and reset == 'true': + reset = " reset=\"y\"" + else: + reset = "" + type = getProperty(obj, "type", "?") if type == "lod_instance": @@ -1488,8 +1500,8 @@ model_string = "model=\"%s\" " % b3d_name f.write(" <object type=\"movable\" %s\n"%(getXYZHPRString(obj))) - f.write(" %sshape=\"%s\" mass=\"%s\"%s/>\n"\ - % (model_string, shape, mass, lodstring)) + f.write(" %sshape=\"%s\" mass=\"%s\"%s%s/>\n"\ + % (model_string, shape, mass, lodstring, reset)) # Now the object either has an IPO, or is a 'ghost' object. # Either can have an IPO. Even if the objects don't move This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-09-29 14:35:35
|
Revision: 9916 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=9916&view=rev Author: auria Date: 2011-09-29 14:35:29 +0000 (Thu, 29 Sep 2011) Log Message: ----------- Improve making reset objects in exporter/panel Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-09-29 14:15:30 UTC (rev 9915) +++ media/trunk/blender_25/stk_panel.py 2011-09-29 14:35:29 UTC (rev 9916) @@ -587,12 +587,23 @@ 'box' : StkEnumChoice("Box", []), 'sphere' : StkEnumChoice("Sphere", []) }, default='box', doc="Shape to use in the physics engine to represent this object") - ], doc="The player will be able to move this object around by pushing it") + ], doc="The player will be able to move this object around by pushing it"), + 'reset' : StkEnumChoice("Reset player", subproperties= + [StkEnumProperty(id='shape', name="Shape", contextLevel=CONTEXT_OBJECT, unique_prefix="itrc_reset", + values={'coneX' : StkEnumChoice("Cone (X)", []), + 'coneY' : StkEnumChoice("Cone (Y)", []), + 'coneZ' : StkEnumChoice("Cone (Z)", []), + 'cylinderX' : StkEnumChoice("Cylinder (X)", []), + 'cylinderY' : StkEnumChoice("Cylinder (Y)", []), + 'cylinderZ' : StkEnumChoice("Cylinder (Z)", []), + 'box' : StkEnumChoice("Box", []), + 'sphere' : StkEnumChoice("Sphere", []), + 'exact' : StkEnumChoice("Exact", []) + }, default='box', doc="Shape to use in the physics engine to represent this object") + ], doc="The player will be resetted when touching this object") }, contextLevel=CONTEXT_OBJECT, default='static', - doc="How this object should interact with other objects in the physics engine"), - StkBoolProperty(id='reset', name='Reset', default="false", contextLevel=CONTEXT_OBJECT, - subproperties=[], doc="Reset the kart if it touches this object") + doc="How this object should interact with other objects in the physics engine") ] # The 'type' property Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-09-29 14:15:30 UTC (rev 9915) +++ media/trunk/blender_25/stk_track.py 2011-09-29 14:35:29 UTC (rev 9916) @@ -1089,13 +1089,7 @@ if shape: shape="shape=\"%s\""%shape if not ipo: ipo=[] - - reset = getProperty(obj, "reset", "") - if reset and reset == 'true': - reset = " reset=\"y\"" - else: - reset = "" - + lodstring = self.getLODString(obj) if type == "lod_instance": @@ -1103,12 +1097,18 @@ else: model_string = "model=\"%s\" " % name + interaction = getProperty(obj, "interaction", '??') + if interaction == 'reset': + reset_string = " reset=\"y\"" + else: + reset_string = "" + if parent and parent.type=="ARMATURE": f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ - (model_string, getXYZHPRString(parent), shape, looped, lodstring, reset)) + (model_string, getXYZHPRString(parent), shape, looped, lodstring, reset_string)) else: f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ - (model_string, getXYZHPRString(obj), shape, looped, lodstring, reset)) + (model_string, getXYZHPRString(obj), shape, looped, lodstring, reset_string)) self.writeIPO(f, ipo) f.write(" </object>\n") @@ -1155,14 +1155,20 @@ else: model_string = " model=\"%s\""%b3d_name + interaction = getProperty(obj, "interaction", '??') + if interaction == 'reset': + reset_string = " reset=\"y\"" + else: + reset_string = "" + if lAnim: - f.write(" <static-object%s%s %s>\n"% \ - (lodstring, model_string, getXYZHPRString(obj)) ) + f.write(" <static-object%s%s %s%s>\n"% \ + (lodstring, model_string, getXYZHPRString(obj), reset_string) ) self.writeAnimatedTextures(f, lAnim) f.write(" </static-object>\n") else: - f.write(" <static-object%s%s %s/>\n"% \ - (lodstring, model_string, getXYZHPRString(obj)) ) + f.write(" <static-object%s%s %s%s/>\n"% \ + (lodstring, model_string, getXYZHPRString(obj), reset_string) ) self.writeAnimatedTextures(f, lAnimTextures) # -------------------------------------------------------------------------- @@ -1485,13 +1491,7 @@ shape="box" mass = getProperty(obj, "mass", 10) lodstring = self.getLODString(obj) - - reset = getProperty(obj, "reset", "") - if reset and reset == 'true': - reset = " reset=\"y\"" - else: - reset = "" - + type = getProperty(obj, "type", "?") if type == "lod_instance": @@ -1500,8 +1500,8 @@ model_string = "model=\"%s\" " % b3d_name f.write(" <object type=\"movable\" %s\n"%(getXYZHPRString(obj))) - f.write(" %sshape=\"%s\" mass=\"%s\"%s%s/>\n"\ - % (model_string, shape, mass, lodstring, reset)) + f.write(" %sshape=\"%s\" mass=\"%s\"%s/>\n"\ + % (model_string, shape, mass, lodstring)) # Now the object either has an IPO, or is a 'ghost' object. # Either can have an IPO. Even if the objects don't move @@ -1517,7 +1517,8 @@ if parent: ipo = parent.animation_data self.writeAnimationWithIPO(f, b3d_name, obj, ipo) - elif interact=="static": + + elif interact=="static" or interact=="reset": ipo = obj.animation_data # In objects with skeletal animations the actual armature (which # is a parent) contains the IPO. So check for this: @@ -1610,7 +1611,7 @@ for obj in lObjects: interact = getProperty(obj, "interaction", "static") - if interact=="static": + if interact=="static" or interact=="reset": ipo = obj.animation_data This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-11-22 02:47:23
|
Revision: 10236 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10236&view=rev Author: auria Date: 2011-11-22 02:47:10 +0000 (Tue, 22 Nov 2011) Log Message: ----------- Add normal map support to browser and exporter Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2011-11-22 00:18:51 UTC (rev 10235) +++ media/trunk/blender_25/stk_material_export.py 2011-11-22 02:47:10 UTC (rev 10236) @@ -94,6 +94,7 @@ 'graphical_effect' : ('none', None), 'ignore' : ("N", None), 'mask' : ("", None), + 'normal_map' : ("", None), 'reset' : ("N", None), 'sphere' : ("N", None), 'surface' : ("N", None), Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-11-22 00:18:51 UTC (rev 10235) +++ media/trunk/blender_25/stk_panel.py 2011-11-22 02:47:10 UTC (rev 10236) @@ -873,6 +873,8 @@ doc="Drive through this texture like it didn't exist (good for smoke, etc.)"), StkProperty( id='mask', name="Mask image", default="", doc="Greyscale image containing the alpha channel (transparency) for this image"), + StkProperty( id='normal_map', name="Normal Map", default="", + doc="Image containing the normal map for this texture (optional)"), StkBoolProperty( id='particle', name="Particle effect", default="false", contextLevel=CONTEXT_MATERIAL, subproperties=PARTICLE_PROPERTIES, doc="Whether to emit particles (e.g. smoke) when driving on this surface"), StkBoolProperty( id='use_sfx', name="Play sound effect", default="false", contextLevel=CONTEXT_MATERIAL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-11-28 00:47:01
|
Revision: 10270 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10270&view=rev Author: auria Date: 2011-11-28 00:46:54 +0000 (Mon, 28 Nov 2011) Log Message: ----------- Add samuncle's feature to the exporter + fix a bug when exporting billboards with IPO Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-11-28 00:21:57 UTC (rev 10269) +++ media/trunk/blender_25/stk_panel.py 2011-11-28 00:46:54 UTC (rev 10270) @@ -611,7 +611,16 @@ {'' : StkEnumChoice('None', [], doc="Nothing special about this object"), 'none' : StkEnumChoice('None', [], doc="Nothing special about this object"), 'banana' : StkEnumChoice('Banana', [], doc="A banana object that needs to be avoided (apply to an Empty)"), - 'billboard' : StkEnumChoice('Billboard', [], doc="A flat quad that will always face the camera"), + 'billboard' : StkEnumChoice('Billboard', + [ + StkBoolProperty(id='fadeout', name="Fadeout when close", default="false", + contextLevel=CONTEXT_OBJECT, doc="Make this billboard fade out when approaching it", + subproperties=[StkFloatProperty(id='start', name="Start", default=1.0, min=0.0, max=200.0, + doc="Distance from the camera at which the billboard is no more visible"), + StkFloatProperty(id='end', name="End", default=15.0, min=0.0, max=200.0, + doc="Distance from the camera at which the billboard is fully visible"), + ]) + ], doc="A flat quad that will always face the camera"), 'check' : StkEnumChoice('Checkline', [ StkProperty(id='name', name="Name", default="", doc="Name of the checkline"), StkObjectReferenceProperty(id='activate', unique_id_suffix="_checkline", name="Activate", default="", Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-11-28 00:21:57 UTC (rev 10269) +++ media/trunk/blender_25/stk_track.py 2011-11-28 00:46:54 UTC (rev 10270) @@ -1226,14 +1226,20 @@ x_max = max(x_max, data.vertices[i].co[0]) y_min = min(y_min, data.vertices[i].co[2]) y_max = max(y_max, data.vertices[i].co[2]) - - + + fadeout_str = "" + fadeout = getProperty(obj, "fadeout", "false") + if fadeout == "true": + start = float(getProperty(obj, "start", 1.0)) + end = float(getProperty(obj, "end", 15.0)) + fadeout_str = "fadeout=\"true\" start=\"" + str(start) + "\" end=\"" + str(end) + "\"" + f.write(' <object type="billboard" texture="%s" xyz="%f %f %f" \n'% (os.path.basename(data.uv_textures[0].data[0].image.filepath), obj.location[0], obj.location[2], obj.location[1]) ) - f.write(' width="%f" height="%f">\n' %(x_max-x_min, y_max-y_min) ) + f.write(' width="%f" height="%f" %s>\n' %(x_max-x_min, y_max-y_min, fadeout_str) ) if obj.animation_data and obj.animation_data.action and obj.animation_data.action.fcurves and len(obj.animation_data.action.fcurves) > 0: - self.writeIPO(f, obj.animation_data.action.fcurves) + self.writeIPO(f, obj.animation_data) f.write(' </object>\n') except ValueError: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-11-30 21:26:38
|
Revision: 10284 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10284&view=rev Author: auria Date: 2011-11-30 21:26:32 +0000 (Wed, 30 Nov 2011) Log Message: ----------- Add exporter support for splatting Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2011-11-30 19:34:37 UTC (rev 10283) +++ media/trunk/blender_25/stk_material_export.py 2011-11-30 21:26:32 UTC (rev 10284) @@ -78,7 +78,7 @@ return - + # the values are of format (default value, parent property if any) lTextureDefaults = { 'light' : ("Y", None), 'additive_lightmap' : ("N", None), @@ -101,13 +101,18 @@ 'surface' : ("N", None), 'high_adhesion' : ('false', None), 'slowdown_time' : (1.0, 'use_slowdown'), - 'max_speed' : (1.0, 'use_slowdown') + 'max_speed' : (1.0, 'use_slowdown'), + 'splatting' : ("N", None), + 'splatting_texture_1' : ("", 'splatting'), + 'splatting_texture_2' : ("", 'splatting'), + 'splatting_texture_3' : ("", 'splatting'), + 'splatting_texture_4' : ("", 'splatting') } lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", "falling_effect", "crash_reset", "fog", "additive_lightmap", "anisotropic","backface_culling","ignore","disable_z_write","reset", - "sfx_positional"] + "sfx_positional", "splatting"] #start_time = bsys.time() print("Writing material file --> \t") @@ -166,7 +171,7 @@ if prop in lTextureDefaults.keys(): - # if this property isc onditional on another + # if this property is conditional on another cond = lTextureDefaults[prop][1] if currentValue != lTextureDefaults[prop][0] and (cond is None or (cond in i and i[cond] == "true")): Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-11-30 19:34:37 UTC (rev 10283) +++ media/trunk/blender_25/stk_panel.py 2011-11-30 21:26:32 UTC (rev 10284) @@ -896,6 +896,14 @@ subproperties=CRASH_RESET_PROPERTIES, doc="whether to rescue kart if it touches/hits this material in any way"), StkBoolProperty( id='sphere', name="Sphere mapping", default="false", contextLevel=CONTEXT_MATERIAL, doc="use sphere mapping on this object (mainly used to simulate a reflection effect)"), + StkBoolProperty( id='splatting', name="Splatting", default="false", contextLevel=CONTEXT_MATERIAL, + doc="Use splatting (multiple textures with smooth transitions)", subproperties= + [ + StkProperty(id='splatting_texture_1', name="Red Texture", default=""), + StkProperty(id='splatting_texture_2', name="Green Texture", default=""), + StkProperty(id='splatting_texture_3', name="Blue Texture", default=""), + StkProperty(id='splatting_texture_4', name="Black Texture", default="") + ]), StkBoolProperty( id='surface', name="Surface", default="false", contextLevel=CONTEXT_MATERIAL, doc="whether this material is the surface of a water area"), StkBoolProperty( id='zipper', name="Zipper (speed boost)", default="false", contextLevel=CONTEXT_MATERIAL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-12-22 23:04:28
|
Revision: 10485 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10485&view=rev Author: auria Date: 2011-12-22 23:04:21 +0000 (Thu, 22 Dec 2011) Log Message: ----------- Extend normal map settings in exporter to allow using a second UV mapping layer Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2011-12-22 22:07:10 UTC (rev 10484) +++ media/trunk/blender_25/stk_material_export.py 2011-12-22 23:04:21 UTC (rev 10485) @@ -95,7 +95,9 @@ 'graphical_effect' : ('none', None), 'ignore' : ("N", None), 'mask' : ("", None), - 'normal_map' : ("", None), + 'normal_map' : ("", 'use_normal_map'), + 'normal_map_uv2' : ("", 'use_normal_map'), + 'use_normal_map' : ("N", None), 'reset' : ("N", None), 'sphere' : ("N", None), 'surface' : ("N", None), @@ -112,7 +114,7 @@ lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", "falling_effect", "crash_reset", "fog", "additive_lightmap", "anisotropic","backface_culling","ignore","disable_z_write","reset", - "sfx_positional", "splatting"] + "sfx_positional", "splatting", "use_normal_map", "normal_map_uv2"] #start_time = bsys.time() print("Writing material file --> \t") Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2011-12-22 22:07:10 UTC (rev 10484) +++ media/trunk/blender_25/stk_panel.py 2011-12-22 23:04:21 UTC (rev 10485) @@ -888,8 +888,16 @@ doc="Make lightmap additive (only makes sense if this material has a lightmap)"), StkProperty( id='mask', name="Mask image", default="", doc="Greyscale image containing the alpha channel (transparency) for this image"), - StkProperty( id='normal_map', name="Normal Map", default="", - doc="Image containing the normal map for this texture (optional)"), + StkBoolProperty( id='use_normal_map',name="Normal Map", default="false", contextLevel=CONTEXT_MATERIAL, + doc="Use a normal map for this image", + subproperties= + [ + StkProperty( id='normal_map', name="Normal Map Image", default="", + doc="Image containing the normal map for this texture (optional)"), + StkBoolProperty( id='normal_map_uv2',name="Use second UV layer", default="false", + contextLevel=CONTEXT_MATERIAL, + doc="If checked, UV layer 2 will be used to map the normal map on the object") + ]), StkBoolProperty( id='particle', name="Particle effect", default="false", contextLevel=CONTEXT_MATERIAL, subproperties=PARTICLE_PROPERTIES, doc="Whether to emit particles (e.g. smoke) when driving on this surface"), StkBoolProperty( id='use_sfx', name="Play sound effect", default="false", contextLevel=CONTEXT_MATERIAL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-01-09 02:30:49
|
Revision: 10622 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10622&view=rev Author: auria Date: 2012-01-09 02:30:43 +0000 (Mon, 09 Jan 2012) Log Message: ----------- Add 'push back on collision' effect Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2012-01-09 01:34:45 UTC (rev 10621) +++ media/trunk/blender_25/stk_material_export.py 2012-01-09 02:30:43 UTC (rev 10622) @@ -86,8 +86,9 @@ 'backface_culling' : ("Y", None), 'below_surface' : ("N", None), 'compositing' : ('none', None), - 'crash_reset' : ("N", None), - 'crash_reset_particles' : ("", 'crash_reset'), + 'collision_detect' : ("N", None), + 'collision_particles' : ("", 'collision_detect'), + 'collision_reaction' : ("none", 'collision_detect'), 'clampu' : ("N", None), 'clampv' : ("N", None), 'disable_z_write' : ("N", None), @@ -112,7 +113,7 @@ } lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", - "falling_effect", "crash_reset", "fog", "additive_lightmap", + "falling_effect", "collision_detect", "fog", "additive_lightmap", "anisotropic","backface_culling","ignore","disable_z_write","reset", "sfx_positional", "splatting", "use_normal_map", "normal_map_uv2"] Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-01-09 01:34:45 UTC (rev 10621) +++ media/trunk/blender_25/stk_panel.py 2012-01-09 02:30:43 UTC (rev 10622) @@ -856,7 +856,12 @@ doc="Speed at which the sound fades out as you stand further from the sound emitter") ] -CRASH_RESET_PROPERTIES = [StkProperty( id='crash_reset_particles', name="Particles on hit", default="")] +COLLISION_DETECTION_PROPERTIES = [StkEnumProperty( id='collision_reaction', name="Action", default='none', contextLevel=CONTEXT_MATERIAL, + values={'none' : StkEnumChoice("None", []), + 'reset' : StkEnumChoice("Rescue kart", []), + 'push' : StkEnumChoice("Push back kart", [])}, + doc="How to react when kart touches this material"), + StkProperty( id='collision_particles', name="Particles on hit", default="")] STK_MATERIAL_PROPERTIES = [ StkBoolProperty( id='fog', name="Affected by fog (if any)", default="true", contextLevel=CONTEXT_MATERIAL, @@ -871,7 +876,9 @@ doc="if checked, this texture will not be repeated horizontally (if the UV texturing goes beyond the texture bounds)"), StkBoolProperty( id='clampv', name="Clamp texture vertically", default="false", contextLevel=CONTEXT_MATERIAL, doc="if checked, this texture will not be repeated vertically (if the UV texturing goes beyond the texture bounds)"), - StkEnumProperty( id='compositing', name="Compsiting Type", default='none', contextLevel=CONTEXT_MATERIAL, + StkBoolProperty( id='collision_detect', name="Collision action", default="false", contextLevel=CONTEXT_MATERIAL, + subproperties=COLLISION_DETECTION_PROPERTIES, doc="What happens when the kart touches/hits this material in any way"), + StkEnumProperty( id='compositing', name="Compositing Type", default='none', contextLevel=CONTEXT_MATERIAL, values=COMPOSITING_VALUES, doc="How to composite this texture with what is behind it"), StkBoolProperty( id='disable_z_write', name="Disable writing to Z-buffer",default="false", contextLevel=CONTEXT_MATERIAL, doc="disable writing to the Z buffer (useful for materials with transparency, if irrlicht fails to do proper alpha sorting, in order not to hide what is behind)"), @@ -905,8 +912,6 @@ subproperties=SFX_PROPERTIES, doc="Whether to play a sound when driving on this surface"), StkBoolProperty( id='reset', name="Reset kart (on drive)", default="false", contextLevel=CONTEXT_MATERIAL, doc="whether to rescue kart if it ends up [driving] on this surface"), - StkBoolProperty( id='crash_reset', name="Reset kart (on touch)", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=CRASH_RESET_PROPERTIES, doc="whether to rescue kart if it touches/hits this material in any way"), StkBoolProperty( id='sphere', name="Sphere mapping", default="false", contextLevel=CONTEXT_MATERIAL, doc="use sphere mapping on this object (mainly used to simulate a reflection effect)"), StkBoolProperty( id='splatting', name="Splatting", default="false", contextLevel=CONTEXT_MATERIAL, This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-01-11 02:46:58
|
Revision: 10645 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10645&view=rev Author: auria Date: 2012-01-11 02:46:52 +0000 (Wed, 11 Jan 2012) Log Message: ----------- Start work to have trigger items, and for now use them to play a sound when crossing the force fields in overworld. This is WIP. Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-01-11 01:25:53 UTC (rev 10644) +++ media/trunk/blender_25/stk_panel.py 2012-01-11 02:46:52 UTC (rev 10645) @@ -689,7 +689,11 @@ doc="Filename of the sound to play"), StkFloatProperty( id='sfx_volume', name="Sound volume", default=1.0, min=0.0, max=1.0), StkFloatProperty( id='sfx_rolloff', name="Rolloff rate", default=0.1, min=0.0, max=2.5, - doc="How fast this sound decays when going farther from the emission point") + doc="How fast this sound decays when going farther from the emission point"), + StkBoolProperty( id='play_when_near', name="Play on approach", default="false", + contextLevel=CONTEXT_OBJECT, doc="Play when the kart approaches this object", + subproperties=[StkFloatProperty('play_distance', "Play when at distance", 1.0, + doc="Distance at which the sound starts playing when approaching")]), ], doc="A sound will be heard when close to this point"), 'sun' : StkEnumChoice('Sun', Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2012-01-11 01:25:53 UTC (rev 10644) +++ media/trunk/blender_25/stk_track.py 2012-01-11 02:46:52 UTC (rev 10645) @@ -114,7 +114,7 @@ loc = obj.location hpr = obj.rotation_euler rad2deg = 180.0/3.1415926535; - s="x=\"%f\" y=\"%f\" z=\"%f\" h=\"%f\"" %\ + s="x=\"%.2f\" y=\"%.2f\" z=\"%.2f\" h=\"%f\"" %\ (loc[0], loc[2], loc[1], hpr[2]*rad2deg) return s @@ -130,7 +130,7 @@ hpr = obj.rotation_euler.to_quaternion().to_euler('XZY') si = obj.scale rad2deg = 180.0/3.1415926535; - s="xyz=\"%f %f %f\" hpr=\"%f %f %f\" scale=\"%f %f %f\"" %\ + s="xyz=\"%.2f %.2f %.2f\" hpr=\"%.1f %.1f %.1f\" scale=\"%.2f %.2f %.2f\"" %\ (loc[0], loc[2], loc[1], -hpr[0]*rad2deg, -hpr[2]*rad2deg, -hpr[1]*rad2deg, si[0], si[2], si[1]) return s @@ -1300,10 +1300,16 @@ try: # origin originXYZ = getXYZHPRString(obj) - f.write(' <object type="sfx-emitter" sound="%s" rolloff="%s" volume="%s" %s/>\n' %\ + + play_near_string = "" + if getProperty(obj, "play_when_near", "false") == "true": + dist = getProperty(obj, "play_distance", 1.0) + play_near_string = " play-when-near=\"true\" distance=\"%.1f\"" % dist + + f.write(' <object type="sfx-emitter" sound="%s" rolloff="%s" volume="%s" %s%s/>\n' %\ (getProperty(obj, "sfx_filename", "some_sound.ogg"), getProperty(obj, "sfx_rolloff", 0.05), - getProperty(obj, "sfx_volume", 0), originXYZ)) + getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string)) except: log_error("Invalid particle emitter <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-01-15 16:46:42
|
Revision: 10670 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10670&view=rev Author: auria Date: 2012-01-15 16:46:36 +0000 (Sun, 15 Jan 2012) Log Message: ----------- Update scripts to use tangent space Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-01-15 16:37:15 UTC (rev 10669) +++ media/trunk/blender_25/stk_panel.py 2012-01-15 16:46:36 UTC (rev 10670) @@ -605,7 +605,9 @@ ], doc="The player will be resetted when touching this object") }, contextLevel=CONTEXT_OBJECT, default='static', - doc="How this object should interact with other objects in the physics engine") + doc="How this object should interact with other objects in the physics engine"), + StkBoolProperty(id='tangents', name="Use Tangent Space", default="false", + contextLevel=CONTEXT_OBJECT, doc="Export object in tangent space, which is required for normal maps"), ] # The 'type' property Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2012-01-15 16:37:15 UTC (rev 10669) +++ media/trunk/blender_25/stk_track.py 2012-01-15 16:46:36 UTC (rev 10670) @@ -1108,12 +1108,18 @@ else: reset_string = "" + tangent_string = "" + if getProperty(obj, "tangents", "false") == "true": + tangent_string="tangents=\"true\" " + if parent and parent.type=="ARMATURE": - f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ - (model_string, getXYZHPRString(parent), shape, looped, lodstring, reset_string)) + f.write(" <object type=\"animation\" %s%s %s%s%s%s%s>\n"% \ + (model_string, getXYZHPRString(parent), shape, looped, + lodstring, reset_string, tangent_string)) else: - f.write(" <object type=\"animation\" %s%s %s%s%s%s>\n"% \ - (model_string, getXYZHPRString(obj), shape, looped, lodstring, reset_string)) + f.write(" <object type=\"animation\" %s%s %s%s%s%s%s>\n"% \ + (model_string, getXYZHPRString(obj), shape, looped, + lodstring, reset_string, tangent_string)) self.writeIPO(f, ipo) f.write(" </object>\n") @@ -1184,16 +1190,20 @@ else: reset_string = "" + tangent_string = "" + if getProperty(obj, "tangents", "false") == "true": + tangent_string=" tangents=\"true\"" + if lAnim: - f.write(" <static-object%s%s %s%s%s%s>\n"% \ + f.write(" <static-object%s%s %s%s%s%s%s>\n"% \ (lodstring, model_string, getXYZHPRString(obj), reset_string, - condition_if_str, condition_ifnot_str) ) + condition_if_str, condition_ifnot_str, tangent_string) ) self.writeAnimatedTextures(f, lAnim) f.write(" </static-object>\n") else: - f.write(" <static-object%s%s %s%s%s%s%s/>\n"% \ + f.write(" <static-object%s%s %s%s%s%s%s%s/>\n"% \ (lodstring, model_string, getXYZHPRString(obj), reset_string, - condition_if_str, condition_ifnot_str, challenge_str) ) + condition_if_str, condition_ifnot_str, challenge_str, tangent_string) ) self.writeAnimatedTextures(f, lAnimTextures) # -------------------------------------------------------------------------- @@ -1545,9 +1555,13 @@ else: model_string = "model=\"%s\" " % b3d_name + tangent_string = "" + if getProperty(obj, "tangents", "false") == "true": + tangent_string=" tangents=\"true\" " + f.write(" <object type=\"movable\" %s\n"%(getXYZHPRString(obj))) - f.write(" %sshape=\"%s\" mass=\"%s\"%s/>\n"\ - % (model_string, shape, mass, lodstring)) + f.write(" %sshape=\"%s\" mass=\"%s\"%s%s/>\n"\ + % (model_string, shape, mass, lodstring, tangent_string)) # Now the object either has an IPO, or is a 'ghost' object. # Either can have an IPO. Even if the objects don't move This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-01-15 22:01:30
|
Revision: 10679 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10679&view=rev Author: auria Date: 2012-01-15 22:01:23 +0000 (Sun, 15 Jan 2012) Log Message: ----------- Update scripts for normal maps/tangent space Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2012-01-15 22:01:09 UTC (rev 10678) +++ media/trunk/blender_25/stk_material_export.py 2012-01-15 22:01:23 UTC (rev 10679) @@ -97,7 +97,6 @@ 'ignore' : ("N", None), 'mask' : ("", None), 'normal_map' : ("", 'use_normal_map'), - 'normal_map_uv2' : ("", 'use_normal_map'), 'use_normal_map' : ("N", None), 'reset' : ("N", None), 'sphere' : ("N", None), @@ -115,7 +114,7 @@ lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", "falling_effect", "collision_detect", "fog", "additive_lightmap", "anisotropic","backface_culling","ignore","disable_z_write","reset", - "sfx_positional", "splatting", "use_normal_map", "normal_map_uv2"] + "sfx_positional", "splatting", "use_normal_map"] #start_time = bsys.time() print("Writing material file --> \t") Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-01-15 22:01:09 UTC (rev 10678) +++ media/trunk/blender_25/stk_panel.py 2012-01-15 22:01:23 UTC (rev 10679) @@ -673,7 +673,10 @@ StkProperty( id='lod_name', name="LOD Group Name", default="SomeModel", doc="Name of the LOD group this object is part of"), StkProperty( id='name', name="Model Filename", default="", - doc="Name of the model to export") + doc="Name of the model to export"), + StkBoolProperty( id='tangents', name="Use Tangent Space", default="false", + contextLevel=CONTEXT_OBJECT, + doc="Export object in tangent space, which is required for normal maps") ], doc="A LOD (level-of-detail) model (this model will not be visible in game, only LOD instances will)"), 'nitro_big' : StkEnumChoice('Nitro (big)', [], doc="A big nitro collectible (apply to an Empty)"), 'nitro_small' : StkEnumChoice('Nitro (small)', [], doc="A small nitro collectible (apply to an Empty)"), @@ -909,10 +912,7 @@ subproperties= [ StkProperty( id='normal_map', name="Normal Map Image", default="", - doc="Image containing the normal map for this texture (optional)"), - StkBoolProperty( id='normal_map_uv2',name="Use second UV layer", default="false", - contextLevel=CONTEXT_MATERIAL, - doc="If checked, UV layer 2 will be used to map the normal map on the object") + doc="Image containing the normal map for this texture (optional)") ]), StkBoolProperty( id='particle', name="Particle effect", default="false", contextLevel=CONTEXT_MATERIAL, subproperties=PARTICLE_PROPERTIES, doc="Whether to emit particles (e.g. smoke) when driving on this surface"), This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-01-29 17:00:39
|
Revision: 10745 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10745&view=rev Author: auria Date: 2012-01-29 17:00:33 +0000 (Sun, 29 Jan 2012) Log Message: ----------- Add water shader to panel and exporter Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2012-01-29 16:40:35 UTC (rev 10744) +++ media/trunk/blender_25/stk_material_export.py 2012-01-29 17:00:33 UTC (rev 10745) @@ -108,13 +108,14 @@ 'splatting_texture_1' : ("", 'splatting'), 'splatting_texture_2' : ("", 'splatting'), 'splatting_texture_3' : ("", 'splatting'), - 'splatting_texture_4' : ("", 'splatting') + 'splatting_texture_4' : ("", 'splatting'), + 'water_shader' : ("N", None) } lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", "falling_effect", "collision_detect", "fog", "additive_lightmap", "anisotropic","backface_culling","ignore","disable_z_write","reset", - "sfx_positional", "splatting", "use_normal_map"] + "sfx_positional", "splatting", "use_normal_map", "water_shader"] #start_time = bsys.time() print("Writing material file --> \t") Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-01-29 16:40:35 UTC (rev 10744) +++ media/trunk/blender_25/stk_panel.py 2012-01-29 17:00:33 UTC (rev 10745) @@ -932,6 +932,8 @@ ]), StkBoolProperty( id='surface', name="Surface", default="false", contextLevel=CONTEXT_MATERIAL, doc="whether this material is the surface of a water area"), + StkBoolProperty( id='water_shader', name="Water Shader", default="false", contextLevel=CONTEXT_MATERIAL, + doc="If checked, a shader will simulate light reflexions and moving waves on this surface"), StkBoolProperty( id='zipper', name="Zipper (speed boost)", default="false", contextLevel=CONTEXT_MATERIAL, subproperties=ZIPPER_PROPERTIES, doc="Whether to get a speed boost when driving on this surface") ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-02-02 16:41:16
|
Revision: 10792 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10792&view=rev Author: auria Date: 2012-02-02 16:41:07 +0000 (Thu, 02 Feb 2012) Log Message: ----------- Make water shader customizable in panel Modified Paths: -------------- media/trunk/blender_25/stk_material_export.py media/trunk/blender_25/stk_panel.py Modified: media/trunk/blender_25/stk_material_export.py =================================================================== --- media/trunk/blender_25/stk_material_export.py 2012-02-02 16:37:30 UTC (rev 10791) +++ media/trunk/blender_25/stk_material_export.py 2012-02-02 16:41:07 UTC (rev 10792) @@ -109,7 +109,9 @@ 'splatting_texture_2' : ("", 'splatting'), 'splatting_texture_3' : ("", 'splatting'), 'splatting_texture_4' : ("", 'splatting'), - 'water_shader' : ("N", None) + 'water_shader' : ("N", None), + 'water_shader_speed_1' : (6.6667, 'water_shader'), + 'water_shader_speed_2' : (4.0, 'water_shader') } lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-02-02 16:37:30 UTC (rev 10791) +++ media/trunk/blender_25/stk_panel.py 2012-02-02 16:41:07 UTC (rev 10792) @@ -933,7 +933,11 @@ StkBoolProperty( id='surface', name="Surface", default="false", contextLevel=CONTEXT_MATERIAL, doc="whether this material is the surface of a water area"), StkBoolProperty( id='water_shader', name="Water Shader", default="false", contextLevel=CONTEXT_MATERIAL, - doc="If checked, a shader will simulate light reflexions and moving waves on this surface"), + doc="If checked, a shader will simulate light reflexions and moving waves on this surface", subproperties= + [ + StkFloatProperty(id='water_shader_speed_1', name="Main wave speed", default=6.6667), + StkFloatProperty(id='water_shader_speed_2', name="Secondary wave speed", default=4.0) + ]), StkBoolProperty( id='zipper', name="Zipper (speed boost)", default="false", contextLevel=CONTEXT_MATERIAL, subproperties=ZIPPER_PROPERTIES, doc="Whether to get a speed boost when driving on this surface") ] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-02-05 01:13:29
|
Revision: 10802 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10802&view=rev Author: auria Date: 2012-02-05 01:13:19 +0000 (Sun, 05 Feb 2012) Log Message: ----------- update blender scripts to allow exporting script-trigger objects (which for now will be used to trigger hardcoded actions in overworld, but eventually we could make tracks scriptable) Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-02-05 00:23:31 UTC (rev 10801) +++ media/trunk/blender_25/stk_panel.py 2012-02-05 01:13:19 UTC (rev 10802) @@ -614,6 +614,12 @@ type = StkEnumProperty('type', "Type", {'' : StkEnumChoice('None', [], doc="Nothing special about this object"), 'none' : StkEnumChoice('None', [], doc="Nothing special about this object"), + 'action_trigger' : StkEnumChoice('Action trigger', + [ + StkProperty(id='action', name="Action", default="", doc="Name of the action to trigger"), + StkFloatProperty(id='trigger_distance', name="Trigger Distance", default=5.0, + doc="Distance at which this action is triggered") + ], doc="Make something happen when driving there (FOR INTERNAL USE ONLY AT THIS TIME)"), 'banana' : StkEnumChoice('Banana', [], doc="A banana object that needs to be avoided (apply to an Empty)"), 'billboard' : StkEnumChoice('Billboard', [ Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2012-02-05 00:23:31 UTC (rev 10801) +++ media/trunk/blender_25/stk_track.py 2012-02-05 01:13:19 UTC (rev 10802) @@ -1322,10 +1322,26 @@ getProperty(obj, "sfx_rolloff", 0.05), getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string)) except: - log_error("Invalid particle emitter <" + getProperty(obj, "name", obj.name) + "> ", + log_error("Invalid sound emitter <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) # -------------------------------------------------------------------------- + # Action Triggers + def writeActionTriggers(self, f, lActionEmitters): + for obj in lActionEmitters: + try: + # origin + originXYZ = getXYZHPRString(obj) + + f.write(' <object type="action-trigger" action="%s" distance="%s" %s/>\n' %\ + (getProperty(obj, "action", ""), + getProperty(obj, "trigger_distance", 5.0), + originXYZ)) + except: + log_error("Invalid action <" + getProperty(obj, "name", obj.name) + "> ", + sys.exc_info()[0]) + + # -------------------------------------------------------------------------- # Writes out all checklines. # \param lChecks All check meshes # \param mainDriveline The main driveline, from which the lap @@ -1654,8 +1670,8 @@ # -------------------------------------------------------------------------- # Writes the scene files, which includes all models, animations, and items def writeSceneFile(self, sPath, sTrackName, lWater, lTrack, lItems, lObjects, lBillboards, - lParticleEmitters, lSoundEmitters, lChecks, lSun, mainDriveline, lStart, - lEndCameras, lCameraCurves): + lParticleEmitters, lSoundEmitters, lActionTriggers, lChecks, lSun, mainDriveline, + lStart, lEndCameras, lCameraCurves): #start_time = bsys.time() print("Writing scene file --> \t") @@ -1705,6 +1721,8 @@ self.writeParticleEmitters(f, lParticleEmitters) if lSoundEmitters: self.writeSoundEmitters(f, lSoundEmitters) + if lActionTriggers: + self.writeActionTriggers(f, lActionTriggers) for obj in lOtherObjects: self.writeObject(f, sPath, obj) @@ -1892,6 +1910,7 @@ lBillboards = [] # All billboards lParticleEmitters = [] # All particle emitters lSoundEmitters = [] + lActionTriggers = [] lChecks = [] # All check structures lSun = [] lStart = [] # All start positions @@ -1931,6 +1950,9 @@ elif stktype=="SFX_EMITTER": lSoundEmitters.append(obj) continue + elif stktype=="ACTION_TRIGGER": + lActionTriggers.append(obj) + continue else: print("Empty '%s' has type '%s' which is not valid - ignored."%\ (obj.name, stktype)) @@ -2020,8 +2042,8 @@ if len(lDrivelines)==0: lDrivelines=[None] self.writeSceneFile(sPath, sTrackName, lWater, lTrack, lItems, - lObjects, lBillboards, lParticleEmitters, lSoundEmitters, lChecks, lSun, - lDrivelines[0], lStart, lEndCameras, lCameraCurves) + lObjects, lBillboards, lParticleEmitters, lSoundEmitters, lActionTriggers, + lChecks, lSun, lDrivelines[0], lStart, lEndCameras, lCameraCurves) # materials file # ---------- if 'stk_material_exporter' not in dir(bpy.ops.screen): This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-02-21 22:06:47
|
Revision: 10880 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=10880&view=rev Author: auria Date: 2012-02-21 22:06:41 +0000 (Tue, 21 Feb 2012) Log Message: ----------- Add simplified feature to make simple LOD objects. Thanks samuncle for the idea, I will use this too Modified Paths: -------------- media/trunk/blender_25/stk_panel.py media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-02-21 01:44:48 UTC (rev 10879) +++ media/trunk/blender_25/stk_panel.py 2012-02-21 22:06:41 UTC (rev 10880) @@ -699,6 +699,12 @@ StkIntProperty(id='clip_distance', name="Clip Distance", default=0, doc="If non-zero, the camera distance at which particles are hidden (for performance reasons)") ], doc="To be applied to an empty; particles will be emitted from this point"), + 'single_lod' : StkEnumChoice('Single LOD', + [ + StkProperty('name', "Name", "", doc="Name of this object, used to name the model file when exporting (if not specified, the blender name of the object will be used)"), + StkFloatProperty( id='lod_distance', name="Distance", default=60.0, min=0.0, max=5000.0, + doc="Distance from the camera at which this object becomes visible") + ], doc="An object that will only be visible when the camera is close enough (shortcut for LOD objects that don't have multiple levels)"), 'start' : StkEnumChoice('Start position', subproperties=[StkIntProperty('start_index', "Start Index", 1, doc="Start position index for battle mode")], doc="A start position for karts in battle mode (only useful if this track is an arena)"), Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2012-02-21 01:44:48 UTC (rev 10879) +++ media/trunk/blender_25/stk_track.py 2012-02-21 22:06:41 UTC (rev 10880) @@ -1164,12 +1164,20 @@ name = getProperty(obj, "name", obj.name) if len(name) == 0: name = obj.name - if getProperty(obj, "type", "X") != "lod_instance": + type = getProperty(obj, "type", "X") + + if type != "lod_instance": b3d_name = self.exportLocalB3D(obj, sPath, name) kind = getProperty(obj, "kind", "") - if getProperty(obj, "type", "X") == "lod_instance": + if type == "lod_instance": model_string = "" + elif type == "single_lod": + # single_lod is a shortcut that generates both a lod_instance and a lod_model + model_string2 = " model=\"%s\""%b3d_name + lodstring2 = ' lod_distance="' + str(getProperty(obj, "lod_distance", 60.0)) + '" lod_group="_single_lod_' + name + '"' + f.write(" <static-object%s%s %s/>\n" % (lodstring2, model_string2, getXYZHPRString(obj)) ) + model_string = "" else: model_string = " model=\"%s\""%b3d_name @@ -1231,6 +1239,8 @@ if len(group) == 0: log_warning("LOD instance " + obj.name + " has no group property") lodstring = ' lod_instance="true" lod_group="' + group + '"' + elif type == "single_lod": + lodstring = ' lod_instance="true" lod_group="_single_lod_' + getProperty(obj, "name", obj.name) + '"' return lodstring # -------------------------------------------------------------------------- @@ -1694,7 +1704,7 @@ for obj in lObjects: type = getProperty(obj, "type", "??") interact = getProperty(obj, "interaction", "static") - if type == "lod_instance" or type == "lod_model": + if type == "lod_instance" or type == "lod_model" or type == "single_lod": interact = "static" if interact=="static" or interact=="reset": @@ -1988,7 +1998,7 @@ found_main_driveline = True elif stktype=="DRIVELINE": lDrivelines.append(Driveline(obj, 0)) - elif stktype=="OBJECT" or stktype=="SPECIAL_OBJECT" or stktype=="LOD_MODEL" or stktype=="LOD_INSTANCE": + elif stktype=="OBJECT" or stktype=="SPECIAL_OBJECT" or stktype=="LOD_MODEL" or stktype=="LOD_INSTANCE" or stktype=="SINGLE_LOD": lObjects.append(obj) # for billboard elif stktype=="BILLBOARD": This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-04-01 01:03:16
|
Revision: 11056 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11056&view=rev Author: auria Date: 2012-04-01 01:03:08 +0000 (Sun, 01 Apr 2012) Log Message: ----------- Big update to the blender panel : now the data in the panel is specified in a set of external XML files, making the panel much more manageable. WARNING: when you update you need to also copy the 'stkdata' directory Modified Paths: -------------- media/trunk/blender_25/stk_panel.py Added Paths: ----------- media/trunk/blender_25/stkdata/ media/trunk/blender_25/stkdata/stk_material_parameters.xml media/trunk/blender_25/stkdata/stk_object_parameters.xml media/trunk/blender_25/stkdata/stk_panel_parameters.xml Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-03-31 22:27:11 UTC (rev 11055) +++ media/trunk/blender_25/stk_panel.py 2012-04-01 01:03:08 UTC (rev 11056) @@ -553,445 +553,168 @@ # THE PROPERTIES # ------------------------------------------------------------------------------ -# Properties when the "type" property is an end-camera -camera_properties = [StkFloatProperty(id='start', name="Start Sphere Radius", default=10.0)] +import xml.dom.minidom -# Property when type="object" -object_properties = [ - StkProperty('name', "Name", "", doc="Name of this object (objects with the same name are exported as a single file)"), - StkEnumProperty('interaction', "Interaction", - {'ghost' : StkEnumChoice("Ghost", [], doc="This object will be non-physical (player can drive through it)"), - 'static' : StkEnumChoice("Static (wont move)", subproperties= - [StkEnumProperty(id='shape', name="Shape (if animated object)", contextLevel=CONTEXT_OBJECT, unique_prefix="static", - values={'coneX' : StkEnumChoice("Cone (X)", []), - 'coneY' : StkEnumChoice("Cone (Y)", []), - 'coneZ' : StkEnumChoice("Cone (Z)", []), - 'cylinderX' : StkEnumChoice("Cylinder (X)", []), - 'cylinderY' : StkEnumChoice("Cylinder (Y)", []), - 'cylinderZ' : StkEnumChoice("Cylinder (Z)", []), - 'box' : StkEnumChoice("Box", []), - 'sphere' : StkEnumChoice("Sphere", []), - 'exact' : StkEnumChoice("Exact", []) - }, default='box', doc="Shape to use in the physics engine to represent this object"), - StkProperty('if', "Visible if...", "", doc="Make this object conditionally visible"), - StkProperty('ifnot', "Visible if not...", "", doc="Make this object conditionally visible") - ], - doc="This object will stay in place, if the user drives on this object they will 'hit a wall'"), - 'move' : StkEnumChoice("Movable by player", - [StkFloatProperty(id='mass', name="Mass (kg)", default=100.0, min=0.0, doc="How heavy the object is"), - StkEnumProperty(id='shape', name="Shape", contextLevel=CONTEXT_OBJECT, unique_prefix="move", - values={'coneX' : StkEnumChoice("Cone (X)", []), - 'coneY' : StkEnumChoice("Cone (Y)", []), - 'coneZ' : StkEnumChoice("Cone (Z)", []), - 'cylinderX' : StkEnumChoice("Cylinder (X)", []), - 'cylinderY' : StkEnumChoice("Cylinder (Y)", []), - 'cylinderZ' : StkEnumChoice("Cylinder (Z)", []), - 'box' : StkEnumChoice("Box", []), - 'sphere' : StkEnumChoice("Sphere", []) - }, default='box', doc="Shape to use in the physics engine to represent this object") - ], doc="The player will be able to move this object around by pushing it"), - 'reset' : StkEnumChoice("Reset player", subproperties= - [StkEnumProperty(id='shape', name="Shape", contextLevel=CONTEXT_OBJECT, unique_prefix="itrc_reset", - values={'coneX' : StkEnumChoice("Cone (X)", []), - 'coneY' : StkEnumChoice("Cone (Y)", []), - 'coneZ' : StkEnumChoice("Cone (Z)", []), - 'cylinderX' : StkEnumChoice("Cylinder (X)", []), - 'cylinderY' : StkEnumChoice("Cylinder (Y)", []), - 'cylinderZ' : StkEnumChoice("Cylinder (Z)", []), - 'box' : StkEnumChoice("Box", []), - 'sphere' : StkEnumChoice("Sphere", []), - 'exact' : StkEnumChoice("Exact", []) - }, default='box', doc="Shape to use in the physics engine to represent this object") - ], doc="The player will be resetted when touching this object") - }, - contextLevel=CONTEXT_OBJECT, default='static', - doc="How this object should interact with other objects in the physics engine"), - StkBoolProperty(id='tangents', name="Use Tangent Space", default="false", - contextLevel=CONTEXT_OBJECT, doc="Export object in tangent space, which is required for normal maps"), - ] +def readEnumValues(valueNodes, contextLevel): + out = {} + + for node in valueNodes: + if node.localName == None: + continue + elif node.localName == "EnumChoice": + args = dict() + args["name"] = node.getAttribute("label") + args["subproperties"] = parseProperties(node, contextLevel) + + if node.hasAttribute("doc"): + args["doc"] = node.getAttribute("doc") + + out[node.getAttribute("id")] = StkEnumChoice(**args) + else: + print("INTERNAL ERROR : Unexpected tag " + str(node.localName) + " in enum '" + str(node.localName) + "'") + + return out -# The 'type' property -type = StkEnumProperty('type', "Type", - {'' : StkEnumChoice('None', [], doc="Nothing special about this object"), - 'none' : StkEnumChoice('None', [], doc="Nothing special about this object"), - 'action_trigger' : StkEnumChoice('Action trigger', - [ - StkProperty(id='action', name="Action", default="", doc="Name of the action to trigger"), - StkFloatProperty(id='trigger_distance', name="Trigger Distance", default=5.0, - doc="Distance at which this action is triggered") - ], doc="Make something happen when driving there (FOR INTERNAL USE ONLY AT THIS TIME)"), - 'banana' : StkEnumChoice('Banana', [], doc="A banana object that needs to be avoided (apply to an Empty)"), - 'billboard' : StkEnumChoice('Billboard', - [ - StkBoolProperty(id='fadeout', name="Fadeout when close", default="false", - contextLevel=CONTEXT_OBJECT, doc="Make this billboard fade out when approaching it", - subproperties=[StkFloatProperty(id='start', name="Start", default=1.0, min=0.0, max=200.0, - doc="Distance from the camera at which the billboard is no more visible"), - StkFloatProperty(id='end', name="End", default=15.0, min=0.0, max=200.0, - doc="Distance from the camera at which the billboard is fully visible"), - ]) - ], doc="A flat quad that will always face the camera"), - 'check' : StkEnumChoice('Checkline', - [ StkProperty(id='name', name="Name", default="", doc="Name of the checkline"), - StkObjectReferenceProperty(id='activate', unique_id_suffix="_checkline", name="Activate", default="", - contextLevel=CONTEXT_OBJECT, static_objects=[("lap","Lap")], - filter=lambda self, o : 'type' in o and o['type'] == 'check', - doc="Which check structure to activate when crossing this checkline") - #'toggle' : Stkproperty("Toggle"), - #'inner_radius' : StkFloatProperty("Color radius"), - #'color' : - ], doc="A checkline that the player must cross (used to forbid shortcuts)"), - 'driveline' : StkEnumChoice('Driveline (additional)', - [StkBoolProperty(id='invisible', name="Invisible", default="false", - contextLevel=CONTEXT_OBJECT, doc="If checked, this path will not appear in the minimap"), - StkBoolProperty(id='ai_ignore', name="Ignored by AIs", default="false", - contextLevel=CONTEXT_OBJECT, doc="If checked, AIs will not drive on this path"), - StkEnumProperty('direction', "Usable directions", default="both", - values = { - 'both' : StkEnumChoice('Both directions', [], doc="Drivable both in forward and reverse directions"), - 'forward' : StkEnumChoice('Forward only', [], doc="Drivable only in forward direction"), - 'reverse' : StkEnumChoice('Reverse only', [], doc="Drivable only in reverse direction") - }, contextLevel=CONTEXT_OBJECT, - doc="In which direction(s) this part of the track is drivable (used with the 'reverse driving' feature)") - ], doc="Driveline used to mark an alternate path"), - 'maindriveline' : StkEnumChoice('Driveline (main)', - [StkObjectReferenceProperty(id='activate', unique_id_suffix="_maindriveline", name="Activate", - default="", contextLevel=CONTEXT_OBJECT, - filter=lambda self, o : 'type' in o and o['type'] == 'check', - doc="Which check structure to activate when crossing the lap line") - ]), - 'fixed' : StkEnumChoice('End Camera (Fixed)', camera_properties, doc="An end camera that stays in place"), - 'ahead' : StkEnumChoice('End Camera (Look Ahead)', camera_properties, doc="An end camera that follows the kart"), - 'ignore' : StkEnumChoice('Ignore', [], doc="An object that is not exported and will not appear in-game"), - 'item' : StkEnumChoice('Item (Gift Box)', [], doc="A gift box containing a random collectible (apply to an Empty)"), - 'lap' : StkEnumChoice('Lap line', - [StkObjectReferenceProperty(id='activate', unique_id_suffix="_lap", name="Activate", default="", - contextLevel=CONTEXT_OBJECT, - filter=lambda self, o : 'type' in o and o['type'] == 'check', - doc="Which check structure to activate when crossing the lap line") - ], doc="An extension to the factory lap line"), - 'lod_instance' : StkEnumChoice('LOD Instance', - [StkObjectReferenceProperty( id='lod_name', name="LOD Group Name", default="SomeModel", - doc="Name of the LOD group this object is an instance of", - contextLevel=CONTEXT_OBJECT, - filter=lambda self, o: "lod_name" in o, - obj_identifier=lambda self, o : o["lod_name"], - obj_text=lambda self, o : o["lod_name"]), - StkProperty('if', "Visible if...", "", doc="Make this object conditionally visible"), - StkProperty('ifnot', "Visible if not...", "", doc="Make this object conditionally visible") - ], doc="A LOD (level-of-detail) instance, will display either of the LOD Models in this LOD group at this location"), - 'lod_model' : StkEnumChoice('LOD Model', - [StkFloatProperty( id='lod_distance', name="Distance", default=60.0, min=0.0, max=5000.0, - doc="Distance from the camera at which this level of detail starts being used"), - StkProperty( id='lod_name', name="LOD Group Name", default="SomeModel", - doc="Name of the LOD group this object is part of"), - StkProperty( id='name', name="Model Filename", default="", - doc="Name of the model to export"), - StkBoolProperty( id='tangents', name="Use Tangent Space", default="false", - contextLevel=CONTEXT_OBJECT, - doc="Export object in tangent space, which is required for normal maps") - ], doc="A LOD (level-of-detail) model (this model will not be visible in game, only LOD instances will)"), - 'nitro_big' : StkEnumChoice('Nitro (big)', [], doc="A big nitro collectible (apply to an Empty)"), - 'nitro_small' : StkEnumChoice('Nitro (small)', [], doc="A small nitro collectible (apply to an Empty)"), - 'object' : StkEnumChoice('Object', object_properties, doc="An (animatable) object that is exported to a separate model file"), - 'particle_emitter' : StkEnumChoice('Particle Emitter', - [ StkProperty(id='kind', name="Particle File", default="smoke.xml"), - StkIntProperty(id='clip_distance', name="Clip Distance", default=0, - doc="If non-zero, the camera distance at which particles are hidden (for performance reasons)") - ], doc="To be applied to an empty; particles will be emitted from this point"), - 'single_lod' : StkEnumChoice('Single LOD', - [ - StkProperty('name', "Name", "", doc="Name of this object, used to name the model file when exporting (if not specified, the blender name of the object will be used)"), - StkFloatProperty( id='lod_distance', name="Distance", default=60.0, min=0.0, max=5000.0, - doc="Distance from the camera at which this object becomes visible") - ], doc="An object that will only be visible when the camera is close enough (shortcut for LOD objects that don't have multiple levels)"), - 'start' : StkEnumChoice('Start position', subproperties=[StkIntProperty('start_index', "Start Index", 1, - doc="Start position index for battle mode")], - doc="A start position for karts in battle mode (only useful if this track is an arena)"), - 'sfx_emitter' : StkEnumChoice('Sound Emitter', - [ StkProperty( id='sfx_filename', name="Sound File", default="some_file.ogg", - doc="Filename of the sound to play"), - StkFloatProperty( id='sfx_volume', name="Sound volume", default=1.0, min=0.0, max=1.0), - StkFloatProperty( id='sfx_rolloff', name="Rolloff rate", default=0.1, min=0.0, max=2.5, - doc="How fast this sound decays when going farther from the emission point"), - StkBoolProperty( id='play_when_near', name="Play on approach", default="false", - contextLevel=CONTEXT_OBJECT, doc="Play when the kart approaches this object", - subproperties=[StkFloatProperty('play_distance', "Play when at distance", 1.0, - doc="Distance at which the sound starts playing when approaching")]), - ], - doc="A sound will be heard when close to this point"), - 'sun' : StkEnumChoice('Sun', - [StkColorProperty('ambient', "Ambient Color", contextLevel=CONTEXT_OBJECT, - doc="Click here to pick an ambient color", default="120 120 120"), - StkColorProperty('diffuse', "Diffuse Color", contextLevel=CONTEXT_OBJECT, - doc="Click here to pick a diffuse color"), - StkColorProperty('specular', "Specular Color", contextLevel=CONTEXT_OBJECT, - doc="Click here to pick a specular color") - ], doc="Set on a sun; used to specify intensity, direction and color of the ambient light in the track"), - 'water' : StkEnumChoice('Water', - [ StkProperty(id='name', name="Name", default="", doc="Name of the model to export"), - StkFloatProperty(id='height', name="Waves Height", default=1.0, min=0.0, doc="Height of the waves"), - StkFloatProperty(id='speed', name="Waves Speed", default=200.0, min=0.0, max=500.0, doc="Speed of the waves"), - StkFloatProperty(id='length', name="Waves Length", default=10.0, min=0.0, doc="Length of the waves") - ], doc="Animate the mesh with waves") - }, contextLevel=CONTEXT_OBJECT, default='none', unique_prefix="track_", doc="SuperTuxKart Object Type") +def parseProperties(node, contextLevel): + props = [] -STK_PER_OBJECT_TRACK_PROPERTIES = [ - type, - StkBoolProperty(id='enable_anim_texture', name='Use animated Texture', default="false", contextLevel=CONTEXT_OBJECT, - subproperties=[ StkProperty(id='anim_texture', name='Texture to animate', default="", - doc="Filename of the texture to animate"), - StkFloatProperty(id='anim_dx', name='Animation X Speed', default=0.0, min=0.0), - StkFloatProperty(id='anim_dy', name='Animation Y Speed', default=0.0, min=0.0) - ], doc="Make a texture on this object move") - ] + for e in node.childNodes: + if e.localName == None: + continue + + elif e.localName == "StringProp": + defaultval = e.getAttribute("default") + if defaultval == "$user": + defaultval = getpass.getuser() + + if node.hasAttribute("doc"): + props.append(StkProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=defaultval, + doc=e.getAttribute("doc"))) + else: + props.append(StkProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=defaultval)) + + elif e.localName == "EnumProp": + + args = dict() + args["id"] = e.getAttribute("id") + args["name"] = e.getAttribute("name") + args["default"] = e.getAttribute("default") + + if node.hasAttribute("unique_prefix"): + args["unique_prefix"] = node.getAttribute("unique_prefix") + + if node.hasAttribute("doc"): + args["doc"] = node.getAttribute("doc") + + args["values"] = readEnumValues(e.childNodes, contextLevel) + args["contextLevel"] = contextLevel + + props.append(StkEnumProperty(**args)) + + elif e.localName == "CombinableEnumProp": + + args = dict() + args["id"] = e.getAttribute("id") + args["name"] = e.getAttribute("name") + args["default"] = e.getAttribute("default") + + if node.hasAttribute("unique_prefix"): + args["unique_prefix"] = node.getAttribute("unique_prefix") + + args["values"] = readEnumValues(e.childNodes, contextLevel) + args["contextLevel"] = contextLevel + + props.append(StkCombinableEnumProperty(**args)) + + elif e.localName == "IntProp": + if node.hasAttribute("doc"): + props.append(StkIntProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=int(e.getAttribute("default")), + doc=e.getAttribute("doc"))) + else: + props.append(StkIntProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=int(e.getAttribute("default")))) + + elif e.localName == "FloatProp": + args = dict() + args["id"] = e.getAttribute("id") + args["name"] = e.getAttribute("name") + args["default"] = float(e.getAttribute("default")) + + if node.hasAttribute("doc"): + args["doc"] = e.getAttribute("doc") + if node.hasAttribute("min"): + args["min"] = float(e.getAttribute("min")) + if node.hasAttribute("max"): + args["max"] = float(e.getAttribute("max")) + + props.append(StkFloatProperty(**args)) + + elif e.localName == "ColorProp": + if node.hasAttribute("doc"): + props.append(StkColorProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=e.getAttribute("default"), + doc=e.getAttribute("doc"), contextLevel=contextLevel)) + else: + props.append(StkColorProperty(id=e.getAttribute("id"), name=e.getAttribute("name"), default=e.getAttribute("default"), + contextLevel=contextLevel)) + + elif e.localName == "BoolProp": + + args = dict() + args["id"] = e.getAttribute("id") + args["name"] = e.getAttribute("name") + args["default"] = e.getAttribute("default") + args["subproperties"] = parseProperties(e, contextLevel) + args["contextLevel"] = contextLevel + + if node.hasAttribute("doc"): + args["doc"] = e.getAttribute("doc") + + if node.hasAttribute("box"): + args["box"] = bool(e.getAttribute("box")) + + props.append(StkBoolProperty(**args)) -STK_PER_OBJECT_KART_PROPERTIES = [ - StkEnumProperty('type', "Type", values=OrderedDict([ ('' , StkEnumChoice('None', [])), - ('none' , StkEnumChoice('None', [])), - ('wheel' , StkEnumChoice('Wheel', [])), - ('ignore', StkEnumChoice('Ignore', [])) - ]), - contextLevel=CONTEXT_OBJECT, default='none', unique_prefix="kart_", doc="Supertuxkart Object Type") - ] + elif e.localName == "ObjRefProp": + args = dict() + args["id"] = e.getAttribute("id") + args["name"] = e.getAttribute("name") + args["default"] = e.getAttribute("default") + args["contextLevel"] = contextLevel + args["filter"] = exec(e.getAttribute("filter")) + + if node.hasAttribute("static_objects"): + args["static_objects"] = exec(e.getAttribute("static_objects")) + + if node.hasAttribute("doc"): + args["doc"] = e.getAttribute("doc") + + if node.hasAttribute("unique_id_suffix"): + args["unique_id_suffix"] = node.getAttribute("unique_id_suffix") + + if node.hasAttribute("obj_identifier"): + args["obj_identifier"] = exec(e.getAttribute("obj_identifier")) + + if node.hasAttribute("obj_text"): + args["obj_text"] = exec(e.getAttribute("obj_text")) + + props.append(StkObjectReferenceProperty(**args)) + + return props + +def getPropertiesFromXML(filename, contextLevel): + node = xml.dom.minidom.parse(filename) + for curr in node.childNodes: + if curr.localName == "Properties": + return parseProperties(curr, contextLevel) + raise Exception("No <Properties> node in " + filename) -SKY_TYPES = { - 'none' : StkEnumChoice('None', [], doc="No sky (useful for indoor scenes)"), - 'box' : StkEnumChoice('Box', - [StkProperty(id='sky_texture2', name='Sky Texture Top', default=""), - StkProperty(id='sky_texture3', name='Sky Texture Bottom', default=""), - StkProperty(id='sky_texture4', name='Sky Texture East', default=""), - StkProperty(id='sky_texture5', name='Sky Texture West', default=""), - StkProperty(id='sky_texture1', name='Sky Texture North', default=""), - StkProperty(id='sky_texture6', name='Sky Texture South', default="") - ]), - 'dome' : StkEnumChoice('Dome', - [ StkProperty(id='sky_texture', name='Sky Texture', default=""), - StkIntProperty(id='sky_horizontal', name='Horizontal Definition', default=20), - StkIntProperty(id='sky_vertical', name='Vertical Definition', default=20), - StkFloatProperty(id='sky_texture_percent', name='Sky Texture Percent', default=1.0, min=0.0, max=1.0, - doc="How much of the height of the texture is used"), - StkFloatProperty(id='sky_sphere_percent', name='Sky Sphere Percent', default=1.3, min=0.0, max=2.0, - doc="1.0 : half-sphere; 2.0 : full sphere"), - StkFloatProperty(id='sky_speed_x', name='Sky Speed X', default=0.0, min=0.0, max=10.0, - doc="Speed at which the sky moves horizontally"), - StkFloatProperty(id='sky_speed_y', name='Sky Speed Y', default=0.0, min=0.0, max=10.0, - doc="Speed at which the sky moves vertically") - ]), - 'simple' : StkEnumChoice('Plain color', - [StkColorProperty(id="sky_color", name="Sky Color", default="77 104 255", contextLevel=CONTEXT_SCENE, - doc="Click here to select the color of the sky")], - doc="A plain-color sky") - } +import os.path +datapath = os.path.join(bpy.utils.script_paths()[0], "addons", "stkdata") +SCENE_PROPS = getPropertiesFromXML(os.path.join(datapath, "stk_panel_parameters.xml"), contextLevel=CONTEXT_SCENE) +STK_PER_OBJECT_TRACK_PROPERTIES = getPropertiesFromXML(os.path.join(datapath, "stk_object_parameters.xml"), contextLevel=CONTEXT_OBJECT) +STK_MATERIAL_PROPERTIES = getPropertiesFromXML(os.path.join(datapath, "stk_material_parameters.xml"), contextLevel=CONTEXT_MATERIAL) -FOG_PROPERTIES = [StkColorProperty(id='fog_color', name='Fog Color', default="0 0 0", contextLevel=CONTEXT_SCENE, - doc="Click here to pick the color of the fog"), - StkFloatProperty(id='fog_start', name='Fog Start', default=50.0, min=0.0, max=1000.0, - doc="Distance from camera at which fog starts dimming objects"), - StkFloatProperty(id='fog_end', name='Fog End', default=300.0, min=0.0, max=1000.0, - doc="Distance from camera at which fog is so dense you can't see a thing") - ] - -WEATHER = {'none' : StkEnumChoice("None",[]), - 'rain' : StkEnumChoice("Rain",[]), - 'snow' : StkEnumChoice("Snow",[]) - } - -# these names are just waaaay too long to fit in the table below -k = ['start_karts_per_row', 'start_forwards_distance', 'start_sidewards_distance', 'start_upwards_distance'] -kk = ['Karts per row on start', 'Start Forwards Distance', 'Start Sidewards Distance', 'Start upwards distance'] - -STK_TRACK_WIDE_PROPERTIES = [ - StkProperty( id='name', name='Name', default='My New Track', - doc="Name of the track"), - StkProperty( id='groups', name='Groups', default='standard', - doc="Tabs in track selection screen this track appears under"), - StkProperty( id='designer', name='Designer', default=getpass.getuser(), - doc="Name of the person that made this track"), - StkProperty( id='music', name='Music', default='kart_grand_prix.music', - doc="Music played in this track"), - StkProperty( id='screenshot', name='Screenshot', default='screenshot.jpg', - doc="Name of the file that contains a screenshot of this track"), - StkEnumProperty( id='sky_type', name='Sky Type', default='dome', - contextLevel=CONTEXT_SCENE, values=SKY_TYPES, doc="The type of sky"), - StkBoolProperty( id='arena', name='Battle Arena', default="false", - contextLevel=CONTEXT_SCENE, doc="Whether this scene is a battle arena"), - StkBoolProperty( id='fog', name='Fog', default='false', - contextLevel=CONTEXT_SCENE, subproperties=FOG_PROPERTIES, doc="Whether to enable fog in the track"), - StkFloatProperty( id='camera_far', name='Camera Far Clip', default=1000.0, - doc="Distance from camera at which objects are clipped (no more visible)"), - StkIntProperty( id=k[0], name=kk[0], default=2), - StkFloatProperty( id=k[1], name=kk[1], default=1.1), - StkFloatProperty( id=k[2], name=kk[2], default=1.1), - StkFloatProperty( id=k[3], name=kk[3], default=1.1), - StkEnumProperty( id='weather', name='Weather', default='none', - contextLevel=CONTEXT_SCENE, values=WEATHER, doc="The weather effect to use in this track") - ] - -COMPOSITING_VALUES = {'none' : StkEnumChoice("None", []), - 'blend' : StkEnumChoice("Alpha Blend", [], - doc="Use transparency on this texture, using the alpha channel or a specified external mask"), - 'test' : StkEnumChoice("Alpha Test", [], - doc="Use fully-opaque-or-fully-transparent transparency on this texture, using the alpha channel or a specified external mask"), - 'coverage' : StkEnumChoice("Alpha to Coverage", [], - doc="Like alpha testing but with softer edges"), - 'additive' : StkEnumChoice("Additive Blending", [], - doc="Brighten up anything under by adding the current color on top (useful for fire or light)") - } - -GFX_VALUES = {'none' : StkEnumChoice("None", []), - 'bubble' : StkEnumChoice("Bubble (wavy texture)", []), - 'water' : StkEnumChoice("Water Splash", []) - } - -SLOWDOWN_PROPERTIES = [ - StkFloatProperty( id='slowdown_time', name="Slowdown Time (seconds)", default=1.0, min=0.0, max=10.0, - doc="Time it takes for speed to drop to its low point when driving here" ), - StkFloatProperty( id='max_speed', name="Maximum Speed (fraction)", default=1.0, min=0.0, max=1.0, - doc="Fraction of the maximum speed can be reached when driving here" ) - ] - -PARTICLE_PROPERTIES = [ - StkProperty( id='particle_base', name="Particles file", default="smoke.xml", - doc="Name of the XML file containing the description of particles to use on this terrain"), - StkCombinableEnumProperty( id='particle_condition', name="Use particles when...", default="skid", contextLevel=CONTEXT_MATERIAL, - values={'skid' : StkEnumChoice('Skid', [], doc="Use particle when skidding"), - 'drive' : StkEnumChoice('Drive', [], doc="Use particles during regular driving")}) - ] - -long_names = ['zipper_max_speed_increase', "Zipper max speed increase", 'zipper_fade_out_time', "Zipper fade out time"] - -ZIPPER_PROPERTIES = [ - StkFloatProperty( id='zipper_duration', name="Zipper duration", default=3.5, min=0.0, max=10.0), - StkFloatProperty( id=long_names[0], name=long_names[1], default=15.0, min=0.0, max=25.0), - StkFloatProperty( id=long_names[2], name=long_names[3], default=3.0, min=0.0, max=10.0), - StkFloatProperty( id='zipper_speed_gain', name="Zipper speed gain", default=4.5, min=0.0, max=10.0) - ] - -# TODO: only enable rolloff if positional is checked - -SFX_PROPERTIES = [ - StkProperty( id='sfx_filename', name="Sound File", default="some_file.ogg"), - StkFloatProperty( id='sfx_min_speed', name="Minimum kart speed", default=0.0), - StkFloatProperty( id='sfx_max_speed', name="Maximum kart speed", default=0.0), - StkFloatProperty( id='sfx_min_pitch', name="Sound pitch at min speed", default=0.8, min=0.1, max=3.0, - doc="Pitch of the sound when the kart is going slowly (1.0 is no change, < 1.0 is lower pitch, > 1.0 is higher pitch)"), - StkFloatProperty( id='sfx_max_pitch', name="Sound pitch at max speed", default=1.2, min=0.1, max=3.0, - doc="Pitch of the sound when the kart is going fastly (1.0 is no change, < 1.0 is lower pitch, > 1.0 is higher pitch)"), - StkBoolProperty( id='sfx_positional', name="Positional sound effect", default="true", contextLevel=CONTEXT_MATERIAL, - doc="If true, the sound will get dimmer when far from camera, and with panning; if false, it's heard at centered pan and at full volume"), - StkFloatProperty( id='sfx_rolloff', name="Rolloff rate", default=0.1, min=0.0, max=2.5, - doc="Speed at which the sound fades out as you stand further from the sound emitter") - ] - -COLLISION_DETECTION_PROPERTIES = [StkEnumProperty( id='collision_reaction', name="Action", default='none', contextLevel=CONTEXT_MATERIAL, - values={'none' : StkEnumChoice("None", []), - 'reset' : StkEnumChoice("Rescue kart", []), - 'push' : StkEnumChoice("Push back kart", [])}, - doc="How to react when kart touches this material"), - StkProperty( id='collision_particles', name="Particles on hit", default="")] - -STK_MATERIAL_PROPERTIES = [ - StkBoolProperty( id='fog', name="Affected by fog (if any)", default="true", contextLevel=CONTEXT_MATERIAL, - doc="Whether this material is affected by fog (if there is fog in this track)"), - StkBoolProperty( id='light', name="Affected by lights", default="true", contextLevel=CONTEXT_MATERIAL, - doc="Whether this material is affected by lights and shadows"), - StkBoolProperty( id='backface_culling', name="Backface Culling", default="true", contextLevel=CONTEXT_MATERIAL, - doc="If checked, this material will only be visible on the side of the normal"), - StkBoolProperty( id='below_surface', name="Below Surface", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Used for the terrain under shallow water where you can drive"), - StkBoolProperty( id='clampu', name="Clamp texture horizontally", default="false", contextLevel=CONTEXT_MATERIAL, - doc="if checked, this texture will not be repeated horizontally (if the UV texturing goes beyond the texture bounds)"), - StkBoolProperty( id='clampv', name="Clamp texture vertically", default="false", contextLevel=CONTEXT_MATERIAL, - doc="if checked, this texture will not be repeated vertically (if the UV texturing goes beyond the texture bounds)"), - StkBoolProperty( id='collision_detect', name="Collision action", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=COLLISION_DETECTION_PROPERTIES, doc="What happens when the kart touches/hits this material in any way"), - StkEnumProperty( id='compositing', name="Compositing Type", default='none', contextLevel=CONTEXT_MATERIAL, - values=COMPOSITING_VALUES, doc="How to composite this texture with what is behind it"), - StkBoolProperty( id='disable_z_write', name="Disable writing to Z-buffer",default="false", contextLevel=CONTEXT_MATERIAL, - doc="disable writing to the Z buffer (useful for materials with transparency, if irrlicht fails to do proper alpha sorting, in order not to hide what is behind)"), - StkBoolProperty( id='use_slowdown', name="Enable Slowdown", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=SLOWDOWN_PROPERTIES, doc="Whether to slow down the kart when driving on this material"), - StkBoolProperty( id='falling_effect', name="Falling Effect", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Whether this material is the bottom of a pit (then camera will look down at kart falling when over it)"), - StkEnumProperty( id='graphical_effect', name="Graphical Effect", default='none', contextLevel=CONTEXT_MATERIAL, - values=GFX_VALUES, doc="Select a special graphical effect"), - StkBoolProperty( id='high_adhesion', name="High tires adhesion", default="false", contextLevel=CONTEXT_MATERIAL, - doc="If checked, karts will have good grip on this surface and not slip, even at angles"), - StkBoolProperty( id='ignore', name="Ignore (ghost material)", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Drive through this texture like it didn't exist (good for smoke, etc.)"), - StkBoolProperty( id='additive_lightmap',name="Lightmap is additive", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Make lightmap additive (only makes sense if this material has a lightmap)"), - StkProperty( id='mask', name="Mask image", default="", - doc="Greyscale image containing the alpha channel (transparency) for this image"), - StkBoolProperty( id='use_normal_map',name="Normal Map", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Use a normal map for this image", - subproperties= - [ - StkProperty( id='normal_map', name="Normal Map Image", default="", - doc="Image containing the normal map for this texture (optional)") - ]), - StkBoolProperty( id='particle', name="Particle effect", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=PARTICLE_PROPERTIES, doc="Whether to emit particles (e.g. smoke) when driving on this surface"), - StkBoolProperty( id='use_sfx', name="Play sound effect", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=SFX_PROPERTIES, doc="Whether to play a sound when driving on this surface"), - StkBoolProperty( id='reset', name="Reset kart (on drive)", default="false", contextLevel=CONTEXT_MATERIAL, - doc="whether to rescue kart if it ends up [driving] on this surface"), - StkBoolProperty( id='sphere', name="Sphere mapping", default="false", contextLevel=CONTEXT_MATERIAL, - doc="use sphere mapping on this object (mainly used to simulate a reflection effect)"), - StkBoolProperty( id='splatting', name="Splatting", default="false", contextLevel=CONTEXT_MATERIAL, - doc="Use splatting (multiple textures with smooth transitions)", subproperties= - [ - StkProperty(id='splatting_texture_1', name="Red Texture", default=""), - StkProperty(id='splatting_texture_2', name="Green Texture", default=""), - StkProperty(id='splatting_texture_3', name="Blue Texture", default=""), - StkProperty(id='splatting_texture_4', name="Black Texture", default="") - ]), - StkBoolProperty( id='surface', name="Surface", default="false", contextLevel=CONTEXT_MATERIAL, - doc="whether this material is the surface of a water area"), - StkBoolProperty( id='water_shader', name="Water Shader", default="false", contextLevel=CONTEXT_MATERIAL, - doc="If checked, a shader will simulate light reflexions and moving waves on this surface", subproperties= - [ - StkFloatProperty(id='water_shader_speed_1', name="Main wave speed", default=6.6667), - StkFloatProperty(id='water_shader_speed_2', name="Secondary wave speed", default=4.0) - ]), - StkBoolProperty( id='zipper', name="Zipper (speed boost)", default="false", contextLevel=CONTEXT_MATERIAL, - subproperties=ZIPPER_PROPERTIES, doc="Whether to get a speed boost when driving on this surface") - ] - -ENGINE_SOUNDS = {'large' : StkEnumChoice("Large", []), - 'small' : StkEnumChoice("Small", []) - } - - -STK_KART_PROPERTIES = [ - StkProperty( id='name', name='Name', default='My New Kart'), - StkProperty( id='group', name='Group', default='standard'), - StkProperty( id='icon', name='Icon', default='icon.png', - doc="Filename of the icon to display in the kart selection screen"), - StkProperty( id='minimap_icon', name='Minimap Icon', default='icon.png', - doc="Filename of the icon to display on the minimap"), - StkProperty( id='shadow', name='Shadow', default='generic_shadow.png', - doc="Filename of the file containing the shadow of this kart"), - StkColorProperty( id='color', name="Color", default="255 255 255", contextLevel=CONTEXT_SCENE, - doc="Color used to highlight the kart's icon in the interface"), - StkFloatProperty( id='center_shift', name="Gravity Center Shift", default=0.0, - doc="Can be used to lower the gravity center of the kart if it topples over too easily"), - StkEnumProperty( id='engine_sfx', name='Engine sound', default='large', contextLevel=CONTEXT_SCENE, - values=ENGINE_SOUNDS) - ] - - -SCENE_PROPS = [ StkBoolProperty(id='is_stk_track', name='Is a SuperTuxKart track', default='false', contextLevel=CONTEXT_SCENE, - subproperties=STK_TRACK_WIDE_PROPERTIES, box=False, - doc="Check this if this blender file is a SuperTuxKart track"), - StkBoolProperty(id='is_stk_kart', name='Is a SuperTuxKart kart', default='false', contextLevel=CONTEXT_SCENE, - subproperties=STK_KART_PROPERTIES, box=False, - doc="Check this if this blender file is a SuperTuxKart kart") - ] - # ==== PANEL BASE ==== class PanelBase: Added: media/trunk/blender_25/stkdata/stk_material_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_material_parameters.xml (rev 0) +++ media/trunk/blender_25/stkdata/stk_material_parameters.xml 2012-04-01 01:03:08 UTC (rev 11056) @@ -0,0 +1,153 @@ +<?xml version="1.0"?> +<Properties> + <!-- Affected by fog --> + <BoolProp id="fog" name="Affected by fog (if any)" default="true" + doc="Whether this material is affected by fog (if there is fog in this track)"/> + + <!-- Affected by lights --> + <BoolProp id="light" name="Affected by lights" default="true" + doc="Whether this material is affected by lights and shadows"/> + + <!-- Backface culling --> + <BoolProp id="backface_culling" name="Backface Culling" default="true" + doc="If checked, this material will only be visible on the side of the normal"/> + + <!-- Below shallow water --> + <BoolProp id="below_surface" name="Below shallow water" default="false" + doc="Used for the terrain under shallow water where you can drive"/> + + <!-- Clamp --> + <BoolProp id="clampu" name="Clamp texture horizontally" default="false" + doc="if checked, this texture will not be repeated horizontally (if the UV texturing goes beyond the texture bounds)"/> + <BoolProp id="clampv" name="Clamp texture vertically" default="false" + doc="if checked, this texture will not be repeated vertically (if the UV texturing goes beyond the texture bounds)"/> + + <!-- Collision --> + <BoolProp id="collision_detect" name="Collision action" default="false" + doc="What happens when the kart touches/hits this material in any way"> + <EnumProp id="collision_reaction" name="Action" default="none" doc="How to react when kart touches this material"> + <EnumChoice id="none" label="None"/> + <EnumChoice id="reset" label="Rescue kart"/> + <EnumChoice id="push" label="Push back kart"/> + </EnumProp> + <StringProp id="collision_particles" name="Particles on hit" default=""/> + </BoolProp> + + <!-- Compositing --> + <EnumProp id="compositing" name="Compositing Type" default="none" doc="How to composite this texture with what is behind it"> + <EnumChoice id="none" label="None"/> + <EnumChoice id="blend" label="Alpha Blend" doc="Use transparency on this texture, using the alpha channel or a specified external mask"/> + <EnumChoice id="test" label="Alpha Test" doc="Use fully-opaque-or-fully-transparent transparency on this texture, using the alpha channel or a specified external mask"/> + <EnumChoice id="coverage" label="Alpha to Coverage" doc="Like alpha testing but with softer edges"/> + <EnumChoice id="additive" label="Additive Blending" doc="Brighten up anything under by adding the current color on top (useful for fire or light)"/> + </EnumProp> + + <!-- Disable writing to Z buffer --> + <BoolProp id="disable_z_write" name="Disable writing to Z-buffer" default="false" + doc="disable writing to the Z buffer (useful for materials with transparency, if irrlicht fails to do proper alpha sorting, in order not to hide what is behind)"/> + + <!-- Slowdown --> + <BoolProp id="use_slowdown" name="Enable Slowdow" default="false" + doc="Whether to slow down the kart when driving on this material"> + <FloatProp id="slowdown_time" name="Slowdown Time (seconds)" default="1.0" min="0.0" max="10.0" + doc="Time it takes for speed to drop to its low point when driving here"/> + <FloatProp id="max_speed" name="Maximum Speed (fraction)" default="1.0" min="0.0" max="1.0" + doc="Fraction of the maximum speed can be reached when driving here"/> + </BoolProp> + + <!-- Falling effect --> + <BoolProp id="falling_effect" name="Falling Effect" default="false" + doc="Whether this material is the bottom of a pit (then camera will look down at kart falling when over it)"/> + + <!-- Graphical effect --> + <EnumProp id="graphical_effect" name="Graphical Effect" default="none" doc="elect a special graphical effect"> + <EnumChoice id="none" label="None"/> + <EnumChoice id="bubble" label="Bubble (wavy texture)"/> + <EnumChoice id="water" label="Water Splash"/> + </EnumProp> + + <!-- High tire adhesion --> + <BoolProp id="high_adhesion" name="High tires adhesion" default="false" + doc="If checked, karts will have good grip on this surface and not slip, even at angles"/> + + <!-- Ignore --> + <BoolProp id="ignore" name="Ignore (ghost material)" default="false" + doc="Drive through this texture like it didn't exist (good for smoke, etc.)"/> + + <!-- Additive lightmap --> + <BoolProp id="additive_lightmap" name="Lightmap is additive" default="false" + doc="Make lightmap additive (only makes sense if this material has a lightmap)"/> + + <!-- Mask --> + <StringProp id="mask" name="Mask image" default="" doc="Greyscale image containing the alpha channel (transparency) for this image"/> + + <!-- Normal map --> + <BoolProp id="use_normal_map" name="Normal Map" default="false" + doc="Use normal maps for this material (the model must be exported as tangent for this to work)"> + <StringProp id="normal_map" name="Normal Map Image" default="" doc="Image containing the normal map for this texture (optional)"/> + </BoolProp> + + <!-- Particles --> + <BoolProp id="particle" name="Particle effect" default="false" + doc="Whether to emit particles (e.g. smoke) when driving on this surface"> + <StringProp id="particle_base" name="Particles file" default="smoke.xml" doc="Name of the XML file containing the description of particles to use on this terrain"/> + <CombinableEnumProp id="particle_condition" name="Use particles when..." default="skid" doc="elect a special graphical effect"> + <EnumChoice id="skid" label="Skid" doc="Use particle when skidding"/> + <EnumChoice id="drive" label="Drive" doc="Use particles during regular driving"/> + </CombinableEnumProp> + </BoolProp> + + <!-- SFX --> + <BoolProp id="use_sfx" name="Play sound effect" default="false" + doc="Whether to play a sound when driving on this surface"> + <!-- TODO: only enable rolloff if positional is checked --> + <StringProp id="sfx_filename" name="Sound File" default="some_file.ogg"/> + <FloatProp id="sfx_min_speed" name="Minimum kart speed" default="5.0" min="0.0"/> + <FloatProp id="sfx_max_speed" name="Maximum kart speed" default="15.0" min="0.0"/> + <FloatProp id="sfx_min_pitch" name="Sound pitch at min speed" default="0.8" min="0.1" max="3.0" + doc="Pitch of the sound when the kart is going slowly (1.0 is no change, < 1.0 is lower pitch, > 1.0 is higher pitch)"/> + <FloatProp id="sfx_max_pitch" name="Sound pitch at max speed" default="1.2" min="0.1" max="3.0" + doc="Pitch of the sound when the kart is going fastly (1.0 is no change, < 1.0 is lower pitch, > 1.0 is higher pitch)"/> + <BoolProp id="sfx_positional" name="Positional sound effect" default="true" + doc="If true, the sound will get dimmer when far from camera, and with panning; if false, it's heard at centered pan and at full volume"/> + <FloatProp id="sfx_rolloff" name="Rolloff rate" default="0.1" min="0.0" max="2.5" + doc="Speed at which the sound fades out as you stand further from the sound emitter"/> + </BoolProp> + + <!-- Reset --> + <BoolProp id="reset" name="Reset kart (on drive)" default="false" + doc="whether to rescue kart if it ends up [driving] on this surface"/> + + <!-- Sphere --> + <BoolProp id="sphere" name="Sphere mapping" default="false" + doc="use sphere mapping on this object (mainly used to simulate a reflection effect)"/> + + <!-- Splatting --> + <BoolProp id="splatting" name="Splatting" default="false" + doc="Use splatting (multiple textures with smooth transitions)"> + <StringProp id="splatting_texture_1" name="Red Texture" default=""/> + <StringProp id="splatting_texture_2" name="Green Texture" default=""/> + <StringProp id="splatting_texture_3" name="Blue Texture" default=""/> + <StringProp id="splatting_texture_4" name="Black Texture" default=""/> + </BoolProp> + + <!-- Surface --> + <BoolProp id="surface" name="Surface" default="false" + doc="whether this material is the surface of a water area"/> + + <!-- Water --> + <BoolProp id="water_shader" name="Water Shader" default="false" + doc="If checked, a shader will simulate light reflexions and moving waves on this surface"> + <FloatProp id="water_shader_speed_1" name="Main wave speed" default="6.6667" min="0.0"/> + <FloatProp id="water_shader_speed_2" name="Secondary wave speed" default="4.0" min="0.0"/> + </BoolProp> + + <!-- Zipper --> + <BoolProp id="zipper" name="Zipper (speed boost)" default="false" + doc="Whether to get a speed boost when driving on this surface"> + <FloatProp id="zipper_duration" name="Zipper duration" default="3.5" min="0.0" max="10.0"/> + <FloatProp id="zipper_max_speed_increase" name="Zipper max speed increase" default="15.0" min="0.0" max="25.0"/> + <FloatProp id="zipper_fade_out_time" name="Zipper fade out time" default="3.0" min="0.0" max="10.0"/> + <FloatProp id="zipper_speed_gain" name="Zipper speed gain" default="4.5" min="0.0" max="10.0"/> + </BoolProp> +</Properties> Added: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml (rev 0) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-04-01 01:03:08 UTC (rev 11056) @@ -0,0 +1,202 @@ +<?xml version="1.0"?> +<Properties> + + <BoolProp id="enable_anim_texture" name="Use animated Texture" default="false" doc="Make a texture on this object move"> + <StringProp id="anim_texture" name="Texture to animate" default="" doc="Filename of the texture to animate"/> + <FloatProp id="anim_dx" name="Animation X Speed" default="0.0" min="0.0"/> + <FloatProp id="anim_dy" name="Animation Y Speed" default="0.0" min="0.0"/> + </BoolProp> + + <!-- ******** STK Object Type ******** --> + <EnumProp id="type" name="Type" default="none" doc="SuperTuxKart Object Type" unique_prefix="objtype_"> + + <!-- None --> + <EnumChoice id="" label="None" doc="N... [truncated message content] |
From: <au...@us...> - 2012-04-01 02:54:20
|
Revision: 11060 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11060&view=rev Author: auria Date: 2012-04-01 02:54:13 +0000 (Sun, 01 Apr 2012) Log Message: ----------- Start working on exporting cannons 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 2012-04-01 01:44:22 UTC (rev 11059) +++ media/trunk/blender_25/stk_track.py 2012-04-01 02:54:13 UTC (rev 11060) @@ -1364,7 +1364,33 @@ except: log_error("Invalid action <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) + + # -------------------------------------------------------------------------- + # Writes out all checklines. + # \param lChecks All check meshes + # \param mainDriveline The main driveline, from which the lap + # counting check line is determined. + def writeCannon(self, f, cannon): + + start = cannon[0] + end = cannon[1] + if len(start.data.vertices) != 2: + log_warning("Cannon start " + start.name + " is not a line made of 2 vertices as expected") + if len(end.data.vertices) != 2: + log_warning("Cannon end " + end.name + " is not a line made of 2 vertices as expected") + + startloc = start.location + endloc = end.location + + f.write(' <cannon speed="%.2f" p1="%.2f %.2f %.2f" p2="%.2f %.2f %.2f" target-p1="%.2f %.2f %.2f" target-p2="%.2f %.2f %.2f">\n'%\ + (getProperty(start, "cannonspeed", 50.0), + start.data.vertices[0].co[0] + startloc[0], start.data.vertices[0].co[2] + startloc[2], start.data.vertices[0].co[1] + startloc[1], + start.data.vertices[1].co[0] + startloc[0], start.data.vertices[1].co[2] + startloc[2], start.data.vertices[1].co[1] + startloc[1], + end.data.vertices[0].co[0] + endloc[0], end.data.vertices[0].co[2] + endloc[2], end.data.vertices[0].co[1] + endloc[1], + end.data.vertices[1].co[0] + endloc[0], end.data.vertices[1].co[2] + endloc[2], end.data.vertices[1].co[1] + endloc[1])) + f.write(' </cannon>\n') + # -------------------------------------------------------------------------- # Writes out all checklines. # \param lChecks All check meshes @@ -1695,7 +1721,7 @@ # Writes the scene files, which includes all models, animations, and items def writeSceneFile(self, sPath, sTrackName, lWater, lTrack, lItems, lObjects, lBillboards, lParticleEmitters, lSoundEmitters, lActionTriggers, lChecks, lSun, mainDriveline, - lStart, lEndCameras, lCameraCurves): + lStart, lEndCameras, lCameraCurves, lCannons): #start_time = bsys.time() print("Writing scene file --> \t") @@ -1856,6 +1882,9 @@ log_warning("No check defined, lap counting will not work properly!") self.writeChecks(f, lChecks, mainDriveline) + for cannon in lCannons: + self.writeCannon(f, cannon) + scene = the_scene sky = getIdProperty(scene, "sky_type", None) # Note that there is a limit to the length of id properties, @@ -1938,6 +1967,7 @@ lChecks = [] # All check structures lSun = [] lStart = [] # All start positions + lCannons = [] for obj in lObj: # Try to get the supertuxkart type field. If it's not defined, # use the name of the objects as type. @@ -1978,8 +2008,7 @@ lActionTriggers.append(obj) continue else: - print("Empty '%s' has type '%s' which is not valid - ignored."%\ - (obj.name, stktype)) + log_warning("Empty '%s' has type '%s' which is not valid - ignored."%(obj.name, stktype)) elif obj.type=="CURVE": # Only append camera, other curves will be handled in animations if stktype[:6]=="CAMERA": lCameraCurves.append(obj) @@ -2011,6 +2040,14 @@ # for billboard elif stktype=="BILLBOARD": lBillboards.append(obj) + elif stktype=="CANNONSTART": + end = getProperty(obj, "cannonend", "") + if len(end) == 0: + log_warning("Cannon " + obj.name + " has no associated end") + continue + lCannons.append( (obj, bpy.data.objects[end]) ) + elif stktype=="CANNONEND": + pass # cannon ends are handled with cannon start objects elif stktype=="NONE": lTrack.append(obj) else: @@ -2067,7 +2104,7 @@ lDrivelines=[None] self.writeSceneFile(sPath, sTrackName, lWater, lTrack, lItems, lObjects, lBillboards, lParticleEmitters, lSoundEmitters, lActionTriggers, - lChecks, lSun, lDrivelines[0], lStart, lEndCameras, lCameraCurves) + lChecks, lSun, lDrivelines[0], lStart, lEndCameras, lCameraCurves, lCannons) # materials file # ---------- if 'stk_material_exporter' not in dir(bpy.ops.screen): Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-04-01 01:44:22 UTC (rev 11059) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-04-01 02:54:13 UTC (rev 11060) @@ -33,6 +33,20 @@ </BoolProp> </EnumChoice> + <!-- Cannon --> + <EnumChoice id="cannonstart" label="Cannon Start" doc="A 'cannon' defines a fly path for the kart. This should be assigned to a line indicating the start of the flight." > + <ObjRefProp id="cannonend" name="Flight end line" default="" + filter="lambda self, o : 'type' in o and o['type'] == 'cannonend'" + doc="The flight end line associated with this flight start line"/> + <ObjRefProp id="cannonpath" name="Path" default="" + filter="lambda self, o : o.type == 'CURVE'" + doc="Path that the kart will follow while flying"/> + <FloatProp id="cannonspeed" name="Speed" default="50.0" min="0.0" max="250.0" doc="Speed at which the kart flies"/> + </EnumChoice> + + <EnumChoice id="cannonend" label="Cannon End" doc="A 'cannon' defines a fly path for the kart. This should be assigned to a line indicating the end of the flight." > + </EnumChoice> + <!-- Drivelines and checklines --> <EnumChoice id="check" label="Checkline" doc="A checkline that the player must cross (used to forbid shortcuts)" > <StringProp id="name" name="Name" default="" doc="Name of the checkline"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-04-23 00:36:33
|
Revision: 11140 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11140&view=rev Author: auria Date: 2012-04-23 00:36:27 +0000 (Mon, 23 Apr 2012) Log Message: ----------- Restore some kart properties lost in the conversion to XML, oops Modified Paths: -------------- media/trunk/blender_25/stk_panel.py Added Paths: ----------- media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml Modified: media/trunk/blender_25/stk_panel.py =================================================================== --- media/trunk/blender_25/stk_panel.py 2012-04-23 00:31:12 UTC (rev 11139) +++ media/trunk/blender_25/stk_panel.py 2012-04-23 00:36:27 UTC (rev 11140) @@ -731,6 +731,7 @@ SCENE_PROPS = getPropertiesFromXML(os.path.join(datapath, "stk_panel_parameters.xml"), contextLevel=CONTEXT_SCENE) STK_PER_OBJECT_TRACK_PROPERTIES = getPropertiesFromXML(os.path.join(datapath, "stk_object_parameters.xml"), contextLevel=CONTEXT_OBJECT) +STK_PER_OBJECT_KART_PROPERTIES = getPropertiesFromXML(os.path.join(datapath, "stk_kart_object_parameters.xml"), contextLevel=CONTEXT_OBJECT) STK_MATERIAL_PROPERTIES = getPropertiesFromXML(os.path.join(datapath, "stk_material_parameters.xml"), contextLevel=CONTEXT_MATERIAL) Added: media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml (rev 0) +++ media/trunk/blender_25/stkdata/stk_kart_object_parameters.xml 2012-04-23 00:36:27 UTC (rev 11140) @@ -0,0 +1,14 @@ +<?xml version="1.0"?> +<Properties> + + <!-- ******** STK Object Type ******** --> + <EnumProp id="type" name="Type" default="none" doc="SuperTuxKart Object Type" unique_prefix="kart_"> + + <!-- None --> + <EnumChoice id="" label="None" doc="Nothing special about this object" /> + <EnumChoice id="none" label="None" doc="Nothing special about this object" /> + + <EnumChoice id="ignore" label="Ignore" doc="Do not export this object" /> + <EnumChoice id="wheel" label="Wheel" doc="This object is a kart wheel" /> + </EnumProp> +</Properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-05-09 00:48:34
|
Revision: 11216 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11216&view=rev Author: auria Date: 2012-05-09 00:48:28 +0000 (Wed, 09 May 2012) Log Message: ----------- Add smooth-normals attribute to panel 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 2012-05-08 07:10:31 UTC (rev 11215) +++ media/trunk/blender_25/stk_track.py 2012-05-09 00:48:28 UTC (rev 11216) @@ -1884,6 +1884,9 @@ weather=weather+".xml" f.write(" <weather particles=\"%s\" />\n"%weather) + smooth_normals = getIdProperty(scene, "smooth_normals", "false") + f.write(" <smooth-normals value=\"%s\" />\n"%smooth_normals) + rad2deg = 180.0/3.1415926 for obj in lItems: name = getProperty(obj, "type", "").lower() Modified: media/trunk/blender_25/stkdata/stk_panel_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_panel_parameters.xml 2012-05-08 07:10:31 UTC (rev 11215) +++ media/trunk/blender_25/stkdata/stk_panel_parameters.xml 2012-05-09 00:48:28 UTC (rev 11216) @@ -49,6 +49,7 @@ <FloatProp id="start_sidewards_distance" name="Start Sidewards Distance" default="1.1"/> <FloatProp id="start_upwards_distance" name="Start upwards distance" default="1.1"/> </BoolProp> + <BoolProp id="smooth_normals" name="Smooth Normals" default="false" doc="Whether to interpolate the normals (gives smoother driving but requires that floors and walls be split)"/> <EnumProp id="weather" name="Weather" default="none" doc="The weather effect to use in this track"> <EnumChoice id="none" label="None" doc="The weather effect to use in this track"/> <EnumChoice id="rain" label="Rain" doc="The weather effect to use in this track"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-06-16 23:37:14
|
Revision: 11312 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11312&view=rev Author: auria Date: 2012-06-16 23:37:08 +0000 (Sat, 16 Jun 2012) Log Message: ----------- Add support for playing sounds at arbitrary times during a cutscene (export scripts) 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 2012-06-16 23:36:14 UTC (rev 11311) +++ media/trunk/blender_25/stk_track.py 2012-06-16 23:37:08 UTC (rev 11312) @@ -1360,10 +1360,14 @@ dist = getProperty(obj, "play_distance", 1.0) play_near_string = " play-when-near=\"true\" distance=\"%.1f\"" % dist - f.write(' <object type="sfx-emitter" sound="%s" rolloff="%s" volume="%s" %s%s/>\n' %\ + conditions_string = "" + if len(getProperty(obj, "sfx_conditions", "")) > 0: + conditions_string = ' conditions="' + getProperty(obj, "sfx_conditions", "") + '"' + + f.write(' <object type="sfx-emitter" sound="%s" rolloff="%s" volume="%s" %s%s%s/>\n' %\ (getProperty(obj, "sfx_filename", "some_sound.ogg"), getProperty(obj, "sfx_rolloff", 0.05), - getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string)) + getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string, conditions_string)) except: log_error("Invalid sound emitter <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-06-16 23:36:14 UTC (rev 11311) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-06-16 23:37:08 UTC (rev 11312) @@ -196,6 +196,7 @@ <FloatProp id="play_distance" name="Play when at distance" default="1.0" min="0.0" max="20.0" doc="Distance at which the sound starts playing when approaching"/> </BoolProp> + <StringProp id="sfx_conditions" name="Sound conditions" default="" doc="For internal use only by STK developers"/> </EnumChoice> <!-- Sun --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-06-30 18:39:58
|
Revision: 11355 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11355&view=rev Author: auria Date: 2012-06-30 18:39:50 +0000 (Sat, 30 Jun 2012) Log Message: ----------- Allow exporting sound rolloff type, animated sfx emitter, animated particle emitter 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 2012-06-30 15:04:05 UTC (rev 11354) +++ media/trunk/blender_25/stk_track.py 2012-06-30 18:39:50 UTC (rev 11355) @@ -1338,11 +1338,16 @@ originXYZ = getXYZHString(obj) if getProperty(obj, "clip_distance", 0) > 0 : - f.write(' <particle-emitter kind="%s" %s clip_distance="%i"/>\n' %\ + f.write(' <particle-emitter kind="%s" %s clip_distance="%i">\n' %\ (getProperty(obj, "kind", 0), originXYZ, getProperty(obj, "clip_distance", 0))) else: - f.write(' <particle-emitter kind="%s" %s/>\n' %\ + f.write(' <particle-emitter kind="%s" %s>\n' %\ (getProperty(obj, "kind", 0), originXYZ)) + + if obj.animation_data and obj.animation_data.action and obj.animation_data.action.fcurves and len(obj.animation_data.action.fcurves) > 0: + self.writeIPO(f, obj.animation_data) + + f.write(' </particle-emitter>\n') except: log_error("Invalid particle emitter <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) @@ -1364,10 +1369,22 @@ if len(getProperty(obj, "sfx_conditions", "")) > 0: conditions_string = ' conditions="' + getProperty(obj, "sfx_conditions", "") + '"' - f.write(' <object type="sfx-emitter" sound="%s" rolloff="%s" volume="%s" %s%s%s/>\n' %\ - (getProperty(obj, "sfx_filename", "some_sound.ogg"), - getProperty(obj, "sfx_rolloff", 0.05), - getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string, conditions_string)) + + if getProperty(obj, "sfx_rolloff_type", "inverse") == "linear": + f.write(' <object type="sfx-emitter" sound="%s" rolloff_type="linear" distance="%.3f" volume="%s" %s%s%s>\n' %\ + (getProperty(obj, "sfx_filename", "some_sound.ogg"), + getProperty(obj, "sfx_rolloff_distance", 10.0), + getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string, conditions_string)) + else: + f.write(' <object type="sfx-emitter" sound="%s" rolloff_type="inverse" rolloff="%.3f" volume="%s" %s%s%s>\n' %\ + (getProperty(obj, "sfx_filename", "some_sound.ogg"), + getProperty(obj, "sfx_rolloff", 0.05), + getProperty(obj, "sfx_volume", 0), originXYZ, play_near_string, conditions_string)) + + if obj.animation_data and obj.animation_data.action and obj.animation_data.action.fcurves and len(obj.animation_data.action.fcurves) > 0: + self.writeIPO(f, obj.animation_data) + + f.write(' </object>\n') except: log_error("Invalid sound emitter <" + getProperty(obj, "name", obj.name) + "> ", sys.exc_info()[0]) Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-06-30 15:04:05 UTC (rev 11354) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-06-30 18:39:50 UTC (rev 11355) @@ -190,8 +190,20 @@ <EnumChoice id="sfx_emitter" label="Sound Emitter" doc="A sound will be heard when close to this point"> <StringProp id="sfx_filename" name="Sound File" default="some_file.ogg" doc="Filename of the sound to play"/> <FloatProp id="sfx_volume" name="Sound volume" default="1.0" min="0.0" max="1.0"/> - <FloatProp id="sfx_rolloff" name="Rolloff rate" default="0.1" min="0.0" max="2.5" - doc="How fast this sound decays when going farther from the emission point"/> + + + <EnumProp id="sfx_rolloff_type" name="Rolloff type" default="inverse" + doc="How the sound fades in when listener approaches"> + <EnumChoice id="inverse" label="Inverse (1/x)"> + <FloatProp id="sfx_rolloff" name="Rolloff rate" default="0.1" min="0.0" max="2.5" + doc="How fast this sound decays when going farther from the emission point"/> + </EnumChoice> + <EnumChoice id="linear" label="Linear"> + <FloatProp id="sfx_rolloff_distance" name="Distance" default="10.0" min="0.0" max="500.0" + doc="Distance at which the sound starts being audible"/> + </EnumChoice> + </EnumProp> + <BoolProp id="play_when_near" name="Play on approach" default="false" doc="Play when the kart approaches this object"> <FloatProp id="play_distance" name="Play when at distance" default="1.0" min="0.0" max="20.0" doc="Distance at which the sound starts playing when approaching"/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-07-26 00:34:24
|
Revision: 11440 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11440&view=rev Author: auria Date: 2012-07-26 00:34:18 +0000 (Thu, 26 Jul 2012) Log Message: ----------- Allow exporting LOD objects with ghost interaction 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 2012-07-26 00:33:25 UTC (rev 11439) +++ media/trunk/blender_25/stk_track.py 2012-07-26 00:34:18 UTC (rev 11440) @@ -1203,7 +1203,7 @@ # single_lod is a shortcut that generates both a lod_instance and a lod_model model_string2 = " model=\"%s\""%b3d_name lodstring2 = ' lod_distance="' + str(getProperty(obj, "lod_distance", 60.0)) + '" lod_group="_single_lod_' + name + '"' - f.write(" <static-object%s%s %s/>\n" % (lodstring2, model_string2, getXYZHPRString(obj)) ) + f.write(" <static-object%s%s %s interaction\"%s\"/> <!-- writeStaticObjects -->\n" % (lodstring2, model_string2, getXYZHPRString(obj), getProperty(obj, "interaction", "static")) ) model_string = "" else: model_string = " model=\"%s\""%b3d_name @@ -1237,13 +1237,13 @@ tangent_string=" tangents=\"true\"" if lAnim: - f.write(" <static-object%s%s %s%s%s%s%s>\n"% \ + f.write(" <static-object%s%s %s%s%s%s%s> <!-- writeStaticObjects 2 -->\n"% \ (lodstring, model_string, getXYZHPRString(obj), reset_string, condition_if_str, condition_ifnot_str, tangent_string) ) self.writeAnimatedTextures(f, lAnim) f.write(" </static-object>\n") else: - f.write(" <static-object%s%s %s%s%s%s%s%s/>\n"% \ + f.write(" <static-object%s%s %s%s%s%s%s%s/> <!-- writeStaticObjects 3 -->\n"% \ (lodstring, model_string, getXYZHPRString(obj), reset_string, condition_if_str, condition_ifnot_str, challenge_str, tangent_string) ) self.writeAnimatedTextures(f, lAnimTextures) @@ -1821,8 +1821,8 @@ for obj in lObjects: type = getProperty(obj, "type", "??") interact = getProperty(obj, "interaction", "static") - if type == "lod_instance" or type == "lod_model" or type == "single_lod": - interact = "static" + #if type == "lod_instance" or type == "lod_model" or type == "single_lod": + # interact = "static" if interact=="static" or interact=="reset": Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-07-26 00:33:25 UTC (rev 11439) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-07-26 00:34:18 UTC (rev 11440) @@ -102,6 +102,10 @@ doc="Name of the LOD group this object is an instance of"/> <StringProp id="if" name="Visible if..." default="" doc="Make this object conditionally visible"/> <StringProp id="ifnot" name="Visible if not..." default="" doc="Make this object conditionally visible"/> + <EnumProp id="interaction" name="Interaction" default="static" unique_prefix="lod" doc="How this object should interact with other objects in the physics engine"> + <EnumChoice id="ghost" label="Ghost" doc="This object will be non-physical (player can drive through it)" /> + <EnumChoice id="static" label="Static (wont move)" doc="This object will stay in place, if the user drives on this object they will 'hit a wall'" /> + </EnumProp> </EnumChoice> <EnumChoice id="lod_model" label="LOD Model" doc="A LOD (level-of-detail) model (this model will not be visible in game, only LOD instances will)"> <FloatProp id="lod_distance" name="Distance" default="60.0" min="0.0" max="5000.0" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2012-10-16 00:16:03
|
Revision: 11688 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=11688&view=rev Author: auria Date: 2012-10-16 00:15:55 +0000 (Tue, 16 Oct 2012) Log Message: ----------- Update exporter to support the new 'explode' interaction Modified Paths: -------------- media/trunk/blender_25/B3DExport.py media/trunk/blender_25/stk_track.py media/trunk/blender_25/stkdata/stk_object_parameters.xml Modified: media/trunk/blender_25/B3DExport.py =================================================================== --- media/trunk/blender_25/B3DExport.py 2012-10-16 00:09:33 UTC (rev 11687) +++ media/trunk/blender_25/B3DExport.py 2012-10-16 00:15:55 UTC (rev 11688) @@ -6,7 +6,7 @@ Group: 'Export' Tooltip: 'Export to Blitz3D file format (.b3d)' """ -__author__ = ["Diego 'GaNDaLDF' Parisi"] +__author__ = ["iego 'GaNDaLDF' Parisi, MTLZ (is06), Joerg Henrichs, Marianne Gagnon"] __url__ = ["www.gandaldf.com"] __version__ = "3.0" __bpydoc__ = """\ @@ -15,8 +15,8 @@ # BLITZ3D EXPORTER 3.0 # Copyright (C) 2009 by Diego "GaNDaLDF" Parisi - www.gandaldf.com # Lightmap issue fixed by Capricorn 76 Pty. Ltd. - www.capricorn76.com +# Blender 2.63 compatiblity based on work by MTLZ, www.is06.com # With changes by Marianne Gagnon and Joerg Henrichs, supertuxkart.sf.net (Copyright (C) 2011-2012) -# Blender 2.63 compatiblity based on work by MTLZ, www.is06.com # # LICENSE: # This program is free software; you can redistribute it and/or modify @@ -36,7 +36,7 @@ bl_info = { "name": "B3D (BLITZ3D) Model Exporter", "description": "Exports a blender scene or object to the B3D (BLITZ3D) format", - "author": "Diego 'GaNDaLDF' Parisi, Joerg Henrichs, Marianne Gagnon, MTLZ (is06)", + "author": "Diego 'GaNDaLDF' Parisi, MTLZ (is06), Joerg Henrichs, Marianne Gagnon", "version": (3,1), "blender": (2, 5, 9), "api": 31236, @@ -47,8 +47,6 @@ "category": "Import-Export"} -#If you get an error here, it might be -#because you don't have Python installed. import bpy import sys,os,os.path,struct,math,string import mathutils @@ -1490,6 +1488,8 @@ if not self.filepath.endswith(".b3d"): self.filepath += ".b3d" + print("EXPORT", self.filepath," vcolor = ", self.vcolors) + obj_list = [] try: # FIXME: silly and ugly hack, the list of objects to export is passed through Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2012-10-16 00:09:33 UTC (rev 11687) +++ media/trunk/blender_25/stk_track.py 2012-10-16 00:15:55 UTC (rev 11688) @@ -1144,6 +1144,8 @@ if interaction == 'reset': reset_string = " reset=\"y\"" + elif interaction == 'explode': + reset_string = " explode=\"y\"" else: reset_string = "" @@ -1236,6 +1238,8 @@ interaction = getProperty(obj, "interaction", '??') if interaction == 'reset': reset_string = " reset=\"y\"" + elif interaction == 'explode': + reset_string = " explode=\"y\"" else: reset_string = "" @@ -1739,7 +1743,7 @@ ipo = parent.animation_data self.writeAnimationWithIPO(f, b3d_name, obj, ipo) - elif interact=="static" or interact=="reset": + elif interact=="static" or interact=="reset" or interact=="explode": ipo = obj.animation_data # In objects with skeletal animations the actual armature (which # is a parent) contains the IPO. So check for this: @@ -1835,7 +1839,7 @@ #if type == "lod_instance" or type == "lod_model" or type == "single_lod": # interact = "static" - if interact=="static" or interact=="reset" or type == "lod_model": + if interact=="static" or interact=="reset" or type == "lod_model" or interact=="explode": ipo = obj.animation_data if obj.parent is not None and obj.parent.type=="ARMATURE" and obj.parent.animation_data is not None: @@ -1845,7 +1849,7 @@ # can't be merged with the physics model of the track # BUT 'reset' objects must NOT be static objects otherwise then we can't detect # collisions against it in bullet - if (ipo and ipo.action) or interact=="reset": + if (ipo and ipo.action) or interact=="reset" or interact=="explode": lOtherObjects.append(obj) else: lStaticObjects.append(obj) Modified: media/trunk/blender_25/stkdata/stk_object_parameters.xml =================================================================== --- media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-10-16 00:09:33 UTC (rev 11687) +++ media/trunk/blender_25/stkdata/stk_object_parameters.xml 2012-10-16 00:15:55 UTC (rev 11688) @@ -175,6 +175,20 @@ <EnumChoice id="exact" label="Exact" /> </EnumProp> </EnumChoice> + <EnumChoice id="explode" label="Knock player" doc="The player will jump like they were hit when touching this object" > + <EnumProp id="shape" name="Shape" default="box" unique_prefix="itrc_explode" + doc="Shape to use in the physics engine to represent this object"> + <EnumChoice id="coneX" label="Cone (X)" /> + <EnumChoice id="coneY" label="Cone (Y)" /> + <EnumChoice id="coneZ" label="Cone (Z)" /> + <EnumChoice id="cylinderX" label="Cylinder (X)" /> + <EnumChoice id="cylinderY" label="Cylinder (Y)" /> + <EnumChoice id="cylinderZ" label="Cylinder (Z)" /> + <EnumChoice id="box" label="Box" /> + <EnumChoice id="sphere" label="Sphere" /> + <EnumChoice id="exact" label="Exact" /> + </EnumProp> + </EnumChoice> </EnumProp> <BoolProp id="tangents" name="Use Tangent Space" default="false" doc="Export object in tangent space, which is required for normal mapping"/> </EnumChoice> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |