sidebar features
sidebar content

Go Back   Blender Artists Forums > General Forums > Python & Plugins

Closed Thread
 
Thread Tools
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Edit 08/12/2005
Blender 2.4 now provides the edgeloop delete function. Since it is an internal function, it is a lot faster. The only advantage left for the Vertex Loop Remover script is that it preserves the UV mapping of a mesh.

----------------------
Here are two scripts that are related, in fact, they share most of the code.

1.- The first one is a merge tool, by which selected vertices are removed based on the shortest distance to another linked (not selected) vertex. This can be used as a"drag and merge" tool, not having to move the 3d cursor. Maybe it is not very intuitive because the appearent distance between vertices in the screen can be deceiving. Basically I keep using it because it cares to update the uv maps, trying not to mess them up. Hopefully someday this will be implemented to add to the poor merge tools.

Download: [size=5]http://kokcito.tk/dragmerge04.py[/size]

2.- Since this first script allows for multiple selections, I found out it can be used to remove vertex loops, but it has to be helped by dragging the vertices close to their targets, This is not so easy if the loop is curved, so I thought I could rewrite it to become an easy to use vertex loop remover.

You can select a vertex loop (AKA edge loop) with alt-B and then run the script to see the magic. As a child of the merge script, this script also preserves the uv mapping.

When there is a triangle along the loop, the script will try to look for the best side to merge to, but if there are more triangles, it will not be possible to match the loop to any side, even if alt-B selected it.

Download: [size=5]http://kokcito.tk/remvrtloop03.py[/size]

Annoyances:

When a vertex loop has only two vertices, the remover will not work (vertices on the ends of the loop don't count if they are connected to other than four edges).

If the mesh has RKV, it will always crash.
#1   Old 21-Jan-05, 06:49   


mvotre mvotre is offline
Member
 
Join Date: Sep 2003
Posts: 160
wow !! thank you dude !
i actually just tested the remove loop script, and it worked flawlessly (?)
when i take a huge loop, with lots of points, it gets slow, but dont crash at all.

thanks for the great script, and i hope this can get implemented in blender

edit: ooops. when i remove some loops from a mesh with creases, the creases are gone ! but it still works fine :P
#2   Old 21-Jan-05, 18:29   
Rangel's Avatar
Rangel Rangel is offline
Member
 
Join Date: Sep 2003
Location: Brasilia - DF - Brasil
Posts: 1,061
Thank you very much! I think the merge script is a real time saver.
Could a similar process be coded for snap (drag and drop)?
............................................
Alexandre Rangel
Multimedia Designer
http://www.3dzine.org
#3   Old 21-Jan-05, 19:58   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Thanks for trying!

mvotre:

I hadn't thought of creases because I haven't really used them myself, let me look into it. I don't know if this can be accessed thruogh python, but good observation.

rangel:

I don't really understand, but I think not, maybe not from python, could you explain? Maybe it's a good idea.
#4   Old 22-Jan-05, 05:55   
Rangel's Avatar
Rangel Rangel is offline
Member
 
Join Date: Sep 2003
Location: Brasilia - DF - Brasil
Posts: 1,061
Right now in Blender, vertex snap is a four step process:
- Select target vertex
- Snap cursor to that point
- Select vertex to be moved
- Snap that vertex to the cursor

The following behaviour could be coded:
- Select vertex to be moved
- Select the "new snap mode" (button or key)
- Now that vertex would auto snap to closest vertex ("magnet")

In Maya, snap works (very pratically) this way:
- Start moving a vertex
- Keep pressed one of the snap keys (for vertex, edge, grid...)
- The vertex being moded snaps to the closest target (Vertex, edge, grid...)
............................................
Alexandre Rangel
Multimedia Designer
http://www.3dzine.org
#5   Old 22-Jan-05, 18:36   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
I didn't know about Maya, makes sense. In an old program, Imagine (which I used many many years ago) the vertex to snap to was simply the most recently selected vertex. Your autosnap idea would be great in Blender, moving the cursor involves too many steps and requesters. In fact, if python scripts could be bound to keys, the script would just do the trick.

For now I think this is as close as you can get.
#6   Old 23-Jan-05, 06:01   
Sutabi's Avatar
Sutabi Sutabi is offline
Member
 
Join Date: Mar 2003
Location: Vista, CA, USA
Posts: 1,712
oh man this is what I really needed!!!!
............................................
______________________________________
Developing the imagination of art.
#7   Old 25-Jan-05, 09:27   
harkyman's Avatar
harkyman harkyman is offline
Member
 
Join Date: Mar 2002
Location: The House of Stone and Water
Posts: 3,298
I've wanted this feature several times while modelling. Thank you.

Also, I think that the current edgeloop tools began life as python scripts. Maybe this one's functionality could make it into the main release as c.
............................................
Roland -- Check out The Beast!
Are you ready to take the next step in Blender?
Animating with Blender: How to Create Short Animations from Start to Finish
#8   Old 25-Jan-05, 12:33   
SHABA1 SHABA1 is offline
Member
 
Join Date: Mar 2002
Location: California
Posts: 1,458
Quote:
Originally Posted by mvotre
edit: ooops. when i remove some loops from a mesh with creases, the creases are gone ! but it still works fine :P
What exactly do you mean by "creases". Can you post and screenshot?
#9   Old 25-Jan-05, 15:20   
Caronte's Avatar
Caronte Caronte is offline
Member
 
Join Date: Mar 2002
Location: Valencia-Spain-Europe
Posts: 505
Very usefull!!
Thanks.
............................................
Caronte.
http://www.nicodigital.com
\"Some day, all will be digital\"
#10   Old 26-Jan-05, 12:56   
SHABA1 SHABA1 is offline
Member
 
Join Date: Mar 2002
Location: California
Posts: 1,458
I have not tried this wiith a make human mesh yet but I do not know if it would work. I think the MH program uses RVK to do its morphing. At least Manuals old Head Creator script did, which is what MakeHuman sprung from.
#11   Old 26-Jan-05, 15:49   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Have you realized you can also collapse a face loop into a vertex loop by using the face loop cut (cntrl-r), and then removing the two adjacent vertex loops?


Please update the vertex loop remover script, I found a couple stupid bugs.
http://kokcito.tk/remvrtloop03.py . It still can't deal with very short loops (two valid vertices), but should be easy to fix (use the merge script for those cases).

Thank you for all your comments! I wanted to write this script, but was lazy until someone asked at the Blender General forum. I would like also to see this in Blender, but the few times I have tried to figure out the c source code, I get lost.

About hidden vertices, creases and seams, the problems seems to be in the mesh.update() method, which causes all edges informations to be lost, so the problem is in Blender, not in my script. It seems it has been solved, so hopefully for the next release all that will be fixed.

I don't really know how makehuman works, I have just played a bit with it and tested to remove some vertex loops. The tricky part comes when triangles result from the loop removal. Generally to keep an all-quads mesh when you remove a vertex loop, you have to remove another loop somewhere else and then do some alt-j around to get more of those nice long loops.
#12   Old 27-Jan-05, 06:13   
SHABA1 SHABA1 is offline
Member
 
Join Date: Mar 2002
Location: California
Posts: 1,458
When I ran the removevertloop script on a very simple model I made myself. I get the following error.

Code:
Traceback (most recent call last): File "C:\PROGRAM FILES\BLENDER FOUNDATION\BLENDER235\.blender\scripts\remvrtlo op01.py", line 236, in ? tloop=gettargets(vloop) File "C:\PROGRAM FILES\BLENDER FOUNDATION\BLENDER235\.blender\scripts\remvrtlo op01.py", line 148, in gettargets if v in pairs[i+1][1]: IndexError: list index out of range
#13   Old 28-Jan-05, 15:16   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Yes, I know that error, the script doesn't test everything. That happens because your loop can't be removed (you post no shot, no blend file, so your console output is not that useful). Just because it gets selected by alt-B doesn't mean it can be removed. There must be the SAME number of vertices on a parallel loop to merge to, and the loop must not touch more than two vertices of any polygon.
#14   Old 29-Jan-05, 06:15   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Still pending a rewrite, but I thought it was important to post this little bugfix, some weights were assigned where they didn't belong.
#15   Old 11-Feb-05, 06:57   
SHABA1 SHABA1 is offline
Member
 
Join Date: Mar 2002
Location: California
Posts: 1,458
Thanks for the two scripts. The dragmerge03.py was really helpful for what I want to do. I just have to get use to removing verts so that quads are formed. I found that quads are easier to put seams on then a mesh made of triangles.
#16   Old 11-Feb-05, 07:09   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
Quote:
Originally Posted by SHABA1
Thanks for the two scripts. The dragmerge03.py was really helpful for what I want to do. I just have to get use to removing verts so that quads are formed. I found that quads are easier to put seams on then a mesh made of triangles.
Update to 04, 03 has a bug.

There is an idea: Merging triangles into a quad when possible to minimize resulting triangles. I had thought of it, that would save me work too, but proved a bit difficult (I don't promise anything). And yes, it is best for many reasons to keep triangles to a minimum, or zero (no subsurfing artifacts, vertex loop modeling). You might end up a no-triangles freak like me! (example images of my mesh)
#17   Old 13-Feb-05, 08:12   
olivS's Avatar
olivS olivS is offline
Member
 
Join Date: Dec 2003
Location: France
Posts: 1,062
hey toloban,
i'd like to use your remove-loop script but unfortunately the URL you provided is no longer valid. Do you have an alternate URL, or has anybody mirrored it, luckily?
Hope somebody will mind helping!
Cheers,
............................................
Olivier Saraja
--
.:Feeblemind.org:.
#18   Old 01-Jun-05, 20:17   
JarellSmith JarellSmith is offline
Member
 
Join Date: May 2002
Location: California, USA
Posts: 692
It's now included in Blender 2.37 in the script mesh menu.
#19   Old 01-Jun-05, 20:52   
tolobán tolobán is offline
Member
 
Join Date: Aug 2004
Posts: 587
SORRY. The scripts can be found at this URL:
http://kokcito.tk

Quote:
Originally Posted by JarellSmith
It's now included in Blender 2.37 in the script mesh menu.
Oooops! Lazy me. I had not applied for inclusion because I think my script is somewhat sloppy. But that'll be a big honor.
#20   Old 01-Jun-05, 22:22   
Closed Thread

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT. The time now is 16:04.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Logo and website design copyright © 2006 by froodee design bureau. All rights reserved.
Blender Headlines
Featured Artwork
Crocodile by Julia Korbut
Classic vintage look renders by HANGAR
Blending life - Old George by bigbad
Other Blender Sites
new icon Blender Homepage »
The official Blender homepage
new icon BlenderNation »
Fresh Blender News, Every Day
new icon Blenderart Magazine »
Blender articles, tutorials and images.
Social BlenderArtists