Commit Graph

115 Commits

Author SHA1 Message Date
e63f211721 Adding missing prototypes, removing unused variables, initializing vars,
all to make compiling warning less again in gcc. :)
2005-09-15 17:32:24 +00:00
dd0cc4d1d2 Fix for bug #3024
In non-prop mode for edgeslide, loop would not return to proper position after cancel.
2005-09-12 14:01:44 +00:00
Alexander Ewering
2da83cecc4 New feature for edgeslide: Holding SHIFT now slows down movement by factor
10 (like transform()) and allows for fine-tuning the loop with hairy
reference edges.
2005-09-09 16:27:20 +00:00
34ae14778c Removing Auto-Fgon feature till it can be a little better implemented and integrated 2005-09-08 12:59:47 +00:00
35734007de Percent and Flip now invalidate the edgeslide redraw, so that it updated on key press 2005-09-06 15:55:54 +00:00
e0c7d270d9 - assorted minor warning fixes 2005-09-03 16:20:33 +00:00
b787bc2829 Auto-Fgon Feature for subdivide
If Fgon is selected in mesh tools panel, In the following cases

Quad - 2 edge Adjacent - Path
Quad - 2 edge Adjacent - Innervert
Quad - 3 edge

'extra' faces are combined to fgons. to make cleaner subdivides. Please give feedback
2005-09-02 16:31:03 +00:00
1472a7aacd Adding back in the "Big Purple Dot" to indicate which edge the non-proportional Edgeslide is using for distance 2005-09-01 18:40:16 +00:00
c9eb15714c Nonproportional mode for loopcut
while sliding the edge, press P this will swap modes. while in Non prop mode, press F to change the control "side". You can still change the control edge too.
2005-08-30 20:33:35 +00:00
3b96d6584f Force redraw on Edgeslide Cancel (RMB and ESC)
Fixes bug reported by Fab31 on IRC
2005-08-30 18:09:07 +00:00
a51896b591 Move the settings in the Mesh Tools panel to the new toolsettings struct in Scene. These settings are now saved per scene. 2005-08-24 20:37:25 +00:00
a978c122ee Making compiler happy;
- removed unused variables
- #if 0 around unused calls
- init of uninitialized vars
2005-08-24 20:26:28 +00:00
2540ca88e8 Quad Adjacent edge subdivide type moved to Mesh Tools panel rather than pupmenu on all subdiv calls. This is a session value like beauty and will revert to path each time you load blender. 2005-08-23 14:13:00 +00:00
3b8e94ac6b This commit introduces 2 new filling methods for subdividing quads which have only 2 adjacent edges selected. Path, Fan and Innerverts. ATM whenever a call is made to any subdivide calling tool, you will be asked for the type by a pupmenu. This will be replaced (perhaps) by a panel setting... 2005-08-22 18:05:40 +00:00
7804860cf6 - added mesh_strip_loose_faces, works in conjunction with make_edges
to get rid of faces with MFace.v3==0
 - change all Mesh's to have ->medge now. This is forced by make_edges
   on readfile, and in the various exotic important routines, and on
   conversion back in python.
 - make python NMesh structure always have medges now (needs testing)
 - with above two changes it is guarenteed that mf->v3 is never ==0
   in main blender code (i.e., all MFace's are actually triangles
   or quads) and so I went through and removed all the historic tests
   to deal with MFace.v3==0. Equals lots of deleting, I am in heaven!
 - removed MEdge edcode flag, no longer needed
 - added experimental replacement for edge flag system

Still are some inconsistencies in FACESELECT mode edge drawing to
be ironed out.

NOTE: This commit adds an experimental edge flag calc system, based
on 10-seconds-of-thought algorithm by yours truly. Would appreciate
feedback on how this system works, esp compared to old one and esp
on complex or interesting models.

To Use: New system is enabled by setting G.rt to a value between
1 and 1000 (Value of 0 uses old system). Value 1000 is reserved for
"auto" edge, which is more or less identical to old system but also
makes sure that at least 10% of edges are drawn (solves errors for
super subdivided meshes). Values between 1 and 999 act as percent
(out of 1000) of edges that should be drawn, starting with "most
interesting" edges first. Please try it and comment!
2005-08-21 07:19:20 +00:00
185054bf5b Temp edge selection for edgeslide draw length now deselected properly at the end of edgeslide 2005-08-20 21:37:52 +00:00
dd5410162a New feature; User definable Clipping Planes.
Press ALT+B in 3d window, draw a rect, and it becomes a clipping
volume of 4 planes. You then can rotate the view anyway you like.
Works for each 3d window individually.

Disable it with another ALT+B press.

Commit is huge because it had to change all selection code as well.
The user-clipping planes are in 'eye space', the other clipping
happens in projected 'viewport space'.

Nice to notice is that the 'x=3200' convention (to denote a coordinate
is clipped) now is a define. Define value is still a number though... but
we now can get up to screens of 12000 pixels without issues!

Known issue; here it refuses to draw the 'object centers' or Lamp icons
within the clipping region. Can't find any reason for it... however, we
might move to non-pixmaps for it anyway.

Testing might reveil numerous issues, will be standby for it.

Curious? Check this http://www.blender.org/bf/rt4.jpg
2005-08-20 19:18:35 +00:00
f00b5c78d4 In edgeslide if Draw Edge Length is on, the rail edges will be temporarily selected so that actual new edge length can be seen. 2005-08-20 16:38:05 +00:00
a30740c196 - convert all DerivedMesh map functions to use index based
mapping (instead of Edit{Vert,Edge,Face} pointers)
 - dropped convertToDispListMeshMapped (whew, glad of it too)
 - added DerivedMesh drawMappedFaces function
 - dropped EM suffix for DerivedMesh functions, it was neither
   particularly correct nor descriptive
 - converted test_index_mface to test_index_face that also corrects
   MCol and TFace. Good thing we had three versions of this routine,
   you never know when one might burn down.
 - removed flipnorm_mesh, not used anymore (and was incorrect to
   boot)

 - Getting face select to work with modifiers turned out to be much
   more complicated than expected. Reworked mapping architecture for
   modifiers - basically elements in a DispListMesh are now required
   to be stored in an order that corresponds exactly to original
   ordering. MVert/MEdge/MFace all have a new flag ME_XXX_STEPINDEX
   that is set on each element that is set on the first derived element
   of each original element. I can't say the code to follow these
   requirements for subsurf is particularly transparent, but on the
   upside it is a reasonably consistent and simple system that is memory
   efficient and allows keeping the DispListMesh structure.

 - rewrote mirror modifier to be simpler/conform to new requirements
   for mapped DispListMesh structure. This also means that mirror interacts
   much better with incremental subsurf calculation (it used to recalc
   one entire side on any topology change, now it generally avoids that).

 - added EM_{init,free}_index_arrays and EM_get_{vert,edge,face}_for_index
   functions to handle mapping indices back into appropriate EditMesh
   structures.
 - bug fix, make edges didn't recalc object data
 - bug fix, initial image assignment to TFace's didn't recalc object data

 - new feature, added circle select support for FACESELECT
 - bug fix, creating new faces in editmode duplicated the TFACE active
   flag - but there should only be one active tface
 - bug fix, possible crash when deleting all faces in faceselect mode
   on mesh with tfaces...

Still todo: TFace edge drawing is still not always correct in face
mode, in particular with a mirror modifier when mesh has edges (and
no preceeding subsurf). Have not yet decided how to deal with this.
Best solution is probably to do switch to meshes all having MEdge's,
in which case I can get rid of TFace edge flags (and need to recalc
modifiers on tface selection change).
2005-08-20 03:08:23 +00:00
2872263377 - New feature: shift+ctrl+t in Mesh editmode splits quads in exact opposite
way. Requested for low-poly modeling.

- fix: on exit editmode, the code always created a mesh->dvert block...
  silly, this made other code confused which decided whether to use
  dverts (vertex groups) or not.

- removed obsolete call from armature.c. Also fixed name of function there,
  preparation work for nicer support in Blender for "deform envelopes"
2005-08-17 13:26:42 +00:00
0c7f65d152 - added view3d_get_object_project_mat function, returns mat to project
object cos into screenspace without mucking with gl matrices.
 - added view3d_project_ functions, take arguments instead of using
   globals
 - removed View3D.{mx,my,mxo,myo}
 - switch drawobject foreachScreenVert functions to use new projection
   functions
 - switch edge slide to use new projection functions, fixes erratic
   behavior (project was using wrong mat I believe)
 - bug fix in edgeslide, nearest edge to start was one-off
2005-08-15 04:10:02 +00:00
f47f8d9418 Patch provided by Campbell Barton; this makes the editmode Mesh CTRL+T
"convert to triangles" check for shortest diagonal to decide how the
triangles will be made.

Fun todo for another occasion; check on facenormals too...
2005-08-14 10:58:17 +00:00
93aeb6b318 - added make_orco_curf, even does keys!
- removed {lattice,curve}_modifier functions
 - changed render code to use displist for curve rendering
   instead of making its own. required adding a bevelSplitFlag
   field to DispList. I also fixed the bevel face splitting
   which did not work correctly in many situations.
 - changed so all curve data creation happens in makeDispListCurveTypes,
   includes making bevel list and filling polys
 - changed render code to use displist for surface rendering
 - removed Curve.orco variable, built as needed now
 - removed stupid BLI_setScanFill* functions... why use a function
   argument when you can use a global and two functions! Why indeed.
   (this fixed crash when reloading a file with filled curves and
   toggling editmode)
 - bug fix, setting curve width!=1 disabled simple bevel for no
   apparent reason
 - cleaned up lots and lots of curve/displist code (fun example:
   "if(dl->type==DL_INDEX3 || dl->type==DL_INDEX3)"). Hmmm!
 - switched almost all lattice calls to go through lattice_deform_verts,
   only exception left is particles
 - added DBG_show_shared_render_faces function in render, just
   helps to visualize which verts are shared while testing (no
   user interface).
 - renamed some curve bevel buttons and rewrote tooltips to be
   more obvious
 - made CU_FAST work without dupfontbase hack

Also by the way I wrote down some notes on how curve code
works, nothing spiffy but it is at:

http://wiki.blender.org/bin/view.pl/Blenderdev/CurveNotes
2005-08-14 06:08:41 +00:00
75bcb4cd98 - added modifiers_getVirtualModifierList, returns pointer to first modifier
but including "virtual" modifiers (for example, an object skel-parented
   to a lattice has a virtual first lattice modifier)
 - removed mesh_modifier(), all functionality has been incorporated into
   modifier stack (well, keys still don't exist as a modifier, but I am
   not sure if they should).
 - added interface option to convert a virtual modifier into a real modifier
 - added option to parent to lattice object or lattice with deform
 - bug fix, patch of hook indices patched all hooks (oops) not just ones
   for edited mesh

NOTE: Files saved with 2.38 that include an object parented to a lattice
will not load correctly, because it will look like the object is parented
only to the object (i.e. without deform). Can be simply fixed by reparenting
or adding a lattice modifier. Older files are handled automatically.
2005-08-11 03:31:33 +00:00
9030e5f686 - added eModifierTypeFlag_RequiresOriginalData for modifiers that
can only follow deform (for example, they store mesh vertex
   indices)
 - added ModifierType.foreachObjectLink for iterating over Object
   links inside modifier data (used for file load, relinking, etc)
 - switched various modifiers_ functions to take object argument
   instead of ListBase
 - added user editable name field to modifiers
 - bug fix, duplicate and make single user didn't relink object
   pointers in modifier data
 - added modifiers to outliner, needs icon
 - added armature, hook, and softbody modifiers (softbody doesn't
   do anything atm). added conversion of old hooks to modifiers.

NOTE-THE-FIRST: User name field is not initialized on loading 2.38 files
so if you have saved stuff with a cvs blender you will see blank names.

NOTE-THE-SECOND: Since modifiers aren't evaluated yet for non-Mesh
objects, hooks for lattices and curves are broken. Don't updated if
you actually, say, *use* Blender.

NOTE-THE-THIRD: Old hooks used a quirky weighting system during
deformation which can't be extended to modifiers. On the upside,
I doubt anyone relied on the old quirky system and the new system
makes much more sense. (Although the way falloff works is still
quite stupid I think).
2005-08-10 22:05:52 +00:00
02f3c930f5 - bug fix, face center drawing was wrong for editmesh
- added several useful utility functions to editmesh,
   these can simplify/clarify a lot of mesh code, check them
   out
 - cleaned up EdgeSlide a bit to be clearer/shorter
     o bug fix, EdgeSlide did not always cancel correctly
     o bug fix, EdgeSlide did not choose initial "control" edge
       correctly after calc_meshverts_ext change
2005-08-10 03:51:34 +00:00
9823e7d548 Removed need for vert-xs and ys in edgeslide 2005-08-09 20:02:53 +00:00
98741ec436 fix for bug #2906
Was allocating array for all hidden edges, not needed, just hidden with a selected vert needed
2005-08-09 14:44:46 +00:00
6aead5176b Possible fix for bug #2906
Added some parens to change eval order
2005-08-09 13:49:05 +00:00
c192b80b17 Big commit, had to rework lots of selection stuff so that things
worked properly with modifiers. Needs more testing I am sure.
No, honestly, I wasn't just cleaning for the hell of it, it
was *necessary* (I would never do such a thing). Selection should
work completely with cage options of modifiers now.

 - added DerivedMesh foreach functions to iterate over mapped
   verts/edges/face centers. These replaced some of the drawing
   functions and are more general anyway. Special edge drawing
   functions remain for performance reasons.
 - removed EditFace xs, ys fields
 - added general functions to iterate over screen coordinates of
   mesh/curve/lattice objects
 - removed all calc_*verts* functions that were used for storing
   screen coordinates in objects. they were recalc'd on the fly
   for most situations anyway, so now we just always do that.
   calc_*verts_ext was one of those calls that did dirty things
   deep down in the callstack (changing curarea and poking at
   matrices)
 - rewrote all vertex level selection routines (circle, lasso, bbox)
   and closest vertex routines (rightmouse select) to use the new
   system. This cleaned up the selection code a lot and the structure
   of selection is much easier to see now. This is good for future
   work on allowing modifiers to completely override the selection
   system. It also points out some discrepancies in the way selection
   is handled that might be nice to resolve (mesh vertex selection has
   fancy stuff to try to help with selecting overlapping, but it only
   works w/o bbuf select, and curves/lattices don't have at all).
 - had to remove ton's code to move Manipulator to cage location, this
   is not reliable (can come up with a different method if requested)
 - as it happens BezTriple.s and BPoint.s are basically available to
   be removed, just need to rewrite editipo code that still does
   background calc of screen coordinates
 - MVert.{xs,ys} are still around because they are abused in some places
   for other info (not sure if this is safe actually, since they are
   short's and the mvert limit went up).

And did I mention this commit is comes out to -305 lines? Well it does.
2005-08-09 08:12:36 +00:00
7f98c960b5 Added extra Select Type option for esubdivide and put them in defines to get rid of magic numbers
SUBDIV_SELECT_ORIG      - Retain selection to look like original selection
SUBDIV_SELECT_INNER     - New selection is all the new inner edges
SUBDIV_SELECT_INNER_SEL - New selection is all the new inner edges except where only 1 edges was selected on a face

Loopcut now uses SUBDIV_SELECT_INNER_SEL for better interaction with edgeslide
2005-08-08 15:59:05 +00:00
fec419a05e Little fix for Edgeslide so it doesn't crash on usage!
Also fixed trying to edgeslide an edge with a missing rail.

And Changed the okee calls to error (thanks intrr)
2005-08-07 23:59:34 +00:00
11e21a8bac Clean up spaces (make into tabs) in editmesh_tools
Also add menu items for Edgeloop Delete
2005-08-07 21:47:08 +00:00
941d5ae44e Fix for bug #2859
Beautyfill didnt work in illustrated case, due to 1) face select 2) no
correct edges selected...
2005-08-07 21:23:55 +00:00
bfcc67267b In CTRL-E menu "Edgeloop Delete" with a valid "inner" edgeloop selected, this function calls other tools to delete that edgeloop by doing the following
Edgeslide to one side 100%
CTRL +  to select "more"
Remove Doubles

Leaves you with new faceloop selected.
2005-08-07 20:46:26 +00:00
843ffdc49a - bug fix, extrude and duplicate automatically enter transform which
may request info from the derived surface, this means we have to
   force a manual recalc before we enter transform... proper design
   of mesh data invalidation/recalc should make this unnecessary...
2005-08-06 19:13:13 +00:00
32656ad7ef Now while choosing an edge in loopcut, S will toggle loopcut smooth. There is a headerprint to show current status of smooth.
Also a little tweak in subd smooth. is still not perfect in full quads/tris cases
2005-08-05 15:52:28 +00:00
46a8c11064 A small improvement to Subdivide multi smooth. It is not perfect yet :( but its better.
BUT! Try doing a EdgeRing (CTRL-ALT-RMB in edge mode) select and a subdivide smooth multi...That works ok (read loopcut multi smooth)  :)
2005-08-05 15:08:43 +00:00
9102983b51 Make Edgeslide work with Subsurf Optimal "on cage" 2005-08-04 19:31:14 +00:00
280e976044 A little feature for Broken...
When choosing Subdivide from the w menu or Confirming the number of cuts in a subdivide multi, hold down the CTRL key and
instead of getting the original selection recreated on the new edges, get the "inner edges" as you would get if doing a loopcut. UI for this may change before release (perhaps a toggle button in edit buttons)
2005-08-02 18:20:36 +00:00
1d2dd4ce75 Adding a little idling to Edgeslide loop, 2005-07-31 20:18:38 +00:00
3b7d40cfdb For edgeslide control rail there are 2 options:
Scroll Up/Down and Left/Right arrow key will cycle through the control edges in either direction.

I got rid of SHIFT for the time being.
2005-07-30 19:50:51 +00:00
9da7ec89ed Edgeslide Mouse Movement Fix
Edgeslide movement is now controlled by a line drawn between the endpoints of the 2 control rail edges. Edgeslide will
try to pick a control rail pair (will color green ATM) if you don't like the edge it picked, use the mouse wheel up to change it.
have to code mouse wheel down to go other direction still. Just ran out of time ATM and wanted to get this in for movement testing.

movement is in 1% per edge (so 1% out of -1 to 1)
CTRL makes it 10%
SHIFT makes it .1%

Se what you think and give me some feedback on functionality :) Code needs cleanup and comments, so don't crit that too much yet.
2005-07-30 16:37:04 +00:00
a2eefbd7c7 Fixed some warning shenanigans 2005-07-30 01:44:15 +00:00
d44e6153d1 Flush Edge selection down to verts in subdivide if you are in Vertex select mode 2005-07-29 20:07:01 +00:00
60dc7730f4 Commented out some debug printfs 2005-07-29 18:54:48 +00:00
0d90195d17 Another UV tweak for subdivide, It seems to work better now, still not perfect 2005-07-29 18:45:40 +00:00
7d797797c8 A Small change on Edgeslide while I try to come up with a better mouse interaction.
Move mouse  - 5%
SHIFT modifier - 1%
CTRL modifier - 10%
2005-07-29 14:20:48 +00:00
26b2648a72 Little issues, combined commit!
- Bug #2857: Spin didn't create nice consistant normals
- removed unnecessary call to where_is_object() in init-render phase.
- Added DAG_scene_sort() calls when objects were removed (join cases)
- When using texture fonts, the file window header didn't display OK
- Saving a file didn't set the 'wait cursor' anymore (oldie!)
2005-07-25 10:58:21 +00:00
fb651ddb4a - change mesh_calc_normals to set vertices with len(no)==0
to normalised coordinate (convention in blender, helps with
   halo)
 - removed vertexnormals(), vertexnormals_mesh()
 - removed CTX_NO_NOR_RECALC (always assume already calculated)
 - change NMesh.c to call mesh_calc_normals
 - chance load_editMesh to call mesh_calc_normals after done
   converting instead of using editmesh normals
 - update recalc_editnormals to also calc vertex normals (whats
   4 more adds and a sqrt among friends)

Its hard to believe, but it just might be the case that there
are only two places mesh normals are calculated now (renderer
and kernel)
2005-07-23 19:03:43 +00:00