[Bf-committers] Re: [Bf-blender-cvs] CVS commit: blender/release/scripts kmz_ImportWithMesh.py

Campbell Barton cbarton at metavr.com
Fri Feb 2 10:27:53 CET 2007


Iv updated some areas from 1.9f but there are areas of script that dont 
make use of the blender API as well as it might.

Why build a new list of faces when you can extend the list you alredy have?

			for FE in UPDATE_F:
				if len(FE)==3:
					FACES.append([ME.verts[FE[0]],ME.verts[FE[1]],ME.verts[FE[2]]])
				else :
				 
FACES.append([ME.verts[FE[0]],ME.verts[FE[1]],ME.verts[FE[2]],ME.verts[FE[3]]])
		if FACES:
				ME.faces.extend(FACES)
				FACES=[]

Just do
	ME_faces.extend(UPDATE_F)


As for printing status. the scripts guideline says not to print pages 
and pages of output text, I dont think its wise to print the length of 
every polygon imported. Thats more for debugging.

http://mediawiki.blender.org/index.php/ScriptDev/Guidelines#Feedback

If you want to evaluate the differences try Meld. its an awesome visual 
diff tool.

http://meld.sourceforge.net/


jean-michel soler wrote:
> Campbell Barton a écrit :
> 
>> campbellbarton (Campbell Barton) 2007/01/30 01:16:05 CET
>>
>>  Modified files:
>>    blender/release/scripts kmz_ImportWithMesh.py  
>>  Log:
>>  Update to JMS's latest version of google earth 3 importer.
>>  also made some changes
>>  * redraw in the 3d view only
>>  * create all objects in visible layers
>>  * other small tweaks and speedups, removed debug print's
>>  
>>
> New version  where, at least, one of yours speedup part is removed and 
> it  is "really" faster. Tested on detailed eiffel tower model, 42000 
> faces, 266 objest, with your modif 37 seconds, without only 33.
> For this one, I asked you to do not make the change so I found  it 
> easily but it would be easier for me if you outlined your modifs  
> clearly with a line before and after
> like this :
> #------  cambo modifs ------
> Thanks .
> Added other stuffs like a clearer message to warn that the imported file 
> is a google earth 4.0 and should be a simple google earth one. Now, 
> progression indicators can be unset from the script's buttons box.
> The new script can be found there:
> http://jmsoler.free.fr/didacticiel/blender/tutor/py_import_kml-kmz.htm#kmz_Mesh_complete_import-0.1.9f 
> 
> or directly here :
> http://jmsoler.free.fr/util/blenderfile/py/kmz_ImportWithMesh_Z019f.py
> 
> With a little luke, the version 2.0 of this script will read the google 
> earth 4.0 format.
> 
> jms
> 
> (ps : modifs on the rvk1torv2 script are almost ended.)
> 
> 
> 
> 
> _______________________________________________
> Bf-committers mailing list
> Bf-committers at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-committers
> 


-- 
Campbell J Barton

133 Hope Street
Geelong West, Victoria 3218 Australia

URL:    http://www.metavr.com
e-mail: cbarton at metavr.com
phone: AU (03) 5229 0241


More information about the Bf-committers mailing list