Commit Graph

2738 Commits

Author SHA1 Message Date
Ton Roosendaal
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
Ton Roosendaal
9118fbd855 Option 'all edges' didnt work anymore... fixed 2004-09-25 16:07:16 +00:00
Ton Roosendaal
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
Ton Roosendaal
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
Ton Roosendaal
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
Ton Roosendaal
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
Ton Roosendaal
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
Ton Roosendaal
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
Matt Ebb
ce12a0173c Fixed bug #1581, toolbox wasn't correctly opening the edit mode
transform properties panel.
2004-09-24 11:45:42 +00:00
Ton Roosendaal
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
Martin Poirier
b997c654b1 MSVC 6.0 projectfiles fixes for new editmesh and bpython files. 2004-09-23 23:03:19 +00:00
Ton Roosendaal
1ae3e3efc1 Fix for loopcut, didn't work after reconstruct... 2004-09-23 22:54:18 +00:00
Ton Roosendaal
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
Ton Roosendaal
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
Ton Roosendaal
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
Jiri Hnidek
4b5203e29e - Cam fixed bug reported by Manuel Bastioni (thanks)
- I fixed one bug too.
2004-09-21 09:09:58 +00:00
Willian Padovani Germano
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
Matt Ebb
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
Matt Ebb
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
Alfredo de Greef
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
Kester Maddock
3eddbfa942 Fix link ordering for blenderplayer. 2004-09-20 10:41:16 +00:00
Martin Poirier
c4a0a01a55 Matt's lamp submenu.
And reorganized the #includes in editobject by "modules"
2004-09-19 19:27:57 +00:00
Ton Roosendaal
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
Martin Poirier
e99320e7d2 Fix for scalling bug with Stretch To constraint (practicly same bug as Track To last week, but deeper ramifications since stretch to affects scalling).
Quick description of bug: scalling armature had a weird effect on stretch to bone size.
2004-09-19 15:07:16 +00:00
Martin Poirier
143f0edc32 Editmesh spliting project files fix (MSVC 6.0) 2004-09-19 14:33:33 +00:00
Matt Ebb
3b065f929e Moved the 'Load UI' option from the File menu to the
fileselect window header.
2004-09-19 14:08:04 +00:00
Nathan Letwory
b9d82d3b47 Update project files to compile and link with newest changes (editmesh refactoring) 2004-09-19 13:46:43 +00:00
Ton Roosendaal
790a34e9a6 Service: SConscript file! 2004-09-19 11:50:38 +00:00
Ton Roosendaal
ca5b7386e5 Part one of editmesh.c refactoring. The huge file has been split in
logical parts, and include files altered to denote internal and external
functions.

include/editmesh.h: internal calls for editmesh_xxx.c files
include/BIF_editmesh.h: external calls for these files

src/editmesh.c: basic alloc/lists and in/out editmode, undo, separate
src/editmesh_lib.c: basic utility calls for all editmesh_xxx.c (no UI)
src/editmesh_add.c: add prim, add duplicate, add vertex/edge/face (UI)
src/editmesh_mods.c: selecting, transforming (UI)
src/editmesh_loop.c: loop tools like knife, loop select, loop subdiv (UI)
src/editmesh_tools.c: other tools (extrude, spin, etc) (UI)

And a new file:

src/meshtools.c: tools for Mesh outside of editmode (normals, draw flags)
2004-09-19 11:47:49 +00:00
Jiri Hnidek
dab46067bf - Cam (ideasman) improved speed of exporting
- I fixed indentation
2004-09-19 10:41:04 +00:00
Kester Maddock
fd5f3e13d2 Convert and use actuators with no target object set.
Certain actuators (Add Object/Replace Mesh/Scene/Track To) used to always require a target, or they would not influence the scene.  If the actuator target is always set from Python, this could be annoying.
2004-09-19 01:33:08 +00:00
Jiri Hnidek
d70197262b - Cam added function getUniqueName, which preserve overwriting of existing mesh.
- I removed fixed identing. It uses only tab for identing so Cam will not be fussed anymore:-).
2004-09-18 21:04:23 +00:00
Ton Roosendaal
131e5908a6 Evil commit! Nothing really changed except;
- EditVlak -> EditFace
- variables called 'evl' -> 'efa'
- functions with 'vlak' in it now have 'face'

Just thought was nice starter for editmesh recode...
2004-09-18 20:15:37 +00:00
Stephen Swaney
a2ea84903e One small part of the Great Bpy Code Cleanup.
Add cvs $Id tag to files
2004-09-18 18:47:03 +00:00
Chris Want
03ccc18d99 For the Bass* people: pad plus/ pad minus moves nla strips up/down in
the nla editor.

Release note blurb:

Selected nla strips may be reordered down or up in the nla editor using
numpad plus/minus.
2004-09-18 18:36:11 +00:00
Ton Roosendaal
34aa59c5c3 - redo now also ctrl+y.
- made undo/redo display of previewrender nice
2004-09-18 18:34:50 +00:00
Ton Roosendaal
e7087aa26b Found little bug in undo system for editing Font objects. Causing
crash at undo after editing.
2004-09-18 13:58:35 +00:00
Ton Roosendaal
cd79d25e83 OSX only: the Apple key now is a normal modifier in code, so can be
detected as others, LR_COMMANDKEY

Unline previous commit, Apple key doesnt map to control anymore, but is
handled separate where needed. Now only for undo (Apple-Z)
2004-09-18 13:25:29 +00:00
Ton Roosendaal
562d6958cb Another step in the undo evolution.
- Made unified API for undo calls, to be found in space.c
  BIF_undo_push(char *str)
  BIF_undo(void)
  BIF_redo(void)
  These calls will do all undo levels, including editmode and vpaint.

  The transition is work in progress, because mesh undo needs recode.

- New global hotkey CTR+Z for undo
  Note: 'shaded draw mode' still is SHIFT+Z, the old CTRL+Z was to recalc
  the lighting in shaded mode, which already became much more interactive,
  like during/after any transform().
  Recalc hotkey now is SHIFT+ALT+Z

  CTRL+<any modifier>+Z is redo.

- For OSX users; the Apple-key ("Command") now maps to CTRL as well. This
  disables the one-mouse-button hack for rightmouse btw, will be fixed in
  next commit. At least we can use Apple-Z :)

- Old Ukey for undo is still there, as a training period... my preference is
  to restore Ukey to "reload original data" as in past, and only use new
  CTRL+Z for undo.

- Added undo_push() for all of editobject.c and editview.c. Meaning we can
  start using/testing global undo in the 3d window. Please dont comment on
  missing parts for now, first I want someone to volunteer to tackle all of
  that.

- Since the global undo has a full 'file' in memory, it can save extremely
  fast on exit to <temp dir>/quit.blend. That's default now when global undo
  is enabled. It prints "Saved session recovery to ..." in console then.

- In file menu, a new option is added "Recover Last Session". Note that this
  reads the undo-save, which is without UI.

- With such nice new features we then can also kill the disputed
  Cancel/Confirm menu on Q-KEY.

- Added fix which initializes seam/normal theme color on saved themes.
  They showed black now.... (Note: that's in usiblender.c!)
2004-09-18 12:12:45 +00:00
Kester Maddock
3d8a485fb9 Fixed PyObject_IsMT_Matrix 2004-09-18 06:03:15 +00:00
Ton Roosendaal
0a6730d830 curve_modifier() call was in makeDispList() already, and called twice,
causing initrender to free illegal pointer...
2004-09-17 21:30:53 +00:00
Kent Mein
e656ce232a updated the documentation on how to add new image types which consisted of:
removed autoconf stuff and replaced with scons info.
Added info on how to make your format showup in the thumbnail viewer.

Kent
2004-09-17 11:31:17 +00:00
Ton Roosendaal
8464889c80 Fixed crash caused by new (strict) rule for displists. Reminder: to signal
that a displist has to be recalculated, you only have to free it.

In the init_render_mesh() not all situations were checked OK.
Thanks Basse for finding it!
2004-09-17 10:36:43 +00:00
Ton Roosendaal
a539a727d4 Bug fix in code committed for hooks; mesh check for displist was on
wrong location... causing tremendous slowdowns!

Note: in previous commit some WIP slipped in.. not dangerous. Plus it
has a text typo fix (beaty)
2004-09-16 19:31:43 +00:00
Ton Roosendaal
e10bae596b Bug 1568
Wrong usage of B_NOP code in button events (xxxx | B_NOP), which is useles
since it is defined as -1.

Reminder for all: use a B_NOP if you want a button event not to be passed
on to the event queues.
2004-09-16 17:57:14 +00:00
Ton Roosendaal
2453774076 Bug fix #1525
RayTransp didnt work on Nurbs anymore (2.34 error).
Just a normal flip problem...
2004-09-16 15:32:38 +00:00
Stephen Swaney
0848aed9fc More Material settings: mirror and transparency.
Contributed by Joilnen B. Leite (pidhash)
2004-09-14 20:03:01 +00:00
Ton Roosendaal
37f57288cb Lot of code... 2 new features:
1) Curve deform
http://www.blender3d.org/cms/Curve_Deform.392.0.html
Works simple as expected, but keep track of the rotation axis
in F7 buttons (Track X Y Z)
Only Mesh deform supported now.

Code changes:
- centralized deformation calls in curve_modifiers() mesh_modifiers()
etcetera. Here also other effects can be added like wave. Now the
evaluation order is fixed, but should become optional. It also doesnt
use the Displist anymore as deform-input. That latter part is unfinished
yet.
This code also is used for Hooks and will be needed for softbody

- made convention stricter that displists are being checked on in
drawobject(), this to prevent routines to make new displists recursively
(like armature does). Now a freedisplist() is sufficient to signal that
a new displaylist should be made.

2) Object Hooks
http://www.blender3d.org/cms/Object_Hooks.391.0.html
Support for Hooks is added to Mesh, Lattice, Curve and Surface objects.
For Armatures this would require some more work & research.
Main goal for this feature is to provide quick & simple access to the
underlying geometry in Objects on Object level, supporting hierarchies and
Ipos etc.
2004-09-14 19:03:11 +00:00