A new mesh optimizing script

Hi there!

Here is ver. 1.0.0 of my script to optimise meshes… and the modules: General, AG, MeshUtils, MeshWorks

You’d need to copy ALL modules into your Python scripts directory and re-start BLENDER before use.

Script is a result of working on mesh optimizing under this http://blenderartists.org/forum/showthread.php?t=140970… Please read there postings #149 and 150 for more info :wink:

Basically, it does the following:

http://www.geocities.com/elonsie/Blender/Scripts/Vert_removal/3D_hole.jpg

Any critics/suggestions welcome! :slight_smile:

Regards,

What are these extra modules all about?

Are you saying I have to install more software to use your script?

not a critic but an error dude

#############################################
#                                           #
#     * * *   Mesh optimization   * * *     #
#                                           #
#   Written by Emil Lozanov, a.k.a. Abidos  #
#     * Thanks to AlbertoEAF & Crouch *     #
#        version 1.0.0 - 22.MAY.2009        #
#                                           #
#############################################

 ==> 1-st stage <Collecting info> - done...

 ==> 2-nd stage <Re-working collected info> - done...

113
[105]
IndexError
Traceback (most recent call last):
  File "D:\Program Files\blender-2.48a-windows\.blender\scripts\Mesh_opt_100.py"
, line 118, in <module>
    Mesh_optim()
  File "D:\Program Files\blender-2.48a-windows\.blender\scripts\Mesh_opt_100.py"
, line 89, in Mesh_optim
    MeshWorks.Rebuild_mesh(me,vie,vif,viv,eiv,d_ed_dirs,d_v_dirs,d_ill_v_dirs,d_
Holes_Body_verts,lst_toStay,lst_BodyFaces_verts,lst_nonPlanarFaces,fiv)
  File "E:\Blender_files\Scripts\Mesh_opt\098_092\Modules\MeshWorks.py", line 99
2, in Rebuild_mesh
  File "E:\Blender_files\Scripts\Mesh_opt\098_092\Modules\MeshWorks.py", line 18
55, in Add_complex_face
  File "E:\Blender_files\Scripts\Mesh_opt\098_092\Modules\MeshWorks.py", line 19
89, in Make_polylines
TypeError: 'NoneType' object is not iterable

@ Atom - no need for a new software, the script is rather long (more than 2000 rows) so many of its re-usable parts are in modules. THis way it runs faster + I plan to produce some other scripts that use the same procs from the same modules. Sooo… only copy the modules into you Python scripts directory.

@ stvndysn - script is still NOT perfect… have you read about its Limitations?? I’d be interested on what mesh the error occurs… Please share :wink:

Regards,

sure abidos here it is, its a mustang cobra (new nightrider car) i found on the web and am wanting it optimised for a game.

Well… the car is nice but it consists of 7-8 independent meshes which are more or less bent 2D-meshes + lack of connections between the parts. This causes the problem… So far script cannot work correctly with this type of meshes. It would be a matter of further development. I will have in mind the case you showed, thanks! :wink:

The BODY of the car (where the problem mentioned appears) has overlapping edges and free edges. My idea is, “normally”, to clear such edges/faces before the real script processing but so far the meshes are processed “AS IS”… I’ve mentioned that in the other thread, where more details about the script are given.

Here’s one of the problems in the MUSTANG:

http://www.geocities.com/elonsie/Blender/Scripts/Vert_removal/Mustang.jpg

1980,1981 and 1982 cannot be connected correctly cause script detects them as lying on 1 geometric prime line. There are connections (1980,1981) and (1981,1982) and it is OK, but there is a connection (1980,1982) which means (1980,1981,1982) is a zero-face as the triangle has area = 0… => problem in processing…

one suggestion

would it be possible to have only one script
would be faster to handle in one folder
i know you said it’s big but many times i prefer to copy the script in one local folder and run it from there

it’s easier and faster to run this way!

Thanks & happy blendering

Oks, Ricky… I will produce such a version too. But it will work slower as now most parts of script are pre-compiled :wink:

it looks very intersting to reduce the qty of verticies in a mesh
it’s an amazing script to minimize without changing the shape

hope this one makes it into blender as a modifer
would be a great new tool

looking foward for new version

Thanks & happy blendering

Here’s a version of the script that does not require modules and does not throws output unless in case of some error or for short info displayed at the console… I was able to clean the code of procs no longer used but it still needs cleaning to get completely taken out from development/tesing mode. And I was wrong about the speed - its the same when in one .py file, just harder to develop it further which will be required :wink:

In fact, my idea is, when script ready & working w/o problems with flat co-planar faces and collinear edges, to modify it in such a way that it processes meshes for which it would be possible to smooth some surfaces like apple cover, human cheek, car roof… I dont know if it is achievable but… I thinking on HOW-TO do it.

Regards,

thanks a lot

appreciate your efforts
and certain other peoples will too!

hope to see the next version in near futur
i’ll keep an neye on it!

and hope it makes it in blender modfier for 2.5

by the way i did a test on a sibdivided cube

and i got a strange sound coming out of my PC

any idea what it is?

but otherwise seems to work fine - it is removing extra vertices!

another one would be if you can
put the messages on the console directly inside the GUI
so you can see the different phases
but that would be nice only it’s not a major thing

happy blendering

Heh… I havent linked the script with any music (so far), lol :wink:

I’ve heard this too… I think it comes from the Internet cause it disappeared when I closed my FIREFOX :smiley:

internet what you mean?

i got this while running in a blender file

vey strange sound lasting like 3 or 4 seconds

you must have set something somewhere inside to make such anoying sound! LOL

or at lest change the song put something like amazing grace
would be more beautiful at least ! LOL

Salutations

is there any size limits or time limits function for mesh size

Ex: i got a mesh with 800,000 vertices that could use some optimisation

can it do the clean up job and in about how much time

i don’t want to start it on monday and finish the next week !

just an idea

Thanks

That’s why we’re making this script but be aware that it isn’t fully optimised yet and it still has some limitations with some types of mesh topology so timings are not garanteed to be practical.

Test first with a smaller mesh :wink:

This link is closer to post 150 with the info about the script.

http://blenderartists.org/forum/showthread.php?t=140970&page=8

@ Dazzle - links here are results of the other thread…

@ Ricky - I dont know how much time it will take - depends on how many resulting faces (body faces) will be there. Non-planar faces DO count in this version. One issue of significant optimisation will be to keep non-planar faces untouched even without the need to re-draw them. Sooo if you have 700,000 non-planar faces out of your 800,000 - time will be LOOOONGER… Second issue that has strong influence on processing time is how many flat resulting faces will be there. If you have 10 resulting faces with contour of 1000 verts will be faster than 1000 faces with 10 verts :wink: