Commit Graph

13836 Commits

Author SHA1 Message Date
Joseph Eagar
52fc6d7829 removed all those nasty enums from the operator api. yay! I'm
so happy.  so now operators and their slots are referred to by
string names.  so much easier to remember!
2009-03-22 23:16:43 +00:00
Geoffrey Bantle
329a8e44ff -> Fixed crasher in extrude code
New extrude code was accessing an uninitialized
variable. Why this sort of thing doesn't cause
crashes on windows, I dont have a clue!

Note for Joe: I see a lot of 'logic' going on in
the client code for extrude that should possibly
put inside the BMOP system itself (aside from the
part about modifiers). This should be cleaned up
in future maybe...
2009-03-22 01:58:43 +00:00
Joseph Eagar
44c120b310 fixed issue in connect vert, had to make a numerical error compensation value absurdly high for some reason I need to investigate. also removed constraints to produce nice tesselations from the ear clipper, since it doesn't really matter for what we do with it. 2009-03-18 17:30:33 +00:00
Joseph Eagar
eb39abdecb made editmesh use mempools, though editmesh customdata does not. this was a major slowdown in bmesh<-> editmesh conversion (even more so then the mf euler, which may not be that bad after all). 2009-03-16 14:52:30 +00:00
Joseph Eagar
b1de007e50 edge subdivide ops now use bmesh code, rather then just the test bmesh op. also, got bmesh edge subdivide's smooth subdivide mode to work (fractal already worked I think, not sure). 2009-03-16 14:15:18 +00:00
Joseph Eagar
aa4915fdcf extrude region op now does wire vert extrudes too 2009-03-16 11:38:42 +00:00
Joseph Eagar
ba4d6babbb some cleanup of bmesh_polygon.c. there were three winding functions, now there's just one, the original testedgeside, that has some additional tests that might fix some issues I was having. still need to decided if bmesh_polygon.c stuff should be entirely double or entire floats, right now there's a little half-and-half going on. 2009-03-16 10:12:52 +00:00
Joseph Eagar
34ed34b572 some fixes for extrude, to better handle customdata, winding, etc. 2009-03-16 09:43:47 +00:00
Joseph Eagar
f8b846ff8f some fixes for extrude, to better handle customdata, winding, etc. 2009-03-16 09:41:33 +00:00
Joseph Eagar
dbad24e0f6 had to increase size of a numerical error compensation value, kindof odd but works 2009-03-15 06:14:03 +00:00
Joseph Eagar
302e796270 connect verts now does geometric tests to perform valid splits. it also supports multiple splits in a face, going around the face boundary in a loop and performing splits. 2009-03-14 13:16:35 +00:00
Joseph Eagar
168847fe79 further code comments. used a somewhat minimilistic style for the function comments, so people won't hate me. 2009-03-14 02:52:16 +00:00
Joseph Eagar
7b5f9c2dec Dissolve faces now uses a different method of finding the boundary,
that handles some non-manifold situations better without failing.  
Also made edge subdivide use a more specializzed internal version 
of BM_Connect_Verts, that should hopefully always split the correct face.

Dissolve verts also now has checks to not accidentally dissolve
unselected vertices.  It's not kindof a hybrid tool, using dissolve
faces where it can to dissolve verts for robustness, and using
BM_Dissolve_Verts where it cannot.

And removed some cruft from a few API functions.
2009-03-13 13:11:50 +00:00
Joseph Eagar
215f0fa27d the make ngon function's overlap test needed some work, the API function
that does that needed to be split in two. this made dissolve faces sometimes
not work.

also added some api functions to recalculate normals for verts, edges and
faces.  and added a new flag, BM_NONORMCALC, to prevent this from happening
on individual fgon faces after they are tesselated.  and made dissolve faces
happen on fkey in all the selection modes, not just face select.
2009-03-12 03:55:53 +00:00
Joseph Eagar
4178cf850a numerical error fix for tesselator 2009-03-11 06:04:17 +00:00
Joseph Eagar
27861a3b3b implemented an (edge) loop walker. note I misunderstood
how original edge loop worked, and made it so if it starts
at a boundary edge, it walks across the boundary.  I'm not
sure if this is bad, most of the time I do that I want it
to do that anyway.
2009-03-11 05:13:36 +00:00
Joseph Eagar
a254db099d fixed some dissolveverts/faces bugs and added a few hackish fixes for some others, so they don't crash 2009-03-09 15:15:17 +00:00
Joseph Eagar
15979466dc fixed triangulator. 2009-03-09 13:24:37 +00:00
Joseph Eagar
714a9303d8 split bmesh_operators.h, added (some) docs in comments, and hopefully made it less messy. also added op names and slot names in comments next to their BM_XXXX_XXX definitions in bmesh_operators.h. 2009-03-09 10:38:36 +00:00
Joseph Eagar
5018318fe0 dissolve faces: errors-out on holes, preserves winding, and doesn't delete original face if no dissolving happened. the conversion from/to editmesh now counts selected elements properly. 2009-03-09 09:52:32 +00:00
Joseph Eagar
34e3e3587b ok anoter compile fix 2009-03-08 16:55:06 +00:00
Joseph Eagar
ccfe5547e1 compiler fix part 1
[[Split portion of a mixed commit.]]
2009-03-08 16:50:11 +00:00
Joseph Eagar
f23b4bc2a1 Got the walker API to work, for safely recursing the mesh.
Used it to implement the dissolve faces operation (previous
incarnation was just a debugging hack).  The code works by
creating one giant new face per region of faces.

The dissolve verts (xkey->collapse, heh need to rename it)
operator now invokes dissolve faces on the faces around verts.
This is less error-prone then a pure topological/euler based
solution.
2009-03-08 15:02:49 +00:00
Joseph Eagar
662230a14c merge with 2.5 at 19207, plus some half-finished walker stuff 2009-03-08 08:03:27 +00:00
Joseph Eagar
0c5032ebf3 merge with 2.5 at 19207, plus some half-finished walker stuff 2009-03-08 07:15:41 +00:00
Geoffrey Bantle
57c37cf10c -> Added new restrction to Join Face Kill Edge Euler
Join Face Kill Edge now checks to make sure it wont create
a face where the same vertex appears twice in the loop cycle.

Note to Joe:

This is what we talked about on IRC a while back. It
seems to work from here, but you should probably give it a
really good test in the vert dissolve code.
2009-03-06 19:41:57 +00:00
Geoffrey Bantle
f945333d81 -> New Euler: "Unglue Face Region Make Vert"
Added a new euler that will take as an argument a face
that is part of a disk and a vertex in the face. The euler
will then 'unglue' this region. An example of this would
be two cones joined at the tip...

Note that this code is untested and probably will have
bugs so shouldnt be trusted yet...
2009-03-06 18:57:43 +00:00
Joseph Eagar
6c481af15c BM_SplitFace now copies header flags to the new face. kindof hackish right now, need to consider how to solve this correctly. also cleaned up tesselator a little and corrected some optimizations that were causing problems. the tesselators now use doubles for internal calculations, should hopefully be more accurate. 2009-03-06 07:17:56 +00:00
Joseph Eagar
f2371cbbae tesselator works. . .FINALLYscons/scons.py BF_QUICK=bf_editors_mesh,bf_bmesh,bf_blenlib,bf_transform,bf_editors_transform also made transform code execute it after transform end. tesselator uses original algorithm, yay 2009-03-06 06:06:14 +00:00
Nathan Letwory
d0267ccf6d 2.5 / Area management
* implementation of a proposal from during Wintercamp:
  - with SHIFT-LMB drag of area corner the area gets
    duplicated into a new window.
    This is the old "Rip Area" operator with a new,
    better name. The old menu and hotkey are now gone.
    This means we have currently split, join and now
    duplicate/copy area into new window in the area
    actionzones.
2009-03-05 23:19:44 +00:00
Shaul Kedem
caf4be7def small commit to allow bpy_operator.c to compile in msvc 2009-03-05 17:47:33 +00:00
Campbell Barton
c3df168539 PyRNA API: some RNA types were crashing on looping, also return None rather then an RNA struct when the ptr->data is NULL 2009-03-05 16:24:30 +00:00
Campbell Barton
a7c4009267 Make RNA an Operator dir() work in py 2.5 - 3.0
removed epy docstrings from RNA python api, since Python can get this info from rna. (could be redone in python if getting doc's on RNA is needed)
epy_doc_gen works again
2009-03-05 12:09:30 +00:00
Nathan Letwory
0229621b51 2.5 / PyRNA
* a collection of small changes after review together with Campbell.
2009-03-05 08:53:29 +00:00
Martin Poirier
63ae590f44 Boolean vectors and arrays! 2009-03-04 15:30:47 +00:00
Campbell Barton
36c3ed2350 run script in the text editor is back. UI scripts dont work yet. 2009-03-04 13:26:33 +00:00
Joseph Eagar
e91a478dab missing file 2009-03-04 09:38:26 +00:00
Joseph Eagar
4b8d872edb ok right branch. . .stop laughing at me :) 2009-03-04 09:34:33 +00:00
Joseph Eagar
2c33a51e3f Printf-style method of calling operations now take a modified format string,
like so:

[opname] [slotname]=%[format code]

Before it was relying on the input format codes being in the same proper
order as the slots, which seemed like a potential maintainance nightmare to
me.  Also the flags for creating buffers from bmop flags or header flags,
now support additional modifiers for combining vert/edge/face inputs.
E.g. %hfvef would accept all geometry with a header flag, and 
%fef would accept edges and faces with a certain bmop flag set.

Example from the UI code:

if (!EDBM_CallOpf(em, op, "del geom=%hf context=%d", BM_SELECT, DEL_ONLYFACES))
			return OPERATOR_CANCELLED;
			
(remember EDBM_CallOpf is the UI wrapper for this that does conversion, 
 error reporting, etc).  
 
 On todo is cleaning up/splitting bmesh_operators.h,
 since it's kindof a mesh right now.  I'm thinking of adding the slot
 names in comments next to the slot ids, but I definitely would have to
 clean up bmesh_operators.h first, or it'd just be too chaotic for me.
 BTW, the operator API should now have enough meta info to wrap with
 a scripting language, not that it matters since that's not happening till
 much much later.
 
 Also hopefully corrected some SConscripts, fix mostly provided by Elia Sarti,
 though I also copied some SConscripts from 2.5 (not sure if doing
 so was especially helpful).
 
 Finally, I refactored a few places to use the new operator calling api,
 as an example of how this is beneficial.
2009-03-04 08:21:10 +00:00
Andrea Weikert
0f040e2f26 2.5 filebrowser
- WIP commit
- bookmarks toggling (region collapsing needs to be done still)
- switching between display types in header (long filenames needs to be done still)
2009-03-03 13:15:40 +00:00
Andrea Weikert
ead30e5bc1 2.5 filebrowser
bugfix: create directories to store thumbnails if they don't exist.
2009-03-03 10:24:06 +00:00
Diego Borghetti
63b4879c9e And another commit to cleanup a little, this is the last,
next commit add internal font and we can go ahead and remove
ftfont and bmfont.
2009-03-02 21:02:39 +00:00
Campbell Barton
c2fdac64c4 * errors in bpyui draw scripts were segfaulting
* added PyLineSpit(), useful for debugging so you can easily find the 
line of the python script running.
2009-03-02 20:18:29 +00:00
Campbell Barton
24e8d7aa74 scons error 2009-03-02 17:24:40 +00:00
Matt Ebb
fc192338c0 * some more rna stuff in materials 2009-03-02 13:34:34 +00:00
Brecht Van Lommel
143fb8e131 2.5: bugfix, new text space was not initialized correct. 2009-03-02 12:43:54 +00:00
Diego Borghetti
acc8d06b77 Cleanup a little before add internal font (bmfont). 2009-03-02 05:20:48 +00:00
Joseph Eagar
1bc67f36d6 Created a printf-style method of calling operators. I did this to cut down on duplicated
code, and also because calling operators was such a pain.  The basic form of the format
is "opname %[code]", where each % matches to an argument.

The codes are fairly simple:
 d - int
 i - int
 f - float
 h[v/e/f] - all verts/edges/faces with a certain header flag.
 f[v/e/f] - all verts/edges/faces with a certain flag.

For example:

  EDBM_CallOpf(em, op, "dissolveverts %hv", BM_SELECT)

will call the dissolve verts operator.

The relevent functions are:
//calls a bmesh operator, doing necassary conversions and error reporting.
int EDBM_CallOpf(EditMesh *em, struct wmOperator *op, char *fmt, ...);

//execute an operator
int BMO_CallOpf(BMesh *bm, char *fmt, ...);
//initializes but doesn't execute an op.
int BMO_InitOpf(BMesh *bm, BMOperator *op, char *fmt, ...);
//vlist version of above.
int BMO_VInitOpf(BMesh *bm, BMOperator *op, char *fmt, va_list vlist);

Note this system is dependant on getting the slot codes from the argument
order.  I'd like to make it better, possibly pass in slot names, but that'd
mean actually giving the slots names (which I can do, but wanted to discuss with
Briggs and others what I have now first).
2009-03-02 04:08:24 +00:00
Joseph Eagar
3faf2b6db7 more tweaks to triangulator. also added a bmeshutils.c file in editors/mesh for ui-related bmesh functions. and made delete only faces use the bmesh del operator, so it can handle ngons. 2009-03-02 02:21:18 +00:00
Joshua Leung
06629033b3 Pose Channels - changing settings in RNA updates them correctly again 2009-03-02 01:22:02 +00:00