I wrote two lines of code, and explained what they should do. Please run each of them separately (copy/paste them to the python command), and tell me if they do what they suppose to do.
Check the indentation (spacing before a line of code). For example, if the ‘return’ line has the same indentation as the if, it would be executed anyway, and nothing would happen.
Make sure that you execute the last line “main()”, else only a procedure is defined and nothing would happen. After running the script, please try to run ‘main()’, with nothing selected, and see what happens (this check if the procedure was defined or not).
Concerning the two last steps, let’s verify what you are doing:
4.1. With your browser, go to http://svn.code.sf.net/p/mymayaplugins/code-0/trunk/boolPro/connect_boolPro.py
4.2. Ctrl+a to select everything, and then ctrl+c to copy
4.3. Open the script editor, go to the python tab, and ctrl+v to paste.
4.4. Press the ‘enter’ in the keypad (not the other one), to execute the whole script.
An alternative to step 4, go again to my link, and save the script on your hd with a name connect_boolPro.py. From the script editor, file> load script, select the script you saved, and execute it with the keypad enter.
Start a manual debug, i.e. test each line of the script to see if it is executed, and see where it fails:
6.1. Clear the selection, and run the script. It should print: “Please select two meshes”. If it works (i.e. prints select two…), select two objects and continue to the next steps.
6.2. After the ‘return’ line, add a line
print "Hello World"
, BUT with the same indentation as the ‘if…’ line. Run the script, and hello should be printed.
6.3. Move the print hello line after
res = mc.createNode("mesh")
with the same indentation as this line, and see if it’s printed.
6.4. Continue this way, i.e. moving the print hello line down the script (after the next line of code and don’t forget indentation), and check where it fails (doesn’t print hello).
Since no polySurface1 is created, there should definitely be a problem with the first lines or the final main().
BTW, the boolPro1 node can only be seen if you uncheck the display> dag objects only in the outliner.
Ho, and please don’t quote all of this when replying
I went through the manual setup you described in the OP and was able to get the nodes created. When I ran the full script it just wasn’t running at all (I’m guessing it’s because it wasn’t finding the plugin as it was named)
All in all, it’s working now with a little fiddling, and man is it awesome! Thanks for putting the time in to make such a great plugin.
Hi there.
Excellent stuff here. Thanks for the plugin but:
It is not good in maya 2014, if you select more than two objects things seem strange when you change boolean type and in some cases there is no object.
At some time I had this error in the output window:
FACE LOOP ERROR: 000000000D0CF1E0-000000000D0CF320 : 1
FACE LOOP ERROR: 000000000D0CF0A0-000000000D0CF258 : -1
FACE LOOP ERROR: 000000000D0CEFD8-000000000D0CF0C8 : -1
FACE LOOP ERROR: 000000000D0CF0F0-000000000D0CF1E0 : 1
FACE LOOP ERROR: 000000000D0CF050-000000000D0CF280 : -1
FACE LOOP ERROR: 000000000D0CF140-000000000D0CF208 : 1
FACE LOOP ERROR: 000000000CE46F58-000000000CE47048 : 1
FACE LOOP ERROR: 000000000CE46EE0-000000000CE46F58 : 1
FACE LOOP ERROR: 000000000D0CEFB0-000000000D0CF0F0 : 1
FACE LOOP ERROR: 000000000D0CF0C8-000000000D0CF208 : -1
FACE LOOP ERROR: 000000000D0CF000-000000000D0CF190 : -1
FACE LOOP ERROR: 000000000D0CF028-000000000D0CF2D0 : 1
FACE LOOP ERROR: 000000000CE47020-000000000CE47110 : -1
FACE LOOP ERROR: 000000000D0CF258-000000000D0CF348 : -1
FACE LOOP ERROR: 000000000D0CF2F8-000000000D0CF348 : 1
FACE LOOP ERROR: 000000000CE47020-000000000CE47070 : 1
FACE LOOP ERROR: 000000000D0CF2A8-000000000D0CF2D0 : -1
FACE LOOP ERROR: 000000000D0CEFD8-000000000D0CF140 : 1
FACE LOOP ERROR: 000000000CE46F08-000000000CE46FD0 : -1
FACE LOOP ERROR: 000000000CE46EE0-000000000CE46F08 : -1
FACE LOOP ERROR: 000000000D0CEFB0-000000000D0CF320 : -1
FACE LOOP ERROR: 000000000D0CF0A0-000000000D0CF2F8 : 1
FACE LOOP ERROR: 000000000D0CF000-000000000D0CF280 : 1
FACE LOOP ERROR: 000000000D0CF028-000000000D0CF230 : -1
FACE LOOP ERROR: 000000000D0CF050-000000000D0CF190 : 1
FACE LOOP ERROR: 000000000D0CF230-000000000D0CF2A8 : -1
FACE LOOP ERROR: 000000000CE47048-000000000CE47110 : 1
FACE LOOP ERROR: 000000000CE46FD0-000000000CE47070 : -1
I am only using primitives and a bolean from primitives.
Everything is fine.
Confused because B - A does an interception between even objects and also a difference with the odd objects counting from the last 4 selected objects added to the last object space.
Maya crashes when I try to move objects in B - A.
Maybe this can be useful or there is something wrong here?
Is there a chance that you give me a full description of the problem and how to reproduce it?
I’m selecting all the objects from pSphere1 to pCube1. I’m running the boolPro setup script, and I change the operation to B-A. I’m translating some of the objects, and everything is fine. Now what?
the face loop error appeared again with simple objects from primitives.
See this mb file select from first object and try to make A - B or interception, it makes face loop error.
EDIT: I must triangulate the cubes before making A - B and things seem to be fine.
2ndEDIT: The first object in the file was a boolean that did nor work well, try seeing it shaded.
It seems that booleans with cubes do not work.
I selected all the objects, ran boolPro (on default union mode), and got the face loop error. The problem is with the first object. I mentioned this before, and now I added it as a note to the initial post on this thread:
Boolean operations are defined for solids. Thus, any input object should be watertight and with planar faces (preferably triangles). Whatever booPro does with other objects is magic, which might fail.
Also, the first object fails the cleanup test, as the note before that warns:
If the operation fails, first check the validity of the input meshes. Each input mesh should pass the Mesh> Cleanup with all the parameters on. If the problem persists please post here a link to your two meshes (.obj or .fbx).
So, please post an example with watertight objects, which passed the cleanup test.
Good job, you found a bug (or at least I can’t remember it).
In the following example I created two cubes. One is scaled along x,z axes and one is scaled along y-axis. Then I did boolean union.
[img]http://i743.photobucket.com/albums/xx77/zoharl/maya/2cubes_boolpro_bug_zps19fb85ac.png[/img]
BUG: In a boolean operation (e.g. union) between two objects A and B, if A is fully contained inside a face in B, then the face would disappear. Temporary solution: refine the face (Mesh> smooth).
Actually, it’s more of an unimplemented feature than a bug. That is, Carve lib supports it (boolean operation when one of the objects is fully contained within a face of another), but it’s not enabled in boolPro. Not sure when we will have time to address this.
Thank you very much for providing so powerful BoolPro. Currently I am trying to do boolean operations to multiple domains polyhedrons. Before this I always use CGAL. However, for this kind of multiple domains polyhedrons, the CGAL doesn’t work. I noticed that Carve could process this kind of problem and I also got to know that the powerful BoolPro provides convenient interface between maya and Carve. I downloaded the BoolPro code and studied very much from the code. Thanks.
Now I have a problem when using the Carve. For the poly1 and poly2 which are read from a1.off and a2.off, the following code crashed. Could you please take a look at it for me?