Commit Graph

175 Commits

Author SHA1 Message Date
524b861437 2.5
Part one (of probably many :) of Operator review/validation.
Nothing final nor defined, it's reseach :)

- Added tool buttons in "Toolbar" (Tkey). Just four examples
  for objectmode, and six for mesh editmode.

(Review in progress is operator internal state vs context, what
do redo exactly, undo vs redo syncing, when op->invoke or not,
etc. This has to be pinned down exactly and frozen asap)

- On undo, clear redo-operator-stack for now (won't work)
- Added call to better detect active/current view3d region.
  ED_view3d_context_rv3d(C)
- Fixed some operators that missed correct redo (add-prim etc).

Later more fun!
2009-06-26 15:48:09 +00:00
6bdbbf150d Ported over the delete key and fkey fully over
to bmesh.  Yay! Creating faces from edge nets
is sill missing, I'm leaving that for later.

I added two new bmop functions, BMO_HeaderFlag_Buffer
and BMO_UnHeaderFlag_Buffer, which are header flag
version of BMO_Flag_Buffer and BMO_Unflag_Buffer.
The new functions properly handle setting/clearing
BM_SELECT via the selection API.
2009-06-18 01:31:50 +00:00
c3fd34d9a7 last commit was accidental. anyway, face loop select mostly works now. there's still some issues. shift-unselecting loops isn't working right now, need to fix it. 2009-06-16 21:33:12 +00:00
2d40b8d56f 2.5
Added SpaceLogic, to restore the old logic buttons into.
In future it can be used for a more advanced logic editor, with
states, behaviour, whatever. We'll see!

This commit only adds the backend for new space. Committed this
now as reference for when we need another space type. It's still
not well plugin-able (dynamic space types), but my idea is to just
have a new SpacePlugIn for this, with a neat small API to define
all relevant callbacks.

Also note the icon for the spacetype is wrong still.
2009-06-16 13:09:36 +00:00
401b58cb45 2.5: Image Editor
* Started porting over to python, menus nearly done, header WIP.
* Game Properties panel is in python too
* Deprecated "Tiles" as a per face flag here, now it's always on
  the image, used to be both, working in a very confusing way.
  Unlikely someone actually had a purpose for this being per face.
* Remove GPC_PolygonMaterial.cpp/h, it's not actually used anymore,
  so I don't want to bother updating it.
* Fix crash in image painting (own mistake in porting over bugfix
  from 2.4x).
2009-06-16 01:22:56 +00:00
51fbc95e8c RNA
* Added icon to property and enum property items. The latter is
  responsible for the large number of files changed.
* For RNA functions, added PROP_RNAPTR flag to ask for a PointerRNA
  as argument instead of a C pointer, instead of doing it implicitly
  with the AnyType type.

* Material: properly wrap diffuse/specular param variables, and
  rename some things for consistency.
* MaterialTextureSlot: added "enabled" property (ma->septex).
* Image: make animated property editable.
* Image Editor: make some things editable, notifiers, respect state.
* Context: fix issue with screen not being set as ID.
2009-06-16 00:52:21 +00:00
fc79b456fd merge with 2.5 at r20783 2009-06-10 19:15:27 +00:00
994a8bd80f pre-merge commit 2009-06-10 13:19:38 +00:00
be286db322 (NOTE: DO NOT TEST)
Start of planned DerivedMesh refactoring.  The mface
interfaces in DerivedMesh have been renamed to reflect
their new status as tesselated face interfaces (rather 
then the primary ones, which are now stored in mpolys).

short review: mpolys store "primary" face data, while
mfaces store the tesselated form of the mesh (generally
as triangles).  mpolys are defined by mloops, and each
mpoly defines a range of loops it "owns" in the main
mloop array.

I've also added basic read-only face iterators, which
are implemented for CDDM, ccgsubsurf, and the bmeditmesh
derivedmesh.  Since faces are now variable-length things,
trying to implement the same interface as mfaces would not
have worked well (especially since faces are stored as
an mpoly + a range of mloops).

I figure first we can evaluate these simple read-only
face iterators, then decide if a) we like using iterators
in DerivedMesh, b) how much of it should use them, and c)
if we want write-capable iterators.

I plan to write official docs on this design after I get
it more stable; I'm committing now because there's a rather
lot of changes, and I might do a merge soon.
2009-06-10 10:06:25 +00:00
dbbe06b690 2.5
Fix for Spin & Screw Mesh edit operators.

- now center and axis are RNA properties for operator
- axis is drawn as Normal button in properties buttons. Fun toy!
2009-06-01 14:08:19 +00:00
f026266e18 merge with 2.5 at r20307. note there were some python hacking necassary for this to work, so um hopefully there's not too much cruft from that.
[[Split portion of a mixed commit.]]
2009-05-23 03:24:15 +00:00
b7fe3258b6 some stability stuff related to undo, and more extrude stuff works 2009-05-19 00:33:54 +00:00
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