Commit Graph

47594 Commits

Author SHA1 Message Date
aa318f0bcc Found potential crash in undo for Curve/Surface; the global var "lastnu"
wasn't restored on undo.
2004-09-29 11:32:08 +00:00
ceb7d3db46 Two fixes;
- borderselect draws cleaner info in bottom/left corner window
- OGL render (in view3d header) option didn't work on successive renders.
  was due to removing hack that reopened the window each time. But now it
  needed to be assigned correctly to blender's 'mywindow' system.
2004-09-29 10:49:19 +00:00
01e6d69ff5 Borderselect and circleselect now use backbuffer method too.
Maybe its time to make this a default now?
2004-09-28 22:05:16 +00:00
de1147e99a Removed nantechnologies from identifierstring :) 2004-09-28 20:59:14 +00:00
5ac0d4fd26 Cleaned the apply deform code in Blender. Now also using the modifier code.
Right now, it works for Meshes (all deformers including Curve) and for
Curve/Surfaces (only hooks).

More follows.
2004-09-28 16:18:22 +00:00
fc0c3a084d Last of the beautifying for subsurf+optimal editing; selectmode 'face' now
draws on click the optimal outline correctly
2004-09-28 14:53:44 +00:00
ff5e65bdbb Crash fix;
- wireframe view
- editmode cube
- subsurf + optimal on
- set new selectmode 'face'

thanks sirdude & sgefant!
2004-09-28 13:58:23 +00:00
e6cc3c1ee1 More maintenance due to new selection code;
- fgons draw correctly again in face selectmode
- on select, fgons dont draw wrong selection dot
2004-09-28 12:04:10 +00:00
84b021e90f Two small fixes thanks to test:
- backbuf draw vertices did still use pointsize 1.0, making them hard to
  select
- wire frontbuf draw on select used un-initialized color
2004-09-28 11:19:57 +00:00
9314ee5e66 Changed valence rule for edgeloop, so it treats fgons OK. 2004-09-28 10:50:22 +00:00
60d53c9e03 Eek! Commit for 'making transform aware for mesh select mode' caused all
other editmodes to crash in transform()!
2004-09-28 10:16:13 +00:00
f3c7fdd80e Recode of 'zbuffer selection'. I first was too afraid using the backbuffer
selection method, since there's too much trash in drawobject.c and displists...
But, I couldn't stand the zbuf selection to miss edges too often. Right now
both methods are still in the code, and can be reviewed.

Please note for test:
- borderselect and circle-select still use old method
- new selection works directly on faces & edges
- subsurf optimal draw and selection works fine now

To detect the closest vertex or edge, i use the old 'spiral selection' code,
which is extremely accurate. If your mouse is close to an edge, it should
find it.

Most evidently I need to test speed... also, the disadvantage of backbuf
selection is the limited depth, which can be 16 bits (65 k faces) on systems.
2004-09-28 09:43:37 +00:00
36695066f7 Picky, picky: Removed the question mark from the end of
'Quit Blender?' as per language guidelines
2004-09-28 05:04:55 +00:00
766db99e45 - fixed error in copying selection from faceselectmode to editmode
- removed ancient convention that switches to wire then
2004-09-27 20:19:16 +00:00
ea84d29d90 Faceloop select recoded, also nonmodal (no loop). It works by clicking with
ALT on an edge, in face-select mode. Holding shift again extends selection.

Current UI access can need rethink though. But I also think the loop tools
deserve to be accessible without menu, for speed/workflow. So what's good
shortcuts!

BTW: both tools don't do triangle meshes (yet)
2004-09-27 19:22:15 +00:00
dbef53aa31 Added edgeloop selection as mode-less loop-less option.
Hotkey: ALT+select (ALT+CTRL for single button mouse)

Hold shift to extend selection, or to deselect

It correctly does edges on boundaries and loose edges too.
2004-09-27 17:05:30 +00:00
0f02704bf3 Transform() now is edge/face selection aware too.
Theeth; i've done the changes as local as possible, and lotsa comments :P
2004-09-27 15:08:12 +00:00
a7f2950ae9 Bug fix: on scene append of curve deformer displist causes crash...
Crash is solved now, but create displist fails.
2004-09-27 10:39:18 +00:00
061442cbd1 - improvement for edge/face select
- edges now sample on three locationsm gives more hits
  - own version of glPolygonOffset remains cumbersome... but for select
    now the selection routine gets more offset than draw.

- first attempt to clean drawobject.c and displists
  - generic call for draw object in backbuf for select purposes, cleans up
    a lot in the other calls.
  - also to verify if we can (in future) use this for vertex/edge/face
    select, but the whole drawobject code works against me... this is
    for another refactory (incl. displist) and out of the focus for now

- subsurf.c: now creates new faces in order of original. Not used yet, but is
  handy to recover the original order for selection/paint purposes.
2004-09-27 10:12:45 +00:00
995826f3ed New drawmethod for creases editing (draw creases option) in editmode.
http://www.blender.org/bf/rt3.jpg

It draws a 2 pixel line, growing from center of edge, to denote sharpness.
This works nicely with the new selection modes.

Please note that subsurf-optimal still draws original edge then... but
this didnt work before neither. :)
2004-09-26 19:55:02 +00:00
f98fda2857 Fix for the beloveled bevel. ;)
Still could use cleanup for flags though.
2004-09-26 18:33:29 +00:00
18638735c3 Two bugs:
- when adding creases in editmode, and separating that part, displists
  did weird things... separate is hackish anyway
- draw faces (transparant) didnt do triangles correctly
2004-09-26 17:53:21 +00:00
ab68f715cd New strict 'hide' rules for editmesh & new selectmodes
- vertex hidden, always means edge is hidden too
- edge hidden, always means face is hidden too
- face hidden, only means face hides

This means, that in face mode you can hide a face, whilst in edge mode
the edges will still display.

Please note, that when you have no edges saved in a Mesh, it also doesnt
store the hide flags for it, causing in/out editmode too reset hidden
edges.
2004-09-26 17:15:52 +00:00
300939e1ba Quick commit to fix crash in hide option editmode subsurf... the hide flags
still are not doing it OK... later!
2004-09-26 14:22:54 +00:00
d41317609d Added initialize code for zbuffer-select option, where it reads larger
parts of zbuffer on border/circle select.
Should speed up quite some.
2004-09-26 13:45:25 +00:00
9a6b8971dc Fix for crashes when mixed faces/edges were hidden. Not all combos were
correctly checked on in subsurf.c
2004-09-26 13:44:15 +00:00
Stephen Swaney
a509b8adc9 Another round in the Great BPy Cleanup:
Run everything thru indent to cleanup spaces vs tabs.
Clean up some of the comments by hand.
BGL.c was not touched due to all that macro wackyness.

There are no functional changes to the code.
Pre-indent versions of source are tagged with
tag bpy-cleanup-20040925 , just in case.
2004-09-25 20:30:40 +00:00
bd371ddb9f Two more fixes:
- face centers didnt recalculate at vertex-smooth, vertex-sphere and so
- on edge extrude (meaning the new faces), it now copies face data (material
  index, smooth, tface) from the face that shared an edge
2004-09-25 17:57:46 +00:00
8655cc40ad Integer version of glReadBuffer with GL_DEPTH_COMPONENT...
reported were errors with ati-linux on using float here.

Code is still there, and can be easily switched back (  if(0) or if(1) !)
2004-09-25 16:38:51 +00:00
9118fbd855 Option 'all edges' didnt work anymore... fixed 2004-09-25 16:07:16 +00:00
dfd583116a Zbuf-selection fix: while drawing vertices, it accepted writing in zbuf
for it too... giving (sometimes) no selection, and possible for linux the
solution too!
2004-09-25 15:15:26 +00:00
dfef53a632 Two small fixes for previous commit;
- new zbuf-clipped select was always on
- drawing the 'floor' now doesnt write in zbuffer when in editmode
2004-09-25 14:21:09 +00:00
6f074f6f46 Two nice workflow improvements;
- Zbuffer clipped selection
Based on same algos as for drawing (blender polygon offset) vertices, edges
and faces now are clipped for draw and selection when Zbuffer is used.
Note that it works for endpoint vertices of edges, and for facecenters.
Also works for border and circle-select

- Optimal draw subsurfs
This now draws optimal with faces and edges selected/unselected, hiding the
original 'cage' (mesh) completely.
TODO: edge select, which still uses original (invisible) edge.

http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html
2004-09-25 13:42:31 +00:00
cfe9a95755 All kinds of fixes for new selection modes
- circle-select now works
- delete options for edge/face select work as to be expected.
  should check on a better set of choices in menu though
- assign material / select material options work for new modes
- shift+f fill didnt leave proper select flags...
- border select on face-gones (fgons) works
- 'draw normals' and fgons works now
2004-09-24 18:17:23 +00:00
572b7c078d New: Fake Polygons, or Face-polygons, or FGons nicked for now.
Just select a bunch of faces (selection should be valid flat poly) and
press FKEY. Works in fact as selection-group optimizing. Nice in solid
drawmode!

Further some small additional fixes in the whole debugging process.
Found old error in loopselect for triangles, subdivision code, and
selection still.

NOTE: subdivide still works on vertex level only.
2004-09-24 16:06:20 +00:00
f59503682d - basic code for fake-polygon support (called FGon in code). Disabled now
- hide flags now save correctly in mesh, to restore after going in/out
  editmode
- after an extrude, faces/edges could have wrong select flags
  (only in vertex select mode)
- new rule for addfacelist(); this now copies edges too, if an example
  is provided. That prevents a lot of awkward code, still testing if it
  goes as desired though...
2004-09-24 12:40:37 +00:00
ce12a0173c Fixed bug #1581, toolbox wasn't correctly opening the edit mode
transform properties panel.
2004-09-24 11:45:42 +00:00
f3135d0009 Very bad typo, causing wrong blocks to be freed when the undostack is
full. Gives crashes on exit...
2004-09-24 09:51:16 +00:00
1ae3e3efc1 Fix for loopcut, didn't work after reconstruct... 2004-09-23 22:54:18 +00:00
404f4d7a01 Three bugfixes, thnx to irc testing! :)
- separate crashed
- wrong button for 'face dot' theme
- deselect vertex on mouseclick didnt work
2004-09-23 22:17:52 +00:00
Nathan Letwory
16593b506a make sure this also builds on Windows. 2004-09-23 21:27:16 +00:00
ea7afe9c48 Little thing; added recalc normals after subdivide, for face centers.
We have to check on this all over very well.
2004-09-23 21:06:56 +00:00
a2e918d831 EditMesh refactory + undo recode
The changelog is very long... it's on the web too:
http://www.blender3d.org/cms/Mesh_editing_rewrite.425.0.html

EditMesh refactor notes (user)

**** New selection modes

When entering Edit Mode for a Mesh, you now have the choice for three selection modes. These are shown as icons in the 3D header (hotkey is being searched for!).

- Vertex Select
Select vertices as usual, fully compatible with how previous version work

- Edge Select
Vertices are not drawn anymore, and selections happen by default on the edges. It is a true edge select, meaning that you can select three out of four edges in a face, without automatic having the 4th edge selected.

- Face Select
Instead of vertices, now selection 'points' are drawn in the face centers. Selected faces also get a colored outline, like for edges. This also is true face select, for each face individual regardless selection status of its vertices or edges.

While holding SHIFT, and press a selection mode, you can also combine the above choices. Now selection becomes mixed, and will behave as expected.
For example; in Edge+Face select mode, selecting the 4 edges of a face will select the face too.

The selection modes and optional drawing modes (like transparant faces, normals, or solid drawing) all work together. All of Blender's mesh editing tools now react to the correct selection mode as well.
Most noticeable it's in:

**** Extrude

Extruding in Edge or Face Select mode allows much more precise control over what's extruded and what should be excluded. Try for example a checker pattern selection, and extrude it.

New is the fixed translation when faces are extruded. This always follows the (averaged) face normal(s) of the old face(s), enabling much easier working in 3D views . A single 'G' (Grab) or 'R' (Rotate) or 'S' (Scale) will change transform modus as usual.

**** Other things to note

- Hiding edges/faces will also behave different based on Select Mode.
- while editing, normals of faces are updated always now
- Border select (BKEY) has 2 different rules for edges; when one edge is fully inside of the border, it will only select edges that are fully inside. Otherwise it selects each edge intersecting with the border.
- in face mode, adding vertices, edges or a circle is invisible...
- "Add monkey" now works as a normal primitive (rotated and on 3d cursor)
- Mesh undo was fully recoded, hopefully solving issues now with Vertex Keys and Groups
- Going in and out of editmode was fully recoded. Especially on larger models you'll notice substantial speed gain.

**** Todo

Add 'FaceSelect mode' functionality in EditMode, including zbuffered selection, display and editing of UV texture.


EditMesh refactor notes (coder)

**** Usage of flags in general
The "->f" flags are reserved for the editmesh.c and editmesh_lib.c core functions. Actually only selection status is there now.
The "->f1" and "->f2" flags are free to use. They're available in vertex/edge/face structs. Since they're free, check carefully when calling other functions that use these flags... for example extrude() or subdivide() use them.

**** Selection flags
EditVert: eve->f & SELECT
EditEdge: eed->f & SELECT
EditFace: efa->f & SELECT

- Selection is only possible when not-hidden!
- Selection flags are always up-to-date, BUT:
  if selection mode >= SELECT_EDGE vertex selection flags can be incorrect
  if selection mode == SELECT_FACE vertex/edge selection flags can be incorrect
  This because of shared vertices or edges.

- use for selecting vertices:
  eve->f &= SELECT
- use for selecting edges always:
  void EM_select_edge(eed, 1)  // 1 = select, 0 = deselect
- use for selecting faces always:
  void EM_select_face(efa, 1)  // 1 = select, 0 = deselect

- To set the 'f' flags in all of the data:
  void EM_set_flag_all(int flag);
  void EM_clear_flag_all(int flag);

- the old faceselectedOR() and faceselectedAND() are still there, but only
  to be used for evaluating its vertices

**** Code hints for handling selection

If the selectmode is 'face'; vertex or edge selections need to be flushed upward. Same is true for 'edge' selection mode. This means that you'll have to keep track of all selections while coding... selecting the four vertices in a face doesn't automatically select the face anymore.

However, by using the above calls, at least selections flush downward (to vertex level). You then can call:

void EM_selectmode_flush(void);

Which flushes selections back upward, based on the selectmode setting. This function does the following:

- if selectmode 'vertex': select edges/faces based on its selected vertices
- if selectmode 'edge': select faces based its selected edges

This works fine in nice controlled situations.

However, only changing the vertex selections then still doesn't select a face in face mode! If you really can't avoid only working with vertex selections, you can use this call:

void EM_select_flush(void);

Now selection is flushed upward regardless current selectmode. That can be destructive for special cases however, like checkerboard selected faces. So use this only when you know everything else was deselected (or deselect it). Example: adding primitives.


**** Hide flags
EditVert: eve->h
EditEdge: eed->h
EditFace: efa->h

- all hide flags are always up-to-date
- hidden vertices/edges/faces are always deselected. so when you operate on selection only, there's no need to check for hide flag.

**** Unified undo for editmode

New file: editmode_undo.h
A pretty nice function pointer handler style undo. Just code three functions, and your undo will fly! The c file has a good reference.

Also note that the old undo system has been replaced. It currently uses minimal dependencies on Meshes themselves (no abuse of going in/out editmode), and is restricted nicely to editmode functions.

**** Going in/out editmode

As speedup now all vertices/faces/edges are allocated in three big chunks. In vertices/faces/edges now tags are set to denote such data cannot be freed.

ALso the hashtable (lookup) for edges uses no mallocs at all anymore, but is part of the EditEdge itself.
2004-09-23 20:52:51 +00:00
e7d3039d12 - Blender: added option 'scriptsdir' to Blender.Get();
- small updates to the docs;
- Object: small fix to getMatrix: check during_script() to avoid undesired loops; added old behavior (pre 2.34) as option: .getMatrix('oldlocal');
- tentative fix for bug #1275: scene REDRAW scriptlinks were not being executed (the call to do so was missing):
http://projects.blender.org/tracker/index.php?func=detail&aid=1275&group_id=9&atid=125
    added the call in drawview.c, in drawview3dspace().  This causes the scriptlink to be called for each visible view3d, but that's what happens with object redraw scriptlinks, too.  Anyway, this is still a test.  The place was chosen based on the idea that a scene redraw scriptlink is like an object redraw one, but for all objs in the scene at once.

- Window.Theme: new submodule, to get/set theme options in Blender;
- Added the script save_theme.py (Help menu for now), to save the current theme in Blender as an executable script (currently shown in the Scripts->Misc menu).

There's more work to do for themes, like defining a proper place for them in the interface, adding documentation (for now the added script and the ones it generates can give a pretty good idea of how to use the new module), probably extending themes to support SpaceScript and so on.
2004-09-21 05:28:17 +00:00
e5e621ad24 Added Hos' NLA move up/down to the NLA Strip menu. Also enabled
'Strip Properties' there again.
2004-09-21 04:09:07 +00:00
8e3f7fa6f5 Added the panel context choices in the 'Panels' menu (buttons
window). Helps for vertical layouts where the tabs are off screen.
2004-09-21 03:35:36 +00:00
7d65af235e test commit
Bugfix for anim crash with xml export and no export dir set.
Alternate relative path using blender function, but wouldn't be surprised
if it still is a problem in some cases for some (windows) users.
2004-09-20 23:59:09 +00:00
Stephen Swaney
273c8e0804 New bpy method for World module to set World for current scene:
my_world.makeActive()

Contributed by Campbell Barton (ideasman)
2004-09-20 16:22:32 +00:00
c4a0a01a55 Matt's lamp submenu.
And reorganized the #includes in editobject by "modules"
2004-09-19 19:27:57 +00:00
74cd2db337 Removed all calls to object_wave in code, and moved it into the
mesh_modifier() in deform.c.

Now wave works on top of hooks, before lattice/curve deform and armature.
But together!
2004-09-19 17:44:20 +00:00