LoopCutter script for Blender

Hot off the presses…

A VERY Alpha version of a script I’ve been working on (thanks to those who have helped me with my queries)

I got annoyed that there was no easy way to cut a loop into a Blender object so I could refine it further, so I decided to create one something like the ‘Connect’ command in Wings3D. Since Blender doesn’t really understand the concept of ‘edges’ very well, or handle polys with more than 4 sides, I had to work on a per face basis, but it seems to do what I wanted it to, at least on my setup :slight_smile:

How to use it

In edit mode:

Select a set of vertices defining a loop from your model (each face needs to share at least two edges with another face and it has to loop)

Hit YKEY to split and PKEY to separate

Exit edit mode and select the new object

Run LoopCutter.

You should get a new object which is split down the middle along the loop.

Select this object and go into edit mode, then remove doubles.

You can then join this with your original model, remove doubles again and there you go.

It takes a lot longer to explain than it does to do :slight_smile:

NOTE
Make sure that your loop only uses quads - Anything else in there and the results will be unpredictable to say the least.

As I say, this is VERY alpha and may well not run at all on your setup. It runs fine on mine (OS X, Python 2.2.3, Blender 2.2.8a) and that’s all I can say at present.

Post here to let me know if it works for you and what you think of it.

And here it is

http://www.setanta.nildram.co.uk/LoopCutter.py

Enjoy

Setanta

testing…
Sounds to long to play with… We’'ll seeeee

^v^

ok just useing a simple extruded cube I get this

Using a clean Global Dictionary.
In Object_GetSelected()
Traceback (most recent call last):
File “LoopCutter.py”, line 87, in ?
File “LoopCutter.py”, line 19, in createMatrix
IndexError: list index out of range

When I run the script on the mesh object and not the loop mesh it makes a new mesh with some sort of subdivide but not a loop.

The biggest problem with your nice thoughts are selecting a loop in the first place. It needs to be simple and quick…

But hey ! Thankyou for the work. I hope you make it realy powerful…
So far I have been useing the knife script from jms…
That does well. but it leaves the old mesh behind, so it is slow to do a lot of cuts with…

also please post some screen shots

Looking at the code, that looks like you have a tri poly somewhere in your object. There is no error checking in there at present so I can’t be sure.

Because of the lack of error checking it will attempt to loop any shape or form at present, so yeah, you will get strange subdivisions if you try to run it on something that isn’t a loop.

As to selecting a loop in the first place, true, that isn’t always easy.

Using ‘Face Select’ will work most of the time, though when you have tight loops sometimes it will incorrectly select polys when you go into edit mode. Using ‘Edge Select’ is also pretty good (<CTRL><ALT><RMB> with <SHIFT> for multiple select)

I have some ideas using the same sort of techniques to select loops, but it can only work is the loop is simple in the first place, in which case I don’t know how useful it would be.

Setanta

ok , Like I said I tested it on stuff. Then I tested it on an extruded cube. That is where the console report comes from. So there are no tris at all.

If you could just have it work by selecting a few vertices, conected or not that go in a circle and have that do the loop. That would be cool and very fast…

http://aprilcolo.com/oh/Colorice.zip

that has a blend file and Tuhopuu2 for OSX.
In side of the blend file are a bunch of scripts form several great coders.

Two of them are from jms they are the knife tools.

Those are what I use for now.
Maybe you can do something with them

Looking at the code again, the same thing could be caused by a solo vertex or by a line - Basically anything that isn’t a quad.

The routine expects 4 vertices in every face and is finding one with less.

Guess it’s time to add in some error checking and do a tutorial on how to use it and when it would be useful. But given that it’s almost 7:00am here, I think I’ll leave that until tomorrow.

Setanta

Caution:
knife is a script (C) December 2002 Stefano <S68> Selleri,
I just did some little modifs to use it on blender228.
The same for rusty knife ( kyk: [email protected] ) ,
and io_obj ( [email protected] )