Anim8or Community

General Category => ASL Scripts => Topic started by: neirao on August 15, 2008, 11:55:08 am

Title: Script Request: untriangulate faces
Post by: neirao on August 15, 2008, 11:55:08 am
Hello all,

some one can  maker this plugin?
untriangulate faces of mesh..for 3ds objects import..etc..

(http://img164.imageshack.us/img164/5129/untrianglefaceskl4.jpg)

i think then if to change parameters of the "Remove useless points.a8s by Kubajzz" can work...

I use another application for make this..but be cool if Anim8or has this plugin script.. ;)

thanks All! :D

Neirão - Brazil
Title: Re: Script Request: untriangulate faces
Post by: Kubajzz on August 16, 2008, 03:08:20 pm
Hi Neirao,
I've heard about somebody trying to make that script before, but I guess he was not succesfull ??? It would be really nice to have that feature in Anim8or...
Unfortunately a script like this is much more complicated than "Remove Useless Points" script, it would take a while to write this one... I added it to my "TryIt" list, but I think this one is too difficult for me...
Title: Re: Script Request: untriangulate faces
Post by: neirao on August 17, 2008, 09:23:23 pm
Thanks Kubajzz,

your script is excellent!

i´m work with others languagens of programation but i´m newbie in as8.. :)

possibly you or other member will obtain this too.
 
thanks  again. you are great!  ;)


Neirao - Brazil


Title: Re: Script Request: untriangulate faces
Post by: NickE on September 15, 2008, 10:09:14 pm
Attached is a script for untriangulating faces.

It uses a parameter called "tolerance" that should be added by Object->Attributes... Click the "new" button, type "tolerance" (case is important), select float, and put a suitably small value like 0.5 as the value.  The tolerance parameter is the measure of how "non-planar" the four points in the un-trianglulated face are.

The script creates a copy of the original mesh that is untriangulated.  On the console output, it will output a list of all the tolerances found in the mesh to help you select the correct value for your mesh.  If you select a tolerance that is too low, simply delete the created mesh copy, change the tolerance value by going to Objects->Attributes..., and re-run the script.  Or you can delete the original mesh, change the tolerance value and re-run the script.

The script is not perfect.  It often cannot determine the best adjacent face to combine with if the tolerance values are too high.  It is often necessary to use repeated applications of the script with ever increasing tolerance values.

Please let me know your feedback.
Title: Re: Script Request: untriangulate faces
Post by: hihosilver on September 16, 2008, 01:55:39 am
Awesome script NickE!
That looks like a great script.  I'm not sure it'll be the most useful for me, since I'm not often converting triangulated meshes to untriangulated since I haven't found a need yet, but that looks like a great addition to the Anim8or toolset :)
Title: Re: Script Request: untriangulate faces
Post by: Kubajzz on September 16, 2008, 03:29:04 am
NickE, you rock! This script is really great, it works perfectly even with huge models!

I have only one minor suggestion - if there are more meshes in your object, the script will untriangulate one of them, but as far as I understand the code, it will choose the mesh to untriangulate no matter what user wants. It's really just a detail, but I think it would be better if it worked with a mesh selected by user. I personally would do this on line 79:
Code: [Select]
if ($shape.GetKind() == SHAPE_KIND_MESH)    -->    if ($shape.GetKind() == SHAPE_KIND_MESH && $shape.Selected)
Title: Re: Script Request: untriangulate faces
Post by: NickE on September 16, 2008, 10:18:11 am
Kubajzz,

Excellent suggestion!  I have made the change and have attached the updated script.

Add to the instructions posted earlier:
"Select the mesh you would like to untriangulate."
Title: Re: Script Request: untriangulate faces
Post by: neirao on September 16, 2008, 11:40:32 am
Perfect!! :D

congratulations..!!!! :o

neirão Brazil..
Title: Re: Script Request: untriangulate faces
Post by: Kubajzz on September 17, 2008, 04:27:01 am
To make the toolbox kinda complete, here's a link to old triangulation plugin written by Claude:
http://www.anim8or.com/ubb/Forum6/HTML/000143.html (http://www.anim8or.com/ubb/Forum6/HTML/000143.html)
Title: Re: Script Request: untriangulate faces
Post by: headwax on September 18, 2008, 11:43:12 pm
thanks nicke  well done. :)
Title: Re: Script Request: untriangulate faces
Post by: NickE on September 20, 2008, 09:49:36 am
Attached is an updated version of the script that fixed the issue that Kreator found where a model has no joined triangles.

Your feedback is appreciated!
Title: Re: Script Request: untriangulate faces
Post by: benzjie on February 04, 2009, 06:06:29 am
i am getting an error " error on line 155: index value out of bounds '$faceref[5]

any ideas?
Title: Re: Script Request: untriangulate faces
Post by: Tanzim on February 05, 2009, 03:49:15 am
Try using the latest version of Anim8or (0.97)
If you already are, then I'm not so sure about the problem.
Title: Re: Script Request: untriangulate faces
Post by: benzjie on February 05, 2009, 07:04:55 am
too many faces was the problem....after manually untriangulating some faces the script worked
Title: Re: Script Request: untriangulate faces
Post by: captaindrewi on February 06, 2009, 05:57:51 am
i have tried to untriangulate a mesh.but havent succeeded yet.
i get  this.
source points=7008
faces=12446, edges=19519.
analysing shape...Tolerance: 0.500

but cant see any new mesh anywhere
Title: Re: Script Request: untriangulate faces
Post by: benzjie on February 07, 2009, 04:43:54 am
a:  it may take a while
b: you have to make a new attribute called tolerance.
Title: Re: Script Request: untriangulate faces
Post by: gattispilot on February 18, 2010, 11:16:47 am
I get this error:
Error on line 44: undefined indentifer 'attribute'
error on line 44: ';' expected
Title: Re: Script Request: untriangulate faces
Post by: davdud101 on February 18, 2010, 04:58:22 pm
How do i... USE a script file? It makes absolutely no sense to me at all.
Title: Re: Script Request: untriangulate faces
Post by: Kubajzz on February 18, 2010, 08:37:41 pm
First, read the "Installing plug-ins" section on the Scripts page (http://www.anim8or.com/scripts/index.html).

Once you install a script, re-start Anim8or. If the newly installed script is a "Command plug-in" (such as the Untriangulate Faces), there will be a new item in the "Scripts" menu. When you install a parametric-mesh plugin, a new button will appear in the left panel in Object mode and when you install an export plugin, a new option appears in the "Export" dialog box... That's it :)
Title: Re: Script Request: untriangulate faces
Post by: Jdez on February 22, 2010, 04:16:49 am
gattispilot: are you using version 0.97 preview? 0.95 doesn't support attributes.