From: <au...@us...> - 2011-05-30 00:36:29
|
Revision: 8774 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8774&view=rev Author: auria Date: 2011-05-30 00:36:23 +0000 (Mon, 30 May 2011) Log Message: ----------- Fixed a few small bugs in track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-05-30 00:34:58 UTC (rev 8773) +++ media/trunk/blender_25/stk_track.py 2011-05-30 00:36:23 UTC (rev 8774) @@ -1000,7 +1000,7 @@ for bez in curve.keyframe_points: if bez.interpolation=='BEZIER': f.write(" <p c=\"%f %f\" h1=\"%f %f\" h2=\"%f %f\"/>\n"%\ - (bez.co[0],factor*bez.co[1][1], + (bez.co[0],factor*bez.co[1], bez.left_handle[0], factor*bez.left_handle[1], bez.right_handle[0], factor*bez.right_handle[1])) else: @@ -1556,6 +1556,7 @@ else: if name=="nitro-big": name="big-nitro" if name=="nitro-small": name="small-nitro" + if name=="nitro_small": name="small-nitro" # Get the position of the item - first check if the item should # be dropped on the track, or stay at the position indicated. @@ -1824,6 +1825,7 @@ if stktype[:8] in ["GHERRING", "RHERRING", "YHERRING", "SHERRING"] \ or stktype[: 6]== "BANANA" or stktype[:4]=="ITEM" \ or stktype[:11]=="NITRO-SMALL" or stktype[:9]=="NITRO-BIG" \ + or stktype[:11]=="NITRO_SMALL" or stktype[:9]=="NITRO_BIG" \ or stktype[:11]=="SMALL-NITRO" or stktype[:9]=="BIG-NITRO" \ or stktype[: 6]=="ZIPPER": lItems.append(obj) @@ -1870,8 +1872,7 @@ else: s = getProperty(obj, "type", None) if s: - log_warning("object", obj.name, \ - " has type property '%s', which is not supported.\n"%s) + log_warning("object " + obj.name + " has type property '%s', which is not supported.\n"%s) lTrack.append(obj) if not found_main_driveline: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-30 00:44:18
|
Revision: 8775 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8775&view=rev Author: auria Date: 2011-05-30 00:44:12 +0000 (Mon, 30 May 2011) Log Message: ----------- Fixed a few small bugs in track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-05-30 00:36:23 UTC (rev 8774) +++ media/trunk/blender_25/stk_track.py 2011-05-30 00:44:12 UTC (rev 8775) @@ -155,11 +155,11 @@ self.is_last_main = 0 # Invisible drivelines are not shown in the minimap self.invisible = getProperty(driveline, "invisible", 0) - self.ai_ignore = getProperty(driveline, "ai-ignore", "no") + self.ai_ignore = getProperty(driveline, "ai_ignore", "no") self.enabled = not getProperty(driveline, "disable", 0) self.activate = getProperty(driveline, "activate", None) self.strict_lap = convertTextToYN(getProperty(driveline, - "strict-lapline", "N") ) \ + "strict_lapline", "N") ) \ == "Y" # -------------------------------------------------------------------------- @@ -1287,7 +1287,7 @@ radius = r radius = math.sqrt(radius) - inner_radius = getProperty(obj, "inner-radius", radius) + inner_radius = getProperty(obj, "inner_radius", radius) color = getProperty(obj, "color", "255 120 120 120") f.write(" <check-sphere%sxyz=\"%f %f %f\" radius=\"%f\"\n" % \ (kind, obj.location[0], obj.location[2], obj.location[1], radius) ) @@ -1303,10 +1303,12 @@ def checkForAnimatedTextures(self, lObjects): lAnimTextures = [] for obj in lObjects: - anim_texture = getProperty(obj, "anim-texture", None) - if not anim_texture: continue - dx = getProperty(obj, "anim-dx", 0) - dy = getProperty(obj, "anim-dy", 0) + use_anim_texture = getProperty(obj, "enable_anim_texture", "false") + if use_anim_texture != 'true': continue + + anim_texture = getProperty(obj, "anim_texture", None) + dx = getProperty(obj, "anim_dx", 0) + dy = getProperty(obj, "anim_dy", 0) lAnimTextures.append( (anim_texture, dx, dy) ) return lAnimTextures @@ -1373,10 +1375,10 @@ def writeStartPositions(self, f, lStart): global the_scene scene = the_scene - karts_per_row = getIdProperty(scene, "start-karts-per-row", "2" ) - distance_forwards = getIdProperty(scene, "start-forwards-distance", "1.5") - distance_sidewards = getIdProperty(scene, "start-sidewards-distance", "3" ) - distance_upwards = getIdProperty(scene, "start-upwards-distance", "0.1") + karts_per_row = getIdProperty(scene, "start_karts_per_row", "2" ) + distance_forwards = getIdProperty(scene, "start_forwards_distance", "1.5") + distance_sidewards = getIdProperty(scene, "start_sidewards_distance", "3" ) + distance_upwards = getIdProperty(scene, "start_upwards_distance", "0.1") f.write(" <default-start karts-per-row =\"%s\"\n"%karts_per_row ) f.write(" forwards-distance =\"%s\"\n"%distance_forwards ) f.write(" sidewards-distance=\"%s\"\n"%distance_sidewards) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-30 01:44:45
|
Revision: 8778 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8778&view=rev Author: auria Date: 2011-05-30 01:44:38 +0000 (Mon, 30 May 2011) Log Message: ----------- Fixed glitch exporting big nitro Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-05-30 01:40:25 UTC (rev 8777) +++ media/trunk/blender_25/stk_track.py 2011-05-30 01:44:38 UTC (rev 8778) @@ -1557,6 +1557,7 @@ if name=="SHERRING": name="small-nitro" else: if name=="nitro-big": name="big-nitro" + if name=="nitro_big": name="big-nitro" if name=="nitro-small": name="small-nitro" if name=="nitro_small": name="small-nitro" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-05-31 01:00:49
|
Revision: 8786 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8786&view=rev Author: auria Date: 2011-05-31 01:00:40 +0000 (Tue, 31 May 2011) Log Message: ----------- Fixed exporting bezier curves Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-05-31 00:15:49 UTC (rev 8785) +++ media/trunk/blender_25/stk_track.py 2011-05-31 01:00:40 UTC (rev 8786) @@ -1001,8 +1001,8 @@ if bez.interpolation=='BEZIER': f.write(" <p c=\"%f %f\" h1=\"%f %f\" h2=\"%f %f\"/>\n"%\ (bez.co[0],factor*bez.co[1], - bez.left_handle[0], factor*bez.left_handle[1], - bez.right_handle[0], factor*bez.right_handle[1])) + bez.handle_left[0], factor*bez.handle_left[1], + bez.handle_right[0], factor*bez.handle_right[1])) else: f.write(" <p c=\"%f %f\"/>\n"%(bez.co[0], factor*bez.co[1])) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-04 23:37:37
|
Revision: 8819 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8819&view=rev Author: auria Date: 2011-06-04 23:37:31 +0000 (Sat, 04 Jun 2011) Log Message: ----------- Try to fix exporting billboards in 2.5 Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-04 23:31:31 UTC (rev 8818) +++ media/trunk/blender_25/stk_track.py 2011-06-04 23:37:31 UTC (rev 8819) @@ -1076,36 +1076,43 @@ # -------------------------------------------------------------------------- # billboard section (check if the billboard is correct and write in the file) def writeBillboard(self,f, obj): - data = obj.getData(mesh=True) + data = obj.data + # check the face if len(data.faces) > 1: log_error("Billboard <" + getProperty(obj, "name", obj.name) \ - + "> has more than ONE texture") + + "> has more than ONE face") return # check the points - if len(data.verts) > 4: + if len(data.vertices) > 4: log_error("Billboard <" + getProperty(obj, "name", obj.name)\ + "> has more than 4 points") return + if len(data.uv_textures) < 1 or len(data.uv_textures[0].data) < 1: + log_error("Billboard <" + getProperty(obj, "name", obj.name)\ + + "> has no UV texture") + return + + try: # write in the XML # calcul the size and the position - x_min = data.verts[0].co[0] + x_min = data.vertices[0].co[0] x_max = x_min - y_min = data.verts[0].co[2] + y_min = data.vertices[0].co[2] y_max = y_min for i in range(1, 4): - x_min = min(x_min, data.verts[i].co[0]) - x_max = max(x_max, data.verts[i].co[0]) - y_min = min(y_min, data.verts[i].co[2]) - y_max = max(y_max, data.verts[i].co[2]) + x_min = min(x_min, data.vertices[i].co[0]) + 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]) f.write(' <object type="billboard" texture="%s" xyz="%f %f %f" \n'% - (Blender.sys.basename(data.faces[0].image.getFilename()), - obj.loc[0], obj.loc[2], obj.loc[1]) ) + (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) ) if obj.getIpo(): self.writeIPO(f, obj.getIpo()) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-04 23:47:03
|
Revision: 8820 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8820&view=rev Author: auria Date: 2011-06-04 23:46:57 +0000 (Sat, 04 Jun 2011) Log Message: ----------- Fixed exporter issue wih cameras Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-04 23:37:31 UTC (rev 8819) +++ media/trunk/blender_25/stk_track.py 2011-06-04 23:46:57 UTC (rev 8820) @@ -790,7 +790,7 @@ cam = lEndCameras[i] try: (distance, driveline_index, quad_index_camera) = \ - lSorted[0].getDistanceTo(cam.loc, lSorted) + lSorted[0].getDistanceTo(cam.location, lSorted) # Each list contains the index of the closest quad, the # distance, and then the camera lEndCameras[i] = (driveline_index, quad_index_camera, cam) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 00:43:35
|
Revision: 8823 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8823&view=rev Author: auria Date: 2011-06-05 00:43:29 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed exporting plain sky color Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 00:34:28 UTC (rev 8822) +++ media/trunk/blender_25/stk_track.py 2011-06-05 00:43:29 UTC (rev 8823) @@ -1523,7 +1523,7 @@ if sSky: f.write(" <sun %s/>\n"%sSky) - sky_color=getIdProperty(scene, "sky-color", None) + sky_color=getIdProperty(scene, "sky_color", None) if sky_color: f.write(" <sky-color rgb=\"%s\"/>\n"%sky_color) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 00:53:47
|
Revision: 8824 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8824&view=rev Author: auria Date: 2011-06-05 00:53:41 +0000 (Sun, 05 Jun 2011) Log Message: ----------- More work on billboards Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 00:43:29 UTC (rev 8823) +++ media/trunk/blender_25/stk_track.py 2011-06-05 00:53:41 UTC (rev 8824) @@ -1114,8 +1114,8 @@ (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) ) - if obj.getIpo(): - self.writeIPO(f, obj.getIpo()) + 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) f.write(' </billboard>\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-06-05 01:03:35
|
Revision: 8825 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8825&view=rev Author: auria Date: 2011-06-05 01:03:29 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed various exporter bugs Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 00:53:41 UTC (rev 8824) +++ media/trunk/blender_25/stk_track.py 2011-06-05 01:03:29 UTC (rev 8825) @@ -1497,14 +1497,14 @@ s = getIdProperty(scene, "fog", 0) if s== "yes": sSky="%s fog=\"true\""%sSky - s=getIdProperty(scene, "fog-color", 0) - if s: sSky="%s fog-color=\"%s\""%(sSky, s) - s=getIdProperty(scene, "fog-density", 0) - if s: sSky="%s fog-density=\"%s\""%(sSky, s) - s=getIdProperty(scene, "fog-start", 0) - if s: sSky="%s fog-start=\"%s\""%(sSky, s) - s=getIdProperty(scene, "fog-end", 0) - if s: sSky="%s fog-end=\"%s\""%(sSky, s) + s=getIdProperty(scene, "fog_color", 0) + if s: sSky="%s fog_color=\"%s\""%(sSky, s) + s=getIdProperty(scene, "fog_density", 0) + if s: sSky="%s fog_density=\"%s\""%(sSky, s) + s=getIdProperty(scene, "fog_start", 0) + if s: sSky="%s fog_start=\"%s\""%(sSky, s) + s=getIdProperty(scene, "fog_end", 0) + if s: sSky="%s fog_end=\"%s\""%(sSky, s) # If there is a sun: if len(lSun) > 0: @@ -1512,11 +1512,11 @@ xyz=sun.location sSky="%s xyz=\"%s %s %s\""%(sSky, xyz[0],xyz[2],xyz[1]) s=getProperty(sun, "color", 0) - if s: sSky="%s sun-color=\"%s\""%(sSky, s) + if s: sSky="%s sun_color=\"%s\""%(sSky, s) s=getProperty(sun, "specular", 0) - if s: sSky="%s sun-specular=\"%s\""%(sSky, s) + if s: sSky="%s sun_specular=\"%s\""%(sSky, s) s=getProperty(sun, "diffuse", 0) - if s: sSky="%s sun-diffuse=\"%s\""%(sSky, s) + if s: sSky="%s sun_diffuse=\"%s\""%(sSky, s) s=getProperty(sun, "ambient", 0) if s: sSky="%s ambient=\"%s\""%(sSky, s) @@ -1715,10 +1715,10 @@ #["particle:condition","skid"] ] - lBooleanAttributes = ["clampU","clampV","light","sphere","surface","below-surface",\ - "falling-effect", \ - "anisotropic","backface-culling","ignore","disable-z-write","reset",\ - "sfx:positional"] + lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", + "falling-effect", + "anisotropic","backface_culling","ignore","disable_z_write","reset", + "sfx_positional"] #start_time = bsys.time() print("Writing material file --> \t") @@ -1734,7 +1734,7 @@ sSFX = "" sParticle = "" sZipper = "" - hasSoundeffect = (convertTextToYN(getIdProperty(i, "sound-effect", "no")) == "Y") + hasSoundeffect = (convertTextToYN(getIdProperty(i, "use_sfx", "no")) == "Y") hasParticle = (convertTextToYN(getIdProperty(i, "particle", "no")) == "Y") hasZipper = (convertTextToYN(getIdProperty(i, "zipper", "no")) == "Y") @@ -1754,20 +1754,20 @@ currentValue = convertTextToYN(currentValue) #These items pertain to the soundeffects (starting with sfx:) - if AProperty.strip().upper().startswith("SFX:"): + if AProperty.strip().upper().startswith("SFX_"): strippedName = AProperty.strip().split(":")[1] sSFX = "%s %s=\"%s\""%(sSFX,strippedName,currentValue) - elif AProperty.strip().upper().startswith("PARTICLE:"): + elif AProperty.strip().upper().startswith("PARTICLE_"): #These items pertain to the particles (starting with sfx:) strippedName = AProperty.strip().split(":")[1] sParticle = "%s %s=\"%s\""%(sParticle,strippedName,currentValue) - elif AProperty.strip().upper().startswith("ZIPPER:"): + elif AProperty.strip().upper().startswith("ZIPPER_"): #These items pertain to the particles (starting with sfx:) strippedName = AProperty.strip().split(":")[1] sZipper = "%s %s=\"%s\""%(sZipper,strippedName,currentValue) else: #These items are standard items - if AProperty.strip().upper() not in ["PARTICLE","SOUND-EFFECT","ZIPPER"]: + if AProperty.strip().upper() not in ["PARTICLE","SOUND_EFFECT","ZIPPER"]: sImage = "%s %s=\"%s\""%(sImage,AProperty,currentValue) # Now write the main content of the materials.xml file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 01:05:21
|
Revision: 8826 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8826&view=rev Author: auria Date: 2011-06-05 01:05:15 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed various exporter bugs Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 01:03:29 UTC (rev 8825) +++ media/trunk/blender_25/stk_track.py 2011-06-05 01:05:15 UTC (rev 8826) @@ -629,10 +629,10 @@ screenshot = getIdProperty(scene, "screenshot", "") # Add default settings for sky-dome so that the user is aware of # can be set. - getIdProperty(scene, "sky-type", "dome") - getIdProperty(scene, "sky-texture", "" ) - getIdProperty(scene, "sky-speed-x", "0") - getIdProperty(scene, "sky-speed-y", "0") + getIdProperty(scene, "sky_type", "dome") + getIdProperty(scene, "sky_texture", "" ) + getIdProperty(scene, "sky_speed_x", "0") + getIdProperty(scene, "sky_speed_y", "0") # Not sure if these should be added - if the user wants a sky # box they are quiet annoying. #getIdProperty(scene, "sky-color","") @@ -1591,23 +1591,23 @@ self.writeChecks(f, lChecks, mainDriveline) scene = the_scene - sky = getIdProperty(scene, "sky-type", None) + sky = getIdProperty(scene, "sky_type", None) # Note that there is a limit to the length of id properties, # which can easily be exceeded by 6 sky textures for a full sky box. # Therefore also check for sky-texture1 and sky-texture2. - texture = getIdProperty(scene, "sky-texture", "") - s = getIdProperty(scene, "sky-texture1", "") + texture = getIdProperty(scene, "sky_texture", "") + s = getIdProperty(scene, "sky_texture1", "") if s: texture = "%s %s"%(texture, s) - s = getIdProperty(scene, "sky-texture2", "") + s = getIdProperty(scene, "sky_texture2", "") if s: texture = "%s %s"%(texture, s) if sky and texture: if sky=="dome": - hori = getIdProperty(scene, "sky-horizontal", 16 ) - verti = getIdProperty(scene, "sky-vertical", 16 ) - tex_percent = getIdProperty(scene, "sky-texture-percent", 0.5) - sphere_percent = getIdProperty(scene, "sky-sphere-percent", 1.3) - speed_x = getIdProperty(scene, "sky-speed-x", 0.0) - speed_y = getIdProperty(scene, "sky-speed-y", 0.0) + hori = getIdProperty(scene, "sky_horizontal", 16 ) + verti = getIdProperty(scene, "sky_vertical", 16 ) + tex_percent = getIdProperty(scene, "sky_texture-percent", 0.5) + sphere_percent = getIdProperty(scene, "sky_sphere-percent", 1.3) + speed_x = getIdProperty(scene, "sky_speed_x", 0.0) + speed_y = getIdProperty(scene, "sky_speed_y", 0.0) f.write(""" <sky-dome texture=\"%s\" horizontal=\"%s\" vertical=\"%s\" @@ -1626,7 +1626,7 @@ log_warning("Found %d textures for sky box, must be 5 or 6 space separated texture names.\n" \ %len(lTextures)) - camera_far = getIdProperty(scene, "camera-far", "" ) + camera_far = getIdProperty(scene, "camera_far", "" ) if camera_far: f.write(" <camera far=\"%s\"/>\n"%camera_far) self.writeStartPositions(f, lStart) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 01:07:11
|
Revision: 8827 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8827&view=rev Author: auria Date: 2011-06-05 01:07:05 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed various exporter bugs Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 01:05:15 UTC (rev 8826) +++ media/trunk/blender_25/stk_track.py 2011-06-05 01:07:05 UTC (rev 8827) @@ -1716,7 +1716,7 @@ ] lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", - "falling-effect", + "falling_effect", "anisotropic","backface_culling","ignore","disable_z_write","reset", "sfx_positional"] This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 01:11:46
|
Revision: 8828 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8828&view=rev Author: auria Date: 2011-06-05 01:11:36 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed various exporter bugs Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 01:07:05 UTC (rev 8827) +++ media/trunk/blender_25/stk_track.py 2011-06-05 01:11:36 UTC (rev 8828) @@ -1495,7 +1495,7 @@ global the_scene scene = the_scene s = getIdProperty(scene, "fog", 0) - if s== "yes": + if s == "yes" or s == "true": sSky="%s fog=\"true\""%sSky s=getIdProperty(scene, "fog_color", 0) if s: sSky="%s fog_color=\"%s\""%(sSky, s) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 01:24:34
|
Revision: 8829 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8829&view=rev Author: auria Date: 2011-06-05 01:24:27 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixed various exporter bugs Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 01:11:36 UTC (rev 8828) +++ media/trunk/blender_25/stk_track.py 2011-06-05 01:24:27 UTC (rev 8829) @@ -1498,13 +1498,13 @@ if s == "yes" or s == "true": sSky="%s fog=\"true\""%sSky s=getIdProperty(scene, "fog_color", 0) - if s: sSky="%s fog_color=\"%s\""%(sSky, s) + if s: sSky="%s fog-color=\"%s\""%(sSky, s) s=getIdProperty(scene, "fog_density", 0) - if s: sSky="%s fog_density=\"%s\""%(sSky, s) + if s: sSky="%s fog-density=\"%s\""%(sSky, s) s=getIdProperty(scene, "fog_start", 0) - if s: sSky="%s fog_start=\"%s\""%(sSky, s) + if s: sSky="%s fog-start=\"%s\""%(sSky, s) s=getIdProperty(scene, "fog_end", 0) - if s: sSky="%s fog_end=\"%s\""%(sSky, s) + if s: sSky="%s fog-end=\"%s\""%(sSky, s) # If there is a sun: if len(lSun) > 0: @@ -1512,11 +1512,11 @@ xyz=sun.location sSky="%s xyz=\"%s %s %s\""%(sSky, xyz[0],xyz[2],xyz[1]) s=getProperty(sun, "color", 0) - if s: sSky="%s sun_color=\"%s\""%(sSky, s) + if s: sSky="%s sun-color=\"%s\""%(sSky, s) s=getProperty(sun, "specular", 0) - if s: sSky="%s sun_specular=\"%s\""%(sSky, s) + if s: sSky="%s sun-specular=\"%s\""%(sSky, s) s=getProperty(sun, "diffuse", 0) - if s: sSky="%s sun_diffuse=\"%s\""%(sSky, s) + if s: sSky="%s sun-diffuse=\"%s\""%(sSky, s) s=getProperty(sun, "ambient", 0) if s: sSky="%s ambient=\"%s\""%(sSky, s) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 17:22:18
|
Revision: 8834 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8834&view=rev Author: auria Date: 2011-06-05 17:22:11 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Fixes in track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 12:05:40 UTC (rev 8833) +++ media/trunk/blender_25/stk_track.py 2011-06-05 17:22:11 UTC (rev 8834) @@ -1755,15 +1755,15 @@ #These items pertain to the soundeffects (starting with sfx:) if AProperty.strip().upper().startswith("SFX_"): - strippedName = AProperty.strip().split(":")[1] + strippedName = APropertyline[len("SFX_"):] sSFX = "%s %s=\"%s\""%(sSFX,strippedName,currentValue) elif AProperty.strip().upper().startswith("PARTICLE_"): #These items pertain to the particles (starting with sfx:) - strippedName = AProperty.strip().split(":")[1] + strippedName = APropertyline[len("PARTICLE_"):] sParticle = "%s %s=\"%s\""%(sParticle,strippedName,currentValue) elif AProperty.strip().upper().startswith("ZIPPER_"): #These items pertain to the particles (starting with sfx:) - strippedName = AProperty.strip().split(":")[1] + strippedName = APropertyline[len("ZIPPER_"):] sZipper = "%s %s=\"%s\""%(sZipper,strippedName,currentValue) else: #These items are standard items @@ -1843,8 +1843,9 @@ elif stktype[:5]=="START": # Start empties are called start1, start2, ... lStart.append(obj) - elif stktype=="PARTICLE-EMITTER": + elif stktype=="PARTICLE_EMITTER": lParticleEmitters.append(obj) + continue else: print("Empty '%s' has type '%s' which is not valid - ignored."%\ (obj.name, stktype)) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 17:40:03
|
Revision: 8837 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8837&view=rev Author: auria Date: 2011-06-05 17:39:57 +0000 (Sun, 05 Jun 2011) Log Message: ----------- More on track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 17:25:04 UTC (rev 8836) +++ media/trunk/blender_25/stk_track.py 2011-06-05 17:39:57 UTC (rev 8837) @@ -1755,15 +1755,15 @@ #These items pertain to the soundeffects (starting with sfx:) if AProperty.strip().upper().startswith("SFX_"): - strippedName = APropertyline[len("SFX_"):] + strippedName = AProperty.strip()[len("SFX_"):] sSFX = "%s %s=\"%s\""%(sSFX,strippedName,currentValue) elif AProperty.strip().upper().startswith("PARTICLE_"): #These items pertain to the particles (starting with sfx:) - strippedName = APropertyline[len("PARTICLE_"):] + strippedName = AProperty.strip()[len("PARTICLE_"):] sParticle = "%s %s=\"%s\""%(sParticle,strippedName,currentValue) elif AProperty.strip().upper().startswith("ZIPPER_"): #These items pertain to the particles (starting with sfx:) - strippedName = APropertyline[len("ZIPPER_"):] + strippedName = AProperty.strip()[len("ZIPPER_"):] sZipper = "%s %s=\"%s\""%(sZipper,strippedName,currentValue) else: #These items are standard items This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 19:26:34
|
Revision: 8844 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8844&view=rev Author: auria Date: 2011-06-05 19:26:27 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Improve material export Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 18:45:30 UTC (rev 8843) +++ media/trunk/blender_25/stk_track.py 2011-06-05 19:26:27 UTC (rev 8844) @@ -1670,51 +1670,26 @@ print("No Materials defined.") return - ### Below a rewrite due to the problems with default values detected by Auria ### - #Shape and form of things to write - #-> this is basically an extract of the stk_browser datamodel... Perhaps go for intergation? - - # The list of all attributes that should always be written, even if - # they are set to the default. For now this list is empty, but I left - # the code in place in case that it might be needed later. - lTextureDefaults = [ - #["anisotropic","yes"],\ - #["backface-culling","yes"],\ - #["clampU","no"],\ - #["clampV","no"],\ - #["compositing","none"],\ - #["disable-z-write","no"],\ - #["friction",1.0],\ - #["graphical-effect","none"],\ - #["ignore","no"],\ - #["light","yes"],\ - #["max-speed",1.0],\ - #["reset","no"],\ - #["slowdown-time",1.0],\ - #["sphere","no"],\ - #["surface","no"],\ - #["below-surface","no"],\ - #["falling-effect","no"],\ - # - #["sfx:filename",""],\ - #["sfx:name",""],\ - #["sfx:rolloff",0.1],\ - #["sfx:min-speed",0.0],\ - #["sfx:max-speed",30.0],\ - #["sfx:min-pitch",1.0],\ - #["sfx:max-pitch",1.0],\ - #["sfx:positional","no"],\ - # - #["zipper:duration",3.5],\ - #["zipper:max-speed-increase",15],\ - #["zipper:fade-out-time",3],\ - #["zipper:speed-gain",4.5],\ - # - #["particle:base",""],\ - #["particle:condition","skid"] - ] + lTextureDefaults = { + 'light' : ("Y", None), + 'backface_culling' : ("Y", None), + 'below_surface' : ("N", None), + 'compositing' : ('none', None), + 'clampu' : ("N", None), + 'clampv' : ("N", None), + 'disable_z_write' : ("N", None), + 'falling_effect' : ("N", None), + 'graphical_effect' : ('none', None), + 'ignore' : ("N", None), + 'reset' : ("N", None), + 'sphere' : ("N", None), + 'friction' : (50000.0, None), + 'slowdown_time' : (1.0, 'use_slowdown'), + 'max_speed' : (1.0, 'use_slowdown') + } + lBooleanAttributes = ["clampu","clampv","light","sphere","surface","below_surface", "falling_effect", "anisotropic","backface_culling","ignore","disable_z_write","reset", @@ -1740,7 +1715,7 @@ # Create a copy of the list of defaults so that it can be modified. Then add # all properties of the current image - l = lTextureDefaults[:] + l = [] for sAttrib in i.keys(): if sAttrib not in l: l.append( (sAttrib, i[sAttrib]) ) @@ -1767,8 +1742,16 @@ sZipper = "%s %s=\"%s\""%(sZipper,strippedName,currentValue) else: #These items are standard items - if AProperty.strip().upper() not in ["PARTICLE","SOUND_EFFECT","ZIPPER"]: - sImage = "%s %s=\"%s\""%(sImage,AProperty,currentValue) + prop = AProperty.strip().lower() + + if prop in lTextureDefaults.keys(): + + # if this property isc onditional on another + cond = lTextureDefaults[prop][1] + + if currentValue != lTextureDefaults[prop][0] and (cond is None or (cond in i and i[cond] == "Y")): + # In blender, proeprties use '_', but STK still expects '-' + sImage = "%s %s=\"%s\""%(sImage,AProperty.replace("_","-"),currentValue) # Now write the main content of the materials.xml file if sImage or hasSoundeffect or hasParticle or hasZipper: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-05 21:13:46
|
Revision: 8848 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8848&view=rev Author: auria Date: 2011-06-05 21:13:40 +0000 (Sun, 05 Jun 2011) Log Message: ----------- Add missing property Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-05 21:12:35 UTC (rev 8847) +++ media/trunk/blender_25/stk_track.py 2011-06-05 21:13:40 UTC (rev 8848) @@ -1685,6 +1685,7 @@ 'ignore' : ("N", None), 'reset' : ("N", None), 'sphere' : ("N", None), + 'surface' : ("N", None), 'friction' : (50000.0, None), 'slowdown_time' : (1.0, 'use_slowdown'), 'max_speed' : (1.0, 'use_slowdown') This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-08 01:18:37
|
Revision: 8865 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8865&view=rev Author: auria Date: 2011-06-08 01:18:31 +0000 (Wed, 08 Jun 2011) Log Message: ----------- Improve water export when name is not specified Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-08 01:12:35 UTC (rev 8864) +++ media/trunk/blender_25/stk_track.py 2011-06-08 01:18:31 UTC (rev 8865) @@ -1419,6 +1419,8 @@ print ("Exporting water -->") for obj in lWater: name = getProperty(obj, "name", obj.name ) + if len(name) == 0: + name = obj.name height = getProperty(obj, "height", None ) speed = getProperty(obj, "speed", None ) length = getProperty(obj, "length", None ) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-11 23:17:05
|
Revision: 8880 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8880&view=rev Author: auria Date: 2011-06-11 23:16:58 +0000 (Sat, 11 Jun 2011) Log Message: ----------- Fixed exporting sky cubes Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-11 20:58:35 UTC (rev 8879) +++ media/trunk/blender_25/stk_track.py 2011-06-11 23:16:58 UTC (rev 8880) @@ -1617,16 +1617,14 @@ speed-x=\"%s\" speed-y=\"%s\" /> """ %(texture, hori, verti, tex_percent, sphere_percent, speed_x, speed_y)) elif sky=="box": - lTextures = string.split(texture) - if len(lTextures)==5: - # Append a dummy 6th element - lTextures.append(lTextures[4]) - if len(lTextures)==6: - f.write(" <sky-box texture=\"%s\"/>\n" % \ + lTextures = [getIdProperty(scene, "sky_texture2", ""), + getIdProperty(scene, "sky_texture3", ""), + getIdProperty(scene, "sky_texture4", ""), + getIdProperty(scene, "sky_texture5", ""), + getIdProperty(scene, "sky_texture6", ""), + getIdProperty(scene, "sky_texture1", "")] + f.write(" <sky-box texture=\"%s\"/>\n" % \ " ".join(lTextures)) - else: - log_warning("Found %d textures for sky box, must be 5 or 6 space separated texture names.\n" \ - %len(lTextures)) camera_far = getIdProperty(scene, "camera_far", "" ) if camera_far: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-12 17:55:18
|
Revision: 8895 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8895&view=rev Author: auria Date: 2011-06-12 17:55:11 +0000 (Sun, 12 Jun 2011) Log Message: ----------- improve handling of activate groups vs case Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-12 17:47:33 UTC (rev 8894) +++ media/trunk/blender_25/stk_track.py 2011-06-12 17:55:11 UTC (rev 8895) @@ -1149,9 +1149,9 @@ # Collect the indices of all check structures for all groups ind = 1 for obj in lChecks: - name = getProperty(obj, "type", obj.name.lower()) + name = getProperty(obj, "type", obj.name.lower()).lower() if name!="lap": - name = getProperty(obj, "name", obj.name.lower()) + name = getProperty(obj, "name", obj.name.lower()).lower() if name in dGroup2Indices: dGroup2Indices[name].append(ind) else: @@ -1264,9 +1264,9 @@ # Get the group name this object belongs to. If the objects # is of type lap then 'lap' is the group name, otherwise # it's taken from the name property (or the object name). - name = getProperty(obj, "type", obj.name.lower()) + name = getProperty(obj, "type", obj.name.lower()).lower() if name!="lap": - name = getProperty(obj, "name", obj.name.lower()) + name = getProperty(obj, "name", obj.name.lower()).lower() # Get the list of indices of this group, excluding # the index of the current object. So create a copy This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-18 15:38:45
|
Revision: 8948 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8948&view=rev Author: auria Date: 2011-06-18 15:38:39 +0000 (Sat, 18 Jun 2011) Log Message: ----------- Fixed exporting sky texture percent Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-18 15:33:53 UTC (rev 8947) +++ media/trunk/blender_25/stk_track.py 2011-06-18 15:38:39 UTC (rev 8948) @@ -1606,8 +1606,8 @@ if sky=="dome": hori = getIdProperty(scene, "sky_horizontal", 16 ) verti = getIdProperty(scene, "sky_vertical", 16 ) - tex_percent = getIdProperty(scene, "sky_texture-percent", 0.5) - sphere_percent = getIdProperty(scene, "sky_sphere-percent", 1.3) + tex_percent = getIdProperty(scene, "sky_texture_percent", 0.5) + sphere_percent = getIdProperty(scene, "sky_sphere_percent", 1.3) speed_x = getIdProperty(scene, "sky_speed_x", 0.0) speed_y = getIdProperty(scene, "sky_speed_y", 0.0) f.write(""" This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-19 17:24:12
|
Revision: 8958 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8958&view=rev Author: auria Date: 2011-06-19 17:24:06 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Fixed bug in track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-19 17:14:53 UTC (rev 8957) +++ media/trunk/blender_25/stk_track.py 2011-06-19 17:24:06 UTC (rev 8958) @@ -914,7 +914,7 @@ # Write the connection from an already written quad to this fr = driveline.getFromQuad() to = driveline.getFirstQuadIndex() - if not dWrittenEdges.has_key( (fr,to) ): + if (fr,to) not in dWrittenEdges: f.write(" <edge from=\"%d\" to=\"%d\"/>\n" %(fr, to)) #if to.isEnabled() and fr.isEnabled(): # f.write(" <edge from=\"%d\" to=\"%d\"/>\n" %(fr, to)) @@ -931,7 +931,7 @@ driveline.getLastQuadIndex())) fr = driveline.getLastQuadIndex() to = driveline.computeSuccessor(lSorted) - if not dWrittenEdges.has_key( (fr, to) ): + if (fr, to) not in dWrittenEdges: f.write(" <edge from=\"%d\" to=\"%d\"/>\n" %(fr, to)) dWrittenEdges[ (fr, to) ] = 1 f.write("</graph>\n") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-19 18:33:58
|
Revision: 8966 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8966&view=rev Author: auria Date: 2011-06-19 18:33:52 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Correct other problem in track exporter Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-19 18:32:37 UTC (rev 8965) +++ media/trunk/blender_25/stk_track.py 2011-06-19 18:33:52 UTC (rev 8966) @@ -1248,7 +1248,7 @@ activate = getProperty(obj, "activate", "") if activate: group = activate.lower() - if not dGroup2Indices.has_key(group): + if group not in dGroup2Indices: log_warning("Activate group '%s' not found for lap line!"%group) print("Ignored - but lap counting might not work correctly.") print("Make sure there is an object of type 'check' with") This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-19 19:42:06
|
Revision: 8973 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8973&view=rev Author: auria Date: 2011-06-19 19:42:00 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Fixed exporting of material slowdown + save floats with less precision, there is no use in having 10 digits after the point Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-19 19:12:41 UTC (rev 8972) +++ media/trunk/blender_25/stk_track.py 2011-06-19 19:42:00 UTC (rev 8973) @@ -686,7 +686,7 @@ % (type, curves.name)) for i in nu: v=Vector(i[0],i[1],i[2]) * matrix - f.write(" <p=\"%f %f %f\"/>\n"%(v[0], v[1], v[2])) + f.write(" <p=\"%.3f %.3f %.3f\"/>\n"%(v[0], v[1], v[2])) f.write(" </%s>\n"%type) elif nu.type==1: f.write(" <%s curvetype=\"bezier\" name=\"%s\">\n" \ @@ -999,7 +999,7 @@ for bez in curve.keyframe_points: if bez.interpolation=='BEZIER': - f.write(" <p c=\"%f %f\" h1=\"%f %f\" h2=\"%f %f\"/>\n"%\ + f.write(" <p c=\"%.3f %.3f\" h1=\"%.3f %.3f\" h2=\"%.3f %.3f\"/>\n"%\ (bez.co[0],factor*bez.co[1], bez.handle_left[0], factor*bez.handle_left[1], bez.handle_right[0], factor*bez.handle_right[1])) @@ -1044,9 +1044,9 @@ def writeAnimatedTextures(self, f, lAnimTextures): for (name, dx, dy) in lAnimTextures: sdx="" - if dx: sdx = " dx=\"%s\" "%dx + if dx: sdx = " dx=\"%.3f\" "%float(dx) sdy="" - if dy: sdy = " dy=\"%s\" "%dy + if dy: sdy = " dy=\"%.3f\" "%float(dy) f.write(" <animated-texture name=\"%s\"%s%s/>\n"%(name, sdx, sdy) ) # -------------------------------------------------------------------------- @@ -1382,14 +1382,14 @@ def writeStartPositions(self, f, lStart): global the_scene scene = the_scene - karts_per_row = getIdProperty(scene, "start_karts_per_row", "2" ) - distance_forwards = getIdProperty(scene, "start_forwards_distance", "1.5") - distance_sidewards = getIdProperty(scene, "start_sidewards_distance", "3" ) - distance_upwards = getIdProperty(scene, "start_upwards_distance", "0.1") - f.write(" <default-start karts-per-row =\"%s\"\n"%karts_per_row ) - f.write(" forwards-distance =\"%s\"\n"%distance_forwards ) - f.write(" sidewards-distance=\"%s\"\n"%distance_sidewards) - f.write(" upwards-distance =\"%s\"/>\n"%distance_upwards) + karts_per_row = getIdProperty(scene, "start_karts_per_row", 2.0) + distance_forwards = getIdProperty(scene, "start_forwards_distance", 1.5) + distance_sidewards = getIdProperty(scene, "start_sidewards_distance", 3 ) + distance_upwards = getIdProperty(scene, "start_upwards_distance", 0.1) + f.write(" <default-start karts-per-row =\"%.2f\"\n"%karts_per_row ) + f.write(" forwards-distance =\"%.2f\"\n"%distance_forwards ) + f.write(" sidewards-distance=\"%.2f\"\n"%distance_sidewards) + f.write(" upwards-distance =\"%.2f\"/>\n"%distance_upwards) dId2Obj = {} count = 1 @@ -1428,9 +1428,9 @@ b3d_name = self.exportLocalB3D(obj, sPath, name) s=" <water model=\"%s\" %s" % \ (b3d_name, getXYZHPRString(obj)) - if height: s="%s height=\"%s\""%(s, height) - if speed: s="%s speed=\"%s\"" %(s, speed ) - if length: s="%s length=\"%s\""%(s, length) + if height: s="%s height=\"%.2f\""%(s, float(height)) + if speed: s="%s speed=\"%.2f\"" %(s, float(speed)) + if length: s="%s length=\"%.2f\""%(s, float(length)) if lAnim: f.write("%s>\n" % s) self.writeAnimatedTextures(f, lAnim) @@ -1512,7 +1512,7 @@ if len(lSun) > 0: sun = lSun[0] xyz=sun.location - sSky="%s xyz=\"%s %s %s\""%(sSky, xyz[0],xyz[2],xyz[1]) + sSky="%s xyz=\"%.2f %.2f %.2f\""%(sSky, float(xyz[0]), float(xyz[2]), float(xyz[1])) s=getProperty(sun, "color", 0) if s: sSky="%s sun-color=\"%s\""%(sSky, s) s=getProperty(sun, "specular", 0) @@ -1732,7 +1732,11 @@ #These items pertain to the soundeffects (starting with sfx:) if AProperty.strip().upper().startswith("SFX_"): strippedName = AProperty.strip()[len("SFX_"):] - sSFX = "%s %s=\"%s\""%(sSFX,strippedName,currentValue) + + if isinstance(currentValue, float): + sSFX = "%s %s=\"%.2f\""%(sSFX,strippedName,currentValue) + else: + sSFX = "%s %s=\"%s\""%(sSFX,strippedName,currentValue) elif AProperty.strip().upper().startswith("PARTICLE_"): #These items pertain to the particles (starting with sfx:) strippedName = AProperty.strip()[len("PARTICLE_"):] @@ -1740,6 +1744,7 @@ elif AProperty.strip().upper().startswith("ZIPPER_"): #These items pertain to the particles (starting with sfx:) strippedName = AProperty.strip()[len("ZIPPER_"):] + sZipper = "%s %s=\"%s\""%(sZipper,strippedName,currentValue) else: #These items are standard items @@ -1750,9 +1755,13 @@ # if this property isc onditional on another cond = lTextureDefaults[prop][1] - if currentValue != lTextureDefaults[prop][0] and (cond is None or (cond in i and i[cond] == "Y")): - # In blender, proeprties use '_', but STK still expects '-' - sImage = "%s %s=\"%s\""%(sImage,AProperty.replace("_","-"),currentValue) + if currentValue != lTextureDefaults[prop][0] and (cond is None or (cond in i and i[cond] == "true")): + if isinstance(currentValue, float): + # In blender, proeprties use '_', but STK still expects '-' + sImage = "%s %s=\"%.2f\""%(sImage,AProperty.replace("_","-"),currentValue) + else: + # In blender, proeprties use '_', but STK still expects '-' + sImage = "%s %s=\"%s\""%(sImage,AProperty.replace("_","-"),currentValue) # Now write the main content of the materials.xml file if sImage or hasSoundeffect or hasParticle or hasZipper: This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <au...@us...> - 2011-06-19 19:50:05
|
Revision: 8975 http://supertuxkart.svn.sourceforge.net/supertuxkart/?rev=8975&view=rev Author: auria Date: 2011-06-19 19:49:58 +0000 (Sun, 19 Jun 2011) Log Message: ----------- Escape ampersands when exporting XML Modified Paths: -------------- media/trunk/blender_25/stk_track.py Modified: media/trunk/blender_25/stk_track.py =================================================================== --- media/trunk/blender_25/stk_track.py 2011-06-19 19:44:31 UTC (rev 8974) +++ media/trunk/blender_25/stk_track.py 2011-06-19 19:49:58 UTC (rev 8975) @@ -84,7 +84,7 @@ # defined, this function will also set the property to this default value. def getIdProperty(obj, name, default="", set_value_if_undefined=1): try: - return obj[name] + return obj[name].replace('&', '&') # this is XML except: if default!=None and set_value_if_undefined: obj[name] = default This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |