Commit Graph

563 Commits

Author SHA1 Message Date
0cd511eee8 2.5
Text drawing in 3D window fixed, using BLF default font (yes, nice AA'ed
fonts too :)

Solved it by gathering all strings that needs to be drawn for an object,
and then draw in end of object drawing, in pixelspace. Also cleaned up
some of the code for projecting 3d coords, much nicer now (mat stored in
region-view3d)
2009-05-18 16:42:34 +00:00
5e1fba0e43 extrude works now, though vert extrude does not. still plenty of work needed on this code. also did some work on the select infrastructure; the bmesh api now tracks the number of selected verts/edges/faces. 2009-05-18 14:55:34 +00:00
088579f36b selection now works. next up, undo, and also need to track down an odd bug with face selection and the subdivide tool, which may be related to the bmesh derivedmesh not being refreshed often enough. also committing a start on a set of docs, which are in mediawiki format. 2009-05-18 10:29:37 +00:00
0ba863de29 renamed BMTessMesh to BMEditMesh, did some more monkeywork, cleaned up the more serious warnings, and also non-backbuffered selection sortof works now, though it still needs plenty of work. 2009-05-18 08:46:04 +00:00
166c270f06 NOTE: do not test. work-in-progress commit with editmesh ripped out and replaced with bmesh. this is not usable by any means. for those who read through this, note the design is still fairly messy in places, and fyi BMTessMesh is the replacement for EditMesh, I need to rename it to BMEditMesh. 2009-05-16 16:18:08 +00:00
b4d46e5ded UI: Layout Engine
* Buttons are now created first, and after that the layout is computed.
  This means the layout engine now works at button level, and makes it
  easier to write templates. Otherwise you had to store all info and
  create the buttons later.
* Added interface_templates.c as a separate file to put templates in.
  These can contain regular buttons, and can be put in a Free layout,
  which means you can specify manual coordinates, but still get nested
  correct inside other layouts.

* API was changed to allow better nesting. Previously items were added
  in the last added layout specifier, i.e. one level up in the layout
  hierarchy. This doesn't work well in always, so now when creating things
  like rows or columns it always returns a layout which you have to add
  the items in. All py scripts were updated to follow this.

* Computing the layout now goes in two passes, first estimating the
  required width/height of all nested layouts, and then in the second
  pass using the results of that to decide on the actual locations.

* Enum and array buttons now follow the direction of the layout, i.e.
  they are vertical or horizontal depending if they are in a column or row.
* Color properties now get a color picker, and only get the additional
  RGB sliders with Expand=True.
* File/directory string properties now get a button next to them for
  opening the file browse, though this is not implemented yet.
* Layout items can now be aligned, set align=True when creating a column,
  row, etc.
* Buttons now get a minimum width of one icon (avoids squashing icon
  buttons).

* Moved some more space variables into Style.
2009-05-15 11:19:59 +00:00
405cf80eb8 Big, big commit!!
1) Remove WITH_FREETYPE2 from code, so now blender always need freetype2
2) Remove the old bmfont
3) Remove ftfont and bFTGL library
4) Implement a new BLF_draw_default function for place that still need/use
   the old BMF api.

I try to update both, scons and cmake, but I only can test with make, so
hope all work fine.

MSVC is broken, but I don't have Windows, things to search and fix are
any reference to WITH_FREETYPE2, FTGL and BMFONT (take in care that
blenkernel also have a BKE_bmfont.h, this don't have anything to do with bmfont).
        Always have to link/include the freetype2 library
        Remove any reference to libbmfont
        Remove any reference to libftfont
        Remove any reference to libbftgl (or libbFTGL)
2009-05-05 23:10:32 +00:00
af02a0aa4e UI
* Headers and menus can now be created in python.
* Replaced the uiMenuItem functions to create menus with equivalent
  uiItem functions using a layout, removing duplicated code.
* More uiItem functions are now exposed to python.
* The text editor header, panels and one of its menus are now created
  in space_text.py.
* Buttons window data context icon new changes depending on active
  object.

Issues
* Icons are not wrapped yet, hardcoded ints at the moment.
* The ID browse template is unfinished.
2009-04-22 18:39:44 +00:00
874c29cea8 2.50: svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r19323:HEAD
Notes:
* blenderbuttons and ICON_SNAP_PEEL_OBJECT were not merged.
2009-04-20 15:06:46 +00:00
41dd360420 2.5: Operator naming, reviewed some of the recent changes
by Shaul, did some minor tweaks.
2009-04-15 15:40:31 +00:00
17814e8bf1 editmesh_tools.c op name change 2009-04-12 17:54:07 +00:00
59578bfad2 as per discussion with ton, the editmesh accessors now live
in blenkernel.
2009-04-11 08:26:51 +00:00
084aa7aedb merge with 2.5 at r19462 2009-03-30 10:03:03 +00:00
89b906db9f editmesh accessor functions. most editmesh access now goes through:
EditMesh *EM_GetEditMesh(Mesh *me);
void EM_EndEditMesh(Mesh *me, EditMesh *em);

as discussed on the mailling list, this is to facilitate migration to bmesh.
next step is to merge this this to the bmesh branch.  this was done in the 2.5
branch to prevent too great a divergance.

also, made makesdna/makesrna work on cygwin/msvc2008/scons.
2009-03-30 07:28:37 +00:00
931527e648 - use clear, set, add, enable, disable and toggle as a prefix in operator names
- use select as a suffix eg UV_OT_loop_select -> UV_OT_select_loop
- Each select all operator was using slightly different wording...
  select_all, deselect_all, de_select_all, select_de_select_all -> select_all_toggle

- selection -> select
- POSE_OT_select_connected -> POSE_OT_select_linked to match other operators
- NODE_OT_delete_selection -> NODE_OT_delete since its not used in other operators
- ANIM_OT_previewrange_define -> ANIM_OT_previewrange_set to match other operators
- NODE_OT_fit_all -> NODE_OT_view_all to match other operators
- View2D_OT_* -> VIEW2D_OT_* to match VIEW3D
- View2D_OT_view_downscroll -> VIEW2D_OT_scroll_down more logical
- removed MARKER_OT_mouseselect_extend and made extend a boolean property of MARKER_OT_mouseselect
- MARKER_OT_mouseselect -> MARKER_OT_select
- GROUP_OT_group_remove -> GROUP_OT_objects_remove more logical since its removing objects from groups
- MESH_OT_removedoublesflag -> MESH_OT_remove_doubles
- redundant words MESH_OT_split_mesh -> MESH_OT_split,  OBJECT_OT_object_delete -> OBJECT_OT_delete

renamed selection operator properties
 extend_select -> extend
 column_select -> column
 select_children_only -> children_only
 ... Since these are all in the context of selection operators there is no need for the extra 'select' in the property name.
 
Updated docs
http://www.graphicall.org/ftp/ideasman42/html/bpyoperator-module.html
2009-03-29 02:15:13 +00:00
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
dff4852671 flat and smooth shading descriptions were replaced 2009-03-15 03:11:05 +00:00
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
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
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
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
d122aea865 coded little vert connect tool. connects selected verts within the same face. currently integrated with fkey, along with the simple face merge tool I made too. 2009-03-01 08:02:28 +00:00
8be2a86ce1 split dissolve_disk into dissolve_vert dissolve_disk as agreed. also made dissolve vert bmop use the error api, and put in some code to report it to the user in the xkey ui code. I'm not sure how this should work; I don't think we can have utility code in bmesh/ for reporting errors to the user, so it'll have to go in editors/mesh somewhere. 2009-03-01 06:23:22 +00:00
99919b1714 merge with trunk. also tried to fix tesselator code; new code should've worked, but there's still some problems, possibly not in the tesselator code entirely. also still have reverted tools/Blender.py since scons still isn't fixed, heh. 2009-02-28 12:49:18 +00:00
Nathan Letwory
cdf70e0f84 2.5 - temporary hack hack
#if 0 main body of EdgeSlide for now - 64bit msvc compiler chokes on it.
 - added a goto line combo to make the function complete.
2009-02-20 18:36:27 +00:00
2cb5af58a6 2.5
- Mesh Rip back (Vkey). For those who keep wondering how
  it works: just put mouse cursor somewhere close to the
  selection, press V and mouse mouse away from it. Feels
  like real rip!

- Made extrude sorta work, no menu/options yet though.
  But it does transform!

- Added an short event->mval[2] with region coords, 
  easier coding for the guys :)

- Fill operator standard delivers 'beauty' now
2009-02-19 19:03:53 +00:00
f377be3783 2.5
Assorted smaller fixes:

- Fix: modal keymaps for editmode in view3d were not set again
  when you copy areas or go fullscreen.

- Improved "redo last op" (F6) to search back in history for
  a redoable operator. Operator also used wrong pupmenu type.

- On creating new FCurve editor, the channel rainbow colors are
  set correct.

- EditMesh: fixed code for Spin/Screw, correct props, init and
  error reporting. (Spin hotkey ALT+R temporary)

- recompiled all to check for uninitialized variable warnings.
  (compile flag should be -O for this). Fixed some proto's.
2009-02-19 16:22:07 +00:00
d00b18c718 working yet preliminary (like everything) screw mesh. in irc there was a discussion about setting the screw axis outside of the function, but someone else should do that. 2009-02-18 03:01:45 +00:00
312c822945 spin mesh is alt Rkey - ton, please check and advise regarding screw_mesh and defaults. F3 fails while pressed continuously 2009-02-16 20:04:01 +00:00
27d52217ca 2.5
Cleanup of wm_event_types.h, removed all old "allqueue" defines.
2009-02-16 14:28:33 +00:00
aac8daa177 extrude uses dupe/delete rather then split, and it detects when to not delete geometry (though this could be smarter in the future). also BMO_pop had two lines out of order, which was causing flags layer to not always be freed when they should. 2009-02-15 00:47:19 +00:00
a0fada6f18 added error reporting to edit mesh 2009-02-14 21:31:34 +00:00
209db3a64c merge with 2.5 at r18948 2009-02-13 03:27:03 +00:00
01a12fa553 Replaced unified extrude edges/faces code (the stuff specificaly for
edges/faces,extrudeflag_edgess, not the entire extrude system) with 
a bmesh version. This stress-tested the operator api, and I had to 
code some new stuff,including:

* An api to iterate over Mapping slots and array slots. It's modeled
  after the normal iterator api.
* The ability to copy mapping slots.
* More mapping functions.
* In addition to being able to flag elements in a buffer,
  you can now unflag them (much clearer then passing in ~flag
  I think).

The extrude edge/faces code has multiple layers.  At the top
level is a funtion in editmesh_lib.c, which takes care of selection,
handles mirror modifiers, etc.  It calls the extrude operator, which
in turns calls split, which calls dupe/del.  Note that split needed
a slot to exclude things from being deleting (e.g. when extruding
a single isolated face).

The basic idea (reflected in original design of split/dupe/del by Briggs)
is to use the split function to do the heavy work of extrude.  split spits
out new geometry and mappings from boundary edges, for extrude (it should
also spit out other mappings, but that's for later).

Briggs: you may want to look over this, hopefully I didn't do anything
too evil.

I probably should spend some time going over the 2.5 mesh operators and
cleaning them up, splitting ones that need splitting, etc, and in general
getting them to work properly.
2009-02-12 16:59:51 +00:00
b8e6e01cfd 2.5: Curve edit mode. Transform works again, and editcurve.c is
partly operatorized though nothing hooked up yet.
2009-02-11 23:02:21 +00:00
2249c61d03 2.5 Bugfixes:
Adjusted ranges for subdivide operators (Mesh + Armature). 
* The Mesh one was causing lockups as its range started from 0. Now it starts from 1.
* Tweaked the soft-limits for subdivide operators to be easier to use (1-10 instead of 0-100)
2009-02-09 22:59:26 +00:00
608e6f1d3e edit_tools ops - starting from 4key up to 8key, ctrl and alt. ton: please check if working (especially uv and color functions) 2009-02-07 23:20:36 +00:00
df7e766032 UI
* Changed uiPupMenuOperator usage to uiPupMenuBegin/End (simpler,
  no need to build a string). Also made transform orientation and
  subdiv type enums instead of ints for this.
* Added an icon argument to many of the uiMenu calls, and added a
  uiMenuItemIntO.
* Move auto rna button creation out of outliner code, now is
  uiDefAutoButR for individual buttons and uiDefAutoButsRNA for a
  whole block.
* Implemented uiPupBlock(O). Pressing F6 gives a menu with the
  properties of the last operator to test. I tried to make a redo
  last operator out of this but couldn't get the context correct
  for the operator to repeat in. Further the popup block also has
  some issues getting closed while editing buttons.
* Fix uiAfterFunc memory leak on Ctrl+Q quit.
* Fix handling of RNA number button dragging and sliding for RNA
  buttons with range -inf/inf.
2009-02-04 11:52:16 +00:00
dce3c08b2c made some mesh operator names and values more consistent with object mode + other minor changes.
- percentage -> percent, and always a float.
- renamed selectconnected to select_linked
- removed _mesh prefix for MESH_OT_* operators.
- renamed select_swap -> select_invert (matching object and sequencer operators)
2009-02-01 12:40:27 +00:00
b3c3af2156 - Converted mesh face popup menu to use brecht's toolbox function (like the image view toolbox)
Rather then having a hard coded popup menu with events that call other operators exec functions, operator names are given to the toolbox where it displays the operator name and shortcut.
This means the real operator is registered rather then the one that called it.

Im not sure about the location for the operator though, at the moment its called VIEW3D_OT_editmesh_face_toolbox() in view3d_header.c since the image editor toolbox is in the header file too.
In a way it makes sense because this menu should eventually be in the header.
- Change shortcut to Ctrl+F as it is in 2.4x

- Added a number of operators that were not being registered - MESH_OT_fill_mesh, beauty_fill, convert_quads_to_tris, convert_tris_to_quads, edge_flip, mesh_set_smooth_faces, mesh_set_solid_faces

- Renamed redundant MESH_OT_mesh_set_smooth_faces() to MESH_OT_faces_shade_smooth(), same for solid.
2009-02-01 04:22:18 +00:00
2755d48d4e - Change 2 operators from using int properties into enums.
- Renamed MESH_OT_mesh_selection_mode_menu to MESH_OT_mesh_selection_type since the operator doesnt have to be accessed from a menu.

Shaul, you might want to look over this, using enums means WM_menu_invoke can be used instead of writing an invoke function for each operator.

Added error messages to WM_menu_invoke if no enum "type" property is found.
2009-02-01 02:37:12 +00:00
51ded6696a 2.5
Big commit, but mainly adminstration.

- Enabled ot->flag OPTYPE_UNDO to work.
- Removed all redundant ED_undo_pushes, but I'd
  recommend everyone to check it while testing. :)
- Added view manipulations as OPTYPE_REGISTER,
  although this will flood the redo stack a bit...
  Nevertheless; for a "redo last action" panel we
  can simply check if both flags are set for redo.

- Bugfix in editmode undo: selectmode was cleared,
  so you couldn't select after undo
- Bugfix in mixing tweaks and keymaps... solution
  works but is weak, need to think over a while.
2009-01-31 19:40:40 +00:00
86a2a0f694 2.5
Edit Mesh:

- Added back "Edge Shortest Path select"
  It now also does regular selection, more fun! 
  It's mapped to CTRL+click now, and makes or clears selections 
  between current and previously activated edge.
  Seam/Sharp/etc marking is a toolsetting mode still. These
  options cannot become properties easily, because the tool
  uses the properties of selected edge to clear...

- Removed a whole bunch of G.f flags, related to mesh drawing.
  It's all now local in me->drawflags. Here's the list of
  removed old globals:

G_DRAWEDGES
G_DRAWFACES
G_DRAWNORMALS
G_DRAW_VNORMALS

G_ALLEDGES
G_HIDDENEDGES

G_DRAWCREASES
G_DRAWSEAMS
G_DRAWSHARP
G_DRAWBWEIGHTS

G_DRAW_EDGELEN
G_DRAW_FACEAREA
G_DRAW_EDGEANG
2009-01-31 13:30:56 +00:00
05e04c5e45 delete menu is back DKEY. seperating may be needed to delete_mesh 2009-01-31 02:31:58 +00:00
a7b0df894e 2.5
Edit Mesh: Fkey back, add edge-face or fill 'edge net'
Make fgon will be different operator.
2009-01-30 19:14:50 +00:00
8036342ea8 2.5: UI & Menus
* Cleaned up UI_interface.h a bit, and added some comments to
  organize things a bit and indicate what should be used when.

* uiMenu* functions can now be used to create menus for headers
  too, this is done with a uiDefMenuBut, which takes a pointer
  to a uiMenuCreateFunc, that will then call uiMenu* functions.

* Renamed uiMenuBegin/End to uiPupMenuBegin/End, as these are
  specific to making popup menus. Will convert the other
  conformation popup menu functions to use this too so we can
  remove some code.

* Extended uiMenu functions, now there is is also:
  BooleanO, FloatO, BooleanR, EnumR, LevelEnumR, Separator.

* Converted image window headers to use uiMenu functions, simplifies
  menu code further here. Did not remove the uiDefMenu functions as
  they are used in sequencer/view3d in some places now (will fix).

* Also tried to simplify and fix bounds computation a bit better
  for popup menus. It tried to find out in advance what the size
  of the menu was but this is difficult with keymap strings in
  there, now uiPopupBoundsBlock can figure this out afterwards and
  ensure the popup is within the window bounds. Will convert some
  other functions to use this too.
2009-01-30 12:18:08 +00:00
5f9ee2cbfe 2.5
- Made WM_cursor_wait() work without context or pointers,
  like old waitcursor(). Only use when operations entirely
  block UI. It will set waitcursor for all open windows.

- Cleanup in mesh tools, removing old cruft, and prepare
  for more goodies for shul to work on!
2009-01-29 18:54:22 +00:00
3e6b5804fd editmesh face menu back, ctrl-pkey 2009-01-24 22:21:12 +00:00
b7f0add801 remove doubles op, ton: is this working properly? 2009-01-23 03:07:07 +00:00
d5f69e8552 2.5
- warning cleanup (wrong casts, unused vars, missing protos)
- removed old cruft from node_edit.c
- cleaned wm_jobs.c a bit
2009-01-22 15:46:35 +00:00