2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* $Id$
|
|
|
|
|
*
|
|
|
|
|
* ***** BEGIN GPL/BL DUAL LICENSE BLOCK *****
|
|
|
|
|
*
|
|
|
|
|
* This program is free software; you can redistribute it and/or
|
|
|
|
|
* modify it under the terms of the GNU General Public License
|
|
|
|
|
* as published by the Free Software Foundation; either version 2
|
|
|
|
|
* of the License, or (at your option) any later version. The Blender
|
|
|
|
|
* Foundation also sells licenses for use in proprietary software under
|
|
|
|
|
* the Blender License. See http://www.blender.org/BL/ for information
|
|
|
|
|
* about this.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
|
* along with this program; if not, write to the Free Software Foundation,
|
|
|
|
|
* Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
|
|
|
|
|
* All rights reserved.
|
|
|
|
|
*
|
|
|
|
|
* The Original Code is: all of this file.
|
|
|
|
|
*
|
|
|
|
|
* Contributor(s): none yet.
|
|
|
|
|
*
|
|
|
|
|
* ***** END GPL/BL DUAL LICENSE BLOCK *****
|
2003-04-30 13:22:26 +00:00
|
|
|
*
|
|
|
|
|
*
|
|
|
|
|
* - here initialize and free and handling SPACE data
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#include <string.h>
|
|
|
|
|
#include <stdio.h>
|
|
|
|
|
|
2002-11-25 12:02:15 +00:00
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
|
#include <config.h>
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "MEM_guardedalloc.h"
|
2006-02-05 19:30:37 +00:00
|
|
|
#include "MEM_CacheLimiterC-Api.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
#ifdef INTERNATIONAL
|
|
|
|
|
#include "BIF_language.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "IMB_imbuf_types.h"
|
|
|
|
|
#include "IMB_imbuf.h"
|
|
|
|
|
|
|
|
|
|
#include "BLI_blenlib.h"
|
|
|
|
|
#include "BLI_arithb.h"
|
|
|
|
|
#include "BLI_linklist.h"
|
|
|
|
|
|
|
|
|
|
#include "DNA_action_types.h"
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
#include "DNA_armature_types.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_curve_types.h"
|
2006-02-09 15:14:19 +00:00
|
|
|
#include "DNA_group_types.h" /* used for select_same_group */
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "DNA_image_types.h"
|
|
|
|
|
#include "DNA_ipo_types.h"
|
|
|
|
|
#include "DNA_mesh_types.h"
|
|
|
|
|
#include "DNA_object_types.h"
|
|
|
|
|
#include "DNA_scene_types.h"
|
|
|
|
|
#include "DNA_screen_types.h"
|
|
|
|
|
#include "DNA_sequence_types.h"
|
|
|
|
|
#include "DNA_sound_types.h"
|
|
|
|
|
#include "DNA_space_types.h"
|
|
|
|
|
#include "DNA_userdef_types.h"
|
|
|
|
|
#include "DNA_view2d_types.h"
|
|
|
|
|
#include "DNA_view3d_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BKE_blender.h"
|
2006-01-09 23:52:51 +00:00
|
|
|
#include "BKE_colortools.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_curve.h"
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_displist.h"
|
|
|
|
|
#include "BKE_global.h"
|
2006-02-14 11:46:45 +00:00
|
|
|
#include "BKE_group.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_ipo.h"
|
|
|
|
|
#include "BKE_main.h"
|
2005-12-18 13:46:01 +00:00
|
|
|
#include "BKE_node.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BKE_scene.h"
|
|
|
|
|
#include "BKE_utildefines.h"
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
#include "BIF_spacetypes.h" // first, nasty dependency with typedef
|
|
|
|
|
|
2003-10-07 18:24:02 +00:00
|
|
|
#include "BIF_butspace.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_drawimage.h"
|
|
|
|
|
#include "BIF_drawseq.h"
|
|
|
|
|
#include "BIF_drawtext.h"
|
2004-04-19 22:05:37 +00:00
|
|
|
#include "BIF_drawscript.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editarmature.h"
|
2005-10-23 12:18:32 +00:00
|
|
|
#include "BIF_editconstraint.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editfont.h"
|
2005-12-06 10:58:54 +00:00
|
|
|
#include "BIF_editgroup.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editkey.h"
|
|
|
|
|
#include "BIF_editlattice.h"
|
|
|
|
|
#include "BIF_editmesh.h"
|
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
|
|
|
#include "BIF_editmode_undo.h"
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
#include "BIF_editnla.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_editoops.h"
|
|
|
|
|
#include "BIF_editseq.h"
|
|
|
|
|
#include "BIF_editsima.h"
|
|
|
|
|
#include "BIF_editsound.h"
|
|
|
|
|
#include "BIF_editview.h"
|
|
|
|
|
#include "BIF_gl.h"
|
|
|
|
|
#include "BIF_imasel.h"
|
|
|
|
|
#include "BIF_interface.h"
|
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
|
|
|
#include "BIF_meshtools.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_mywindow.h"
|
|
|
|
|
#include "BIF_oops.h"
|
2005-07-24 11:36:05 +00:00
|
|
|
#include "BIF_poseobject.h"
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
#include "BIF_outliner.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BIF_resources.h"
|
|
|
|
|
#include "BIF_screen.h"
|
|
|
|
|
#include "BIF_space.h"
|
|
|
|
|
#include "BIF_toets.h"
|
|
|
|
|
#include "BIF_toolbox.h"
|
|
|
|
|
#include "BIF_usiblender.h"
|
|
|
|
|
#include "BIF_previewrender.h"
|
|
|
|
|
|
|
|
|
|
#include "BSE_edit.h"
|
|
|
|
|
#include "BSE_view.h"
|
|
|
|
|
#include "BSE_editipo.h"
|
|
|
|
|
#include "BSE_drawipo.h"
|
|
|
|
|
#include "BSE_drawview.h"
|
|
|
|
|
#include "BSE_drawnla.h"
|
|
|
|
|
#include "BSE_filesel.h"
|
|
|
|
|
#include "BSE_headerbuttons.h"
|
|
|
|
|
#include "BSE_editnla_types.h"
|
|
|
|
|
|
|
|
|
|
#include "BDR_vpaint.h"
|
|
|
|
|
#include "BDR_editmball.h"
|
|
|
|
|
#include "BDR_editobject.h"
|
|
|
|
|
#include "BDR_editcurve.h"
|
|
|
|
|
#include "BDR_editface.h"
|
|
|
|
|
#include "BDR_drawmesh.h"
|
2003-10-07 18:24:02 +00:00
|
|
|
#include "BDR_drawobject.h"
|
2005-09-16 20:17:09 +00:00
|
|
|
#include "BDR_imagepaint.h"
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
#include "BDR_unwrapper.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#include "BLO_readfile.h" /* for BLO_blendhandle_close */
|
|
|
|
|
|
2004-12-02 21:22:17 +00:00
|
|
|
#include "PIL_time.h"
|
|
|
|
|
|
2003-11-23 14:28:46 +00:00
|
|
|
#include "BPY_extern.h"
|
|
|
|
|
|
2006-02-19 14:55:16 +00:00
|
|
|
#include "butspace.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "mydevice.h"
|
|
|
|
|
#include "blendef.h"
|
|
|
|
|
#include "datatoc.h"
|
|
|
|
|
|
2005-02-20 01:25:10 +00:00
|
|
|
#include "BIF_transform.h"
|
2005-02-14 02:53:36 +00:00
|
|
|
|
2005-04-30 21:27:05 +00:00
|
|
|
#include "BKE_depsgraph.h"
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
#include "BSE_trans_types.h"
|
2002-11-29 17:07:58 +00:00
|
|
|
#include "IMG_Api.h"
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
#include "SYS_System.h" /* for the user def menu ... should move elsewhere. */
|
|
|
|
|
|
2005-08-23 13:16:02 +00:00
|
|
|
|
|
|
|
|
extern void StartKetsjiShell(ScrArea *area, char* startscenename, struct Main* maggie, struct SpaceIpo* sipo,int always_use_expand_framing);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* When the mipmap setting changes, we want to redraw the view right
|
|
|
|
|
* away to reflect this setting.
|
|
|
|
|
*/
|
|
|
|
|
void space_mipmap_button_function(int event);
|
|
|
|
|
|
|
|
|
|
void free_soundspace(SpaceSound *ssound);
|
|
|
|
|
|
2003-10-15 12:26:26 +00:00
|
|
|
/* *************************************** */
|
|
|
|
|
|
|
|
|
|
/* don't know yet how the handlers will evolve, for simplicity
|
|
|
|
|
i choose for an array with eventcodes, this saves in a file!
|
|
|
|
|
*/
|
2003-10-15 16:01:08 +00:00
|
|
|
void add_blockhandler(ScrArea *sa, short eventcode, short val)
|
2003-10-15 12:26:26 +00:00
|
|
|
{
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
short a;
|
|
|
|
|
|
|
|
|
|
// find empty spot
|
2003-10-15 16:01:08 +00:00
|
|
|
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
|
2003-10-16 00:17:24 +00:00
|
|
|
if( sl->blockhandler[a]==eventcode ) {
|
|
|
|
|
sl->blockhandler[a+1]= val;
|
|
|
|
|
break;
|
|
|
|
|
}
|
2003-10-15 12:26:26 +00:00
|
|
|
else if( sl->blockhandler[a]==0) {
|
|
|
|
|
sl->blockhandler[a]= eventcode;
|
2003-10-15 16:01:08 +00:00
|
|
|
sl->blockhandler[a+1]= val;
|
2003-10-15 12:26:26 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-15 16:01:08 +00:00
|
|
|
if(a==SPACE_MAXHANDLER) printf("error; max (4) blockhandlers reached!\n");
|
2003-10-15 12:26:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void rem_blockhandler(ScrArea *sa, short eventcode)
|
|
|
|
|
{
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
short a;
|
|
|
|
|
|
2003-10-15 16:01:08 +00:00
|
|
|
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
|
2003-10-15 12:26:26 +00:00
|
|
|
if( sl->blockhandler[a]==eventcode) {
|
|
|
|
|
sl->blockhandler[a]= 0;
|
Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
right now Images or Render Results. That makes the entire composite tree
only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
what the cropped area should be. Compositing is on Scene level, not local
per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
2006-02-09 11:07:04 +00:00
|
|
|
|
|
|
|
|
/* specific free calls */
|
|
|
|
|
if(eventcode==IMAGE_HANDLER_PREVIEW)
|
|
|
|
|
image_preview_event(0);
|
2003-10-15 12:26:26 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-06-19 12:25:28 +00:00
|
|
|
void toggle_blockhandler(ScrArea *sa, short eventcode, short val)
|
|
|
|
|
{
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
short a, addnew=1;
|
|
|
|
|
|
|
|
|
|
// find if it exists
|
|
|
|
|
for(a=0; a<SPACE_MAXHANDLER; a+=2) {
|
|
|
|
|
if( sl->blockhandler[a]==eventcode ) {
|
|
|
|
|
sl->blockhandler[a]= 0;
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
|
|
|
|
|
/* specific free calls */
|
|
|
|
|
if(eventcode==VIEW3D_HANDLER_PREVIEW)
|
New:
- ZTransp render now also delivers Z values and Speed vectors in passes
Note that speed vectors accumulate within a pixel to store the minimum,
so rendering ztransp on top of a non-moving plane won't give speed...
Best results you get is by rendering it in a separate layer.
The Z value stored is the closest visible transparent face in the pixel.
Fixes:
- Render to 'spare page' has been enabled again. Because of the strict
separation of Render and UI, but especially because a 'render result' now
can consist of unlimited images, I've not made this a Render feature.
Instead, the render-window itself stores the 'spare' image... I also
had to change the convention for it a bit.
Now, instead of having two "render buffers" (which was a render feature),
the RenderWindow will store each previous frame on a re-render. This
storing will only start after you've pressed 'Jkey' once, but then always
will happen for as long the rendered image is same size as previously.
For clarity, I've also renamed the window title, to 'previous frame'.
- RenderWindow shows alpha again on Akey
- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
closest, and the color range goes from camera clip-sta to clip-end.
- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
not always freed correctly, potentially causing crashes or memory leaks.
2006-02-08 16:51:09 +00:00
|
|
|
BIF_view3d_previewrender_free(sa->spacedata.first);
|
Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
right now Images or Render Results. That makes the entire composite tree
only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
what the cropped area should be. Compositing is on Scene level, not local
per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
2006-02-09 11:07:04 +00:00
|
|
|
else if(eventcode==IMAGE_HANDLER_PREVIEW)
|
|
|
|
|
image_preview_event(0);
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
|
2004-06-19 12:25:28 +00:00
|
|
|
addnew= 0;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if(addnew) add_blockhandler(sa, eventcode, val);
|
|
|
|
|
}
|
2003-10-15 12:26:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* ************* SPACE: VIEW3D ************* */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
/* extern void drawview3dspace(ScrArea *sa, void *spacedata); BSE_drawview.h */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
void copy_view3d_lock(short val)
|
|
|
|
|
{
|
|
|
|
|
bScreen *sc;
|
|
|
|
|
int bit;
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* from G.scene copy to the other views */
|
2002-10-12 11:37:38 +00:00
|
|
|
sc= G.main->screen.first;
|
|
|
|
|
|
|
|
|
|
while(sc) {
|
|
|
|
|
if(sc->scene==G.scene) {
|
|
|
|
|
ScrArea *sa= sc->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
if(sl->spacetype==SPACE_OOPS && val==REDRAW) {
|
|
|
|
|
if(sa->win) scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
View3D *vd= (View3D*) sl;
|
|
|
|
|
if(vd->scenelock && vd->localview==0) {
|
|
|
|
|
vd->lay= G.scene->lay;
|
|
|
|
|
vd->camera= G.scene->camera;
|
|
|
|
|
|
|
|
|
|
if(vd->camera==0 && vd->persp>1) vd->persp= 1;
|
|
|
|
|
|
|
|
|
|
if( (vd->lay & vd->layact) == 0) {
|
|
|
|
|
bit= 0;
|
|
|
|
|
while(bit<32) {
|
|
|
|
|
if(vd->lay & (1<<bit)) {
|
|
|
|
|
vd->layact= 1<<bit;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
bit++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(val==REDRAW && vd==sa->spacedata.first) {
|
2003-07-04 20:15:13 +00:00
|
|
|
if(sa->win) scrarea_queue_redraw(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sc= sc->id.next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Commit for the 4 aforementioned "features":
- "Global Pivot": Maintains a global Pivot and Align mode setting for
all 3d views when enabled, instead of seperate settings per 3d view
- "Auto Perspective": Switch to ortho mode automatically on 1/3/7, and
to Perspective when the view is rotated with the mouse
- "Align mode": As suggested on the list, when enabled, transformations
on several objects only transform their locations, not their sizes or
rotations.
- Grid dotted when not 1:1
***ATTENTION***! The User Interface parts of these features have not been
committed, as I work on my own modified UI here. The three features need
toggle buttons to turn them on and off.
I used the following 3 buttons (first two features are in userprefs,
third as a 3d view setting):
uiDefButBitS(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Persp",
(xpos+edgespace+(3*medprefbut)+(3*midspace)+smallprefbut+2),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Automatically switch between orthographic and perspective");
uiDefButBitS(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
(xpos+edgespace+(4*midspace)+(4*medprefbut)),y3+10,smallprefbut,buth,
&(U.uiflag), 0, 0, 0, 0,
"Use global pivot setting for all 3d views");
uiDefIconButS(block, TOG|BIT|10, B_AROUND, ICON_ALIGN,
xco+=XIC,0,XIC,YIC,
&G.vd->flag, 0, 0, 0, 0, "Translate only (align)");
Someone needs to add these to the interface in an appropriate manner!
Thanks.
2004-07-15 13:31:18 +00:00
|
|
|
void handle_view3d_around()
|
|
|
|
|
{
|
|
|
|
|
bScreen *sc;
|
|
|
|
|
|
|
|
|
|
if ((U.uiflag & USER_LOCKAROUND)==0) return;
|
|
|
|
|
|
|
|
|
|
/* copies from G.vd->around to other view3ds */
|
|
|
|
|
|
|
|
|
|
sc= G.main->screen.first;
|
|
|
|
|
|
|
|
|
|
while(sc) {
|
|
|
|
|
if(sc->scene==G.scene) {
|
|
|
|
|
ScrArea *sa= sc->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
View3D *vd= (View3D*) sl;
|
|
|
|
|
if (vd != G.vd) {
|
|
|
|
|
vd->around= G.vd->around;
|
|
|
|
|
if (G.vd->flag & V3D_ALIGN)
|
|
|
|
|
vd->flag |= V3D_ALIGN;
|
|
|
|
|
else
|
|
|
|
|
vd->flag &= ~V3D_ALIGN;
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sc= sc->id.next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
void handle_view3d_lock()
|
|
|
|
|
{
|
|
|
|
|
if (G.vd != NULL) {
|
|
|
|
|
if(G.vd->localview==0 && G.vd->scenelock && curarea->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* copy to scene */
|
2002-10-12 11:37:38 +00:00
|
|
|
G.scene->lay= G.vd->lay;
|
|
|
|
|
G.scene->camera= G.vd->camera;
|
|
|
|
|
|
|
|
|
|
copy_view3d_lock(REDRAW);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void space_set_commmandline_options(void) {
|
|
|
|
|
SYS_SystemHandle syshandle;
|
|
|
|
|
int a;
|
|
|
|
|
|
|
|
|
|
if ( (syshandle = SYS_GetSystem()) ) {
|
|
|
|
|
/* User defined settings */
|
2004-01-13 14:50:45 +00:00
|
|
|
a= (U.gameflags & USER_VERTEX_ARRAYS);
|
2002-10-12 11:37:38 +00:00
|
|
|
SYS_WriteCommandLineInt(syshandle, "vertexarrays", a);
|
|
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
a= (U.gameflags & USER_DISABLE_SOUND);
|
2002-10-12 11:37:38 +00:00
|
|
|
SYS_WriteCommandLineInt(syshandle, "noaudio", a);
|
|
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
a= (U.gameflags & USER_DISABLE_MIPMAP);
|
2002-10-12 11:37:38 +00:00
|
|
|
set_mipmap(!a);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "nomipmap", a);
|
|
|
|
|
|
|
|
|
|
/* File specific settings: */
|
|
|
|
|
/* Only test the first one. These two are switched
|
|
|
|
|
* simultaneously. */
|
|
|
|
|
a= (G.fileflags & G_FILE_SHOW_FRAMERATE);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "show_framerate", a);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "show_profile", a);
|
|
|
|
|
|
|
|
|
|
/* When in wireframe mode, always draw debug props. */
|
|
|
|
|
if (G.vd) {
|
|
|
|
|
a = ( (G.fileflags & G_FILE_SHOW_DEBUG_PROPS)
|
|
|
|
|
|| (G.vd->drawtype == OB_WIRE)
|
|
|
|
|
|| (G.vd->drawtype == OB_SOLID) );
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "show_properties", a);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
a= (G.fileflags & G_FILE_ENABLE_ALL_FRAMES);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "fixedtime", a);
|
2005-08-23 13:16:02 +00:00
|
|
|
|
|
|
|
|
a= (G.fileflags & G_FILE_GAME_TO_IPO);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "game2ipo", a);
|
|
|
|
|
|
2006-01-06 03:46:54 +00:00
|
|
|
a=(G.fileflags & G_FILE_GAME_MAT);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "blender_material", a);
|
2006-04-02 21:04:20 +00:00
|
|
|
a=(G.fileflags & G_FILE_DIAPLAY_LISTS);
|
|
|
|
|
SYS_WriteCommandLineInt(syshandle, "displaylists", a);
|
2006-01-06 03:46:54 +00:00
|
|
|
|
2005-08-23 13:16:02 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
#if GAMEBLENDER == 1
|
2002-10-12 11:37:38 +00:00
|
|
|
/**
|
|
|
|
|
* These two routines imported from the gameengine,
|
|
|
|
|
* I suspect a lot of the resetting stuff is cruft
|
|
|
|
|
* and can be removed, but it should be checked.
|
|
|
|
|
*/
|
|
|
|
|
static void SaveState(void)
|
|
|
|
|
{
|
|
|
|
|
glPushAttrib(GL_ALL_ATTRIB_BITS);
|
|
|
|
|
|
|
|
|
|
init_realtime_GL();
|
|
|
|
|
init_gl_stuff();
|
|
|
|
|
|
|
|
|
|
if(G.scene->camera==0 || G.scene->camera->type!=OB_CAMERA)
|
|
|
|
|
error("no (correct) camera");
|
|
|
|
|
|
|
|
|
|
waitcursor(1);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void RestoreState(void)
|
|
|
|
|
{
|
|
|
|
|
curarea->win_swap = 0;
|
|
|
|
|
curarea->head_swap=0;
|
2004-10-01 10:10:09 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 1);
|
2002-10-12 11:37:38 +00:00
|
|
|
allqueue(REDRAWBUTSALL, 0);
|
|
|
|
|
reset_slowparents();
|
|
|
|
|
waitcursor(0);
|
|
|
|
|
G.qual= 0;
|
|
|
|
|
glPopAttrib();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static LinkNode *save_and_reset_all_scene_cfra(void)
|
|
|
|
|
{
|
|
|
|
|
LinkNode *storelist= NULL;
|
|
|
|
|
Scene *sc;
|
|
|
|
|
|
|
|
|
|
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
|
2003-07-09 16:02:39 +00:00
|
|
|
BLI_linklist_prepend(&storelist, (void*) (long) sc->r.cfra);
|
2005-08-23 13:16:02 +00:00
|
|
|
|
|
|
|
|
//why is this reset to 1 ?
|
|
|
|
|
//sc->r.cfra= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
set_scene_bg(sc);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLI_linklist_reverse(&storelist);
|
|
|
|
|
|
|
|
|
|
return storelist;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void restore_all_scene_cfra(LinkNode *storelist) {
|
|
|
|
|
LinkNode *sc_store= storelist;
|
|
|
|
|
Scene *sc;
|
|
|
|
|
|
|
|
|
|
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
|
|
|
|
|
int stored_cfra= (int) sc_store->link;
|
|
|
|
|
|
|
|
|
|
sc->r.cfra= stored_cfra;
|
|
|
|
|
set_scene_bg(sc);
|
|
|
|
|
|
|
|
|
|
sc_store= sc_store->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
BLI_linklist_free(storelist, NULL);
|
|
|
|
|
}
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
void start_game(void)
|
|
|
|
|
{
|
2002-11-29 17:07:58 +00:00
|
|
|
#if GAMEBLENDER == 1
|
2004-03-28 22:33:21 +00:00
|
|
|
#ifndef NO_KETSJI
|
2002-10-12 11:37:38 +00:00
|
|
|
Scene *sc, *startscene = G.scene;
|
|
|
|
|
LinkNode *scene_cfra_store;
|
|
|
|
|
|
|
|
|
|
/* XXX, silly code - the game engine can
|
|
|
|
|
* access any scene through logic, so we try
|
|
|
|
|
* to make sure each scene has a valid camera,
|
|
|
|
|
* just in case the game engine tries to use it.
|
|
|
|
|
*
|
|
|
|
|
* Better would be to make a better routine
|
|
|
|
|
* in the game engine for finding the camera.
|
|
|
|
|
* - zr
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
* Note: yes, this is all very badly hacked! (ton)
|
2002-10-12 11:37:38 +00:00
|
|
|
*/
|
|
|
|
|
for (sc= G.main->scene.first; sc; sc= sc->id.next) {
|
|
|
|
|
if (!sc->camera) {
|
|
|
|
|
Base *base;
|
|
|
|
|
|
|
|
|
|
for (base= sc->base.first; base; base= base->next)
|
|
|
|
|
if (base->object->type==OB_CAMERA)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
sc->camera= base?base->object:NULL;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* these two lines make sure front and backbuffer are equal. for swapbuffers */
|
|
|
|
|
markdirty_all();
|
|
|
|
|
screen_swapbuffers();
|
|
|
|
|
|
|
|
|
|
/* can start from header */
|
|
|
|
|
mywinset(curarea->win);
|
|
|
|
|
|
|
|
|
|
scene_cfra_store= save_and_reset_all_scene_cfra();
|
|
|
|
|
|
|
|
|
|
|
2004-07-26 11:54:10 +00:00
|
|
|
/* game engine will do its own sounds. */
|
2002-10-12 11:37:38 +00:00
|
|
|
sound_stop_all_sounds();
|
2004-07-26 11:54:10 +00:00
|
|
|
sound_exit_audio();
|
2004-04-21 13:38:54 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* Before jumping into Ketsji, we configure some settings. */
|
|
|
|
|
space_set_commmandline_options();
|
|
|
|
|
|
|
|
|
|
SaveState();
|
2005-08-23 13:16:02 +00:00
|
|
|
StartKetsjiShell(curarea, startscene->id.name+2, G.main,G.sipo, 1);
|
2002-10-12 11:37:38 +00:00
|
|
|
RestoreState();
|
|
|
|
|
|
2004-05-21 09:27:42 +00:00
|
|
|
/* Restart BPY - unload the game engine modules. */
|
|
|
|
|
BPY_end_python();
|
BPython:
- Blender.Window: added function GetPerspMatrix() (Tom Musgrave's patch, thanks);
- added Chris Want's patch to tell argc, argv to the Python interpreter (thanks, Hos);
- Blender.Image: added image.glFree() to free textures bound by the recently added
image.glLoad() (both suggested by Campbell Barton -- thanks, with these Blender can
be used to load textures for scripts);
- Blender.Sound: removed for now at least a few get/set methods of vars that can't be
accessed via interface;
- renamed Get/makeActive to Get/setCurrent in Blender.World (actually added alias for
now), same in Blender.Sound: renamed makeActive to setCurrent. Stephen Swaney
pointed this some weeks ago, we should stick to one naming convention.
- added documentation for Sound and Window.Theme modules and the other added
functions, made other small updates.
- Blender.Object: made 'worldspace' become the default output of .getMatrix and .mat/.matrix:
after reading a discussion on blender.org's Python forum where eeshlo mentioned the
pre 2.34 default was worldspace, I took a better look at Blender's relevant code,
confirmed, talked to Theeth about this and as he suggested am changing the default
back to 'worldspace'.
2004-10-20 05:51:24 +00:00
|
|
|
BPY_start_python(0, NULL); /* argc, argv stored there already */
|
2004-07-29 19:10:52 +00:00
|
|
|
BPY_post_start_python(); /* userpref path and menus init */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
restore_all_scene_cfra(scene_cfra_store);
|
|
|
|
|
set_scene_bg(startscene);
|
More work on render stuff!
- Scene support in RenderLayers
You now can indicate in Compositor to use RenderLayer(s) from other scenes.
Use the new dropdown menu in the "Render Result" node. It will change the
title of the node to indicate that.
The other Scenes are rendered fully separate, creating own databases (and
octrees) after the current scene was finished. They use their own render
settings, with as exception the render output size (and optional border).
This makes the option an interesting memory saver and speedup.
Also note that the render-results of other scenes are kept in memory while
you work. So, after a render, you can tweak all composit effects.
- Render Stats
Added an 'info string' to stats, printed in renderwindow header. It gives
info now on steps "creating database", "shadow buffers", and "octree".
- Bug fixes
Added redraw event for Image window, when using compositor render.
Text objects were not rendered using background render (probably a bug
since depsgraph was added)
Dropdown buttons in Node editor were not refreshed after usage
Sometimes render window did not open, this due to wrong check for 'esc'.
Removed option that renders view-layers on F12, with mouse in 3d window.
Not only was it confusing, it's now more efficient with the Preview Panel,
which does this nicely.
2006-02-04 13:28:50 +00:00
|
|
|
scene_update_for_newframe(G.scene, G.scene->lay);
|
|
|
|
|
|
2005-08-03 18:48:22 +00:00
|
|
|
if (G.flags & G_FILE_AUTOPLAY)
|
2002-10-12 11:37:38 +00:00
|
|
|
exit_usiblender();
|
|
|
|
|
|
|
|
|
|
/* groups could have changed ipo */
|
|
|
|
|
allqueue(REDRAWNLA, 0);
|
|
|
|
|
allqueue(REDRAWACTION, 0);
|
|
|
|
|
allspace(REMAKEIPO, 0);
|
|
|
|
|
allqueue(REDRAWIPO, 0);
|
2004-03-21 19:59:51 +00:00
|
|
|
#endif
|
2003-02-09 19:34:22 +00:00
|
|
|
#else
|
|
|
|
|
notice("Game engine is disabled in this release!");
|
2002-11-29 17:07:58 +00:00
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
static void changeview3dspace(ScrArea *sa, void *spacedata)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
setwinmatrixview3d(sa->winx, sa->winy, NULL); /* 0= no pick rect */
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* Callable from editmode and faceselect mode from the
|
|
|
|
|
* moment, would be nice (and is easy) to generalize
|
|
|
|
|
* to any mode.
|
|
|
|
|
*/
|
|
|
|
|
static void align_view_to_selected(View3D *v3d)
|
|
|
|
|
{
|
2004-01-12 13:30:00 +00:00
|
|
|
int nr= pupmenu("Align View%t|To Selected (top)%x2|To Selected (front)%x1|To Selected (side)%x0");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if (nr!=-1) {
|
|
|
|
|
int axis= nr;
|
|
|
|
|
|
2003-10-27 23:55:38 +00:00
|
|
|
if ((G.obedit) && (G.obedit->type == OB_MESH)) {
|
2002-10-12 11:37:38 +00:00
|
|
|
editmesh_align_view_to_selected(v3d, axis);
|
|
|
|
|
addqueue(v3d->area->win, REDRAW, 1);
|
|
|
|
|
} else if (G.f & G_FACESELECT) {
|
|
|
|
|
Object *obact= OBACT;
|
|
|
|
|
if (obact && obact->type==OB_MESH) {
|
|
|
|
|
Mesh *me= obact->data;
|
|
|
|
|
|
|
|
|
|
if (me->tface) {
|
|
|
|
|
faceselect_align_view_to_selected(v3d, me, axis);
|
|
|
|
|
addqueue(v3d->area->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
static void select_children(Object *ob, int recursive)
|
2003-04-29 16:24:56 +00:00
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
|
|
|
|
|
for (base= FIRSTBASE; base; base= base->next)
|
|
|
|
|
if (ob == base->object->parent) {
|
|
|
|
|
base->flag |= SELECT;
|
2003-07-18 15:50:33 +00:00
|
|
|
base->object->flag |= SELECT;
|
|
|
|
|
if (recursive) select_children(base->object, 1);
|
2003-04-29 16:24:56 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
static void select_parent(void) /* Makes parent active and de-selected OBACT */
|
2003-07-18 15:50:33 +00:00
|
|
|
{
|
2003-10-04 20:35:50 +00:00
|
|
|
Base *base, *startbase, *basact=NULL, *oldbasact;
|
2004-08-05 00:03:53 +00:00
|
|
|
|
|
|
|
|
if (!(OBACT) || !(OBACT->parent)) return;
|
2003-07-18 15:50:33 +00:00
|
|
|
BASACT->flag &= (~SELECT);
|
|
|
|
|
BASACT->object->flag &= (~SELECT);
|
|
|
|
|
startbase= FIRSTBASE;
|
|
|
|
|
if(BASACT && BASACT->next) startbase= BASACT->next;
|
|
|
|
|
base = startbase;
|
|
|
|
|
while(base) {
|
|
|
|
|
if(base->object==BASACT->object->parent) { basact=base; break; }
|
|
|
|
|
base=base->next;
|
2005-03-01 14:03:59 +00:00
|
|
|
if(base==NULL) base= FIRSTBASE;
|
2003-07-18 15:50:33 +00:00
|
|
|
if(base==startbase) break;
|
|
|
|
|
}
|
2005-03-01 14:03:59 +00:00
|
|
|
/* can be NULL if parent in other scene */
|
|
|
|
|
if(basact) {
|
|
|
|
|
oldbasact = BASACT;
|
|
|
|
|
BASACT = basact;
|
|
|
|
|
basact->flag |= SELECT;
|
|
|
|
|
|
|
|
|
|
basact->object->flag= basact->flag;
|
|
|
|
|
|
|
|
|
|
set_active_base(basact);
|
|
|
|
|
}
|
2003-07-18 15:50:33 +00:00
|
|
|
}
|
|
|
|
|
|
2006-02-09 15:14:19 +00:00
|
|
|
static void select_same_group(Object *ob) /* Select objects in the same group as the active */
|
|
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
Group *group= find_group(ob);
|
|
|
|
|
if (!group || !ob)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (base= FIRSTBASE; base; base= base->next)
|
|
|
|
|
if (object_in_group(base->object, group)) {
|
|
|
|
|
base->flag |= SELECT;
|
|
|
|
|
base->object->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-04-02 15:40:56 +00:00
|
|
|
|
|
|
|
|
static void select_same_parent(Object *ob) /* Select objects woth the same parent as the active (siblings), parent can be NULL also */
|
|
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
if (!ob)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (base= FIRSTBASE; base; base= base->next)
|
|
|
|
|
if (base->object->parent==ob->parent) {
|
|
|
|
|
base->flag |= SELECT;
|
|
|
|
|
base->object->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static void select_same_type(Object *ob) /* Select objects woth the same parent as the active (siblings), parent can be NULL also */
|
|
|
|
|
{
|
|
|
|
|
Base *base;
|
|
|
|
|
if (!ob)
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
for (base= FIRSTBASE; base; base= base->next)
|
|
|
|
|
if (base->object->type==ob->type) {
|
|
|
|
|
base->flag |= SELECT;
|
|
|
|
|
base->object->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-25 04:37:40 +00:00
|
|
|
void select_object_grouped(short nr)
|
2004-01-12 13:30:00 +00:00
|
|
|
{
|
|
|
|
|
Base *base;
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
|
2006-04-02 15:40:56 +00:00
|
|
|
if(nr==6) {
|
2003-07-18 15:50:33 +00:00
|
|
|
base= FIRSTBASE;
|
|
|
|
|
while(base) {
|
|
|
|
|
if (base->lay & OBACT->lay) {
|
|
|
|
|
base->flag |= SELECT;
|
|
|
|
|
base->object->flag |= SELECT;
|
|
|
|
|
}
|
|
|
|
|
base= base->next;
|
2006-02-09 15:14:19 +00:00
|
|
|
}
|
2003-07-18 15:50:33 +00:00
|
|
|
}
|
|
|
|
|
else if(nr==1) select_children(OBACT, 1);
|
2006-04-02 15:40:56 +00:00
|
|
|
else if(nr==2) select_children(OBACT, 0);
|
2003-07-18 15:50:33 +00:00
|
|
|
else if(nr==3) select_parent();
|
2006-04-02 15:40:56 +00:00
|
|
|
else if(nr==4) select_same_parent(OBACT);
|
|
|
|
|
else if(nr==5) select_same_type(OBACT);
|
|
|
|
|
else if(nr==7) select_same_group(OBACT);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2003-07-18 15:50:33 +00:00
|
|
|
|
2005-09-18 11:20:05 +00:00
|
|
|
countall();
|
2003-07-18 15:50:33 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
2003-10-07 18:24:02 +00:00
|
|
|
allqueue(REDRAWBUTSOBJECT, 0);
|
2003-07-18 15:50:33 +00:00
|
|
|
allspace(REMAKEIPO, 0);
|
|
|
|
|
allqueue(REDRAWIPO, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2006-03-25 04:37:40 +00:00
|
|
|
static void select_object_grouped_menu(void)
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
{
|
|
|
|
|
char *str;
|
|
|
|
|
short nr;
|
|
|
|
|
|
|
|
|
|
/* make menu string */
|
|
|
|
|
|
2006-04-02 15:40:56 +00:00
|
|
|
str= MEM_mallocN(180, "groupmenu");
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
strcpy(str, "Select Grouped%t|Children%x1|"
|
|
|
|
|
"Immediate Children%x2|Parent%x3|"
|
2006-04-02 15:40:56 +00:00
|
|
|
"Siblings (Shared Parent)%x4|"
|
|
|
|
|
"Objects of Same Type%x5|"
|
|
|
|
|
"Objects on Shared Layers%x6|"
|
|
|
|
|
"Objects in Same Group%x7|");
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
|
|
|
|
|
/* here we go */
|
|
|
|
|
|
|
|
|
|
nr= pupmenu(str);
|
|
|
|
|
MEM_freeN(str);
|
|
|
|
|
|
2006-03-25 04:37:40 +00:00
|
|
|
select_object_grouped(nr);
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
}
|
|
|
|
|
|
2005-12-30 14:17:15 +00:00
|
|
|
void join_menu(void)
|
|
|
|
|
{
|
|
|
|
|
Object *ob= OBACT;
|
|
|
|
|
if (ob && !G.obedit) {
|
|
|
|
|
if(ob->type == OB_MESH) {
|
|
|
|
|
if(okee("Join selected meshes")==0) return;
|
|
|
|
|
join_mesh();
|
|
|
|
|
} else if(ob->type == OB_CURVE) {
|
|
|
|
|
if(okee("Join selected curves")==0) return;
|
|
|
|
|
join_curve(OB_CURVE);
|
|
|
|
|
} else if(ob->type == OB_SURF) {
|
|
|
|
|
if(okee("Join selected NURBS")==0) return;
|
|
|
|
|
join_curve(OB_SURF);
|
|
|
|
|
} else if(ob->type == OB_ARMATURE) {
|
|
|
|
|
/* Make sure the user wants to continue*/
|
|
|
|
|
if(okee("Join selected armatures")==0) return;
|
|
|
|
|
join_armature ();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
|
2004-07-23 21:07:32 +00:00
|
|
|
static unsigned short convert_for_nonumpad(unsigned short event)
|
|
|
|
|
{
|
|
|
|
|
if (event>=ZEROKEY && event<=NINEKEY) {
|
|
|
|
|
return event - ZEROKEY + PAD0;
|
|
|
|
|
} else if (event==MINUSKEY) {
|
|
|
|
|
return PADMINUS;
|
|
|
|
|
} else if (event==EQUALKEY) {
|
|
|
|
|
return PADPLUSKEY;
|
|
|
|
|
} else if (event==BACKSLASHKEY) {
|
|
|
|
|
return PADSLASHKEY;
|
|
|
|
|
} else {
|
|
|
|
|
return event;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-09-16 17:57:14 +00:00
|
|
|
/* *************** */
|
|
|
|
|
|
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
|
|
|
void BIF_undo_push(char *str)
|
2004-09-16 17:57:14 +00:00
|
|
|
{
|
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
|
|
|
if(G.obedit) {
|
2005-10-24 20:11:16 +00:00
|
|
|
if (U.undosteps == 0) return;
|
|
|
|
|
|
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
|
|
|
if(G.obedit->type==OB_MESH)
|
|
|
|
|
undo_push_mesh(str);
|
|
|
|
|
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
|
|
|
|
undo_push_curve(str);
|
2004-11-07 20:11:42 +00:00
|
|
|
else if (G.obedit->type==OB_FONT)
|
|
|
|
|
undo_push_font(str);
|
2004-09-29 22:28:14 +00:00
|
|
|
else if (G.obedit->type==OB_MBALL)
|
|
|
|
|
undo_push_mball(str);
|
2004-11-07 21:14:21 +00:00
|
|
|
else if (G.obedit->type==OB_LATTICE)
|
|
|
|
|
undo_push_lattice(str);
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
else if (G.obedit->type==OB_ARMATURE)
|
|
|
|
|
undo_push_armature(str);
|
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
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if(U.uiflag & USER_GLOBALUNDO)
|
|
|
|
|
BKE_write_undo(str);
|
|
|
|
|
}
|
|
|
|
|
}
|
2004-09-16 17:57:14 +00:00
|
|
|
|
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
|
|
|
void BIF_undo(void)
|
2004-09-24 12:40:37 +00:00
|
|
|
{
|
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
|
|
|
if(G.obedit) {
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
|
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
|
|
|
undo_editmode_step(1);
|
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
|
|
|
}
|
|
|
|
|
else {
|
2004-11-06 23:22:06 +00:00
|
|
|
if(G.f & G_WEIGHTPAINT)
|
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
|
|
|
wpaint_undo();
|
|
|
|
|
else if(G.f & G_VERTEXPAINT)
|
|
|
|
|
vpaint_undo();
|
2005-09-16 20:17:09 +00:00
|
|
|
else if(G.f & G_TEXTUREPAINT); /* no texture paint undo yet */
|
|
|
|
|
else if(curarea->spacetype==SPACE_IMAGE && (G.sima->flag & SI_DRAWTOOL));
|
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
|
|
|
else {
|
2004-11-06 23:22:06 +00:00
|
|
|
/* now also in faceselect mode */
|
2006-01-03 12:04:05 +00:00
|
|
|
if(U.uiflag & USER_GLOBALUNDO) {
|
|
|
|
|
BKE_undo_step(1);
|
|
|
|
|
sound_initialize_sounds();
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
}
|
2004-09-16 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
void BIF_redo(void)
|
2004-09-16 17:57:14 +00:00
|
|
|
{
|
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
|
|
|
if(G.obedit) {
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
|
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
|
|
|
undo_editmode_step(-1);
|
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
|
|
|
}
|
|
|
|
|
else {
|
2004-11-06 23:22:06 +00:00
|
|
|
if(G.f & G_WEIGHTPAINT)
|
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
|
|
|
wpaint_undo();
|
|
|
|
|
else if(G.f & G_VERTEXPAINT)
|
|
|
|
|
vpaint_undo();
|
|
|
|
|
else {
|
2004-11-06 23:22:06 +00:00
|
|
|
/* includes faceselect now */
|
2006-01-03 12:04:05 +00:00
|
|
|
if(U.uiflag & USER_GLOBALUNDO) {
|
|
|
|
|
BKE_undo_step(-1);
|
|
|
|
|
sound_initialize_sounds();
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
}
|
2004-09-16 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
|
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
|
|
|
void BIF_undo_menu(void)
|
2004-09-16 17:57:14 +00:00
|
|
|
{
|
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
|
|
|
if(G.obedit) {
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
if ELEM7(G.obedit->type, OB_MESH, OB_FONT, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE)
|
2004-09-29 22:28:14 +00:00
|
|
|
undo_editmode_menu();
|
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
|
|
|
allqueue(REDRAWALL, 0);
|
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
|
|
|
}
|
|
|
|
|
else {
|
2004-11-06 23:22:06 +00:00
|
|
|
if(G.f & G_WEIGHTPAINT)
|
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
|
|
|
;
|
|
|
|
|
else if(G.f & G_VERTEXPAINT)
|
|
|
|
|
;
|
|
|
|
|
else {
|
2004-11-07 16:49:46 +00:00
|
|
|
if(U.uiflag & USER_GLOBALUNDO) {
|
|
|
|
|
char *menu= BKE_undo_menu_string();
|
|
|
|
|
if(menu) {
|
|
|
|
|
short event= pupmenu_col(menu, 20);
|
|
|
|
|
MEM_freeN(menu);
|
|
|
|
|
if(event>0) BKE_undo_number(event);
|
|
|
|
|
}
|
|
|
|
|
}
|
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
|
|
|
}
|
|
|
|
|
}
|
2004-09-16 17:57:14 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* *************** */
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadview3dspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2005-03-19 12:17:06 +00:00
|
|
|
View3D *v3d= sa->spacedata.first;
|
2005-07-23 18:52:31 +00:00
|
|
|
Object *ob= OBACT; // do not change!
|
2002-10-12 11:37:38 +00:00
|
|
|
float *curs;
|
|
|
|
|
int doredraw= 0, pupval;
|
2005-07-23 18:52:31 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
|
|
|
|
char ascii= evt->ascii;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
if(curarea->win==0) return; /* when it comes from sa->headqread() */
|
2003-10-15 12:26:26 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(val) {
|
|
|
|
|
|
|
|
|
|
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
2004-08-31 13:43:18 +00:00
|
|
|
if(event==MOUSEY || event==MOUSEX) return;
|
2003-10-15 12:26:26 +00:00
|
|
|
|
|
|
|
|
if(event==UI_BUT_EVENT) do_butspace(val); // temporal, view3d deserves own queue?
|
|
|
|
|
|
BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events). Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab. Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default. "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type. Cancel the popup to leave the string button empty (link exists, but has no script assigned). A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown. With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View, but it's trivial to add for others. There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window. Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu. Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
print "a"
elif evt == Draw.LEFTMOUSE:
print "left mouse button"
else:
return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers. Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable. Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are. The tooltips may not be accepted either, since other menus don't use them. Opinions welcomed.
2005-05-08 21:20:34 +00:00
|
|
|
/* we consider manipulator a button, defaulting to leftmouse */
|
So! Finally a show-off of the *power* of Martin P's work! :)
- Made framework for 3d Transform Manipulators (widgets)
- The Manipulators act like '2d buttons', by default with LeftMouse and with
while-hold-move-release
- Implemented now: Translation Widget, which allows:
- four hotspots for axis grab or view-aligned grab
- center defined by 'around' setting
- SHIFT+LMB gives planar constraint on other 2 axes
- works in Object mode and Edit mode (not posemode yet)
Enable it with (temporal) icon in 3D header. All other 'normal' transforms
then keeps working btw.
On the todo for this widget:
- choice for Global, Local or Normal orientation
The way the widgets are going to work is in review still. Commit is also for
Matt for his proposal/paper on topic.
Some notes regarding this project;
- no life updates (on mouse over) like 3DS, I think that's neurotic
- on click, dominant axis changes to theme defined "Transform" color, other axes disappear, like maya
- manipulater size is fixed preset, independent zoom.
- manipulator follows selection, and is located based on 'around' mode
Unresolved;
- in maya, when you select 2 or more objects, the manipulator draws on the 'active' object, also interesting
- what to do with G,R,S hotkeys? It could switch the manipulator "mode"...
- header button/menu for manipulator mode?
2005-03-17 21:31:49 +00:00
|
|
|
if(event==LEFTMOUSE) if(BIF_do_manipulator(sa)) return;
|
|
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
/* swap mouse buttons based on user preference */
|
|
|
|
|
if (U.flag & USER_LMOUSESELECT) {
|
2004-11-26 20:20:42 +00:00
|
|
|
if (event==LEFTMOUSE) event = RIGHTMOUSE;
|
|
|
|
|
else if (event==RIGHTMOUSE) event = LEFTMOUSE;
|
2004-07-16 01:34:19 +00:00
|
|
|
}
|
BPython:
- Made Blender.event var (previously only used by script links) hold ascii value -- where it applies -- of current event during events callback registered with Draw.Register(gui, events, button_events). Useful for gui scripts like Campbell's Python console. No problem using this var to hold the value, since in gui scripts it was not used (always None).
- Updated Window and Window.Theme with new theme vars and the Time space.
- Script links:
-- Added "Render" event for script links (runs twice, second time as "PostEvent", for clean-up actions). Now FrameChanged links don't run when a single pic is rendered.
-- Added "Enable Script Links" button in the script buttons tab. Now this bit gets saved in .blends along with the rest of G.f, so users can define per .blend if they are on or off by default. "blender -y" also disables all slinks as happened before with OnLoad ones only.
-- Other small changes in the script buttons tab:
When a link is added (button "new"), it becomes the active one for the window, no need to press a button to reach it.
Also, a pupmenu showing all available texts is shown when "new" is pressed, so users can choose a text w/o having to type. Cancel the popup to leave the string button empty (link exists, but has no script assigned). A pulldown would be better UI-wise, but it's kinda weird to show both scripts and normal texts (Blender doesn't differentiate them) in a script links pulldown. With a popup we can show only texts ending in ".py" (not done in this commit, need opinions) and if the script has no or another extension, case of many in old and current .blend's, there's still the string box for writing its name.
-- Implemented Ton's space handler script links:
Right now only for the 3d View, but it's trivial to add for others. There are two types: EVENT, to receive 3d View events from a chosen window and DRAW, to draw on the window. Ton's idea was to give scripts a controlled way to integrate better within Blender.
Here's how it works:
- scripts must have a proper header, like:
# SPACEHANDLER.VIEW3D.EVENT
and then they are shown in 3d View's View menu, "Space Handler Scripts" submenu. Check (mark, click on it) a script to make it active.
EVENT handlers should consult the Blender.event var to get the current event, which can be compared with values from the Draw module:
import Blender
from Blender import Draw
evt = Blender.event
if evt == Draw.AKEY:
print "a"
elif evt == Draw.LEFTMOUSE:
print "left mouse button"
else:
return # ignore, pass event back to Blender
Blender.event = None # tell Blender not to process itself the event
DRAW handlers are free to draw to their owner 3D View. OpenGL attributes and modelview and projection matrices are pushed before running the handler and poped when it finishes.
To communicate between EVENT and DRAW handler scripts we have the Blender.Registry module, as always.
Still need to code some nice example, which should also serve to test properly space handlers. Simple tests went fine.
- doc updates about the additions.
=======
Note: the UI part of the space handlers and script links is of course open for changes, I just tried to make it understandable. Probably we won't use the scriptlinks icon for "None Available" (check 3d View -> View -> Space Handler Scripts), though it hints at what space handlers are. The tooltips may not be accepted either, since other menus don't use them. Opinions welcomed.
2005-05-08 21:20:34 +00:00
|
|
|
|
|
|
|
|
/* run any view3d event handler script links */
|
|
|
|
|
if (event && sa->scriptlink.totscript)
|
|
|
|
|
if (BPY_do_spacehandlers(sa, event, SPACEHANDLER_VIEW3D_EVENT))
|
|
|
|
|
return; /* return if event was processed (swallowed) by handler(s) */
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* TEXTEDITING?? */
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.obedit) && G.obedit->type==OB_FONT) {
|
2002-10-12 11:37:38 +00:00
|
|
|
switch(event) {
|
|
|
|
|
|
|
|
|
|
case LEFTMOUSE:
|
|
|
|
|
mouse_cursor();
|
|
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
2003-11-06 15:28:40 +00:00
|
|
|
/* use '&' here, because of alt+leftmouse which emulates middlemouse */
|
2004-01-13 14:50:45 +00:00
|
|
|
if(U.flag & USER_VIEWMOVE) {
|
|
|
|
|
if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(0);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(2);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(1);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2004-01-13 14:50:45 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(1);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(2);
|
2003-11-06 15:28:40 +00:00
|
|
|
else
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-29 22:53:09 +00:00
|
|
|
break;
|
|
|
|
|
|
2003-06-10 21:07:56 +00:00
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
/* Regular: Zoom in */
|
|
|
|
|
/* Shift: Scroll up */
|
|
|
|
|
/* Ctrl: Scroll right */
|
|
|
|
|
/* Alt-Shift: Rotate up */
|
|
|
|
|
/* Alt-Ctrl: Rotate right */
|
|
|
|
|
|
|
|
|
|
if( G.qual & LR_SHIFTKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_SHIFTKEY;
|
|
|
|
|
persptoetsen(PAD2);
|
|
|
|
|
G.qual |= LR_SHIFTKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD2);
|
|
|
|
|
}
|
|
|
|
|
} else if( G.qual & LR_CTRLKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_CTRLKEY;
|
|
|
|
|
persptoetsen(PAD4);
|
|
|
|
|
G.qual |= LR_CTRLKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD4);
|
|
|
|
|
}
|
2004-01-13 14:50:45 +00:00
|
|
|
} else if(U.uiflag & USER_WHEELZOOMDIR)
|
2003-06-10 21:07:56 +00:00
|
|
|
persptoetsen(PADMINUS);
|
|
|
|
|
else
|
|
|
|
|
persptoetsen(PADPLUSKEY);
|
|
|
|
|
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
/* Regular: Zoom out */
|
|
|
|
|
/* Shift: Scroll down */
|
|
|
|
|
/* Ctrl: Scroll left */
|
|
|
|
|
/* Alt-Shift: Rotate down */
|
|
|
|
|
/* Alt-Ctrl: Rotate left */
|
|
|
|
|
|
|
|
|
|
if( G.qual & LR_SHIFTKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_SHIFTKEY;
|
|
|
|
|
persptoetsen(PAD8);
|
|
|
|
|
G.qual |= LR_SHIFTKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD8);
|
|
|
|
|
}
|
|
|
|
|
} else if( G.qual & LR_CTRLKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_CTRLKEY;
|
|
|
|
|
persptoetsen(PAD6);
|
|
|
|
|
G.qual |= LR_CTRLKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD6);
|
|
|
|
|
}
|
2004-01-13 14:50:45 +00:00
|
|
|
} else if(U.uiflag & USER_WHEELZOOMDIR)
|
2003-06-10 21:07:56 +00:00
|
|
|
persptoetsen(PADPLUSKEY);
|
|
|
|
|
else
|
|
|
|
|
persptoetsen(PADMINUS);
|
|
|
|
|
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case UKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_ALTKEY) {
|
2002-10-12 11:37:38 +00:00
|
|
|
remake_editText();
|
|
|
|
|
doredraw= 1;
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2002-10-12 11:37:38 +00:00
|
|
|
do_textedit(event, val, ascii);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-04-28 11:17:21 +00:00
|
|
|
case VKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_ALTKEY) {
|
2003-04-28 11:17:21 +00:00
|
|
|
paste_editText();
|
|
|
|
|
doredraw= 1;
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2003-04-28 11:17:21 +00:00
|
|
|
do_textedit(event, val, ascii);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
|
|
|
|
|
case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
|
|
|
|
|
case PADENTER:
|
|
|
|
|
persptoetsen(event);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
do_textedit(event, val, ascii);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
2004-07-23 21:07:32 +00:00
|
|
|
|
|
|
|
|
if (U.flag & USER_NONUMPAD) {
|
|
|
|
|
event= convert_for_nonumpad(event);
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
switch(event) {
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
/* Afterqueue events */
|
2002-10-12 11:37:38 +00:00
|
|
|
case BACKBUFDRAW:
|
|
|
|
|
backdrawview3d(1);
|
|
|
|
|
break;
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
case RENDERPREVIEW:
|
|
|
|
|
BIF_view3d_previewrender(sa);
|
|
|
|
|
break;
|
|
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
/* LEFTMOUSE and RIGHTMOUSE event codes can be swapped above,
|
|
|
|
|
* based on user preference USER_LMOUSESELECT
|
|
|
|
|
*/
|
|
|
|
|
case LEFTMOUSE:
|
2003-10-27 23:55:38 +00:00
|
|
|
if ((G.obedit) || !(G.f&(G_VERTEXPAINT|G_WEIGHTPAINT|G_TEXTUREPAINT))) {
|
2002-10-12 11:37:38 +00:00
|
|
|
mouse_cursor();
|
2004-07-16 01:34:19 +00:00
|
|
|
} else if (G.f & G_VERTEXPAINT) {
|
2002-10-12 11:37:38 +00:00
|
|
|
vertex_paint();
|
|
|
|
|
}
|
|
|
|
|
else if (G.f & G_WEIGHTPAINT){
|
|
|
|
|
weight_paint();
|
|
|
|
|
}
|
|
|
|
|
else if (G.f & G_TEXTUREPAINT) {
|
|
|
|
|
face_draw();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
2003-11-06 15:28:40 +00:00
|
|
|
/* use '&' here, because of alt+leftmouse which emulates middlemouse */
|
2004-01-13 14:50:45 +00:00
|
|
|
if(U.flag & USER_VIEWMOVE) {
|
|
|
|
|
if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(0);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(2);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(1);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2004-01-13 14:50:45 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_SHIFTKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(1);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(2);
|
2004-01-13 14:50:45 +00:00
|
|
|
else if((G.qual==0) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==LR_ALTKEY)))
|
2003-10-27 23:55:38 +00:00
|
|
|
viewmove(0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.obedit) && (G.qual & LR_CTRLKEY)==0) {
|
|
|
|
|
if(G.obedit->type==OB_MESH)
|
|
|
|
|
mouse_mesh();
|
|
|
|
|
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
|
|
|
|
mouse_nurb();
|
|
|
|
|
else if(G.obedit->type==OB_MBALL)
|
|
|
|
|
mouse_mball();
|
|
|
|
|
else if(G.obedit->type==OB_LATTICE)
|
|
|
|
|
mouse_lattice();
|
|
|
|
|
else if(G.obedit->type==OB_ARMATURE)
|
|
|
|
|
mouse_armature();
|
|
|
|
|
}
|
2005-10-24 19:22:04 +00:00
|
|
|
else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY)))
|
2004-09-28 12:04:10 +00:00
|
|
|
mouse_mesh(); // loop select for 1 mousebutton dudes
|
2005-10-24 19:22:04 +00:00
|
|
|
else if((G.obedit && G.obedit->type==OB_MESH) && (G.qual == (LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY)))
|
2004-09-28 12:04:10 +00:00
|
|
|
mouse_mesh(); // loop select for 1 mousebutton dudes
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY)
|
2004-01-17 12:54:11 +00:00
|
|
|
mouse_select(); // also allow in editmode, for vertex parenting
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.f & G_FACESELECT)
|
|
|
|
|
face_select();
|
|
|
|
|
else if( G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))
|
|
|
|
|
sample_vpaint();
|
2002-10-12 11:37:38 +00:00
|
|
|
else
|
2005-07-23 18:52:31 +00:00
|
|
|
mouse_select(); // does poses too
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-01-28 11:14:38 +00:00
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
/* Regular: Zoom in */
|
|
|
|
|
/* Shift: Scroll up */
|
|
|
|
|
/* Ctrl: Scroll right */
|
|
|
|
|
/* Alt-Shift: Rotate up */
|
|
|
|
|
/* Alt-Ctrl: Rotate right */
|
|
|
|
|
|
|
|
|
|
if( G.qual & LR_SHIFTKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_SHIFTKEY;
|
|
|
|
|
persptoetsen(PAD2);
|
|
|
|
|
G.qual |= LR_SHIFTKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD2);
|
|
|
|
|
}
|
|
|
|
|
} else if( G.qual & LR_CTRLKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_CTRLKEY;
|
|
|
|
|
persptoetsen(PAD4);
|
|
|
|
|
G.qual |= LR_CTRLKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD4);
|
|
|
|
|
}
|
2004-01-13 14:50:45 +00:00
|
|
|
} else if(U.uiflag & USER_WHEELZOOMDIR)
|
2003-01-28 11:14:38 +00:00
|
|
|
persptoetsen(PADMINUS);
|
|
|
|
|
else
|
|
|
|
|
persptoetsen(PADPLUSKEY);
|
|
|
|
|
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
/* Regular: Zoom out */
|
|
|
|
|
/* Shift: Scroll down */
|
|
|
|
|
/* Ctrl: Scroll left */
|
|
|
|
|
/* Alt-Shift: Rotate down */
|
|
|
|
|
/* Alt-Ctrl: Rotate left */
|
|
|
|
|
|
|
|
|
|
if( G.qual & LR_SHIFTKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_SHIFTKEY;
|
|
|
|
|
persptoetsen(PAD8);
|
|
|
|
|
G.qual |= LR_SHIFTKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD8);
|
|
|
|
|
}
|
|
|
|
|
} else if( G.qual & LR_CTRLKEY ) {
|
|
|
|
|
if( G.qual & LR_ALTKEY ) {
|
|
|
|
|
G.qual &= ~LR_CTRLKEY;
|
|
|
|
|
persptoetsen(PAD6);
|
|
|
|
|
G.qual |= LR_CTRLKEY;
|
|
|
|
|
} else {
|
|
|
|
|
persptoetsen(PAD6);
|
|
|
|
|
}
|
2004-01-13 14:50:45 +00:00
|
|
|
} else if(U.uiflag & USER_WHEELZOOMDIR)
|
2003-01-28 11:14:38 +00:00
|
|
|
persptoetsen(PADPLUSKEY);
|
|
|
|
|
else
|
|
|
|
|
persptoetsen(PADMINUS);
|
|
|
|
|
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
case ONEKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
2003-11-28 20:45:11 +00:00
|
|
|
if(ob && ob->type == OB_MESH) {
|
2003-05-07 19:27:29 +00:00
|
|
|
flip_subdivison(ob, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-11-28 20:45:11 +00:00
|
|
|
else do_layer_buttons(0);
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case TWOKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
2003-11-28 20:45:11 +00:00
|
|
|
if(ob && ob->type == OB_MESH) {
|
2003-05-07 19:27:29 +00:00
|
|
|
flip_subdivison(ob, 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-11-28 20:45:11 +00:00
|
|
|
else do_layer_buttons(1);
|
2003-05-07 19:27:29 +00:00
|
|
|
break;
|
2003-11-28 20:45:11 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case THREEKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
2003-11-28 20:45:11 +00:00
|
|
|
if(ob && ob->type == OB_MESH) {
|
2003-05-07 19:27:29 +00:00
|
|
|
flip_subdivison(ob, 3);
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-08-16 22:11:40 +00:00
|
|
|
else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
|
|
|
|
if ( (G.obedit) && (G.obedit->type==OB_MESH) )
|
|
|
|
|
select_faces_by_numverts(3);
|
|
|
|
|
}
|
2003-11-28 20:45:11 +00:00
|
|
|
else do_layer_buttons(2);
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case FOURKEY:
|
2003-11-28 20:45:11 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
if(ob && ob->type == OB_MESH) {
|
2003-05-07 19:27:29 +00:00
|
|
|
flip_subdivison(ob, 4);
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-08-16 22:11:40 +00:00
|
|
|
else if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
|
|
|
|
if ( (G.obedit) && (G.obedit->type==OB_MESH) )
|
|
|
|
|
select_faces_by_numverts(4);
|
|
|
|
|
}
|
2003-11-28 20:45:11 +00:00
|
|
|
else do_layer_buttons(3);
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case FIVEKEY:
|
2005-08-16 22:11:40 +00:00
|
|
|
if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
|
|
|
|
if ( (G.obedit) && (G.obedit->type==OB_MESH) )
|
|
|
|
|
select_faces_by_numverts(5);
|
|
|
|
|
}
|
|
|
|
|
else do_layer_buttons(4);
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case SIXKEY:
|
|
|
|
|
do_layer_buttons(5); break;
|
|
|
|
|
case SEVENKEY:
|
|
|
|
|
do_layer_buttons(6); break;
|
|
|
|
|
case EIGHTKEY:
|
|
|
|
|
do_layer_buttons(7); break;
|
|
|
|
|
case NINEKEY:
|
|
|
|
|
do_layer_buttons(8); break;
|
|
|
|
|
case ZEROKEY:
|
|
|
|
|
do_layer_buttons(9); break;
|
|
|
|
|
case MINUSKEY:
|
|
|
|
|
do_layer_buttons(10); break;
|
|
|
|
|
case EQUALKEY:
|
|
|
|
|
do_layer_buttons(11); break;
|
|
|
|
|
case ACCENTGRAVEKEY:
|
|
|
|
|
do_layer_buttons(-1); break;
|
2005-03-27 18:17:48 +00:00
|
|
|
|
|
|
|
|
case SPACEKEY:
|
2005-04-24 13:22:24 +00:00
|
|
|
if(G.qual == LR_CTRLKEY) {
|
|
|
|
|
val= pupmenu("Manipulator%t|Enable/Disable|Translate|Rotate|Scale|Combo");
|
|
|
|
|
if(val>0) {
|
|
|
|
|
if(val==1) v3d->twflag ^= V3D_USE_MANIPULATOR;
|
|
|
|
|
else {
|
|
|
|
|
if(val==2) v3d->twtype= V3D_MANIP_TRANSLATE;
|
|
|
|
|
else if(val==3) v3d->twtype= V3D_MANIP_ROTATE;
|
|
|
|
|
else if(val==4) v3d->twtype= V3D_MANIP_SCALE;
|
|
|
|
|
else if(val==5) v3d->twtype= V3D_MANIP_TRANSLATE|V3D_MANIP_ROTATE|V3D_MANIP_SCALE;
|
|
|
|
|
v3d->twflag |= V3D_USE_MANIPULATOR;
|
|
|
|
|
}
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual == LR_ALTKEY) {
|
Big Transform Manipulator Merge
*NOTE*: Some UI decision done in this commit will most likely be revised, all flame shall go in /dev/null. Constructive discussions of course welcomed.
This commit merges manipulator orientation selection back in "traditional" transform.
That's how it works:
- The dropdown in the 3D view header is always visible
- The orientation chosen will be used when choosing an axis with MMB and for the *second* key press of X,Y,Z
However, Local orientation doesn't use the one calculated by the manipulator. This is to ensure that multiple object local and armatures in pose still works as before.
- Alt-Space (to change the orientation) works during transform
New Transform orientation: View, using the view axis.
Fixes for the following bugs:
- Constraint projection code "jammed" if input vector was <0,0,0>, reported a couple of times on IRC. Thanks to Basse for the example file.
- Transform on texspace crashed on objects without texspace data (camera, lamp, ...). This was reported in tracker.
- Numinput with lock constraints didn't work correctly. Reported on elysiun
Probably some others that I'm forgetting
I also moved a couple of functions around in an attempt to make things clearer.
2005-07-24 06:25:00 +00:00
|
|
|
BIF_selectOrientation();
|
|
|
|
|
doredraw= 1;
|
2005-04-24 13:22:24 +00:00
|
|
|
}
|
|
|
|
|
|
2005-03-27 18:17:48 +00:00
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
case AKEY:
|
2003-10-28 21:28:13 +00:00
|
|
|
if(G.qual & LR_CTRLKEY) apply_object(); // also with shift!
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY)) {
|
2003-10-29 00:23:16 +00:00
|
|
|
toolbox_n_add();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if(G.obedit) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.obedit->type==OB_MESH)
|
|
|
|
|
deselectall_mesh();
|
|
|
|
|
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
|
|
|
|
deselectall_nurb();
|
|
|
|
|
else if(G.obedit->type==OB_MBALL)
|
|
|
|
|
deselectall_mball();
|
|
|
|
|
else if(G.obedit->type==OB_LATTICE)
|
|
|
|
|
deselectall_Latt();
|
|
|
|
|
else if(G.obedit->type==OB_ARMATURE)
|
2005-07-19 10:06:57 +00:00
|
|
|
deselectall_armature(1); // 1 == toggle
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2005-07-23 18:52:31 +00:00
|
|
|
else if (ob && (ob->flag & OB_POSEMODE)){
|
|
|
|
|
deselectall_posearmature(ob, 1);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if(G.f & G_FACESELECT) deselectall_tface();
|
2003-02-16 00:12:06 +00:00
|
|
|
else {
|
|
|
|
|
/* by design, the center of the active object
|
|
|
|
|
* (which need not necessarily by selected) will
|
|
|
|
|
* still be drawn as if it were selected.
|
|
|
|
|
*/
|
|
|
|
|
deselectall();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case BKEY:
|
2005-08-20 19:18:35 +00:00
|
|
|
if(G.qual==LR_ALTKEY)
|
|
|
|
|
view3d_edit_clipping(v3d);
|
|
|
|
|
else if(G.qual==LR_SHIFTKEY)
|
2003-10-27 23:55:38 +00:00
|
|
|
set_render_border();
|
2006-03-08 17:45:32 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
if(okee("Bake all selected")) {
|
|
|
|
|
extern void softbody_bake(Object *ob);
|
2006-03-29 07:35:54 +00:00
|
|
|
extern void fluidsimBake(Object *ob);
|
2006-03-08 17:45:32 +00:00
|
|
|
softbody_bake(NULL);
|
2006-03-29 07:35:54 +00:00
|
|
|
// also bake first domain of selected objects...
|
|
|
|
|
fluidsimBake(NULL);
|
2006-03-08 17:45:32 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-08-20 19:18:35 +00:00
|
|
|
else if(G.qual==0)
|
2003-10-27 23:55:38 +00:00
|
|
|
borderselect();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case CKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
2005-07-26 19:51:15 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE))
|
|
|
|
|
pose_copy_menu(); /* poseobject.c */
|
|
|
|
|
else
|
|
|
|
|
copy_attr_menu();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
2005-07-24 11:36:05 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE))
|
|
|
|
|
pose_clear_constraints(); /* poseobject.c */
|
|
|
|
|
else
|
|
|
|
|
convertmenu(); /* editobject.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2005-10-23 12:18:32 +00:00
|
|
|
else if(G.qual==(LR_ALTKEY|LR_CTRLKEY))
|
|
|
|
|
add_constraint(0); /* editconstraint.c, generic for objects and posemode */
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY)) {
|
2002-10-12 11:37:38 +00:00
|
|
|
view3d_home(1);
|
|
|
|
|
curs= give_cursor();
|
|
|
|
|
curs[0]=curs[1]=curs[2]= 0.0;
|
2003-08-17 13:02:17 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF) ) {
|
2002-10-12 11:37:38 +00:00
|
|
|
makecyclicNurb();
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
2002-10-12 11:37:38 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0)){
|
2002-10-12 11:37:38 +00:00
|
|
|
curs= give_cursor();
|
|
|
|
|
G.vd->ofs[0]= -curs[0];
|
|
|
|
|
G.vd->ofs[1]= -curs[1];
|
|
|
|
|
G.vd->ofs[2]= -curs[2];
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case DKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
2003-03-24 01:46:05 +00:00
|
|
|
duplicate_context_selected();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
2005-07-23 18:52:31 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE))
|
2003-10-27 23:55:38 +00:00
|
|
|
error ("Duplicate not possible in posemode.");
|
2005-07-23 18:52:31 +00:00
|
|
|
else if((G.obedit==NULL))
|
2006-01-02 10:40:13 +00:00
|
|
|
adduplicate(0, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
2002-10-12 11:37:38 +00:00
|
|
|
imagestodisplist();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0)){
|
2003-07-17 19:25:36 +00:00
|
|
|
pupval= pupmenu("Draw mode%t|BoundBox %x1|Wire %x2|OpenGL Solid %x3|Shaded Solid %x4|Textured Solid %x5");
|
2002-10-12 11:37:38 +00:00
|
|
|
if(pupval>0) {
|
|
|
|
|
G.vd->drawtype= pupval;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case EKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if (G.qual==0){
|
|
|
|
|
if(G.obedit) {
|
|
|
|
|
if(G.obedit->type==OB_MESH)
|
|
|
|
|
extrude_mesh();
|
|
|
|
|
else if(G.obedit->type==OB_CURVE)
|
|
|
|
|
addvert_Nurb('e');
|
|
|
|
|
else if(G.obedit->type==OB_SURF)
|
|
|
|
|
extrude_nurb();
|
|
|
|
|
else if(G.obedit->type==OB_ARMATURE)
|
2005-08-15 14:02:03 +00:00
|
|
|
extrude_armature(0);
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
else if (G.qual==LR_CTRLKEY) {
|
|
|
|
|
if(G.obedit && G.obedit->type==OB_MESH)
|
|
|
|
|
Edge_Menu();
|
2006-02-08 21:01:00 +00:00
|
|
|
else if (G.f & G_FACESELECT)
|
|
|
|
|
seam_mark_clear_tface(0);
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
}
|
|
|
|
|
else if (G.qual==LR_SHIFTKEY) {
|
|
|
|
|
if (G.obedit && G.obedit->type==OB_MESH) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_CREASE, CTX_EDGE);
|
|
|
|
|
Transform();
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
}
|
2005-08-15 14:02:03 +00:00
|
|
|
else if (G.obedit && G.obedit->type==OB_ARMATURE) {
|
|
|
|
|
extrude_armature(1);
|
|
|
|
|
}
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case FKEY:
|
|
|
|
|
if(G.obedit) {
|
|
|
|
|
if(G.obedit->type==OB_MESH) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
fill_mesh();
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
beauty_fill();
|
|
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
edge_flip();
|
|
|
|
|
else if (G.qual==0)
|
2004-09-18 20:15:37 +00:00
|
|
|
addedgeface_mesh();
|
2005-12-29 23:26:48 +00:00
|
|
|
else if ( G.qual ==
|
|
|
|
|
(LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
|
|
|
|
select_linked_flat_faces();
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF) addsegment_nurb();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
sort_faces();
|
New: X-axis mirror weightpainting.
- Set the button in Paint Panel, Edit buttons context
- It assumes the mesh to be near-perfectly mirrored. Current threshold is
set to 0.0001 (maximum difference allowed).
In order to evaluate proper mirroring, a new option will be added in
Mesh editmode later.
- When the flipped group doesn't exist yet, it creates the group
- Of course this doesn't work for mirror modifier!
New: Select/activate flipped bone or vertex group
- Press SHIFT+F in PoseMode or WeightPaint mode to get the flipped bone.
Is especially to see while painting if the mirror copying works OK.
New: "Apply Envelope to VertexGroup" uses X-mirror option too.
Todo; check on mirror vertex painting, and mirror Mesh editmode....
The implementation is based on a 8x8x8 Octree, where vertex locations are
stored. Vertices on the threshold boundary of an Octree node are filled in
the neighbour nodes as well, ensuring that the lookup works with threshold.
The current size of the Octree gives good speedup, even for 128k vertices
it only needs 256 lookup cycles per checked vertex.
Same code could be used for the bevel tool for example.
src/meshtools.c:
int mesh_octree_table(Object *ob, float *co, char mode)
- mode 's' or 'e' is "start octree" or "end octree"
- mode 'u' is "use", it then returns an index nr of the found vertex.
(return -1 if not found)
2005-10-22 14:05:25 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
if(ob && (ob->flag & OB_POSEMODE))
|
|
|
|
|
pose_activate_flipped_bone();
|
|
|
|
|
else if(G.f & G_WEIGHTPAINT)
|
|
|
|
|
pose_activate_flipped_bone();
|
|
|
|
|
else
|
|
|
|
|
fly();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
else {
|
New: X-axis mirror weightpainting.
- Set the button in Paint Panel, Edit buttons context
- It assumes the mesh to be near-perfectly mirrored. Current threshold is
set to 0.0001 (maximum difference allowed).
In order to evaluate proper mirroring, a new option will be added in
Mesh editmode later.
- When the flipped group doesn't exist yet, it creates the group
- Of course this doesn't work for mirror modifier!
New: Select/activate flipped bone or vertex group
- Press SHIFT+F in PoseMode or WeightPaint mode to get the flipped bone.
Is especially to see while painting if the mirror copying works OK.
New: "Apply Envelope to VertexGroup" uses X-mirror option too.
Todo; check on mirror vertex painting, and mirror Mesh editmode....
The implementation is based on a 8x8x8 Octree, where vertex locations are
stored. Vertices on the threshold boundary of an Octree node are filled in
the neighbour nodes as well, ensuring that the lookup works with threshold.
The current size of the Octree gives good speedup, even for 128k vertices
it only needs 256 lookup cycles per checked vertex.
Same code could be used for the bevel tool for example.
src/meshtools.c:
int mesh_octree_table(Object *ob, float *co, char mode)
- mode 's' or 'e' is "start octree" or "end octree"
- mode 'u' is "use", it then returns an index nr of the found vertex.
(return -1 if not found)
2005-10-22 14:05:25 +00:00
|
|
|
set_faceselect();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case GKEY:
|
2006-05-30 07:55:33 +00:00
|
|
|
if(G.qual == LR_CTRLKEY)
|
|
|
|
|
group_operation_with_menu();
|
Orange branch: Revived hidden treasure, the Groups!
Previous experiment (in 2000) didn't satisfy, it had even some primitive
NLA option in groups... so, cleaned up the old code (removed most) and
integrated it back in a more useful way.
Usage:
- CTRL+G gives menu to add group, add to existing group, or remove from
groups.
- In Object buttons, a new (should become first) Panel was added, showing
not only Object "ID button" and Parent, but also the Groups the Object
Belongs to. These buttons also allow rename, assigning or removing.
- To indicate Objects are grouped, they're drawn in a (not theme yet, so
temporal?) green wire color.
- Use ALT+SHIFT mouse-select to (de)select an entire group
But, the real power of groups is in the following features:
-> Particle Force field and Guide control
In the "Particle Motion" Panel, you can indicate a Group name, this then
limits force fields or guides to members of that Group. (Note that layers
still work on top of that... not sure about that).
-> Light Groups
In the Material "Shaders" Panel, you can indicate a Group name to limit
lighting for the Material to lamps in this group. The Lights in a Group do
need to be 'visible' for the Scene to be rendered (as usual).
-> Group Duplicator
In the Object "Anim" Panel, you can set any Object (use Empty!) to
duplicate an entire Group. It will make copies of all Objects in that Group.
Also works for animated Objects, but it will copy the current positions or
deforms. Control over 'local timing' (so we can do Massive anims!) will be
added later.
(Note; this commit won't render Group duplicators yet, a fix in bf-blender
will enable that, next commit will sync)
-> Library Appending
In the SHIFT-F1 or SHIFT+F4 browsers, you can also find the Groups listed.
By appending or linking the Group itself, and use the Group Duplicator, you
now can animate and position linked Objects. The nice thing is that the
local saved file itself will only store the Group name that was linked, so
on a next file read, the Group Objects will be re-read as stored (changed)
in the Library file.
(Note; current implementation also "gives a base" to linked Group Objects,
to show them as Objects in the current Scene. Need that now for testing
purposes, but probably will be removed later).
-> Outliner
Outliner now shows Groups as optio too, nice to organize your data a bit too!
In General, Groups have a very good potential... for example, it could
become default for MetaBall Objects too (jiri, I can help you later on how
this works). All current 'layer relationships' in Blender should be dropped
in time, I guess...
2005-12-06 10:55:30 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
2006-03-25 04:37:40 +00:00
|
|
|
if(G.obedit) {
|
|
|
|
|
if(G.obedit->type==OB_MESH)
|
|
|
|
|
select_mesh_group_menu();
|
|
|
|
|
} else
|
|
|
|
|
select_object_grouped_menu();
|
2005-02-14 02:53:36 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
|
|
|
|
if(okee("Clear location")) {
|
|
|
|
|
clear_object('g');
|
|
|
|
|
}
|
2005-04-24 13:22:24 +00:00
|
|
|
}
|
|
|
|
|
else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
|
|
|
|
|
v3d->twtype= V3D_MANIP_TRANSLATE;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
else if((G.qual==0)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_TRANSLATION, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-19 12:17:06 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case HKEY:
|
|
|
|
|
if(G.obedit) {
|
|
|
|
|
if(G.obedit->type==OB_MESH) {
|
2004-09-14 19:03:11 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
add_hook();
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
2003-10-27 23:55:38 +00:00
|
|
|
reveal_mesh();
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
hide_mesh(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
hide_mesh(0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(G.obedit->type== OB_SURF) {
|
2004-09-14 19:03:11 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
add_hook();
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
2003-10-27 23:55:38 +00:00
|
|
|
revealNurb();
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
hideNurb(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
hideNurb(0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_CURVE) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
2004-09-14 19:03:11 +00:00
|
|
|
add_hook();
|
|
|
|
|
else {
|
|
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
autocalchandlesNurb_all(1); /* flag=1, selected */
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
sethandlesNurb(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
sethandlesNurb(3);
|
|
|
|
|
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
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
|
|
|
BIF_undo_push("Handle change");
|
2004-09-14 19:03:11 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_LATTICE) {
|
|
|
|
|
if(G.qual==LR_CTRLKEY) add_hook();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2005-02-21 10:40:30 +00:00
|
|
|
else if(G.obedit->type==OB_MBALL) {
|
|
|
|
|
if(G.qual==LR_ALTKEY)
|
|
|
|
|
reveal_mball();
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
hide_mball(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
hide_mball(0);
|
|
|
|
|
}
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
else if(G.obedit->type==OB_ARMATURE) {
|
|
|
|
|
if (G.qual==0)
|
|
|
|
|
hide_selected_armature_bones();
|
|
|
|
|
else if (G.qual==LR_SHIFTKEY)
|
|
|
|
|
hide_unselected_armature_bones();
|
|
|
|
|
else if (G.qual==LR_ALTKEY)
|
|
|
|
|
show_all_armature_bones();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.f & G_FACESELECT)
|
|
|
|
|
hide_tface();
|
2005-07-23 18:52:31 +00:00
|
|
|
else if(ob && (ob->flag & OB_POSEMODE)) {
|
2004-01-03 05:07:31 +00:00
|
|
|
if (G.qual==0)
|
|
|
|
|
hide_selected_pose_bones();
|
|
|
|
|
else if (G.qual==LR_SHIFTKEY)
|
|
|
|
|
hide_unselected_pose_bones();
|
|
|
|
|
else if (G.qual==LR_ALTKEY)
|
|
|
|
|
show_all_pose_bones();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case IKEY:
|
2005-07-24 11:36:05 +00:00
|
|
|
if(G.obedit);
|
|
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
if(ob && ob->type==OB_ARMATURE)
|
|
|
|
|
if(ob->flag & OB_POSEMODE)
|
|
|
|
|
pose_add_IK();
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_ALTKEY) {
|
|
|
|
|
if(ob && ob->type==OB_ARMATURE)
|
|
|
|
|
if(ob->flag & OB_POSEMODE)
|
|
|
|
|
pose_clear_IK();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case JKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
2005-07-23 18:52:31 +00:00
|
|
|
if( ob ) {
|
2005-12-30 14:17:15 +00:00
|
|
|
join_menu();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if ((G.obedit) && ELEM(G.obedit->type, OB_CURVE, OB_SURF))
|
|
|
|
|
addsegment_nurb();
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit) {
|
2002-10-12 11:37:38 +00:00
|
|
|
if(G.obedit->type==OB_MESH) {
|
|
|
|
|
join_triangles();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case KKEY:
|
|
|
|
|
if(G.obedit) {
|
2003-10-26 21:22:32 +00:00
|
|
|
if (G.obedit->type==OB_MESH) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if (G.qual==LR_SHIFTKEY)
|
|
|
|
|
KnifeSubdivide(KNIFE_PROMPT);
|
|
|
|
|
else if (G.qual==0)
|
|
|
|
|
LoopMenu();
|
2003-10-12 23:43:26 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.obedit->type==OB_SURF)
|
|
|
|
|
printknots();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
if(G.f & G_FACESELECT)
|
2006-02-27 12:34:53 +00:00
|
|
|
if (G.f & G_WEIGHTPAINT)
|
|
|
|
|
clear_wpaint_selectedfaces();
|
|
|
|
|
else
|
|
|
|
|
clear_vpaint_selectedfaces();
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.f & G_VERTEXPAINT)
|
|
|
|
|
clear_vpaint();
|
|
|
|
|
else
|
|
|
|
|
select_select_keys();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if (G.qual==0)
|
|
|
|
|
set_ob_ipoflags();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case LKEY:
|
|
|
|
|
if(G.obedit) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.obedit->type==OB_MESH)
|
2003-10-28 21:28:13 +00:00
|
|
|
selectconnected_mesh(G.qual);
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.obedit->type==OB_ARMATURE)
|
|
|
|
|
selectconnected_armature();
|
|
|
|
|
else if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
|
|
|
|
selectconnected_nurb();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2005-07-23 18:52:31 +00:00
|
|
|
else if(ob && (ob->flag & OB_POSEMODE)) {
|
|
|
|
|
selectconnected_posearmature();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2005-04-23 01:36:08 +00:00
|
|
|
if(G.f & G_FACESELECT) {
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
select_linked_tfaces(0);
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
select_linked_tfaces(1);
|
|
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
select_linked_tfaces(2);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if((G.qual==0))
|
2006-06-01 09:03:43 +00:00
|
|
|
make_local_menu();
|
2005-04-23 01:36:08 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
selectlinks_menu();
|
|
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
make_links_menu();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2003-05-10 12:22:26 +00:00
|
|
|
case MKEY:
|
2005-08-11 00:00:24 +00:00
|
|
|
if((G.obedit==0) && (G.f & G_FACESELECT) && (G.qual==0))
|
|
|
|
|
mirror_uv_tface();
|
|
|
|
|
else if(G.obedit){
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_ALTKEY) {
|
2003-11-16 00:31:27 +00:00
|
|
|
if(G.obedit->type==OB_MESH) {
|
2003-10-27 23:55:38 +00:00
|
|
|
mergemenu();
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
2003-11-16 00:31:27 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2004-04-24 21:09:06 +00:00
|
|
|
else if((G.qual==0) || (G.qual==LR_CTRLKEY)) {
|
2003-12-31 22:44:26 +00:00
|
|
|
mirrormenu();
|
2003-11-16 00:31:27 +00:00
|
|
|
}
|
2005-01-30 21:33:12 +00:00
|
|
|
if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
2004-01-03 06:01:16 +00:00
|
|
|
if(G.obedit->type==OB_MESH) select_non_manifold();
|
|
|
|
|
}
|
2003-05-10 12:22:26 +00:00
|
|
|
}
|
2004-04-24 21:09:06 +00:00
|
|
|
else if(G.qual & LR_CTRLKEY) {
|
|
|
|
|
mirrormenu();
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==0) {
|
2005-12-07 12:36:26 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE))
|
|
|
|
|
pose_movetolayer();
|
|
|
|
|
else
|
|
|
|
|
movetolayer();
|
2003-05-10 12:22:26 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case NKEY:
|
2003-10-28 16:26:51 +00:00
|
|
|
if((G.qual==0)) {
|
2004-06-19 12:25:28 +00:00
|
|
|
toggle_blockhandler(curarea, VIEW3D_HANDLER_OBJECT, UI_PNL_TO_MOUSE);
|
2003-10-28 16:26:51 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit) {
|
2002-10-12 11:37:38 +00:00
|
|
|
switch (G.obedit->type){
|
|
|
|
|
case OB_ARMATURE:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY){
|
2004-06-05 05:55:15 +00:00
|
|
|
if (okee("Recalculate bone roll angles")) {
|
2003-10-27 23:55:38 +00:00
|
|
|
auto_align_armature();
|
|
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case OB_MESH:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
|
2004-06-05 05:55:15 +00:00
|
|
|
if(okee("Recalculate normals inside")) {
|
2003-10-22 00:52:26 +00:00
|
|
|
righthandfaces(2);
|
2003-10-27 23:55:38 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
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
|
|
|
BIF_undo_push("Recalculate normals inside");
|
2003-10-22 00:52:26 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY){
|
2004-06-05 05:55:15 +00:00
|
|
|
if(okee("Recalculate normals outside")) {
|
2003-10-22 00:52:26 +00:00
|
|
|
righthandfaces(1);
|
2003-10-27 23:55:38 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
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
|
|
|
BIF_undo_push("Recalculate normals outside");
|
2003-10-22 00:52:26 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-28 16:26:51 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case OKEY:
|
2005-04-01 18:39:39 +00:00
|
|
|
if (G.obedit) {
|
|
|
|
|
if (G.qual==LR_SHIFTKEY) {
|
2005-05-03 10:54:42 +00:00
|
|
|
G.scene->prop_mode = (G.scene->prop_mode+1)%6;
|
|
|
|
|
allqueue(REDRAWHEADERS, 0);
|
|
|
|
|
}
|
|
|
|
|
else if((G.qual==LR_ALTKEY)) {
|
|
|
|
|
if(G.scene->proportional==2) G.scene->proportional= 1;
|
|
|
|
|
else G.scene->proportional= 2;
|
2005-04-01 18:39:39 +00:00
|
|
|
allqueue(REDRAWHEADERS, 0);
|
|
|
|
|
}
|
|
|
|
|
else if((G.qual==0)) {
|
2005-05-03 10:54:42 +00:00
|
|
|
G.scene->proportional= !G.scene->proportional;
|
2005-04-01 18:39:39 +00:00
|
|
|
allqueue(REDRAWHEADERS, 0);
|
|
|
|
|
}
|
2005-02-14 02:53:36 +00:00
|
|
|
}
|
2005-04-01 18:39:39 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY)) {
|
2003-07-23 00:24:42 +00:00
|
|
|
if(ob && ob->type == OB_MESH) {
|
2004-01-08 04:42:29 +00:00
|
|
|
flip_subdivison(ob, -1);
|
2003-07-21 17:44:23 +00:00
|
|
|
}
|
|
|
|
|
}
|
2005-02-14 02:53:36 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
|
|
|
|
if(okee("Clear origin")) {
|
|
|
|
|
clear_object('o');
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-07-21 17:44:23 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case PKEY:
|
|
|
|
|
if(G.obedit) {
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
|
|
|
|
|
if(G.obedit->type==OB_ARMATURE)
|
|
|
|
|
make_bone_parent();
|
|
|
|
|
else
|
|
|
|
|
make_parent();
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_ALTKEY && G.obedit->type==OB_ARMATURE)
|
|
|
|
|
clear_bone_parent();
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0) && G.obedit->type==OB_MESH)
|
|
|
|
|
separatemenu();
|
|
|
|
|
else if ((G.qual==0) && ELEM(G.obedit->type, OB_CURVE, OB_SURF))
|
|
|
|
|
separate_nurb();
|
2005-05-10 04:21:11 +00:00
|
|
|
else if (G.qual==LR_SHIFTKEY) {
|
|
|
|
|
initTransform(TFM_PUSHPULL, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2003-12-09 17:46:40 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY || G.qual==(LR_SHIFTKEY|LR_CTRLKEY))
|
2003-10-27 23:55:38 +00:00
|
|
|
make_parent();
|
2005-05-10 04:21:11 +00:00
|
|
|
else if(G.qual==LR_SHIFTKEY) {
|
2006-01-30 19:39:05 +00:00
|
|
|
if(G.obedit) {
|
|
|
|
|
initTransform(TFM_PUSHPULL, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
toggle_blockhandler(curarea, VIEW3D_HANDLER_PREVIEW, 0);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
2005-05-10 04:21:11 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
clear_parent();
|
|
|
|
|
else if((G.qual==0)) {
|
2006-01-30 05:43:07 +00:00
|
|
|
start_game();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-17 19:59:32 +00:00
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case RKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.obedit==0) && (G.f & G_FACESELECT) && (G.qual==0))
|
|
|
|
|
rotate_uv_tface();
|
2005-02-14 02:53:36 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
|
|
|
|
if(okee("Clear rotation")) {
|
|
|
|
|
clear_object('r');
|
|
|
|
|
}
|
2005-04-24 13:22:24 +00:00
|
|
|
}
|
|
|
|
|
else if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
|
|
|
|
|
v3d->twtype= V3D_MANIP_ROTATE;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
else if (G.obedit) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
2003-10-17 19:59:32 +00:00
|
|
|
if ELEM(G.obedit->type, OB_CURVE, OB_SURF)
|
|
|
|
|
selectrow_nurb();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
2003-10-17 19:59:32 +00:00
|
|
|
if (G.obedit->type==OB_MESH)
|
2005-07-13 15:20:40 +00:00
|
|
|
CutEdgeloop(1);
|
|
|
|
|
BIF_undo_push("Cut Edgeloop");
|
2003-10-17 19:59:32 +00:00
|
|
|
}
|
2005-03-19 12:17:06 +00:00
|
|
|
else if((G.qual==0)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_ROTATION, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-19 12:17:06 +00:00
|
|
|
}
|
2003-10-17 19:59:32 +00:00
|
|
|
}
|
2005-03-19 12:17:06 +00:00
|
|
|
else if((G.qual==0)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_ROTATION, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-19 12:17:06 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case SKEY:
|
2005-04-24 13:22:24 +00:00
|
|
|
if(G.qual== (LR_CTRLKEY|LR_ALTKEY)) {
|
|
|
|
|
v3d->twtype= V3D_MANIP_SCALE;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit) {
|
2005-07-16 19:07:02 +00:00
|
|
|
|
2005-05-10 04:21:11 +00:00
|
|
|
if(G.qual==LR_ALTKEY) {
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
if(G.obedit->type==OB_ARMATURE) {
|
2005-07-16 19:07:02 +00:00
|
|
|
initTransform(TFM_BONESIZE, CTX_NONE);
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
}
|
2005-07-16 19:07:02 +00:00
|
|
|
else
|
|
|
|
|
initTransform(TFM_SHRINKFATTEN, CTX_NONE);
|
2005-05-10 04:21:11 +00:00
|
|
|
Transform();
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
initTransform(TFM_SHEAR, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2003-10-28 07:15:02 +00:00
|
|
|
else if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
snapmenu();
|
2005-03-19 12:17:06 +00:00
|
|
|
else if(G.qual==0) {
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
if(G.obedit->type==OB_ARMATURE) {
|
|
|
|
|
bArmature *arm= G.obedit->data;
|
|
|
|
|
if(arm->drawtype==ARM_ENVELOPE)
|
|
|
|
|
initTransform(TFM_BONE_ENVELOPE, CTX_NONE);
|
|
|
|
|
else
|
|
|
|
|
initTransform(TFM_RESIZE, CTX_NONE);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
initTransform(TFM_RESIZE, CTX_NONE);
|
2005-05-10 04:21:11 +00:00
|
|
|
Transform();
|
2005-03-19 12:17:06 +00:00
|
|
|
}
|
2005-03-19 13:26:03 +00:00
|
|
|
else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)){
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_TOSPHERE, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-19 13:26:03 +00:00
|
|
|
}
|
2005-12-29 23:26:48 +00:00
|
|
|
if ( G.qual == (LR_SHIFTKEY | LR_ALTKEY | LR_CTRLKEY) ) {
|
|
|
|
|
if(G.obedit->type==OB_MESH) select_sharp_edges();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_ALTKEY) {
|
Armature "Envelope" editing.
For defining the deformation distances of Bones, three values are being
used now. The bone tip and root radius define the bone-shape itself and the
"dist" defines the soft area around it. A full (user) doc is in CMS here;
http://www.blender3d.org/cms/Armature_Envelopes.647.0.html
Note: todo still is allowing both Vertex Deform Groups and these Envelopes
together (and or per Bone).
Also part of this commit is:
- New: Hiding bones in EditMode. This is a separate 'hide flag', so you can
keep the PoseMode hidden Bones separate from EditMode.
(In the future we should do some kind of bone-grouping or so)
- While transform(), the hotkeys G,R,S only switch mode when the previous
mode was compatible. Caused conflicts with Crease/BoneDist/etc.
- Deleting the last VertexGroup now also deletes the entire Mesh 'dvert'
data. Sounds logical, but remember that VertexGroups are partial on a
Mesh, partial on Object. Weird design decision though...
Anyhoo, at this moment the only way to have Bone Envelopes deform, is
by deleting all VertexGroups!
- In PoseMode, the hotkey ALT+S now does both B-Bone size or Envelope,
depending draw type.
- In EditMode, Extrude now also works when only Root points were selected.
- Weight editing is also symmetrical btw, with the "X-axis Mirror" option
set.
2005-08-19 12:35:15 +00:00
|
|
|
if(G.f & G_WEIGHTPAINT)
|
|
|
|
|
ob= ob->parent;
|
|
|
|
|
if(ob && (ob->flag & OB_POSEMODE)) {
|
|
|
|
|
bArmature *arm= ob->data;
|
|
|
|
|
if( ELEM(arm->drawtype, ARM_B_BONE, ARM_ENVELOPE)) {
|
|
|
|
|
initTransform(TFM_BONESIZE, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2005-02-14 02:53:36 +00:00
|
|
|
if(okee("Clear size")) {
|
|
|
|
|
clear_object('s');
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2005-02-14 02:53:36 +00:00
|
|
|
else if(G.qual==LR_SHIFTKEY) {
|
2003-10-27 23:55:38 +00:00
|
|
|
snapmenu();
|
2005-02-14 02:53:36 +00:00
|
|
|
}
|
2005-03-19 12:17:06 +00:00
|
|
|
else if((G.qual==0)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_RESIZE, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==(LR_SHIFTKEY|LR_CTRLKEY)) {
|
|
|
|
|
initTransform(TFM_TOSPHERE, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2005-07-22 03:25:29 +00:00
|
|
|
else if(G.qual==(LR_CTRLKEY|LR_ALTKEY|LR_SHIFTKEY)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_SHEAR, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-19 12:17:06 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case TKEY:
|
2003-10-28 07:15:02 +00:00
|
|
|
if(G.obedit){
|
2005-08-17 13:26:42 +00:00
|
|
|
if((G.qual & LR_CTRLKEY) && G.obedit->type==OB_MESH) {
|
|
|
|
|
convert_to_triface(G.qual & LR_SHIFTKEY);
|
2003-10-27 23:55:38 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
countall();
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2005-03-16 21:55:57 +00:00
|
|
|
if (G.obedit->type==OB_CURVE) {
|
|
|
|
|
if (G.qual==LR_ALTKEY) {
|
|
|
|
|
clear_tilt();
|
|
|
|
|
}
|
|
|
|
|
else if (G.qual==0) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_TILT, CTX_NONE);
|
|
|
|
|
Transform();
|
2005-03-16 21:55:57 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-10-28 07:15:02 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
2005-09-12 15:17:35 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE));
|
|
|
|
|
else make_track();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
2005-09-12 15:17:35 +00:00
|
|
|
if(ob && (ob->flag & OB_POSEMODE));
|
|
|
|
|
else clear_track();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0)){
|
|
|
|
|
texspace_edit();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case UKEY:
|
|
|
|
|
if(G.obedit) {
|
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
|
|
|
if(G.obedit->type==OB_MESH) {
|
|
|
|
|
if(G.qual==0) BIF_undo(); else BIF_redo();
|
2003-10-19 20:52:34 +00:00
|
|
|
}
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
else if ELEM5(G.obedit->type, OB_CURVE, OB_SURF, OB_MBALL, OB_LATTICE, OB_ARMATURE) {
|
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
|
|
|
if(G.qual==0) BIF_undo(); else BIF_redo();
|
2004-08-31 13:43:18 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2004-11-07 21:14:21 +00:00
|
|
|
else if((G.qual==0)) {
|
2003-10-27 23:55:38 +00:00
|
|
|
if (G.f & G_FACESELECT)
|
|
|
|
|
uv_autocalc_tface();
|
|
|
|
|
else if(G.f & G_WEIGHTPAINT)
|
|
|
|
|
wpaint_undo();
|
|
|
|
|
else if(G.f & G_VERTEXPAINT)
|
|
|
|
|
vpaint_undo();
|
2004-08-31 21:01:21 +00:00
|
|
|
else {
|
2004-09-18 18:34:50 +00:00
|
|
|
single_user();
|
2004-08-31 21:01:21 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
2004-08-31 20:13:32 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case VKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
if ((G.obedit) && G.obedit->type==OB_MESH) {
|
2002-10-12 11:37:38 +00:00
|
|
|
align_view_to_selected(v3d);
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
|
|
|
|
else if (G.f & G_FACESELECT) {
|
2002-10-12 11:37:38 +00:00
|
|
|
align_view_to_selected(v3d);
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
image_aspect();
|
|
|
|
|
else if (G.qual==0){
|
2002-10-12 11:37:38 +00:00
|
|
|
if(G.obedit) {
|
2005-10-20 07:47:10 +00:00
|
|
|
if(G.obedit->type==OB_MESH) {
|
|
|
|
|
mesh_rip();
|
|
|
|
|
}
|
|
|
|
|
else if(G.obedit->type==OB_CURVE) {
|
2002-10-12 11:37:38 +00:00
|
|
|
sethandlesNurb(2);
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
DAG_object_flush_update(G.scene, G.obedit, OB_RECALC_DATA);
|
2002-10-12 11:37:38 +00:00
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
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
|
|
|
BIF_undo_push("Handle change");
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(ob && ob->type == OB_MESH)
|
|
|
|
|
set_vpaint();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case WKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
2005-05-10 04:21:11 +00:00
|
|
|
initTransform(TFM_WARP, CTX_NONE);
|
|
|
|
|
Transform();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_ALTKEY) {
|
2002-10-12 11:37:38 +00:00
|
|
|
/* if(G.obedit && G.obedit->type==OB_MESH) write_videoscape(); */
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY) {
|
2002-10-12 11:37:38 +00:00
|
|
|
if(G.obedit) {
|
|
|
|
|
if ELEM(G.obedit->type, OB_CURVE, OB_SURF) {
|
|
|
|
|
switchdirectionNurb2();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0))
|
|
|
|
|
special_editmenu();
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
case XKEY:
|
|
|
|
|
case DELKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0)
|
|
|
|
|
delete_context_selected();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case YKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0) && (G.obedit)) {
|
2002-10-12 11:37:38 +00:00
|
|
|
if(G.obedit->type==OB_MESH) split_mesh();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case ZKEY:
|
2003-03-24 01:46:05 +00:00
|
|
|
toggle_shading();
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
scrarea_queue_headredraw(curarea);
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HOMEKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0)
|
|
|
|
|
view3d_home(0);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case COMMAKEY:
|
2004-01-07 12:59:42 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
G.vd->around= V3D_CENTROID;
|
2004-07-15 17:42:04 +00:00
|
|
|
} else if(G.qual==LR_SHIFTKEY) {
|
|
|
|
|
G.vd->around= V3D_CENTROID;
|
2004-01-07 12:59:42 +00:00
|
|
|
} else if(G.qual==0) {
|
2003-10-28 03:08:50 +00:00
|
|
|
G.vd->around= V3D_CENTRE;
|
|
|
|
|
}
|
2005-02-12 12:06:30 +00:00
|
|
|
handle_view3d_around();
|
|
|
|
|
|
2004-01-07 12:59:42 +00:00
|
|
|
scrarea_queue_headredraw(curarea);
|
2005-05-11 20:01:42 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PERIODKEY:
|
2004-01-07 12:59:42 +00:00
|
|
|
if(G.qual==LR_CTRLKEY) {
|
|
|
|
|
G.vd->around= V3D_LOCAL;
|
2004-07-15 17:42:04 +00:00
|
|
|
} else if(G.qual==0) {
|
2003-10-28 03:08:50 +00:00
|
|
|
G.vd->around= V3D_CURSOR;
|
|
|
|
|
}
|
2005-02-12 12:06:30 +00:00
|
|
|
handle_view3d_around();
|
|
|
|
|
|
2004-01-07 12:59:42 +00:00
|
|
|
scrarea_queue_headredraw(curarea);
|
2005-05-11 20:01:42 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PADSLASHKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0) {
|
|
|
|
|
if(G.vd->localview) {
|
|
|
|
|
G.vd->localview= 0;
|
|
|
|
|
endlocalview(curarea);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
G.vd->localview= 1;
|
|
|
|
|
initlocalview();
|
|
|
|
|
}
|
|
|
|
|
scrarea_queue_headredraw(curarea);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case PADASTERKEY: /* '*' */
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0) {
|
|
|
|
|
if(ob) {
|
2005-01-08 21:16:24 +00:00
|
|
|
if ((G.obedit) && (G.obedit->type == OB_MESH)) {
|
|
|
|
|
editmesh_align_view_to_selected(G.vd, 2);
|
|
|
|
|
}
|
|
|
|
|
else if (G.f & G_FACESELECT) {
|
|
|
|
|
if(ob->type==OB_MESH) {
|
|
|
|
|
Mesh *me= ob->data;
|
|
|
|
|
faceselect_align_view_to_selected(G.vd, me, 2);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
obmat_to_viewmat(ob);
|
|
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.vd->persp==2) G.vd->persp= 1;
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case PADPERIOD: /* '.' */
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0)
|
|
|
|
|
centreview();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PAGEUPKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
movekey_obipo(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
nextkey_obipo(1); /* in editipo.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PAGEDOWNKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
movekey_obipo(-1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
nextkey_obipo(-1);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PAD0: case PAD1: case PAD2: case PAD3: case PAD4:
|
|
|
|
|
case PAD5: case PAD6: case PAD7: case PAD8: case PAD9:
|
2004-01-03 06:01:16 +00:00
|
|
|
case PADENTER:
|
2002-10-12 11:37:38 +00:00
|
|
|
persptoetsen(event);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
2004-01-03 06:01:16 +00:00
|
|
|
case PADMINUS:
|
|
|
|
|
if ( (G.qual==LR_CTRLKEY)
|
|
|
|
|
&& (G.obedit) && (G.obedit->type==OB_MESH) )
|
|
|
|
|
select_less();
|
|
|
|
|
else {
|
|
|
|
|
persptoetsen(event);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PADPLUSKEY:
|
|
|
|
|
if ( (G.qual==LR_CTRLKEY)
|
|
|
|
|
&& (G.obedit) && (G.obedit->type==OB_MESH) )
|
|
|
|
|
select_more();
|
|
|
|
|
else {
|
|
|
|
|
persptoetsen(event);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case ESCKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0) {
|
|
|
|
|
if (G.vd->flag & V3D_DISPIMAGE) {
|
|
|
|
|
G.vd->flag &= ~V3D_DISPIMAGE;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(doredraw) {
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
scrarea_queue_headredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void initview3d(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
View3D *vd;
|
|
|
|
|
|
|
|
|
|
vd= MEM_callocN(sizeof(View3D), "initview3d");
|
2003-04-30 13:22:26 +00:00
|
|
|
BLI_addhead(&sa->spacedata, vd); /* addhead! not addtail */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
vd->spacetype= SPACE_VIEW3D;
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
vd->blockscale= 0.7f;
|
|
|
|
|
vd->viewquat[0]= 1.0f;
|
|
|
|
|
vd->viewquat[1]= vd->viewquat[2]= vd->viewquat[3]= 0.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
vd->persp= 1;
|
|
|
|
|
vd->drawtype= OB_WIRE;
|
|
|
|
|
vd->view= 7;
|
|
|
|
|
vd->dist= 10.0;
|
2003-10-28 03:08:50 +00:00
|
|
|
vd->lens= 35.0f;
|
|
|
|
|
vd->near= 0.01f;
|
|
|
|
|
vd->far= 500.0f;
|
|
|
|
|
vd->grid= 1.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
vd->gridlines= 16;
|
|
|
|
|
vd->lay= vd->layact= 1;
|
|
|
|
|
if(G.scene) {
|
|
|
|
|
vd->lay= vd->layact= G.scene->lay;
|
|
|
|
|
vd->camera= G.scene->camera;
|
|
|
|
|
}
|
|
|
|
|
vd->scenelock= 1;
|
2004-01-24 05:06:12 +00:00
|
|
|
vd->gridflag |= V3D_SHOW_X;
|
|
|
|
|
vd->gridflag |= V3D_SHOW_Y;
|
|
|
|
|
vd->gridflag |= V3D_SHOW_FLOOR;
|
|
|
|
|
vd->gridflag &= ~V3D_SHOW_Z;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: IPO ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
static void changeview2dspace(ScrArea *sa, void *spacedata)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
if(G.v2d==0) return;
|
|
|
|
|
|
|
|
|
|
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
|
|
|
|
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
|
|
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadipospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-10-28 14:20:03 +00:00
|
|
|
extern void do_ipobuts(unsigned short event); // drawipo.c
|
2003-03-24 01:46:05 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceIpo *sipo= curarea->spacedata.first;
|
|
|
|
|
View2D *v2d= &sipo->v2d;
|
|
|
|
|
float dx, dy;
|
|
|
|
|
int cfra, doredraw= 0;
|
|
|
|
|
short mval[2];
|
2004-07-16 01:34:19 +00:00
|
|
|
short mousebut = L_MOUSE;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 14:20:03 +00:00
|
|
|
if(sa->win==0) return;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(val) {
|
2003-10-28 14:20:03 +00:00
|
|
|
if( uiDoBlocks(&sa->uiblocks, event)!=UI_NOTHING ) event= 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
/* swap mouse buttons based on user preference */
|
|
|
|
|
if (U.flag & USER_LMOUSESELECT) {
|
2004-11-26 20:20:42 +00:00
|
|
|
if (event == LEFTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = RIGHTMOUSE;
|
|
|
|
|
mousebut = L_MOUSE;
|
2004-11-26 20:20:42 +00:00
|
|
|
} else if (event == RIGHTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = LEFTMOUSE;
|
|
|
|
|
mousebut = R_MOUSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
switch(event) {
|
|
|
|
|
case UI_BUT_EVENT:
|
2003-10-28 14:20:03 +00:00
|
|
|
/* note: bad bad code, will be cleaned! is because event queues are all shattered */
|
2006-05-24 17:15:26 +00:00
|
|
|
if(val>0 && val < 256) do_ipowin_buts(val-1);
|
2003-10-28 14:20:03 +00:00
|
|
|
else do_ipobuts(val);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-10-28 14:20:03 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case LEFTMOUSE:
|
|
|
|
|
if( in_ipo_buttons() ) {
|
|
|
|
|
do_ipo_selectbuttons();
|
|
|
|
|
doredraw= 1;
|
2004-10-29 17:21:28 +00:00
|
|
|
}
|
|
|
|
|
else if(view2dmove(LEFTMOUSE)); // only checks for sliders
|
2002-10-12 11:37:38 +00:00
|
|
|
else if(G.qual & LR_CTRLKEY) add_vert_ipo();
|
|
|
|
|
else {
|
|
|
|
|
do {
|
|
|
|
|
getmouseco_areawin(mval);
|
|
|
|
|
areamouseco_to_ipoco(v2d, mval, &dx, &dy);
|
|
|
|
|
|
|
|
|
|
cfra= (int)dx;
|
|
|
|
|
if(cfra< 1) cfra= 1;
|
|
|
|
|
|
|
|
|
|
if( cfra!=CFRA ) {
|
|
|
|
|
CFRA= cfra;
|
2005-09-27 21:52:04 +00:00
|
|
|
update_for_newframe_nodraw(1); /* 1 = nosound */
|
2004-11-07 18:20:44 +00:00
|
|
|
force_draw_all(0); /* To make constraint sliders redraw */
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
Bug fix, after irc report sk1p:
frame-sliding (LMB) in action, nla, sound and ipo window went into very
tight while loop, causing cpu to choke. Added nice idle.
Bug fix, found self while testing:
- relative.blend, editmode
- delete part, exit editmode
- enter editmode, undo twice, exit editmode -> crash
The trick to copy 'old' locations of vertices to keys isnt undo-resistant
yet. This fix at least doesnt crash, but copying doesnt work when undo-ing
back to previous editmode session (indices just differ from current mesh...)
2004-12-12 21:13:07 +00:00
|
|
|
else PIL_sleep_ms(30);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
} while(get_mbut() & mousebut);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2004-07-16 01:34:19 +00:00
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
|
|
|
|
mouse_select_ipo();
|
|
|
|
|
allqueue (REDRAWACTION, 0);
|
|
|
|
|
allqueue(REDRAWNLA, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
|
|
|
|
if(in_ipo_buttons()) {
|
|
|
|
|
scroll_ipobuts();
|
|
|
|
|
}
|
2003-01-28 12:14:47 +00:00
|
|
|
else view2dmove(event); /* in drawipo.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-01-28 11:14:38 +00:00
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case PADPLUSKEY:
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
view2d_zoom(v2d, 0.1154f, sa->winx, sa->winy);
|
2002-10-12 11:37:38 +00:00
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
case PADMINUS:
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
view2d_zoom(v2d, -0.15f, sa->winx, sa->winy);
|
2002-10-12 11:37:38 +00:00
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
case PAGEUPKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
movekey_ipo(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
nextkey_ipo(1);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case PAGEDOWNKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
movekey_ipo(-1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
nextkey_ipo(-1);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case HOMEKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
do_ipo_buttons(B_IPOHOME);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case AKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0)) {
|
|
|
|
|
if(in_ipo_buttons()) {
|
|
|
|
|
swap_visible_editipo();
|
|
|
|
|
}
|
2005-03-23 16:55:22 +00:00
|
|
|
else {
|
|
|
|
|
swap_selectall_editipo();
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
allspace (REMAKEIPO, 0);
|
|
|
|
|
allqueue (REDRAWNLA, 0);
|
|
|
|
|
allqueue (REDRAWACTION, 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case BKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
borderselect_ipo();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case CKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
move_to_frame();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case DKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
add_duplicate_editipo();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case GKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
transform_ipo('g');
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case HKEY:
|
2005-07-10 12:50:14 +00:00
|
|
|
if(G.qual==LR_ALTKEY)
|
2005-10-23 21:36:24 +00:00
|
|
|
sethandles_ipo(HD_AUTO_ANIM);
|
2005-07-10 12:50:14 +00:00
|
|
|
if(G.qual==LR_SHIFTKEY)
|
2003-10-27 23:55:38 +00:00
|
|
|
sethandles_ipo(HD_AUTO);
|
2005-07-10 12:50:14 +00:00
|
|
|
else if(G.qual==0)
|
2003-10-27 23:55:38 +00:00
|
|
|
sethandles_ipo(HD_ALIGN);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case JKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
2004-01-12 13:30:00 +00:00
|
|
|
join_ipo_menu();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case KKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0)) {
|
|
|
|
|
ipo_toggle_showkey();
|
|
|
|
|
scrarea_queue_headredraw(curarea);
|
|
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-10-28 14:20:03 +00:00
|
|
|
case NKEY:
|
2004-06-19 12:25:28 +00:00
|
|
|
toggle_blockhandler(sa, IPO_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
2003-10-28 14:20:03 +00:00
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case RKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
ipo_record();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case SKEY:
|
2004-01-12 13:30:00 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
ipo_snap_menu();
|
|
|
|
|
} else if((G.qual==0))
|
2003-10-27 23:55:38 +00:00
|
|
|
transform_ipo('s');
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case TKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
set_ipotype();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case VKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
sethandles_ipo(HD_VECT);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case XKEY:
|
|
|
|
|
case DELKEY:
|
2005-09-26 15:34:21 +00:00
|
|
|
del_ipo();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-10-28 14:20:03 +00:00
|
|
|
if(doredraw) scrarea_queue_winredraw(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void initipo(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceIpo *sipo;
|
|
|
|
|
|
|
|
|
|
sipo= MEM_callocN(sizeof(SpaceIpo), "initipo");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sipo);
|
|
|
|
|
|
|
|
|
|
sipo->spacetype= SPACE_IPO;
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
sipo->blockscale= 0.7f;
|
2003-11-30 22:29:54 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* sipo space loopt van (0,-?) tot (??,?) */
|
|
|
|
|
sipo->v2d.tot.xmin= 0.0;
|
|
|
|
|
sipo->v2d.tot.ymin= -10.0;
|
|
|
|
|
sipo->v2d.tot.xmax= G.scene->r.efra;
|
|
|
|
|
sipo->v2d.tot.ymax= 10.0;
|
|
|
|
|
|
|
|
|
|
sipo->v2d.cur= sipo->v2d.tot;
|
|
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
sipo->v2d.min[0]= 0.01f;
|
|
|
|
|
sipo->v2d.min[1]= 0.01f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
sipo->v2d.max[0]= 15000.0f;
|
|
|
|
|
sipo->v2d.max[1]= 10000.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sipo->v2d.scroll= L_SCROLL+B_SCROLL;
|
|
|
|
|
sipo->v2d.keeptot= 0;
|
|
|
|
|
|
|
|
|
|
sipo->blocktype= ID_OB;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: INFO ********************** */
|
|
|
|
|
|
|
|
|
|
void space_mipmap_button_function(int event) {
|
2004-01-13 14:50:45 +00:00
|
|
|
set_mipmap(!(U.gameflags & USER_DISABLE_MIPMAP));
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
#if 0
|
|
|
|
|
static void space_sound_button_function(int event)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
int a;
|
|
|
|
|
SYS_SystemHandle syshandle;
|
|
|
|
|
|
|
|
|
|
if ((syshandle = SYS_GetSystem()))
|
|
|
|
|
{
|
2004-01-13 14:50:45 +00:00
|
|
|
a = (U.gameflags & USER_DISABLE_SOUND);
|
2002-10-12 11:37:38 +00:00
|
|
|
SYS_WriteCommandLineInt(syshandle, "noaudio", a);
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-03-09 19:45:59 +00:00
|
|
|
#endif
|
2002-10-12 11:37:38 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
// needed for event; choose new 'curmain' resets it...
|
|
|
|
|
static short th_curcol= TH_BACK;
|
|
|
|
|
static char *th_curcol_ptr= NULL;
|
|
|
|
|
static char th_curcol_arr[4]={0, 0, 0, 255};
|
|
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
static void info_user_themebuts(uiBlock *block, short y1, short y2, short y3)
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
{
|
|
|
|
|
bTheme *btheme, *bt;
|
|
|
|
|
int spacetype= 0;
|
|
|
|
|
static short cur=1, curmain=2;
|
|
|
|
|
short a, tot=0, isbuiltin= 0;
|
2004-09-06 08:10:56 +00:00
|
|
|
char string[21*32], *strp, *col;
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
|
|
|
|
y3= y2+23; // exception!
|
|
|
|
|
|
|
|
|
|
/* count total, max 16! */
|
|
|
|
|
for(bt= U.themes.first; bt; bt= bt->next) tot++;
|
|
|
|
|
|
|
|
|
|
/* if cur not is 1; move that to front of list */
|
|
|
|
|
if(cur!=1) {
|
|
|
|
|
a= 1;
|
|
|
|
|
for(bt= U.themes.first; bt; bt= bt->next, a++) {
|
|
|
|
|
if(a==cur) {
|
|
|
|
|
BLI_remlink(&U.themes, bt);
|
|
|
|
|
BLI_addhead(&U.themes, bt);
|
2003-11-23 13:48:12 +00:00
|
|
|
allqueue(REDRAWALL, 0);
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
cur= 1;
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* the current theme */
|
|
|
|
|
btheme= U.themes.first;
|
|
|
|
|
if(strcmp(btheme->name, "Default")==0) isbuiltin= 1;
|
|
|
|
|
|
|
|
|
|
/* construct popup script */
|
|
|
|
|
string[0]= 0;
|
|
|
|
|
for(bt= U.themes.first; bt; bt= bt->next) {
|
|
|
|
|
strcat(string, bt->name);
|
|
|
|
|
if(btheme->next) strcat(string, " |");
|
|
|
|
|
}
|
|
|
|
|
uiDefButS(block, MENU, B_UPDATE_THEME, string, 45,y3,200,20, &cur, 0, 0, 0, 0, "Current theme");
|
|
|
|
|
|
|
|
|
|
/* add / delete / name */
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
if(tot<16)
|
|
|
|
|
uiDefBut(block, BUT, B_ADD_THEME, "Add", 45,y2,200,20, NULL, 0, 0, 0, 0, "Makes new copy of this theme");
|
|
|
|
|
if(tot>1 && isbuiltin==0)
|
|
|
|
|
uiDefBut(block, BUT, B_DEL_THEME, "Delete", 45,y1,200,20, NULL, 0, 0, 0, 0, "Delete theme");
|
|
|
|
|
|
|
|
|
|
if(isbuiltin) return;
|
|
|
|
|
|
|
|
|
|
/* name */
|
|
|
|
|
uiDefBut(block, TEX, B_NAME_THEME, "", 255,y3,200,20, btheme->name, 1.0, 30.0, 0, 0, "Rename theme");
|
|
|
|
|
|
|
|
|
|
/* main choices pup */
|
2004-01-10 13:41:03 +00:00
|
|
|
uiDefButS(block, MENU, B_CHANGE_THEME, "UI and Buttons %x1|%l|3D View %x2|%l|Ipo Curve Editor %x3|Action Editor %x4|"
|
2005-12-30 15:56:42 +00:00
|
|
|
"NLA Editor %x5|%l|UV/Image Editor %x6|Video Sequence Editor %x7|Node Editor %x16|Timeline %x15|Audio Window %x8|Text Editor %x9|%l|User Preferences %x10|"
|
2004-11-14 13:35:57 +00:00
|
|
|
"Outliner %x11|Buttons Window %x12|%l|File Browser %x13|Image Browser %x14",
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
255,y2,200,20, &curmain, 0, 0, 0, 0, "Specify theme for...");
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
if(curmain==1) spacetype= 0;
|
|
|
|
|
else if(curmain==2) spacetype= SPACE_VIEW3D;
|
|
|
|
|
else if(curmain==3) spacetype= SPACE_IPO;
|
2003-10-22 23:20:44 +00:00
|
|
|
else if(curmain==4) spacetype= SPACE_ACTION;
|
|
|
|
|
else if(curmain==5) spacetype= SPACE_NLA;
|
|
|
|
|
else if(curmain==6) spacetype= SPACE_IMAGE;
|
|
|
|
|
else if(curmain==7) spacetype= SPACE_SEQ;
|
|
|
|
|
else if(curmain==8) spacetype= SPACE_SOUND;
|
|
|
|
|
else if(curmain==9) spacetype= SPACE_TEXT;
|
|
|
|
|
else if(curmain==10) spacetype= SPACE_INFO;
|
|
|
|
|
else if(curmain==11) spacetype= SPACE_OOPS;
|
|
|
|
|
else if(curmain==12) spacetype= SPACE_BUTS;
|
|
|
|
|
else if(curmain==13) spacetype= SPACE_FILE;
|
|
|
|
|
else if(curmain==14) spacetype= SPACE_IMASEL;
|
2005-05-08 11:24:46 +00:00
|
|
|
else if(curmain==15) spacetype= SPACE_TIME;
|
2005-12-30 15:56:42 +00:00
|
|
|
else if(curmain==16) spacetype= SPACE_NODE;
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
else return; // only needed while coding... when adding themes for more windows
|
|
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
/* color choices pup */
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
if(curmain==1) {
|
|
|
|
|
strp= BIF_ThemeColorsPup(0);
|
2004-01-12 16:51:33 +00:00
|
|
|
if(th_curcol==TH_BACK) th_curcol= TH_BUT_OUTLINE; // switching main choices...
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
}
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
else strp= BIF_ThemeColorsPup(spacetype);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
uiDefButS(block, MENU, B_REDR, strp, 255,y1,200,20, &th_curcol, 0, 0, 0, 0, "Current color");
|
|
|
|
|
MEM_freeN(strp);
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
th_curcol_ptr= col= BIF_ThemeGetColorPtr(btheme, spacetype, th_curcol);
|
|
|
|
|
if(col==NULL) return;
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
/* first handle exceptions, special single values, row selection, etc */
|
|
|
|
|
if(th_curcol==TH_VERTEX_SIZE) {
|
|
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Vertex size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
|
|
|
|
|
}
|
2004-09-23 22:17:52 +00:00
|
|
|
else if(th_curcol==TH_FACEDOT_SIZE) {
|
|
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"Face dot size ", 465,y3,200,20, col, 1.0, 10.0, 0, 0, "");
|
|
|
|
|
}
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
else if(th_curcol==TH_BUT_DRAWTYPE) {
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-11-14 00:44:48 +00:00
|
|
|
uiDefButC(block, ROW, B_UPDATE_THEME, "Minimal", 465,y3,100,20, col, 2.0, 0.0, 0, 0, "");
|
|
|
|
|
uiDefButC(block, ROW, B_UPDATE_THEME, "Shaded", 565,y3,100,20, col, 2.0, 1.0, 0, 0, "");
|
|
|
|
|
uiDefButC(block, ROW, B_UPDATE_THEME, "Rounded", 465,y2,100,20, col, 2.0, 2.0, 0, 0, "");
|
|
|
|
|
uiDefButC(block, ROW, B_UPDATE_THEME, "OldSkool", 565,y2,100,20, col, 2.0, 3.0, 0, 0, "");
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockEndAlign(block);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
}
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
else {
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2005-11-19 10:55:07 +00:00
|
|
|
if ELEM7(th_curcol, TH_PANEL, TH_LAMP, TH_FACE, TH_FACE_SELECT, TH_MENU_BACK, TH_MENU_HILITE, TH_MENU_ITEM) {
|
2003-11-17 14:31:25 +00:00
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"A ", 465,y3+25,200,20, col+3, 0.0, 255.0, B_THEMECOL, 0, "");
|
|
|
|
|
}
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"R ", 465,y3,200,20, col, 0.0, 255.0, B_THEMECOL, 0, "");
|
|
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"G ", 465,y2,200,20, col+1, 0.0, 255.0, B_THEMECOL, 0, "");
|
|
|
|
|
uiDefButC(block, NUMSLI, B_UPDATE_THEME,"B ", 465,y1,200,20, col+2, 0.0, 255.0, B_THEMECOL, 0, "");
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockEndAlign(block);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
2004-07-22 13:40:17 +00:00
|
|
|
uiDefButC(block, COL, B_UPDATE_THEME, "", 675,y1,50,y3-y1+20, col, 0, 0, 0, 0, "");
|
2003-11-17 14:31:25 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
/* copy paste */
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockBeginAlign(block);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
uiDefBut(block, BUT, B_THEME_COPY, "Copy Color", 755,y2,120,20, NULL, 0, 0, 0, 0, "Stores current color in buffer");
|
|
|
|
|
uiDefBut(block, BUT, B_THEME_PASTE, "Paste Color", 755,y1,120,20, NULL, 0, 0, 0, 0, "Pastes buffer color");
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
uiDefButC(block, COL, 0, "", 885,y1,50,y2-y1+20, th_curcol_arr, 0, 0, 0, 0, "");
|
|
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-04 11:20:14 +00:00
|
|
|
void drawinfospace(ScrArea *sa, void *spacedata)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
uiBlock *block;
|
2003-10-25 16:53:50 +00:00
|
|
|
static short cur_light=0, cur_light_var=0;
|
2003-10-22 23:20:44 +00:00
|
|
|
float fac, col[3];
|
2004-07-24 16:43:16 +00:00
|
|
|
short xpos, ypos, ypostab, buth, rspace, dx, y1, y2, y3, y4, y5, y6;
|
|
|
|
|
short y2label, y3label, y4label, y5label, y6label;
|
|
|
|
|
short spref, mpref, lpref, smfileselbut;
|
|
|
|
|
short edgsp, midsp;
|
2002-10-12 11:37:38 +00:00
|
|
|
char naam[32];
|
|
|
|
|
|
2005-08-20 09:55:11 +00:00
|
|
|
if(curarea->win==0 || curarea->winy<2) return;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-22 23:20:44 +00:00
|
|
|
BIF_GetThemeColor3fv(TH_BACK, col);
|
|
|
|
|
glClearColor(col[0], col[1], col[2], 0.0);
|
2002-10-12 11:37:38 +00:00
|
|
|
glClear(GL_COLOR_BUFFER_BIT);
|
|
|
|
|
|
2004-12-03 16:32:24 +00:00
|
|
|
if(curarea->winx<=1280.0) {
|
|
|
|
|
fac= ((float)curarea->winx)/1280.0f;
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
myortho2(0.375f, 1280.375f, 0.375f, curarea->winy/fac + 0.375f);
|
2004-12-03 16:32:24 +00:00
|
|
|
}
|
|
|
|
|
else {
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
myortho2(0.375f, (float)curarea->winx + 0.375f, 0.375f, (float)curarea->winy + 0.375f);
|
2004-12-03 16:32:24 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sprintf(naam, "infowin %d", curarea->win);
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
block= uiNewBlock(&curarea->uiblocks, naam, UI_EMBOSS, UI_HELV, curarea->win);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
/* Vars for nice grid alignment */
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
dx= (1280-90)/7; /* spacing for use in equally dividing 'tab' row */
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
xpos = 45; /* left padding */
|
|
|
|
|
ypos = 50; /* bottom padding for buttons */
|
|
|
|
|
ypostab = 10; /* bottom padding for 'tab' row */
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
buth = 20; /* standard button height */
|
|
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
spref = 90; /* standard size for small preferences button */
|
|
|
|
|
mpref = 189; /* standard size for medium preferences button */
|
|
|
|
|
lpref = 288; /* standard size for large preferences button */
|
2003-05-03 12:17:11 +00:00
|
|
|
smfileselbut = buth; /* standard size for fileselect button (square) */
|
2004-01-16 23:40:14 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
edgsp = 3; /* space from edge of end 'tab' to edge of end button */
|
|
|
|
|
midsp = 9; /* horizontal space between buttons */
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
rspace = 3; /* default space between rows */
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
y1 = ypos; /* grid alignment for each row of buttons */
|
|
|
|
|
y2 = ypos+buth+rspace;
|
|
|
|
|
y3 = ypos+2*(buth+rspace);
|
|
|
|
|
y4 = ypos+3*(buth+rspace);
|
|
|
|
|
y5 = ypos+4*(buth+rspace);
|
|
|
|
|
y6 = ypos+5*(buth+rspace);
|
|
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
y2label = y2-2; /* adjustments to offset the labels down to align better */
|
2004-07-24 16:43:16 +00:00
|
|
|
y3label = y3-2;
|
|
|
|
|
y4label = y4-2;
|
|
|
|
|
y5label = y5-2;
|
|
|
|
|
y6label = y6-2;
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* set the colour to blue and draw the main 'tab' controls */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1);
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"View & Controls",
|
2003-05-01 12:50:49 +00:00
|
|
|
xpos,ypostab,(short)dx,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
&U.userpref,1.0,0.0, 0, 0,"");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"Edit Methods",
|
2003-05-01 12:50:49 +00:00
|
|
|
(short)(xpos+dx),ypostab,(short)dx,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
&U.userpref,1.0,1.0, 0, 0,"");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"Language & Font",
|
2003-05-01 12:50:49 +00:00
|
|
|
(short)(xpos+2*dx),ypostab,(short)dx,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
&U.userpref,1.0,2.0, 0, 0,"");
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"Themes",
|
2003-10-17 14:11:17 +00:00
|
|
|
(short)(xpos+3*dx),ypostab,(short)dx,buth,
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
&U.userpref,1.0,6.0, 0, 0,"");
|
|
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"Auto Save",
|
2003-10-17 14:11:17 +00:00
|
|
|
(short)(xpos+4*dx),ypostab,(short)dx,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&U.userpref,1.0,3.0, 0, 0,"");
|
|
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"System & OpenGL",
|
2003-05-03 12:17:11 +00:00
|
|
|
(short)(xpos+5*dx),ypostab,(short)dx,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
&U.userpref,1.0,4.0, 0, 0,"");
|
2003-10-17 14:11:17 +00:00
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW,B_USERPREF,"File Paths",
|
2003-10-17 14:11:17 +00:00
|
|
|
(short)(xpos+6*dx),ypostab,(short)dx,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
&U.userpref,1.0,5.0, 0, 0,"");
|
2003-01-28 11:14:38 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO);
|
2003-11-17 14:31:25 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
/* end 'tab' controls */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
/* line 2: left x co-ord, top y co-ord, width, height */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
if(U.userpref == 6) {
|
|
|
|
|
info_user_themebuts(block, y1, y2, y3);
|
|
|
|
|
}
|
|
|
|
|
else if (U.userpref == 0) { /* view & controls */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Display:",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos,y6label,spref,buth,
|
|
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_TOOLTIPS, 0, "Tool Tips",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y5,spref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Display tooltips (help tags) over buttons");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DRAWVIEWINFO, B_DRAWINFO, "Object Info",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y4,spref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Display active object name and frame number in the 3D View");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_SCENEGLOBAL, 0, "Global Scene",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y3,spref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Forces the current Scene to be displayed in all Screens");
|
2004-07-24 16:43:16 +00:00
|
|
|
#ifndef __APPLE__
|
2005-08-03 18:48:22 +00:00
|
|
|
uiDefButBitS(block, TOG, 1, 0, "Large Cursors",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y2,spref,buth,
|
|
|
|
|
&(U.curssize), 0, 0, 0, 0,
|
|
|
|
|
"Use large mouse cursors when available");
|
|
|
|
|
#else
|
|
|
|
|
U.curssize=0; /*Small Cursor always for OS X for now */
|
|
|
|
|
#endif
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_SHOW_VIEWPORTNAME, B_DRAWINFO, "View Name",
|
Patch #3365, Toolbox from Tuhopuu
Patch prvovided by Guillermo, code was - afaik - from Rob Haarsma.
This changes the toolbox (space menu) to have the first level aligned
vertically. Works much easier that way, and since the items open either
left or right, it doesn't flip order of the contents for it either.
To allow people to test (and to compare) it's a user menu setting (in
View & Controls, "Plain menus"). I've turned this on by default though,
since I propose to not have it a user setting. User setting can be
removed later.
Fixed two bugs in patch:
- if saved in user settings, first time usage of this toolbox opened in
wrong location
- Button for "plain menus" was writing a short in an int
(causing this new menu not to work for big endian systems)
As a bonus I've added the long wanted hotkey support for opening and
closing sublevels of pulldowns with arrow keys!
I didn't add the commenting out of correcting pulldown menu order, which
is based on location of the originating button in the UI. This uncommenting
didn't solve anything, since button definitions itself can be flipped too.
(Example: the data brose menus in top bar need to be corrected).
I can imagine the order flipping is sometimes annoying, but it still has
reasons to be there;
- the most important / most used items are always closest to the mouse.
(like opening properties panel, or "Add new" for material.
- it follows muscle memory and 'locus of attention' (mouse position).
- menus are configured to open to the top for bottom headers, and to the
bottom for top headers. We can expect the UI is configured consistantly
for headers, so in general the menus will appear consistant as well.
Where menu flipping fails is especially for alphabetic listings, like in
the menu button of fileselect. However, that one should be configured to
open by default to the bottom, so ordering is consistant as well.
If people like to check this themselves; uncomment the lines in the top
of the function uiBlockFlipOrder() in src/interface.c
2005-11-19 15:16:34 +00:00
|
|
|
(xpos+edgsp),y1,spref,buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
2006-04-25 12:26:46 +00:00
|
|
|
"Show the name of the view's direction in each 3D View");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Menus:",
|
|
|
|
|
(xpos+(2*edgsp)+spref),y6label,spref,buth,
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButBitI(block, TOG, USER_MENUOPENAUTO, 0, "Open on Mouse Over",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+spref+midsp),y5,mpref,buth,
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Open menu buttons and pulldowns automatically when the mouse is hovering");
|
|
|
|
|
uiDefButS(block, NUM, 0, "Top Level:",
|
|
|
|
|
(xpos+edgsp+spref+midsp),y4,spref+edgsp,buth,
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
&(U.menuthreshold1), 1, 40, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Time delay in 1/10 seconds before automatically opening top level menus");
|
|
|
|
|
uiDefButS(block, NUM, 0, "Sublevels:",
|
|
|
|
|
(xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y4,spref+edgsp,buth,
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
&(U.menuthreshold2), 1, 40, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Time delay in 1/10 seconds before automatically opening menu sublevels");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-10-29 01:10:10 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Toolbox click-hold delay:",
|
|
|
|
|
(xpos+(2*edgsp)+spref),y3label,mpref,buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-10-29 01:10:10 +00:00
|
|
|
uiDefButS(block, NUM, 0, "LMB:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+spref+midsp),y2,spref+edgsp,buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
&(U.tb_leftmouse), 2, 40, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Time in 1/10 seconds to hold the Left Mouse Button before opening the toolbox");
|
2003-10-29 01:10:10 +00:00
|
|
|
uiDefButS(block, NUM, 0, "RMB:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*spref)+(2*midsp)-edgsp),y2,spref+edgsp,buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
&(U.tb_rightmouse), 2, 40, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Time in 1/10 seconds to hold the Right Mouse Button before opening the toolbox");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiDefButBitI(block, TOG, USER_PANELPINNED, 0, "Pin Floating Panels",
|
|
|
|
|
(xpos+edgsp+spref+midsp),y1,(mpref/2),buth,
|
2004-07-24 16:43:16 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
|
|
|
|
"Make floating panels invoked by a hotkey (eg. N Key) open at the previous location");
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_PLAINMENUS, B_PLAINMENUS, "Plain Menus",
|
|
|
|
|
(xpos+edgsp+(2*spref)+(2*midsp)),y1,spref,buth,
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
2006-04-25 12:26:46 +00:00
|
|
|
"Use a column layout for toolbox and do not flip the contents of any menu");
|
|
|
|
|
uiBlockEndAlign(block);
|
2004-07-24 16:43:16 +00:00
|
|
|
|
|
|
|
|
uiDefBut(block, LABEL,0,"Snap to grid:",
|
|
|
|
|
(xpos+(2*edgsp)+spref+midsp+mpref),y6label,mpref,buth,
|
|
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButBitI(block, TOG, USER_AUTOGRABGRID, 0, "Grab/Move",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+spref+(2*midsp)),y5,spref,buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Snap objects and sub-objects to grid units when moving");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_AUTOROTGRID, 0, "Rotate",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+spref+(2*midsp)),y4,spref,buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Snap objects and sub-objects to grid units when rotating");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_AUTOSIZEGRID, 0, "Scale",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+spref+(2*midsp)),y3,spref,buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Snap objects and sub-objects to grid units when scaling");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2004-07-24 16:43:16 +00:00
|
|
|
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_LOCKAROUND, B_DRAWINFO, "Global Pivot",
|
|
|
|
|
(xpos+edgsp+mpref+spref+(2*midsp)),y1,spref,buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
|
|
|
|
"Lock the same rotation/scaling pivot in all 3D Views");
|
|
|
|
|
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefBut(block, LABEL,0,"View zoom:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y6label,mpref,buth,
|
2004-06-16 13:31:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
|
2004-06-16 13:31:32 +00:00
|
|
|
uiDefButS(block, ROW, 0, "Continue",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)),y5,(mpref/3),buth,
|
2004-06-16 13:31:32 +00:00
|
|
|
&(U.viewzoom), 40, USER_ZOOM_CONT, 0, 0,
|
|
|
|
|
"Old style zoom, continues while moving mouse up or down");
|
|
|
|
|
uiDefButS(block, ROW, 0, "Dolly",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/3)),y5,(mpref/3),buth,
|
2004-06-16 13:31:32 +00:00
|
|
|
&(U.viewzoom), 40, USER_ZOOM_DOLLY, 0, 0,
|
|
|
|
|
"Zooms in and out based on vertical mouse movement.");
|
|
|
|
|
uiDefButS(block, ROW, 0, "Scale",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)+(2*mpref/3)),y5,(mpref/3),buth,
|
2004-06-16 13:31:32 +00:00
|
|
|
&(U.viewzoom), 40, USER_ZOOM_SCALE, 0, 0,
|
|
|
|
|
"Zooms in and out like scaling the view, mouse movements relative to center.");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO); /* end color */
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
2003-10-29 01:10:10 +00:00
|
|
|
uiDefBut(block, LABEL,0,"View rotation:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+mpref+(2*spref)+(2*midsp)),y4label,mpref,buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
|
|
|
|
|
uiDefButBitI(block, TOG, USER_TRACKBALL, B_DRAWINFO, "Trackball",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)),y3,(mpref/2),buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Allow the view to tumble freely when orbiting with the Middle Mouse Button");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOGN, USER_TRACKBALL, B_DRAWINFO, "Turntable",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y3,(mpref/2),buth,
|
2003-10-29 01:10:10 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
2005-10-10 17:42:48 +00:00
|
|
|
"Use fixed up axis for orbiting with Middle Mouse Button");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO); /* end color */
|
|
|
|
|
uiDefButBitI(block, TOG, USER_AUTOPERSP, B_DRAWINFO, "Auto Perspective",
|
|
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)),y2,(mpref/2),buth,
|
2004-07-24 16:43:16 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
|
|
|
|
"Automatically switch between orthographic and perspective when changing from top/front/side views");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_ORBIT_SELECTION, B_DRAWINFO, "Around Active",
|
|
|
|
|
(xpos+edgsp+mpref+(2*spref)+(3*midsp)+(mpref/2)),y2,(mpref/2),buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
|
|
|
|
"Keep the active object in place when orbiting the views (Object Mode)");
|
|
|
|
|
uiBlockEndAlign(block);
|
2006-04-25 12:26:46 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButBitI(block, TOG, USER_SHOW_ROTVIEWICON, B_DRAWINFO, "Mini Axis",
|
|
|
|
|
(xpos+edgsp+(2*mpref)+(2*midsp)),y1,(mpref/3),buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
|
|
|
|
"Show a small rotating 3D axis in the bottom left corner of the 3D View");
|
|
|
|
|
uiDefButS(block, NUM, B_DRAWINFO, "Size:",
|
|
|
|
|
(xpos+edgsp+(2*mpref)+(2*midsp)+(mpref/3)),y1,(mpref/3),buth,
|
|
|
|
|
&U.rvisize, 10, 64, 0, 0,
|
|
|
|
|
"The axis icon's size");
|
|
|
|
|
uiDefButS(block, NUM, B_DRAWINFO, "Bright:",
|
|
|
|
|
(xpos+edgsp+(2*mpref)+(2*midsp)+2*(mpref/3)),y1,(mpref/3),buth,
|
|
|
|
|
&U.rvibright, 0, 10, 0, 0,
|
|
|
|
|
"The brightness of the icon");
|
|
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
2003-10-29 01:10:10 +00:00
|
|
|
|
2004-07-29 05:03:02 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Select with:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y6label,mpref,buth,
|
2004-07-16 01:34:19 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
uiBlockBeginAlign(block);
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
|
|
|
|
|
uiDefButBitI(block, TOG, USER_LMOUSESELECT, B_DRAWINFO, "Left Mouse",
|
2004-08-01 03:07:56 +00:00
|
|
|
(xpos+edgsp+(3*mpref)+(4*midsp)),y5,(mpref/2),buth,
|
2004-07-29 05:03:02 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0, "Use the Left Mouse Button for selection");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOGN, USER_LMOUSESELECT, B_DRAWINFO, "Right Mouse",
|
2004-08-01 03:07:56 +00:00
|
|
|
(xpos+edgsp+(3*mpref)+(4*midsp)+(mpref/2)),y5,(mpref/2),buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0, "Use the Right Mouse Button for selection");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO); /* end color */
|
2004-07-16 01:34:19 +00:00
|
|
|
uiBlockEndAlign(block);
|
2004-07-24 16:43:16 +00:00
|
|
|
|
|
|
|
|
|
2004-07-29 05:03:02 +00:00
|
|
|
if(U.flag & USER_LMOUSESELECT) {
|
|
|
|
|
uiDefBut(block, LABEL,0,"Cursor with: Right Mouse",
|
|
|
|
|
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth,
|
|
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
} else {
|
|
|
|
|
uiDefBut(block, LABEL,0,"Cursor with: Left Mouse",
|
|
|
|
|
(xpos+(2*edgsp)+(3*mpref)+(3*midsp)),y4label+5,mpref,buth,
|
|
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
}
|
2004-11-29 12:15:25 +00:00
|
|
|
|
|
|
|
|
/* illegal combo... */
|
|
|
|
|
if (U.flag & USER_LMOUSESELECT)
|
|
|
|
|
U.flag &= ~USER_TWOBUTTONMOUSE;
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_TWOBUTTONMOUSE, B_DRAWINFO, "Emulate 3 Button Mouse",
|
2004-07-29 05:03:02 +00:00
|
|
|
(xpos+edgsp+(3*mpref)+(4*midsp)),y3,mpref,buth,
|
2004-07-24 16:43:16 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
2004-11-29 12:15:25 +00:00
|
|
|
"Emulates Middle Mouse with Alt+LeftMouse (doesnt work with Left Mouse Select option)");
|
2004-07-24 16:43:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
uiDefBut(block, LABEL,0,"Middle Mouse Button:",
|
|
|
|
|
(xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y6label,mpref,buth,
|
2004-06-16 13:31:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1); /* mutually exclusive toggles, start color */
|
|
|
|
|
uiDefButBitI(block, TOGN, USER_VIEWMOVE, B_DRAWINFO, "Rotate View",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(5*midsp)),y5,(mpref/2),buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_VIEWMOVE, B_DRAWINFO, "Pan View",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(5*midsp)+(mpref/2)),y5,(mpref/2),buth,
|
|
|
|
|
&(U.flag), 0, 0, 0, 0, "Default action for the Middle Mouse Button");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO); /* end color */
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiDefBut(block, LABEL,0,"Mouse Wheel:",
|
|
|
|
|
(xpos+(2*edgsp)+(4*mpref)+(4*midsp)),y4label,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButBitI(block, TOG, USER_WHEELZOOMDIR, 0, "Invert Zoom",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(5*midsp)),y3,spref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"Swap the Mouse Wheel zoom direction");
|
2003-05-01 12:50:49 +00:00
|
|
|
uiDefButI(block, NUM, 0, "Scroll Lines:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(6*midsp)+spref-edgsp),y3,spref+edgsp,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&U.wheellinescroll, 0.0, 32.0, 0, 0,
|
2004-07-24 16:43:16 +00:00
|
|
|
"The number of lines scrolled at a time with the mouse wheel");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2004-07-24 16:43:16 +00:00
|
|
|
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2005-03-21 14:20:04 +00:00
|
|
|
uiDefBut(block, LABEL,0,"3D Transform Widget:",
|
|
|
|
|
(xpos+(2*edgsp)+(5*mpref)+(5*midsp)),y6label,mpref,buth,
|
|
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButS(block, NUM, B_REDRCURW3D, "Size:",
|
|
|
|
|
(xpos+edgsp+(5*mpref)+(6*midsp)),y5,(mpref/2),buth,
|
2005-11-19 10:55:07 +00:00
|
|
|
&(U.tw_size), 2, 40, 0, 0, "Diameter of widget, in 10 pixel units");
|
2005-03-21 14:20:04 +00:00
|
|
|
uiDefButS(block, NUM, B_REDRCURW3D, "Handle:",
|
|
|
|
|
(xpos+edgsp+(5*mpref)+(6*midsp)+(mpref/2)),y5,(mpref/2),buth,
|
|
|
|
|
&(U.tw_handlesize), 2, 40, 0, 0, "Size of widget handles as percentage of widget radius");
|
|
|
|
|
uiDefButS(block, NUM, B_REDRCURW3D, "Hotspot:",
|
2005-04-24 13:22:24 +00:00
|
|
|
(xpos+edgsp+(5*mpref)+(6*midsp)),y4,(mpref),buth,
|
2005-03-21 14:20:04 +00:00
|
|
|
&(U.tw_hotspot), 4, 40, 0, 0, "Hotspot in pixels for clicking widget handles");
|
|
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButS(block, NUM, B_REDRCURW3D, "Object Center Size: ",
|
|
|
|
|
(xpos+edgsp+(5*mpref)+(6*midsp)),y3,mpref,buth,
|
2005-11-19 10:55:07 +00:00
|
|
|
&(U.obcenter_dia), 4, 10, 0, 0,
|
2006-04-25 12:26:46 +00:00
|
|
|
"Diameter in Pixels for Object/Lamp center display");
|
2005-11-19 10:55:07 +00:00
|
|
|
|
|
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
} else if (U.userpref == 1) { /* edit methods */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
|
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Material linked to:",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos,y3label,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOGN, USER_MAT_ON_OB, B_DRAWINFO, "ObData",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y2,(mpref/2),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0, "Link new objects' material to the obData block");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_MAT_ON_OB, B_DRAWINFO, "Object",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(mpref/2)),y2,(mpref/2),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0, "Link new objects' material to the object block");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-10-28 18:43:55 +00:00
|
|
|
|
2005-12-05 11:46:40 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Undo:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+mpref),y3label, mpref,buth,
|
2003-10-28 18:43:55 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButS(block, NUMSLI, B_DRAWINFO, "Steps: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y2,mpref,buth,
|
2005-12-05 11:46:40 +00:00
|
|
|
&(U.undosteps), 0, 64, 0, 0, "Number of undo steps available (smaller values conserve memory)");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2006-04-25 12:26:46 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_GLOBALUNDO, B_DRAWINFO, "Global Undo",
|
2004-08-31 21:01:21 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y1,mpref,buth,
|
2005-12-05 11:46:40 +00:00
|
|
|
&(U.uiflag), 2, 64, 0, 0, "Global undo works by keeping a full copy of the file itself in memory, so takes extra memory");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2004-08-31 21:01:21 +00:00
|
|
|
|
Another mega commit... loadsof restructure, and a pretty good one! :)
- changed the BIF_DrawString() function. it used to work different for
AA fonts as for default fonts. Now it's identical. Setting color for fonts
can just be done with OpenGL, for both font types.
Removed: BIF_DrawStringRGB()
- added theme color options for Buttons
- recoded DefButton, so it automatically chooses the right color.
- had to remove a 1000 uiBlockSetCol() calls for that reason...
- uiBlockSetCol() still works, to override automatic color
- removed entirely the silly old color system (BIFColorID). All color
calls can now be done with a BIF_ThemeColor() call, including fonts and
buttons and opengl stuff
- all buttons in button header have headercolor by default
- recoded drawing icons, it was a really bad & old loop doing manually
colorshading and blending... which was per pixel a load of code!
Now it uses a single OpenGL call to blend or colorize. Quite faster!
- (as test, for review) icons don't colorize anymore with button color,
but have a different alpha to blend in (when not active)
- recoded the entire interface_draw.c file...:
- drawing buttons is separated in three parts:
1. main drawing function for text and icons
2. free definable callback for button itself
3. free definable callback for slider
- removed a load of redundant code for this!
- coded a minimal theme, and adjusted Matt's buttons to match new
callback system
- adding new drawing themes is piece of cake now
- for coders, default 'themes' to be aware of:
UI_EMBOSS : the themable drawing style
UI_EMBOSSP: the pulldown menu system (apart from color not themable)
UI_EMBOSSN: draw nothing, only text and/or icon
UI_EMBOSSM: minimal theme, still in use for Logic and Constraintsa
this can be set with uiBlockSetEmboss(block) or in the uiNewBlock() call.
TODO: make UI API call for button alignment
(plus removed another series of warnings from code...)
Plus: fixed bug in Matts commit: he used a 'short' button for an 'int'
2003-10-20 15:40:20 +00:00
|
|
|
|
2005-05-05 18:31:39 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Auto keyframe",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+(2*mpref)+midsp),y3label,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2005-12-18 20:14:22 +00:00
|
|
|
|
2005-06-11 16:30:36 +00:00
|
|
|
uiDefButBitI(block, TOG, G_RECORDKEYS, REDRAWTIME, "Action and Object",
|
2005-05-05 18:31:39 +00:00
|
|
|
(xpos+edgsp+(2*mpref)+(2*midsp)),y2,mpref, buth,
|
2005-06-11 16:30:36 +00:00
|
|
|
&(G.flags), 0, 0, 0, 0, "Automatic keyframe insertion in Object and Action Ipo curves");
|
2005-05-05 18:31:39 +00:00
|
|
|
|
2005-12-18 20:14:22 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_KEYINSERTAVAI, REDRAWTIME, "Available",
|
|
|
|
|
(xpos+edgsp+(2*mpref)+(2*midsp)),y1,mpref, buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in available curves");
|
|
|
|
|
|
2005-05-05 18:31:39 +00:00
|
|
|
// uiDefButBitS(block, TOG, USER_KEYINSERTACT, 0, "Action",
|
|
|
|
|
// (xpos+edgsp+(2*mpref)+(2*midsp)),y2,(spref+edgsp),buth,
|
|
|
|
|
// &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in Action Ipo curve");
|
|
|
|
|
// uiDefButBitS(block, TOG, USER_KEYINSERTOBJ, 0, "Object",
|
|
|
|
|
// (xpos+edgsp+(2*mpref)+(3*midsp)+spref-edgsp),y2,(spref+edgsp),buth,
|
|
|
|
|
// &(U.uiflag), 0, 0, 0, 0, "Automatic keyframe insertion in Object Ipo curve");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Duplicate with object:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+(2*edgsp)+(3*midsp)+(3*mpref)+spref),y3label,mpref,buth,
|
2003-04-28 11:17:21 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_MESH, 0, "Mesh",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*midsp)+(3*mpref)+spref),y2,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes mesh data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DUP_SURF, 0, "Surface",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y2,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes surface data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DUP_CURVE, 0, "Curve",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y2,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes curve data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DUP_FONT, 0, "Text",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y2,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes text data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DUP_MBALL, 0, "Metaball",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y2,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes metaball data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_ARM, 0, "Armature",
|
|
|
|
|
(xpos+edgsp+(4*midsp)+(3*mpref)+spref),y1,(spref+edgsp),buth,
|
|
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes armature data to be duplicated with Shift+D");
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_LAMP, 0, "Lamp",
|
|
|
|
|
(xpos+edgsp+(5*midsp)+(3*mpref)+(2*spref)),y1,(spref+edgsp),buth,
|
|
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes lamp data to be duplicated with Shift+D");
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_MAT, 0, "Material",
|
|
|
|
|
(xpos+edgsp+(6*midsp)+(3*mpref)+(3*spref)),y1,(spref+edgsp),buth,
|
|
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes material data to be duplicated with Shift+D");
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_TEX, 0, "Texture",
|
|
|
|
|
(xpos+edgsp+(7*midsp)+(3*mpref)+(4*spref)),y1,(spref+edgsp),buth,
|
|
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes texture data to be duplicated with Shift+D");
|
|
|
|
|
uiDefButBitI(block, TOG, USER_DUP_IPO, 0, "Ipo",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(8*midsp)+(3*mpref)+(5*spref)),y1,(spref+edgsp),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.dupflag), 0, 0, 0, 0, "Causes ipo data to be duplicated with Shift+D");
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-10-19 20:52:34 +00:00
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
} else if(U.userpref == 2) { /* language & colors */
|
|
|
|
|
|
|
|
|
|
#ifdef INTERNATIONAL
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_DOTRANSLATE, B_DOLANGUIFONT, "International Fonts",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos,y2,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.transopts), 0, 0, 0, 0, "Activate international interface");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
if(U.transopts & USER_DOTRANSLATE) {
|
2004-11-08 15:46:57 +00:00
|
|
|
char curfont[320];
|
|
|
|
|
|
|
|
|
|
sprintf(curfont, "Interface Font: ");
|
|
|
|
|
if(U.fontname[0]) strcat(curfont, U.fontname);
|
|
|
|
|
else strcat(curfont, "Built-in");
|
|
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
uiDefBut(block, LABEL,0,curfont,
|
2004-11-08 15:46:57 +00:00
|
|
|
(xpos),y3,4*mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
uiDefBut(block, BUT, B_LOADUIFONT, "Select Font",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos,y1,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
0, 0, 0, 0, 0, "Select a new font for the interface");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-11-08 15:46:57 +00:00
|
|
|
uiDefButI(block, BUT, B_RESTOREFONT, "Restore to default",
|
|
|
|
|
(xpos+edgsp+mpref+midsp),y2,mpref,buth,
|
|
|
|
|
&U.fontsize, 0, 0, 0, 0, "Restores to using the default included antialised font");
|
|
|
|
|
|
2005-08-03 19:27:19 +00:00
|
|
|
uiDefButI(block, MENU, B_SETFONTSIZE, fontsize_pup(),
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y1,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&U.fontsize, 0, 0, 0, 0, "Current interface font size (points)");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-11 23:28:32 +00:00
|
|
|
/*
|
2005-08-03 19:27:19 +00:00
|
|
|
uiDefButS(block, MENU, B_SETENCODING, encoding_pup(),
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y1,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&U.encoding, 0, 0, 0, 0, "Current interface font encoding");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Translate:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2.1*mpref)+(2*midsp)),y3label,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2003-05-11 23:28:32 +00:00
|
|
|
*/
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_TR_TOOLTIPS, B_SETTRANSBUTS, "Tooltips",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2.2*mpref)+(3*midsp)),y1,spref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.transopts), 0, 0, 0, 0, "Translate tooltips");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_TR_BUTTONS, B_SETTRANSBUTS, "Buttons",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2.2*mpref)+(4*midsp)+spref),y1,spref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.transopts), 0, 0, 0, 0, "Translate button labels");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_TR_MENUS, B_SETTRANSBUTS, "Toolbox",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2.2*mpref)+(5*midsp)+(2*spref)),y1,spref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.transopts), 0, 0, 0, 0, "Translate toolbox menu");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2005-08-03 19:27:19 +00:00
|
|
|
uiDefButI(block, MENU, B_SETLANGUAGE, language_pup(),
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2.2*mpref)+(3*midsp)),y2,mpref+(0.5*mpref)+3,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&U.language, 0, 0, 0, 0, "Select interface language");
|
|
|
|
|
|
2005-01-19 13:53:43 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_USETEXTUREFONT, B_USETEXTUREFONT, "Use Textured Fonts",
|
|
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.transopts), 0, 0, 0, 0,
|
2005-01-19 13:53:43 +00:00
|
|
|
"Use Textured Fonts");
|
2003-05-03 12:17:11 +00:00
|
|
|
}
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
/* end of INTERNATIONAL */
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
} else if(U.userpref == 3) { /* auto save */
|
|
|
|
|
|
|
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
uiDefButS(block, NUM, 0, "Save Versions:",
|
|
|
|
|
(xpos+edgsp),y3,mpref,buth,
|
|
|
|
|
&U.versions, 0.0, 32.0, 0, 0,
|
|
|
|
|
"The number of old versions to maintain in the current directory, when manually saving");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_AUTOSAVE, B_RESETAUTOSAVE, "Auto Save Temp Files",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y3,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Enables automatic saving of temporary files");
|
|
|
|
|
|
2004-01-13 14:50:45 +00:00
|
|
|
if(U.flag & USER_AUTOSAVE) {
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-03 12:17:11 +00:00
|
|
|
uiDefButI(block, NUM, B_RESETAUTOSAVE, "Minutes:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+mpref+midsp),y2,mpref,buth,
|
2003-05-03 12:17:11 +00:00
|
|
|
&(U.savetime), 1.0, 60.0, 0, 0,
|
|
|
|
|
"The time (in minutes) to wait between automatic temporary saves");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
uiDefBut(block, BUT, B_LOADTEMP, "Open Recent",
|
|
|
|
|
(xpos+edgsp+mpref+midsp),y1,mpref,buth,
|
|
|
|
|
0, 0, 0, 0, 0,"Open the most recently saved temporary file");
|
2003-05-03 12:17:11 +00:00
|
|
|
}
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
} else if (U.userpref == 4) { /* system & opengl */
|
2003-10-25 16:53:50 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Solid OpenGL light:",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp, y3label, mpref, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
|
2006-05-14 08:49:10 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-10-25 16:53:50 +00:00
|
|
|
uiDefButS(block, MENU, B_REDR, "Light1 %x0|Light2 %x1|Light3 %x2",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp, y2, 2*mpref/6, buth, &cur_light, 0.0, 0.0, 0, 0, "");
|
2003-10-25 16:53:50 +00:00
|
|
|
uiBlockSetCol(block, TH_BUT_SETTING1);
|
2005-08-03 18:48:22 +00:00
|
|
|
uiDefButBitI(block, TOG, 1, B_RECALCLIGHT, "On",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+2*mpref/6, y2, mpref/6, buth,
|
2004-11-01 17:03:05 +00:00
|
|
|
&U.light[cur_light].flag, 0.0, 0.0, 0, 0, "Enable this OpenGL light in Solid draw mode");
|
2006-05-14 08:49:10 +00:00
|
|
|
|
2003-10-25 16:53:50 +00:00
|
|
|
uiBlockSetCol(block, TH_AUTO);
|
|
|
|
|
uiDefButS(block, ROW, B_REDR, "Vec",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+3*mpref/6, y2, mpref/6, buth,
|
2004-11-01 17:03:05 +00:00
|
|
|
&cur_light_var, 123.0, 0.0, 0, 0, "Lamp vector for OpenGL light");
|
2003-10-25 16:53:50 +00:00
|
|
|
uiDefButS(block, ROW, B_REDR, "Col",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+4*mpref/6, y2, mpref/6, buth,
|
2004-11-01 17:03:05 +00:00
|
|
|
&cur_light_var, 123.0, 1.0, 0, 0, "Diffuse Color for OpenGL light");
|
2003-10-25 16:53:50 +00:00
|
|
|
uiDefButS(block, ROW, B_REDR, "Spec",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+5*mpref/6, y2, mpref/6, buth,
|
2004-11-01 17:03:05 +00:00
|
|
|
&cur_light_var, 123.0, 2.0, 0, 0, "Specular color for OpenGL light");
|
2006-05-14 08:49:10 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-10-25 16:53:50 +00:00
|
|
|
if(cur_light_var==1) {
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "R ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].col, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "G ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].col+1, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "B ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+2*mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].col+2, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
}
|
|
|
|
|
else if(cur_light_var==2) {
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "sR ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].spec, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "sG ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].spec+1, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "sB ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+2*mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].spec+2, 0.0, 1.0, 100, 2, "");
|
|
|
|
|
}
|
|
|
|
|
else if(cur_light_var==0) {
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "X ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].vec, -1.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "Y ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].vec+1, -1.0, 1.0, 100, 2, "");
|
|
|
|
|
uiDefButF(block, NUM, B_RECALCLIGHT, "Z ",
|
2004-07-24 16:43:16 +00:00
|
|
|
xpos+edgsp+2*mpref/3, y1, mpref/3, buth,
|
2003-10-25 16:53:50 +00:00
|
|
|
U.light[cur_light].vec+2, -1.0, 1.0, 100, 2, "");
|
|
|
|
|
}
|
2006-05-14 08:49:10 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
/*
|
2005-08-03 18:48:22 +00:00
|
|
|
uiDefButBitS(block, TOG, USER_EVTTOCONSOLE, 0, "Log Events to Console",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y2,lpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0, "Display a list of input events in the console");
|
|
|
|
|
|
2005-08-03 19:27:19 +00:00
|
|
|
uiDefButS(block, MENU, B_CONSOLEOUT, consolemethod_pup(),
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp), y1, lpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&U.console_out, 0, 0, 0, 0, "Select console output method");
|
|
|
|
|
|
|
|
|
|
uiDefButS(block, NUM, B_CONSOLENUMLINES, "Lines:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref+midsp),y1,spref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&U.console_buffer, 1.0, 4000.0, 0, 0, "Maximum number of internal console lines");
|
2003-04-28 11:17:21 +00:00
|
|
|
*/
|
|
|
|
|
|
2003-05-11 23:28:32 +00:00
|
|
|
#ifdef _WIN32
|
|
|
|
|
uiDefBut(block, LABEL,0,"Win Codecs:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(1*midsp)+(1*mpref)),y3label,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_ALLWINCODECS, 0, "Enable all codecs",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(1*mpref)+(1*midsp)),y2,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0, "Allows all codecs for rendering (not guaranteed)");
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
uiDefBut(block, LABEL,0,"Keyboard:",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*midsp)+(3*mpref)),y3label,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_NO_CAPSLOCK, B_U_CAPSLOCK, "Disable Caps Lock",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*midsp)+(3*mpref)),y1,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Disables the Caps Lock key when entering text");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_NONUMPAD, 0, "Emulate Numpad",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*midsp)+(3*mpref)),y2,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.flag), 0, 0, 0, 0,
|
|
|
|
|
"Causes the 1 to 0 keys to act as the numpad (useful for laptops)");
|
2003-04-28 11:17:21 +00:00
|
|
|
|
|
|
|
|
|
2003-05-11 23:28:32 +00:00
|
|
|
uiDefBut(block, LABEL,0,"System:",
|
2006-02-05 19:30:37 +00:00
|
|
|
(xpos+edgsp+(4*midsp)+(4*mpref)),y6label,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2006-02-05 19:30:37 +00:00
|
|
|
uiDefButI(block, NUM, B_MEMCACHELIMIT, "MEM Cache Limit ",
|
|
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)), y5, mpref, buth,
|
|
|
|
|
&U.memcachelimit, 0.0, 1024.0, 30, 2,
|
|
|
|
|
"Memory cache limit in sequencer");
|
|
|
|
|
uiDefButS(block, NUM, B_REDR, "Frameserver Port ",
|
|
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)), y4, mpref, buth,
|
|
|
|
|
&U.frameserverport, 0.0, 32727.0, 30, 2,
|
|
|
|
|
"Frameserver Port for Framserver-Rendering");
|
2003-05-11 23:28:32 +00:00
|
|
|
|
2005-04-12 10:08:04 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_DISABLE_SOUND, B_SOUNDTOGGLE, "Disable Game Sound",
|
2005-07-11 23:49:06 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)),y3,mpref,buth,
|
2005-04-12 10:08:04 +00:00
|
|
|
&(U.gameflags), 0, 0, 0, 0, "Disables sounds from being played in games");
|
2003-05-01 12:50:49 +00:00
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_FILTERFILEEXTS, 0, "Filter File Extensions",
|
2005-07-11 23:49:06 +00:00
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)),y2,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.uiflag), 0, 0, 0, 0, "Display only files with extensions in the image select window");
|
|
|
|
|
|
2005-07-11 23:49:06 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_HIDE_DOT, 0, "Hide dot file/datablock",
|
|
|
|
|
(xpos+edgsp+(4*mpref)+(4*midsp)),y1,mpref,buth,
|
|
|
|
|
&(U.uiflag), 0, 0, 0, 0, "Hide files/datablocks that start with a dot(.*)");
|
|
|
|
|
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-05-11 23:28:32 +00:00
|
|
|
uiDefBut(block, LABEL,0,"OpenGL:",
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
(xpos+edgsp+(5*midsp)+(5*mpref)),y5label,mpref,buth,
|
2003-05-11 23:28:32 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitI(block, TOGN, USER_DISABLE_MIPMAP, B_MIPMAPCHANGED, "Mipmaps",
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
(xpos+edgsp+(5*mpref)+(5*midsp)),y4,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.gameflags), 0, 0, 0, 0, "Toggles between mipmap textures on (beautiful) and off (fast)");
|
2004-01-13 14:50:45 +00:00
|
|
|
uiDefButBitI(block, TOG, USER_VERTEX_ARRAYS, 0, "Vertex Arrays",
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
(xpos+edgsp+(5*mpref)+(5*midsp)),y3,mpref,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
&(U.gameflags), 0, 0, 0, 0, "Toggles between vertex arrays on (less reliable) and off (more reliable)");
|
|
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
uiDefButI(block, NUM, 0, "Time Out ",
|
|
|
|
|
(xpos+edgsp+(5*mpref)+(5*midsp)), y2, mpref, buth,
|
|
|
|
|
&U.textimeout, 0.0, 3600.0, 30, 2, "Time since last access of a GL texture in seconds after which it is freed. (Set to 0 to keep textures allocated)");
|
|
|
|
|
uiDefButI(block, NUM, 0, "Collect Rate ",
|
|
|
|
|
(xpos+edgsp+(5*mpref)+(5*midsp)), y1, mpref, buth,
|
|
|
|
|
&U.texcollectrate, 1.0, 3600.0, 30, 2, "Number of seconds between each run of the GL texture garbage collector.");
|
|
|
|
|
|
|
|
|
|
|
2004-07-24 16:43:16 +00:00
|
|
|
uiDefBut(block, LABEL,0,"Audio mixing buffer:",
|
|
|
|
|
(xpos+edgsp+(2*midsp)+(2*mpref)),y3label,mpref,buth,
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 20:16:56 +00:00
|
|
|
0, 0, 0, 0, 0, "");
|
2004-07-24 16:43:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
|
|
|
|
uiDefButI(block, ROW, 0, "256",
|
|
|
|
|
(xpos+edgsp+(2*midsp)+(2*mpref)),y2,(mpref/4),buth,
|
|
|
|
|
&U.mixbufsize, 2.0, 256.0, 0, 0, "Set audio mixing buffer size to 256 samples");
|
|
|
|
|
uiDefButI(block, ROW, 0, "512",
|
|
|
|
|
(xpos+edgsp+(2*midsp)+(2*mpref)+(mpref/4)),y2,(mpref/4),buth,
|
|
|
|
|
&U.mixbufsize, 2.0, 512.0, 0, 0, "Set audio mixing buffer size to 512 samples");
|
|
|
|
|
uiDefButI(block, ROW, 0, "1024",
|
|
|
|
|
(xpos+edgsp+(2*midsp)+(2*mpref)+(2*mpref/4)),y2,(mpref/4),buth,
|
|
|
|
|
&U.mixbufsize, 2.0, 1024.0, 0, 0, "Set audio mixing buffer size to 1024 samples");
|
|
|
|
|
uiDefButI(block, ROW, 0, "2048",
|
|
|
|
|
(xpos+edgsp+(2*midsp)+(2*mpref)+(3*mpref/4)),y2,(mpref/4),buth,
|
|
|
|
|
&U.mixbufsize, 2.0, 2048.0, 0, 0, "Set audio mixing buffer size to 2048 samples");
|
|
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
|
|
|
|
} else if(U.userpref == 5) { /* file paths */
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2004-01-06 12:28:31 +00:00
|
|
|
/* yafray: (temporary) path button for yafray xml export, now with fileselect */
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2004-01-04 22:10:36 +00:00
|
|
|
uiDefBut(block, TEX, 0, "YFexport: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp), y2+buth+rspace, lpref-smfileselbut, buth,
|
2004-01-04 22:10:36 +00:00
|
|
|
U.yfexportdir, 1.0, 63.0, 0, 0,
|
|
|
|
|
"The default directory for yafray xml export (must exist!)");
|
2004-01-06 12:28:31 +00:00
|
|
|
uiDefIconBut(block, BUT, B_YAFRAYDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref-smfileselbut), y2+buth+rspace, smfileselbut, buth,
|
2004-01-06 12:28:31 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default yafray export directory");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Fonts: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y2,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.fontdir, 1.0, 63.0, 0, 0,
|
|
|
|
|
"The default directory to search for loading fonts");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_FONTDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref-smfileselbut),y2,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default font directory");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Textures: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref+midsp),y2,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.textudir, 1.0, 63.0, 0, 0, "The default directory to search for textures");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_TEXTUDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y2,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default texture location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2006-01-15 14:47:16 +00:00
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Tex Plugins: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*lpref)+(2*midsp)),y2,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.plugtexdir, 1.0, 63.0, 0, 0, "The default directory to search for texture plugins");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_PLUGTEXDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y2,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default texture plugin location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
|
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Seq Plugins: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*lpref)+(3*midsp)),y2,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.plugseqdir, 1.0, 63.0, 0, 0, "The default directory to search for sequence plugins");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_PLUGSEQDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y2,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default sequence plugin location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2006-01-15 14:47:16 +00:00
|
|
|
|
|
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Render: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp),y1,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.renderdir, 1.0, 63.0, 0, 0, "The default directory for rendering output");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_RENDERDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref-smfileselbut),y1,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default render output location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Python: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+lpref+midsp),y1,(lpref-2*smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.pythondir, 1.0, 63.0, 0, 0, "The default directory to search for Python scripts");
|
2004-01-16 23:40:14 +00:00
|
|
|
uiDefIconBut(block, BUT, B_PYMENUEVAL, ICON_SCRIPT,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*lpref)+midsp-2*smfileselbut),y1,smfileselbut,buth,
|
2004-01-16 23:40:14 +00:00
|
|
|
0, 0, 0, 0, 0, "Re-evaluate scripts registration in menus");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_PYTHONDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*lpref)+midsp-smfileselbut),y1,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default Python script location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2003-04-28 11:17:21 +00:00
|
|
|
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Sounds: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(2*lpref)+(2*midsp)),y1,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.sounddir, 1.0, 63.0, 0, 0, "The default directory to search for sounds");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_SOUNDDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*lpref)+(2*midsp)-smfileselbut),y1,smfileselbut,buth,
|
2006-01-15 14:47:16 +00:00
|
|
|
0, 0, 0, 0, 0, "Selet the default sound location");
|
|
|
|
|
uiBlockEndAlign(block);
|
2003-05-01 12:50:49 +00:00
|
|
|
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockBeginAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefBut(block, TEX, 0, "Temp: ",
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(3*lpref)+(3*midsp)),y1,(lpref-smfileselbut),buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
U.tempdir, 1.0, 63.0, 0, 0, "The directory for storing temporary save files");
|
2003-04-28 11:17:21 +00:00
|
|
|
uiDefIconBut(block, BUT, B_TEMPDIRFILESEL, ICON_FILESEL,
|
2004-07-24 16:43:16 +00:00
|
|
|
(xpos+edgsp+(4*lpref)+(3*midsp)-smfileselbut),y1,smfileselbut,buth,
|
2003-05-01 12:50:49 +00:00
|
|
|
0, 0, 0, 0, 0, "Select the default temporary save file location");
|
2006-01-15 14:47:16 +00:00
|
|
|
uiBlockEndAlign(block);
|
2003-04-28 11:17:21 +00:00
|
|
|
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
uiDrawBlock(block);
|
2003-10-04 20:35:50 +00:00
|
|
|
|
2003-11-18 11:22:17 +00:00
|
|
|
myortho2(-0.375, (float)(sa->winx)-0.375, -0.375, (float)(sa->winy)-0.375);
|
2003-10-04 20:35:50 +00:00
|
|
|
draw_area_emboss(sa);
|
2004-12-03 18:04:33 +00:00
|
|
|
|
|
|
|
|
/* restore buttons transform */
|
|
|
|
|
if(curarea->winx<=1280.0) {
|
|
|
|
|
fac= ((float)curarea->winx)/1280.0f;
|
|
|
|
|
myortho2(0.0, 1280.0, 0.0, curarea->winy/fac);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
myortho2(0.0, (float)curarea->winx, 0.0, (float)curarea->winy);
|
|
|
|
|
}
|
2003-10-04 20:35:50 +00:00
|
|
|
sa->win_swap= WIN_BACK_OK;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2003-04-28 11:17:21 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadinfospace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-03-24 01:46:05 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(val) {
|
|
|
|
|
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
|
|
|
|
|
|
|
|
|
switch(event) {
|
|
|
|
|
case UI_BUT_EVENT:
|
2005-05-05 18:31:39 +00:00
|
|
|
if(val==REDRAWTIME) allqueue(REDRAWTIME, 0);
|
|
|
|
|
else if(val==B_ADD_THEME) {
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
bTheme *btheme, *new;
|
|
|
|
|
|
|
|
|
|
btheme= U.themes.first;
|
|
|
|
|
new= MEM_callocN(sizeof(bTheme), "theme");
|
|
|
|
|
memcpy(new, btheme, sizeof(bTheme));
|
|
|
|
|
BLI_addhead(&U.themes, new);
|
|
|
|
|
strcpy(new->name, "New User Theme");
|
|
|
|
|
addqueue(sa->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_DEL_THEME) {
|
|
|
|
|
bTheme *btheme= U.themes.first;
|
|
|
|
|
BLI_remlink(&U.themes, btheme);
|
|
|
|
|
MEM_freeN(btheme);
|
2003-11-23 13:48:12 +00:00
|
|
|
BIF_SetTheme(sa); // prevent usage of old theme in calls
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
addqueue(sa->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_NAME_THEME) {
|
|
|
|
|
bTheme *btheme= U.themes.first;
|
|
|
|
|
if(strcmp(btheme->name, "Default")==0) {
|
|
|
|
|
strcpy(btheme->name, "New User Theme");
|
|
|
|
|
addqueue(sa->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_UPDATE_THEME) {
|
|
|
|
|
allqueue(REDRAWALL, 0);
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_CHANGE_THEME) {
|
|
|
|
|
th_curcol= TH_BACK; // backdrop color is always there...
|
|
|
|
|
addqueue(sa->win, REDRAW, 1);
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_THEME_COPY) {
|
|
|
|
|
if(th_curcol_ptr) {
|
|
|
|
|
th_curcol_arr[0]= th_curcol_ptr[0];
|
|
|
|
|
th_curcol_arr[1]= th_curcol_ptr[1];
|
|
|
|
|
th_curcol_arr[2]= th_curcol_ptr[2];
|
|
|
|
|
th_curcol_arr[3]= th_curcol_ptr[3];
|
2003-10-17 15:12:45 +00:00
|
|
|
addqueue(sa->win, REDRAW, 1);
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(val==B_THEME_PASTE) {
|
|
|
|
|
if(th_curcol_ptr) {
|
|
|
|
|
th_curcol_ptr[0]= th_curcol_arr[0];
|
|
|
|
|
th_curcol_ptr[1]= th_curcol_arr[1];
|
|
|
|
|
th_curcol_ptr[2]= th_curcol_arr[2];
|
|
|
|
|
th_curcol_ptr[3]= th_curcol_arr[3];
|
|
|
|
|
allqueue(REDRAWALL, 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
2003-10-25 16:53:50 +00:00
|
|
|
else if(val==B_RECALCLIGHT) {
|
|
|
|
|
if(U.light[0].flag==0 && U.light[1].flag==0 && U.light[2].flag==0)
|
|
|
|
|
U.light[0].flag= 1;
|
|
|
|
|
|
|
|
|
|
default_gl_light();
|
|
|
|
|
addqueue(sa->win, REDRAW, 1);
|
|
|
|
|
allqueue(REDRAWVIEW3D, 0);
|
2006-02-05 19:30:37 +00:00
|
|
|
}
|
|
|
|
|
else if (val==B_MEMCACHELIMIT) {
|
|
|
|
|
printf("Setting memcache limit to %d\n",
|
|
|
|
|
U.memcachelimit);
|
|
|
|
|
MEM_CacheLimiter_set_maximum(
|
|
|
|
|
U.memcachelimit * 1024 * 1024);
|
2003-10-25 16:53:50 +00:00
|
|
|
}
|
- The basic layer for Themes in place!
- currently only implemented for 3d window
- create as many themes you like, and name them
- default theme is not editable, and always will be defined at startup
(initTheme)
- saves in .B.blend
- themes for spaces can become local too, so you can set individual
3d windows at theme 'Maya' or so. (to be implemented)
- it uses alpha as well...!
API:
This doesnt use the old method with BFCOLORID blahblah. The API is copied
from OpenGL conventions (naming) as much as possible:
- void BIF_ThemeColor(ScrArea *sa, int colorid)
sets a color... id's are in BIF_resources.h (TH_GRID, TH_WIRE, etc)
- void BIF_ThemeColorShade(ScrArea *sa, int colorid, int offset)
sets a color with offset, no more weird COLORSHADE_LGREY stuff
- void BIF_GetThemeColor3fv(ScrArea *sa, int colorid, float *col)
like opengl, this gives you in *col the three rgb values
- void BIF_GetThemeColor4ubv(ScrArea *sa, int colorid, char *col)
or the one to get 4 bytes
ThemeColor calls for globals (UI etc) can also call NULL for *sa... this
is to be implemented still.
Next step: cleaning up interface.c for all weird colorcalls.
2003-10-17 14:02:08 +00:00
|
|
|
else do_global_buttons(val);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_infospace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceInfo *sinfo;
|
|
|
|
|
|
|
|
|
|
sinfo= MEM_callocN(sizeof(SpaceInfo), "initinfo");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sinfo);
|
2003-06-13 19:56:15 +00:00
|
|
|
|
|
|
|
|
sinfo->spacetype=SPACE_INFO;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: BUTS ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawbutspace(ScrArea *sa, void *spacedata); /* buttons.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
static void changebutspace(ScrArea *sa, void *spacedata)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
if(G.v2d==0) return;
|
|
|
|
|
|
|
|
|
|
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
2003-11-12 21:14:30 +00:00
|
|
|
myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadbutspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-03-24 01:46:05 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceButs *sbuts= curarea->spacedata.first;
|
2003-03-24 01:46:05 +00:00
|
|
|
ScrArea *sa2, *sa3d;
|
2003-10-04 20:35:50 +00:00
|
|
|
int nr, doredraw= 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(val) {
|
|
|
|
|
|
|
|
|
|
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
|
|
|
|
|
|
|
|
|
switch(event) {
|
|
|
|
|
case UI_BUT_EVENT:
|
2003-10-07 18:24:02 +00:00
|
|
|
do_butspace(val);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MIDDLEMOUSE:
|
2003-01-28 11:14:38 +00:00
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2003-10-04 21:03:57 +00:00
|
|
|
case PAGEUPKEY:
|
|
|
|
|
event= WHEELUPMOUSE;
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
|
|
|
|
break;
|
|
|
|
|
case PAGEDOWNKEY:
|
|
|
|
|
event= WHEELDOWNMOUSE;
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
|
|
|
|
break;
|
|
|
|
|
|
2003-10-04 20:35:50 +00:00
|
|
|
case RIGHTMOUSE:
|
2004-01-10 11:19:05 +00:00
|
|
|
nr= pupmenu("Panel Alignment%t|Horizontal%x1|Vertical%x2|Free %x0");
|
2003-10-04 20:35:50 +00:00
|
|
|
if (nr>=0) {
|
|
|
|
|
sbuts->align= nr;
|
2003-10-11 18:15:07 +00:00
|
|
|
if(nr) {
|
|
|
|
|
uiAlignPanelStep(sa, 1.0);
|
|
|
|
|
do_buts_buttons(B_BUTSHOME);
|
|
|
|
|
}
|
2003-10-04 20:35:50 +00:00
|
|
|
}
|
2003-01-28 11:14:38 +00:00
|
|
|
|
2003-10-04 20:35:50 +00:00
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case PADPLUSKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
view2d_zoom(&sbuts->v2d, 0.06f, curarea->winx, curarea->winy);
|
2003-03-24 01:46:05 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case PADMINUS:
|
2003-10-28 03:08:50 +00:00
|
|
|
view2d_zoom(&sbuts->v2d, -0.075f, curarea->winx, curarea->winy);
|
2003-03-24 01:46:05 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case RENDERPREVIEW:
|
2005-12-21 22:21:43 +00:00
|
|
|
BIF_previewrender_buts(sbuts);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HOMEKEY:
|
|
|
|
|
do_buts_buttons(B_BUTSHOME);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* if only 1 view, also de persp, excluding arrowkeys */
|
|
|
|
|
case PAD0: case PAD1: case PAD3:
|
|
|
|
|
case PAD5: case PAD7: case PAD9:
|
|
|
|
|
case PADENTER: case ZKEY: case PKEY:
|
|
|
|
|
sa3d= 0;
|
2003-03-24 01:46:05 +00:00
|
|
|
sa2= G.curscreen->areabase.first;
|
|
|
|
|
while(sa2) {
|
|
|
|
|
if(sa2->spacetype==SPACE_VIEW3D) {
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sa3d) return;
|
2003-03-24 01:46:05 +00:00
|
|
|
sa3d= sa2;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-03-24 01:46:05 +00:00
|
|
|
sa2= sa2->next;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
if(sa3d) {
|
|
|
|
|
sa= curarea;
|
|
|
|
|
areawinset(sa3d->win);
|
|
|
|
|
|
|
|
|
|
if(event==PKEY) start_game();
|
2003-03-24 01:46:05 +00:00
|
|
|
else if(event==ZKEY) toggle_shading();
|
2002-10-12 11:37:38 +00:00
|
|
|
else persptoetsen(event);
|
|
|
|
|
|
|
|
|
|
scrarea_queue_winredraw(sa3d);
|
|
|
|
|
scrarea_queue_headredraw(sa3d);
|
|
|
|
|
areawinset(sa->win);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(doredraw) scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void set_rects_butspace(SpaceButs *buts)
|
|
|
|
|
{
|
2003-04-30 13:22:26 +00:00
|
|
|
/* buts space goes from (0,0) to (1280, 228) */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
buts->v2d.tot.xmin= 0.0f;
|
|
|
|
|
buts->v2d.tot.ymin= 0.0f;
|
|
|
|
|
buts->v2d.tot.xmax= 1279.0f;
|
|
|
|
|
buts->v2d.tot.ymax= 228.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
buts->v2d.min[0]= 256.0f;
|
|
|
|
|
buts->v2d.min[1]= 42.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
buts->v2d.max[0]= 2048.0f;
|
|
|
|
|
buts->v2d.max[1]= 450.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
buts->v2d.minzoom= 0.5f;
|
|
|
|
|
buts->v2d.maxzoom= 1.21f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
buts->v2d.scroll= 0;
|
|
|
|
|
buts->v2d.keepaspect= 1;
|
|
|
|
|
buts->v2d.keepzoom= 1;
|
|
|
|
|
buts->v2d.keeptot= 1;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void test_butspace(void)
|
|
|
|
|
{
|
|
|
|
|
ScrArea *area= curarea;
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
int blocksmin= uiBlocksGetYMin(&area->uiblocks)-10.0f;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
G.buts->v2d.tot.ymin= MIN2(0.0f, blocksmin-10.0f);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_butspace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceButs *buts;
|
|
|
|
|
|
|
|
|
|
buts= MEM_callocN(sizeof(SpaceButs), "initbuts");
|
|
|
|
|
BLI_addhead(&sa->spacedata, buts);
|
|
|
|
|
|
|
|
|
|
buts->spacetype= SPACE_BUTS;
|
|
|
|
|
buts->scaflag= BUTS_SENS_LINK|BUTS_SENS_ACT|BUTS_CONT_ACT|BUTS_ACT_ACT|BUTS_ACT_LINK;
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* set_rects only does defaults, so after reading a file the cur has not changed */
|
2002-10-12 11:37:38 +00:00
|
|
|
set_rects_butspace(buts);
|
|
|
|
|
buts->v2d.cur= buts->v2d.tot;
|
2005-12-21 22:21:43 +00:00
|
|
|
|
|
|
|
|
buts->ri = NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void extern_set_butspace(int fkey)
|
|
|
|
|
{
|
|
|
|
|
ScrArea *sa;
|
|
|
|
|
SpaceButs *sbuts;
|
2005-11-26 15:13:10 +00:00
|
|
|
Object *ob= OBACT;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
/* when a f-key pressed: 'closest' button window is initialized */
|
2002-10-12 11:37:38 +00:00
|
|
|
if(curarea->spacetype==SPACE_BUTS) sa= curarea;
|
|
|
|
|
else {
|
2003-04-30 13:22:26 +00:00
|
|
|
/* find area */
|
2002-10-12 11:37:38 +00:00
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa->spacetype==SPACE_BUTS) break;
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(sa==0) return;
|
|
|
|
|
|
|
|
|
|
if(sa!=curarea) areawinset(sa->win);
|
|
|
|
|
|
|
|
|
|
sbuts= sa->spacedata.first;
|
|
|
|
|
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
if(fkey==F4KEY) {
|
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
- Converted lamp buttons and world buttons, they're pretty!
- menu auto open now is user preset, including 2 thresholds you can set
- hilites of pulldown menus were not cleared, fixed
- changed F4 key to logic. F5 will show lamp buttons, when lamp active
- in 'shader context' buttons, clicking camera will show world
2003-10-12 13:58:56 +00:00
|
|
|
sbuts->mainb= CONTEXT_LOGIC;
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
}
|
|
|
|
|
else if(fkey==F5KEY) {
|
2005-11-05 16:35:32 +00:00
|
|
|
/* if it's already in shading context, cycle between tabs with the same key */
|
2005-11-10 20:07:17 +00:00
|
|
|
if (sbuts->oldkeypress == F5KEY) {
|
2005-11-05 16:35:32 +00:00
|
|
|
|
|
|
|
|
if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_LAMP)
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_MAT;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_MAT)
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_TEX;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SHADING]==1) {
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_RAD;
|
|
|
|
|
}
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_RAD)
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_WORLD;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SHADING]==TAB_SHADING_WORLD)
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]=TAB_SHADING_LAMP;
|
|
|
|
|
}
|
2005-11-24 17:55:46 +00:00
|
|
|
/* if we're coming in from texture buttons,
|
|
|
|
|
or from outside the shading context, just go to the 'default' */
|
2005-11-26 15:13:10 +00:00
|
|
|
else if (ob && ((sbuts->mainb!= CONTEXT_SHADING) || (sbuts->oldkeypress == F6KEY)) ) {
|
2005-11-19 10:55:07 +00:00
|
|
|
sbuts->mainb= CONTEXT_SHADING;
|
|
|
|
|
|
2005-11-26 15:13:10 +00:00
|
|
|
if(ob->type==OB_CAMERA)
|
2005-11-19 10:55:07 +00:00
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD;
|
2005-11-26 15:13:10 +00:00
|
|
|
else if(ob->type==OB_LAMP)
|
2005-11-19 10:55:07 +00:00
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_LAMP;
|
|
|
|
|
else
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
|
|
|
|
|
}
|
2005-11-10 20:07:17 +00:00
|
|
|
else {
|
|
|
|
|
sbuts->mainb= CONTEXT_SHADING;
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_MAT;
|
|
|
|
|
}
|
Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
button, in the new Material buttons "Nodes" Panel or in header
of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
a negative normal. The input socket 'Normal' will force the material
to use that normal, otherwise it uses the normal from the Material
that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
in the Material Buttons. Active Material Nodes draw the material icon
in red.
- A click on any node will show its options in the Node Panel in the
Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
only one Output is the real one, which is indicated in a different
color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
only adds the material/mix nodes and connects them. Dunno if this is
worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
structure of nodes and in/output sockets. The Type structs store all
fixed info, callbacks, and allow to reconstruct saved Nodes to match
what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
2005-12-28 15:42:51 +00:00
|
|
|
BIF_preview_changed(ID_TE);
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
}
|
|
|
|
|
else if(fkey==F6KEY) {
|
|
|
|
|
sbuts->mainb= CONTEXT_SHADING;
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_TEX;
|
Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
button, in the new Material buttons "Nodes" Panel or in header
of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
a negative normal. The input socket 'Normal' will force the material
to use that normal, otherwise it uses the normal from the Material
that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
in the Material Buttons. Active Material Nodes draw the material icon
in red.
- A click on any node will show its options in the Node Panel in the
Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
only one Output is the real one, which is indicated in a different
color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
only adds the material/mix nodes and connects them. Dunno if this is
worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
structure of nodes and in/output sockets. The Type structs store all
fixed info, callbacks, and allow to reconstruct saved Nodes to match
what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
2005-12-28 15:42:51 +00:00
|
|
|
BIF_preview_changed(ID_TE);
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
}
|
2005-11-05 16:35:32 +00:00
|
|
|
else if(fkey==F7KEY) {
|
|
|
|
|
/* if it's already in object context, cycle between tabs with the same key */
|
2005-11-10 20:07:17 +00:00
|
|
|
if (sbuts->oldkeypress == F7KEY) {
|
2005-11-05 16:35:32 +00:00
|
|
|
|
|
|
|
|
if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_OBJECT)
|
|
|
|
|
sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_PHYSICS;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_OBJECT]==TAB_OBJECT_PHYSICS)
|
|
|
|
|
sbuts->tab[CONTEXT_OBJECT]=TAB_OBJECT_OBJECT;
|
|
|
|
|
}
|
|
|
|
|
else sbuts->mainb= CONTEXT_OBJECT;
|
|
|
|
|
|
|
|
|
|
}
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
else if(fkey==F8KEY) {
|
|
|
|
|
sbuts->mainb= CONTEXT_SHADING;
|
|
|
|
|
sbuts->tab[CONTEXT_SHADING]= TAB_SHADING_WORLD;
|
|
|
|
|
}
|
2003-10-07 12:49:39 +00:00
|
|
|
else if(fkey==F9KEY) sbuts->mainb= CONTEXT_EDITING;
|
2005-11-05 16:35:32 +00:00
|
|
|
else if(fkey==F10KEY) {
|
|
|
|
|
/* if it's already in scene context, cycle between tabs with the same key */
|
2005-11-10 20:07:17 +00:00
|
|
|
if (sbuts->oldkeypress == F10KEY) {
|
2005-11-05 16:35:32 +00:00
|
|
|
|
|
|
|
|
if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_RENDER)
|
|
|
|
|
sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_ANIM;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_ANIM)
|
|
|
|
|
sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_SOUND;
|
|
|
|
|
else if (sbuts->tab[CONTEXT_SCENE]==TAB_SCENE_SOUND)
|
|
|
|
|
sbuts->tab[CONTEXT_SCENE]=TAB_SCENE_RENDER;
|
|
|
|
|
}
|
|
|
|
|
else sbuts->mainb= CONTEXT_SCENE;
|
|
|
|
|
}
|
|
|
|
|
|
2005-11-10 20:07:17 +00:00
|
|
|
sbuts->oldkeypress = fkey;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: SEQUENCE ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
/* extern void drawseqspace(ScrArea *sa, void *spacedata); BIF_drawseq.h */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadseqspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-03-24 01:46:05 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceSeq *sseq= curarea->spacedata.first;
|
|
|
|
|
View2D *v2d= &sseq->v2d;
|
2006-03-26 21:36:42 +00:00
|
|
|
Sequence *last_seq = get_last_seq();
|
2002-10-12 11:37:38 +00:00
|
|
|
float dx, dy;
|
|
|
|
|
int doredraw= 0, cfra, first;
|
|
|
|
|
short mval[2];
|
2006-03-26 21:36:42 +00:00
|
|
|
short nr;
|
2004-07-16 01:34:19 +00:00
|
|
|
short mousebut = L_MOUSE;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(curarea->win==0) return;
|
|
|
|
|
|
|
|
|
|
if(val) {
|
|
|
|
|
if( uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
2004-07-16 01:34:19 +00:00
|
|
|
|
|
|
|
|
/* swap mouse buttons based on user preference */
|
|
|
|
|
if (U.flag & USER_LMOUSESELECT) {
|
2004-11-26 20:20:42 +00:00
|
|
|
if (event == LEFTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = RIGHTMOUSE;
|
|
|
|
|
mousebut = L_MOUSE;
|
2004-11-26 20:20:42 +00:00
|
|
|
} else if (event == RIGHTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = LEFTMOUSE;
|
|
|
|
|
mousebut = R_MOUSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
switch(event) {
|
2004-06-16 20:25:56 +00:00
|
|
|
case UI_BUT_EVENT:
|
|
|
|
|
do_seqbuttons(val);
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case LEFTMOUSE:
|
2003-01-28 12:14:47 +00:00
|
|
|
if(sseq->mainb || view2dmove(event)==0) {
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
first= 1;
|
|
|
|
|
set_special_seq_update(1);
|
|
|
|
|
|
|
|
|
|
do {
|
|
|
|
|
getmouseco_areawin(mval);
|
|
|
|
|
areamouseco_to_ipoco(v2d, mval, &dx, &dy);
|
|
|
|
|
|
|
|
|
|
cfra= (int)dx;
|
|
|
|
|
if(cfra< 1) cfra= 1;
|
|
|
|
|
/* else if(cfra> EFRA) cfra= EFRA; */
|
|
|
|
|
|
|
|
|
|
if( cfra!=CFRA || first ) {
|
|
|
|
|
first= 0;
|
|
|
|
|
|
|
|
|
|
CFRA= cfra;
|
2004-11-07 18:20:44 +00:00
|
|
|
force_draw(0);
|
Commit message and the brunt of the code courtesy of intrr, apologies for the
size of this;
Finally, the Sequencer audio support and global audio/animation sync stuff!
(See http://intrr.org/blender/audiosequencer.html)
Stuff that has been done:
./source/blender/blenloader/intern/writefile.c
./source/blender/blenloader/intern/readfile.c
Added code to make it handle sounds used by audio strips, and to convert
Scene data from older (<2.28) versions to init Scene global audio settings
(Scene->audio) to defaults.
./source/blender/include/BSE_seqaudio.h
./source/blender/src/seqaudio.c
The main audio routines that start/stop/scrub the audio stream at
a certain frame position, provide the frame reference for the current
stream position, mix the audio, convert the audio, mixdown the audio
into a file.
./source/blender/makesdna/DNA_sound_types.h
Introduced new variables in the bSound struct to accomodate the sample
data after converted to the scene's global mixing format (stream, streamlen).
Also added a new flag SOUND_FLAGS_SEQUENCE that gets set if the Sound
belongs to a sequence strip.
./source/blender/makesdna/DNA_scene_types.h
Added AudioData struct, which holds scene-global audio settings.
./source/blender/makesdna/DNA_sequence_types.h
Added support for audio strips. Some variables to hold Panning/Attenuation
information, position information, reference to the sample, and some flags.
./source/blender/makesdna/DNA_userdef_types.h
./source/blender/src/usiblender.c
Added a "Mixing buffer size" userpref. Made the versions stuff initialize
it to a default for versions <2.28.
./source/blender/makesdna/DNA_space_types.h
./source/blender/src/filesel.c
Added a Cyan dot to .WAV files. Any other suggestions on a better color? :)
./source/blender/src/editsound.c
Changes (fixes) to the WAV file loader, re-enabled some gameengine code that
is needed for dealing with bSounds and bSamples.
./source/blender/src/editipo.c
./source/blender/src/drawseq.c
./source/blender/src/editnla.c
./source/blender/src/space.c
./source/blender/src/drawview.c
./source/blender/src/renderwin.c
./source/blender/src/headerbuttons.c
- Created two different wrappers for update_for_newframe(), one which scrubs
the audio, one which doesn't.
- Replaced some of the occurences of update_for_newframe() with
update_for_newframe_muted(), which doesn't scrub the audio.
- In drawview.c: Changed the synchronization scheme to get the current audio
position from the audio engine, and use that as a reference for setting
CFRA. Implements a/v sync and framedrop.
- In editipo.c: Changed handling of Fac IPOs to be usable for audio strips as
volume envelopes.
- In space.c: Added the mixing buffer size Userpref, enabled audio scrubbing
(update_for_newframe()) for moving the sequence editor framebar.
./source/blender/src/editseq.c
Added support for audio strips and a default directory for WAV files which
gets saved from the last Shift-A operation.
./source/blender/src/buttons.c
Added Scene-global audio sequencer settings in Sound buttons.
./source/blender/src/sequence.c
Various stuff that deals with handling audio strips differently than
usual strips.
2003-07-13 20:16:56 +00:00
|
|
|
update_for_newframe(); /* for audio scrubbing */
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2004-12-02 18:12:18 +00:00
|
|
|
else PIL_sleep_ms(30);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
} while(get_mbut() & mousebut);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
set_special_seq_update(0);
|
|
|
|
|
|
|
|
|
|
update_for_newframe();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
2006-06-08 19:05:58 +00:00
|
|
|
if(sseq->mainb) seq_viewmove(sseq);
|
|
|
|
|
else view2dmove(event); /* in drawipo.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
|
|
|
|
if(sseq->mainb) break;
|
|
|
|
|
mouse_select_seq();
|
|
|
|
|
break;
|
|
|
|
|
case PADPLUSKEY:
|
2006-03-26 21:36:42 +00:00
|
|
|
case WHEELUPMOUSE:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sseq->mainb) {
|
|
|
|
|
sseq->zoom++;
|
2005-11-07 13:22:23 +00:00
|
|
|
if(sseq->zoom==-1) sseq->zoom= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sseq->zoom>8) sseq->zoom= 8;
|
|
|
|
|
}
|
|
|
|
|
else {
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0)) {
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
dx= 0.1154f*(v2d->cur.xmax-v2d->cur.xmin);
|
2002-10-12 11:37:38 +00:00
|
|
|
v2d->cur.xmin+= dx;
|
|
|
|
|
v2d->cur.xmax-= dx;
|
2006-06-04 16:26:02 +00:00
|
|
|
test_view2d(G.v2d, sa->winx, sa->winy);
|
|
|
|
|
view2d_do_locks(sa, V2D_LOCK_COPY);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
insert_gap(25, CFRA);
|
2004-11-13 12:55:59 +00:00
|
|
|
BIF_undo_push("Insert gaps Sequencer");
|
2003-10-27 23:55:38 +00:00
|
|
|
allqueue(REDRAWSEQ, 0);
|
|
|
|
|
}
|
|
|
|
|
else if(G.qual==LR_ALTKEY) {
|
|
|
|
|
insert_gap(250, CFRA);
|
2004-11-13 12:55:59 +00:00
|
|
|
BIF_undo_push("Insert gaps Sequencer");
|
2003-10-27 23:55:38 +00:00
|
|
|
allqueue(REDRAWSEQ, 0);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
case PADMINUS:
|
2006-03-26 21:36:42 +00:00
|
|
|
case WHEELDOWNMOUSE:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sseq->mainb) {
|
|
|
|
|
sseq->zoom--;
|
2005-11-07 13:22:23 +00:00
|
|
|
if(sseq->zoom==0) sseq->zoom= -2;
|
|
|
|
|
if(sseq->zoom<-8) sseq->zoom= -8;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else {
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
no_gaps();
|
|
|
|
|
else if((G.qual==0)) {
|
3D view orbit option: Around Active
This fixes the active object in place when orbiting the view.
Choppy 15fps demo can be seen there: http://www.elysiun.com/~theeth/bf/around_active.html
Image Memory Grabage Collection
This adds memory handling to the image code. An image is tagged each time it is used.
During a collection cycle (frequency of cycles is user defined), if an image is older
than a user defined limit, its buffer gets deallocated. This also applies to gl memory buffers.
Images that are loading in GL memory needs to go through two time outs before being fully deallocated: the first time out deallocated the gl memorry, the second the buffer in ram.
Notes:
Image buffer loaded from python gets tagged as permanent upon load. That tag is removed when python stops using the image.
I might have missed some tagging spots, especially in the rendering pipeline. Someone with more knowledge about this code should check to be careful.
Tagging is done on every access, for rendering, this will probably be a performance hit. A scheme should be developped to only tag when the rendering is completed.
Collecting is called in draw_object, most likely not the best place to do it.
Safe from undo, since using undo deallocates memory anyway (like when loading a blend file with one currently opened)
Userpref DNA changes:
I've changed a couple of flagging variables from short to int. Some because they needed more space, others to keep SDNA happy.
Info window changes:
I've grouped a couple of buttons in aligned blocks and changed the color of mutually exclusive options to make them clearer.
Matt didn't do any changes on that in tuhopuu, so hopefully I'm not stepping on anyone's feet with this.
Also changed double constants into floats with f in a couple of places (mostly space.c) to make compiler happier.
2005-07-06 00:33:41 +00:00
|
|
|
dx= 0.15f*(v2d->cur.xmax-v2d->cur.xmin);
|
2002-10-12 11:37:38 +00:00
|
|
|
v2d->cur.xmin-= dx;
|
|
|
|
|
v2d->cur.xmax+= dx;
|
2006-06-04 16:26:02 +00:00
|
|
|
test_view2d(G.v2d, sa->winx, sa->winy);
|
|
|
|
|
view2d_do_locks(sa, V2D_LOCK_COPY);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
break;
|
|
|
|
|
case HOMEKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
do_seq_buttons(B_SEQHOME);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case PADPERIOD:
|
|
|
|
|
if(last_seq) {
|
|
|
|
|
CFRA= last_seq->startdisp;
|
|
|
|
|
v2d->cur.xmin= last_seq->startdisp- (last_seq->len/20);
|
|
|
|
|
v2d->cur.xmax= last_seq->enddisp+ (last_seq->len/20);
|
|
|
|
|
update_for_newframe();
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case AKEY:
|
|
|
|
|
if(sseq->mainb) break;
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) {
|
2003-10-20 20:12:01 +00:00
|
|
|
add_sequence(-1);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else if((G.qual==0))
|
|
|
|
|
swap_select_seq();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2006-03-26 21:36:42 +00:00
|
|
|
case SPACEKEY:
|
|
|
|
|
if (G.qual==0) {
|
|
|
|
|
if (sseq->mainb) {
|
|
|
|
|
play_anim(1);
|
|
|
|
|
} else {
|
|
|
|
|
add_sequence(-1);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case BKEY:
|
|
|
|
|
if(sseq->mainb) break;
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
borderselect_seq();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case CKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0)) {
|
|
|
|
|
if(last_seq && (last_seq->flag & (SEQ_LEFTSEL+SEQ_RIGHTSEL))) {
|
|
|
|
|
if(last_seq->flag & SEQ_LEFTSEL) CFRA= last_seq->startdisp;
|
|
|
|
|
else CFRA= last_seq->enddisp-1;
|
|
|
|
|
|
|
|
|
|
dx= CFRA-(v2d->cur.xmax+v2d->cur.xmin)/2;
|
|
|
|
|
v2d->cur.xmax+= dx;
|
|
|
|
|
v2d->cur.xmin+= dx;
|
|
|
|
|
update_for_newframe();
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
change_sequence();
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case DKEY:
|
|
|
|
|
if(sseq->mainb) break;
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY)) add_duplicate_seq();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case EKEY:
|
|
|
|
|
break;
|
|
|
|
|
case FKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
set_filter_seq();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case GKEY:
|
|
|
|
|
if(sseq->mainb) break;
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
2005-04-30 21:19:19 +00:00
|
|
|
transform_seq('g', 0);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2005-08-14 10:31:14 +00:00
|
|
|
case KKEY:
|
|
|
|
|
if((G.qual==0)) { /* Cut at current frame */
|
|
|
|
|
if(okee("Cut strips")) seq_cut(CFRA);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case MKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_ALTKEY)
|
|
|
|
|
un_meta();
|
|
|
|
|
else if((G.qual==0)){
|
2006-02-05 19:30:37 +00:00
|
|
|
if ((last_seq) &&
|
|
|
|
|
(last_seq->type == SEQ_RAM_SOUND
|
|
|
|
|
|| last_seq->type == SEQ_HD_SOUND))
|
2003-07-13 21:43:15 +00:00
|
|
|
{
|
|
|
|
|
last_seq->flag ^= SEQ_MUTE;
|
|
|
|
|
doredraw = 1;
|
|
|
|
|
}
|
2003-10-27 23:55:38 +00:00
|
|
|
else
|
|
|
|
|
make_meta();
|
2003-07-13 21:43:15 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2004-06-16 20:25:56 +00:00
|
|
|
case NKEY:
|
|
|
|
|
if(G.qual==0) {
|
2004-06-19 12:25:28 +00:00
|
|
|
toggle_blockhandler(curarea, SEQ_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
2004-06-16 20:25:56 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case SKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==LR_SHIFTKEY))
|
2004-06-03 14:29:14 +00:00
|
|
|
seq_snap_menu();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2006-03-26 21:36:42 +00:00
|
|
|
case PKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if((G.qual==0))
|
|
|
|
|
touch_seq_files();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2006-03-26 21:36:42 +00:00
|
|
|
case TKEY: /* popup menu */
|
|
|
|
|
nr= pupmenu("Time value%t|Frames %x1|Seconds%x2");
|
|
|
|
|
if (nr>0) {
|
|
|
|
|
if(nr==1) sseq->flag |= SEQ_DRAWFRAMES;
|
|
|
|
|
else sseq->flag &= ~SEQ_DRAWFRAMES;
|
|
|
|
|
doredraw= 1;
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case XKEY:
|
|
|
|
|
case DELKEY:
|
2003-10-28 03:08:50 +00:00
|
|
|
if(G.qual==0) {
|
|
|
|
|
if(sseq->mainb) break;
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
del_seq();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(doredraw) scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_seqspace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceSeq *sseq;
|
|
|
|
|
|
|
|
|
|
sseq= MEM_callocN(sizeof(SpaceSeq), "initseqspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sseq);
|
|
|
|
|
|
|
|
|
|
sseq->spacetype= SPACE_SEQ;
|
2006-02-05 19:30:37 +00:00
|
|
|
sseq->zoom= 4;
|
2004-04-19 22:05:37 +00:00
|
|
|
sseq->blockscale= 0.7;
|
2006-02-05 19:30:37 +00:00
|
|
|
sseq->chanshown = 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* seq space goes from (0,8) to (250, 0) */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sseq->v2d.tot.xmin= 0.0;
|
|
|
|
|
sseq->v2d.tot.ymin= 0.0;
|
|
|
|
|
sseq->v2d.tot.xmax= 250.0;
|
|
|
|
|
sseq->v2d.tot.ymax= 8.0;
|
|
|
|
|
|
|
|
|
|
sseq->v2d.cur= sseq->v2d.tot;
|
|
|
|
|
|
|
|
|
|
sseq->v2d.min[0]= 10.0;
|
|
|
|
|
sseq->v2d.min[1]= 4.0;
|
|
|
|
|
|
|
|
|
|
sseq->v2d.max[0]= 32000.0;
|
|
|
|
|
sseq->v2d.max[1]= MAXSEQ;
|
|
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
sseq->v2d.minzoom= 0.1f;
|
2002-10-12 11:37:38 +00:00
|
|
|
sseq->v2d.maxzoom= 10.0;
|
|
|
|
|
|
|
|
|
|
sseq->v2d.scroll= L_SCROLL+B_SCROLL;
|
|
|
|
|
sseq->v2d.keepaspect= 0;
|
|
|
|
|
sseq->v2d.keepzoom= 0;
|
|
|
|
|
sseq->v2d.keeptot= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: ACTION ********************** */
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawactionspace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadactionspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2003-06-21 21:34:40 +00:00
|
|
|
static void changeactionspace(ScrArea *sa, void *spacedata)
|
|
|
|
|
{
|
|
|
|
|
if(G.v2d==0) return;
|
|
|
|
|
|
2003-07-22 12:49:32 +00:00
|
|
|
/* this sets the sub-areas correct, for scrollbars */
|
2006-04-14 15:29:52 +00:00
|
|
|
test_view2d(G.v2d, sa->winx, sa->winy);
|
2003-06-21 21:34:40 +00:00
|
|
|
|
2003-07-22 12:49:32 +00:00
|
|
|
/* action space uses weird matrices... local calculated in a function */
|
2003-06-21 21:34:40 +00:00
|
|
|
// myortho2(G.v2d->cur.xmin, G.v2d->cur.xmax, G.v2d->cur.ymin, G.v2d->cur.ymax);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_actionspace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceAction *saction;
|
|
|
|
|
|
|
|
|
|
saction= MEM_callocN(sizeof(SpaceAction), "initactionspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, saction);
|
|
|
|
|
|
|
|
|
|
saction->spacetype= SPACE_ACTION;
|
2004-04-19 22:05:37 +00:00
|
|
|
saction->blockscale= 0.7;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
saction->v2d.tot.xmin= 1.0;
|
|
|
|
|
saction->v2d.tot.ymin= 0.0;
|
|
|
|
|
saction->v2d.tot.xmax= 1000.0;
|
|
|
|
|
saction->v2d.tot.ymax= 1000.0;
|
|
|
|
|
|
|
|
|
|
saction->v2d.cur.xmin= -5.0;
|
|
|
|
|
saction->v2d.cur.ymin= 0.0;
|
|
|
|
|
saction->v2d.cur.xmax= 65.0;
|
|
|
|
|
saction->v2d.cur.ymax= 1000.0;
|
|
|
|
|
|
|
|
|
|
saction->v2d.min[0]= 0.0;
|
|
|
|
|
saction->v2d.min[1]= 0.0;
|
|
|
|
|
|
2003-07-22 14:28:56 +00:00
|
|
|
saction->v2d.max[0]= 32000.0;
|
2002-10-12 11:37:38 +00:00
|
|
|
saction->v2d.max[1]= 1000.0;
|
|
|
|
|
|
2003-11-08 19:04:50 +00:00
|
|
|
saction->v2d.minzoom= 0.01;
|
|
|
|
|
saction->v2d.maxzoom= 50;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
saction->v2d.scroll= R_SCROLL+B_SCROLL;
|
|
|
|
|
saction->v2d.keepaspect= 0;
|
|
|
|
|
saction->v2d.keepzoom= V2D_LOCKZOOM_Y;
|
|
|
|
|
saction->v2d.keeptot= 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
2005-03-09 19:45:59 +00:00
|
|
|
static void free_actionspace(SpaceAction *saction)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
/* don't free saction itself */
|
|
|
|
|
|
|
|
|
|
/* __PINFAKE */
|
|
|
|
|
/* if (saction->flag & SACTION_PIN)
|
|
|
|
|
if (saction->action)
|
|
|
|
|
saction->action->id.us --;
|
|
|
|
|
|
|
|
|
|
*/ /* end PINFAKE */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: FILE ********************** */
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_filespace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceFile *sfile;
|
|
|
|
|
|
|
|
|
|
sfile= MEM_callocN(sizeof(SpaceFile), "initfilespace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sfile);
|
|
|
|
|
|
|
|
|
|
sfile->dir[0]= '/';
|
|
|
|
|
sfile->type= FILE_UNIX;
|
2004-04-19 22:05:37 +00:00
|
|
|
sfile->blockscale= 0.7;
|
2002-10-12 11:37:38 +00:00
|
|
|
sfile->spacetype= SPACE_FILE;
|
|
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_imaselspace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceImaSel *simasel;
|
|
|
|
|
|
|
|
|
|
simasel= MEM_callocN(sizeof(SpaceImaSel), "initimaselspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, simasel);
|
|
|
|
|
|
|
|
|
|
simasel->spacetype= SPACE_IMASEL;
|
2004-04-19 22:05:37 +00:00
|
|
|
simasel->blockscale= 0.7;
|
2002-10-12 11:37:38 +00:00
|
|
|
simasel->mode = 7;
|
|
|
|
|
strcpy (simasel->dir, U.textudir); /* TON */
|
|
|
|
|
strcpy (simasel->file, "");
|
|
|
|
|
strcpy(simasel->fole, simasel->file);
|
|
|
|
|
strcpy(simasel->dor, simasel->dir);
|
|
|
|
|
|
|
|
|
|
simasel->first_sel_ima = 0;
|
|
|
|
|
simasel->hilite_ima = 0;
|
|
|
|
|
simasel->firstdir = 0;
|
|
|
|
|
simasel->firstfile = 0;
|
|
|
|
|
simasel->cmap = 0;
|
|
|
|
|
simasel->returnfunc = 0;
|
|
|
|
|
|
|
|
|
|
simasel->title[0] = 0;
|
|
|
|
|
|
|
|
|
|
clear_ima_dir(simasel);
|
|
|
|
|
|
|
|
|
|
// simasel->cmap= IMB_loadiffmem((int*)datatoc_cmap_tga, IB_rect|IB_cmap);
|
|
|
|
|
simasel->cmap= IMB_ibImageFromMemory((int *)datatoc_cmap_tga, datatoc_cmap_tga_size, IB_rect|IB_cmap);
|
|
|
|
|
if (!simasel->cmap) {
|
|
|
|
|
error("in console");
|
|
|
|
|
printf("Image select cmap file not found \n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: SOUND ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawsoundspace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadsoundspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_soundspace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceSound *ssound;
|
|
|
|
|
|
|
|
|
|
ssound= MEM_callocN(sizeof(SpaceSound), "initsoundspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, ssound);
|
|
|
|
|
|
|
|
|
|
ssound->spacetype= SPACE_SOUND;
|
2004-04-19 22:05:37 +00:00
|
|
|
ssound->blockscale= 0.7;
|
2003-04-30 13:22:26 +00:00
|
|
|
/* sound space goes from (0,8) to (250, 0) */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
ssound->v2d.tot.xmin= -4.0;
|
|
|
|
|
ssound->v2d.tot.ymin= -4.0;
|
|
|
|
|
ssound->v2d.tot.xmax= 250.0;
|
|
|
|
|
ssound->v2d.tot.ymax= 255.0;
|
|
|
|
|
|
|
|
|
|
ssound->v2d.cur.xmin= -4.0;
|
|
|
|
|
ssound->v2d.cur.ymin= -4.0;
|
|
|
|
|
ssound->v2d.cur.xmax= 50.0;
|
|
|
|
|
ssound->v2d.cur.ymax= 255.0;
|
|
|
|
|
|
|
|
|
|
ssound->v2d.min[0]= 1.0;
|
|
|
|
|
ssound->v2d.min[1]= 259.0;
|
|
|
|
|
|
|
|
|
|
ssound->v2d.max[0]= 32000.0;
|
|
|
|
|
ssound->v2d.max[1]= 259;
|
|
|
|
|
|
2003-10-28 03:08:50 +00:00
|
|
|
ssound->v2d.minzoom= 0.1f;
|
2002-10-12 11:37:38 +00:00
|
|
|
ssound->v2d.maxzoom= 10.0;
|
|
|
|
|
|
|
|
|
|
ssound->v2d.scroll= B_SCROLL;
|
|
|
|
|
ssound->v2d.keepaspect= 0;
|
|
|
|
|
ssound->v2d.keepzoom= 0;
|
|
|
|
|
ssound->v2d.keeptot= 0;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void free_soundspace(SpaceSound *ssound)
|
|
|
|
|
{
|
|
|
|
|
/* don't free ssound itself */
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: IMAGE ********************** */
|
|
|
|
|
|
Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
right now Images or Render Results. That makes the entire composite tree
only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
what the cropped area should be. Compositing is on Scene level, not local
per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
2006-02-09 11:07:04 +00:00
|
|
|
static void changeimagepace(ScrArea *sa, void *spacedata)
|
|
|
|
|
{
|
|
|
|
|
image_preview_event(2);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadimagespace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2005-09-16 20:17:09 +00:00
|
|
|
unsigned short event= evt->event, origevent= evt->event;
|
2003-03-24 01:46:05 +00:00
|
|
|
short val= evt->val;
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceImage *sima= curarea->spacedata.first;
|
2004-07-16 01:34:19 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(val==0) return;
|
|
|
|
|
|
2004-04-19 22:05:37 +00:00
|
|
|
if(uiDoBlocks(&curarea->uiblocks, event)!=UI_NOTHING ) event= 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-07-16 01:34:19 +00:00
|
|
|
if (U.flag & USER_LMOUSESELECT) {
|
2004-11-26 20:20:42 +00:00
|
|
|
if (event == LEFTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = RIGHTMOUSE;
|
2004-11-26 20:20:42 +00:00
|
|
|
} else if (event == RIGHTMOUSE) {
|
2004-07-16 01:34:19 +00:00
|
|
|
event = LEFTMOUSE;
|
|
|
|
|
}
|
|
|
|
|
}
|
2005-09-12 19:20:53 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if (sima->flag & SI_DRAWTOOL) {
|
|
|
|
|
switch(event) {
|
2006-03-25 22:29:48 +00:00
|
|
|
case CKEY:
|
|
|
|
|
toggle_blockhandler(curarea, IMAGE_HANDLER_PAINT, UI_PNL_UNSTOW);
|
2005-09-16 20:17:09 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
|
|
|
|
case LEFTMOUSE:
|
|
|
|
|
imagepaint_paint(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE);
|
|
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
|
|
|
|
imagepaint_pick(origevent==LEFTMOUSE? L_MOUSE: R_MOUSE);
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
/* Draw tool is inactive */
|
|
|
|
|
switch(event) {
|
|
|
|
|
case LEFTMOUSE:
|
2006-01-09 23:52:51 +00:00
|
|
|
if(G.qual & LR_SHIFTKEY) {
|
|
|
|
|
if(G.sima->image && G.sima->image->tpageflag & IMA_TILES)
|
|
|
|
|
mouseco_to_curtile();
|
|
|
|
|
else
|
|
|
|
|
sima_sample_color();
|
|
|
|
|
}
|
|
|
|
|
else if(G.f & G_FACESELECT)
|
|
|
|
|
gesture();
|
|
|
|
|
else
|
|
|
|
|
sima_sample_color();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
2004-04-01 12:55:12 +00:00
|
|
|
if(G.f & G_FACESELECT)
|
|
|
|
|
mouse_select_sima();
|
|
|
|
|
else if(G.f & (G_VERTEXPAINT|G_TEXTUREPAINT))
|
|
|
|
|
sample_vpaint();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case AKEY:
|
2005-12-01 02:09:21 +00:00
|
|
|
select_swap_tface_uv();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case BKEY:
|
2005-10-20 10:31:02 +00:00
|
|
|
if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
borderselect_sima(UV_SELECT_PINNED);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
borderselect_sima(UV_SELECT_ALL);
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2004-04-05 13:22:55 +00:00
|
|
|
case CKEY:
|
|
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
toggle_uv_select('s');
|
|
|
|
|
else if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
toggle_uv_select('l');
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
toggle_uv_select('o');
|
|
|
|
|
else
|
|
|
|
|
toggle_uv_select('f');
|
|
|
|
|
break;
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
case EKEY :
|
2006-02-05 14:12:45 +00:00
|
|
|
if(okee("Unwrap"))
|
2006-02-08 21:01:00 +00:00
|
|
|
unwrap_lscm(0);
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case GKEY:
|
2005-08-23 18:13:30 +00:00
|
|
|
if((G.qual==0) && is_uv_tface_editing_allowed()) {
|
|
|
|
|
initTransform(TFM_TRANSLATION, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2004-04-01 12:55:12 +00:00
|
|
|
case HKEY:
|
|
|
|
|
if(G.qual==LR_ALTKEY)
|
|
|
|
|
reveal_tface_uv();
|
|
|
|
|
else if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
hide_tface_uv(1);
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
hide_tface_uv(0);
|
|
|
|
|
break;
|
|
|
|
|
case LKEY:
|
2005-04-23 01:36:08 +00:00
|
|
|
if(G.qual==0)
|
|
|
|
|
select_linked_tface_uv(0);
|
|
|
|
|
else if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
select_linked_tface_uv(1);
|
|
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
select_linked_tface_uv(2);
|
2004-04-05 13:22:55 +00:00
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
unlink_selection();
|
|
|
|
|
break;
|
|
|
|
|
case MKEY:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
mirrormenu_tface_uv();
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case NKEY:
|
2003-10-27 23:55:38 +00:00
|
|
|
if(G.qual==LR_CTRLKEY)
|
|
|
|
|
replace_names_but();
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2004-04-01 12:55:12 +00:00
|
|
|
case OKEY:
|
|
|
|
|
if (G.qual==LR_SHIFTKEY) {
|
2005-08-12 15:33:06 +00:00
|
|
|
G.scene->prop_mode = (G.scene->prop_mode+1)%6;
|
|
|
|
|
allqueue(REDRAWHEADERS, 0);
|
2004-04-01 12:55:12 +00:00
|
|
|
}
|
|
|
|
|
else if((G.qual==0)) {
|
2005-05-03 10:54:42 +00:00
|
|
|
G.scene->proportional= !G.scene->proportional;
|
2004-04-01 12:55:12 +00:00
|
|
|
}
|
|
|
|
|
break;
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
case PKEY:
|
Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
right now Images or Render Results. That makes the entire composite tree
only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
what the cropped area should be. Compositing is on Scene level, not local
per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
2006-02-09 11:07:04 +00:00
|
|
|
if(G.f & G_FACESELECT) {
|
|
|
|
|
if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
select_pinned_tface_uv();
|
|
|
|
|
else if(G.qual==LR_ALTKEY)
|
|
|
|
|
pin_tface_uv(0);
|
|
|
|
|
else
|
|
|
|
|
pin_tface_uv(1);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
if(G.qual==LR_SHIFTKEY) {
|
|
|
|
|
toggle_blockhandler(curarea, IMAGE_HANDLER_PREVIEW, 0);
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
}
|
|
|
|
|
}
|
Added LSCM UV Unwrapping:
http://www.loria.fr/~levy/Galleries/LSCM/index.html
http://www.loria.fr/~levy/Papers/2002/s2002_lscm.pdf
Implementation Least Squares Conformal Maps parameterization, based on
chapter 2 of:
Bruno Levy, Sylvain Petitjean, Nicolas Ray, Jerome Maillot. Least Squares
Conformal Maps for Automatic Texture Atlas Generation. In Siggraph 2002,
July 2002.
Seams: Stored as a flag (ME_SEAM) in the new MEdge struct, these seams define
where a mesh will be cut when executing LSCM unwrapping. Seams can be marked
and cleared in Edit Mode. Ctrl+EKEY will pop up a menu allowing to Clear or Mark
the selected edges as seams.
Select Linked in Face Select Mode now only selects linked faces if no seams
separate them. So if seams are defined, this will now select the 'face group'
defined by the seams. Hotkey is still LKEY.
LSCM Unwrap: unwrap UV's by calculating a conformal mapping (preserving local
angles). Based on seams, the selected faces will be 'cut'. If multiple
'face groups' are selected, they will be unwrapped separately and packed in
the image rectangle in the UV Editor. Packing uses a simple and fast
algorithm, only designed to avoid having overlapping faces.
LSCM can be found in the Unwrap menu (UKEY), and the UV Calculation panel.
Pinning: UV's can be pinned in the UV Editor. When LSCM Unwrap is then
executed, these UV's will stay in place, allowing to tweak the solution.
PKEY and ALT+PKEY will respectively pin and unpin selected UV's.
Face Select Mode Drawing Changes:
- Draw Seams option to enable disable drawing of seams
- Draw Faces option to enable drawing of selected faces in transparent purple
- Draw Hidden Edges option to enable drawing of edges of hidden faces
- Draw Edges option to enable drawing of edges of visible faces
The colors for these seams, faces and edges are themeable.
2004-07-13 11:48:52 +00:00
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case RKEY:
|
2005-08-23 18:13:30 +00:00
|
|
|
if((G.qual==0) && is_uv_tface_editing_allowed()) {
|
|
|
|
|
initTransform(TFM_ROTATION, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
|
|
|
|
case SKEY:
|
2005-08-23 18:13:30 +00:00
|
|
|
if((G.qual==0) && is_uv_tface_editing_allowed()) {
|
|
|
|
|
initTransform(TFM_RESIZE, CTX_NONE);
|
|
|
|
|
Transform();
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
break;
|
2004-04-01 12:55:12 +00:00
|
|
|
case VKEY:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
stitch_uv_tface(0);
|
|
|
|
|
else if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
stitch_uv_tface(1);
|
2005-12-01 02:09:21 +00:00
|
|
|
else if(G.qual==LR_CTRLKEY)
|
|
|
|
|
minimize_stretch_tface_uv();
|
2004-04-01 12:55:12 +00:00
|
|
|
break;
|
|
|
|
|
case WKEY:
|
2005-04-23 01:36:08 +00:00
|
|
|
weld_align_menu_tface_uv();
|
2004-04-01 12:55:12 +00:00
|
|
|
break;
|
2005-04-22 20:16:02 +00:00
|
|
|
case PADPERIOD:
|
|
|
|
|
if(G.qual==0)
|
|
|
|
|
image_viewcentre();
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2004-04-19 22:05:37 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-08-05 10:54:00 +00:00
|
|
|
|
|
|
|
|
/* least intrusive nonumpad hack, only for plus/minus */
|
|
|
|
|
if (U.flag & USER_NONUMPAD) {
|
|
|
|
|
event= convert_for_nonumpad(event);
|
|
|
|
|
}
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
/* Events handled always (whether the draw tool is active or not) */
|
|
|
|
|
switch (event) {
|
2004-04-19 22:05:37 +00:00
|
|
|
case UI_BUT_EVENT:
|
|
|
|
|
do_imagebuts(val); // drawimage.c
|
|
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
2005-04-24 11:57:23 +00:00
|
|
|
if((G.qual==LR_CTRLKEY) || ((U.flag & USER_TWOBUTTONMOUSE) && (G.qual==(LR_ALTKEY|LR_CTRLKEY))))
|
|
|
|
|
image_viewmove(1);
|
|
|
|
|
else
|
|
|
|
|
image_viewmove(0);
|
2004-04-19 22:05:37 +00:00
|
|
|
break;
|
2005-04-24 11:57:23 +00:00
|
|
|
case WHEELUPMOUSE: case WHEELDOWNMOUSE: case PADPLUSKEY: case PADMINUS:
|
|
|
|
|
image_viewzoom(event, 0);
|
2004-04-19 22:05:37 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
|
|
|
|
case HOMEKEY:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
image_home();
|
|
|
|
|
break;
|
|
|
|
|
case NKEY:
|
|
|
|
|
if(G.qual==0) {
|
2004-06-19 12:25:28 +00:00
|
|
|
toggle_blockhandler(curarea, IMAGE_HANDLER_PROPERTIES, UI_PNL_TO_MOUSE);
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
2004-04-19 22:05:37 +00:00
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_imagespace(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceImage *sima;
|
|
|
|
|
|
|
|
|
|
sima= MEM_callocN(sizeof(SpaceImage), "initimaspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sima);
|
|
|
|
|
|
|
|
|
|
sima->spacetype= SPACE_IMAGE;
|
|
|
|
|
sima->zoom= 1;
|
2004-04-19 22:05:37 +00:00
|
|
|
sima->blockscale= 0.7;
|
2006-02-05 14:12:45 +00:00
|
|
|
sima->flag = SI_LOCALSTICKY;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: IMASEL ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawimaselspace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadimaselspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* everything to imasel.c */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: OOPS ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawoopsspace(ScrArea *sa, void *spacedata);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void winqreadoopsspace(ScrArea *sa, void *spacedata, BWinEvent *evt)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-03-24 01:46:05 +00:00
|
|
|
unsigned short event= evt->event;
|
|
|
|
|
short val= evt->val;
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceOops *soops= curarea->spacedata.first;
|
|
|
|
|
View2D *v2d= &soops->v2d;
|
|
|
|
|
float dx, dy;
|
|
|
|
|
|
|
|
|
|
if(val==0) return;
|
|
|
|
|
|
2004-10-11 11:54:14 +00:00
|
|
|
if( uiDoBlocks(&sa->uiblocks, event)!=UI_NOTHING ) event= 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-08-05 10:54:00 +00:00
|
|
|
if (U.flag & USER_NONUMPAD) {
|
|
|
|
|
event= convert_for_nonumpad(event);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
2004-10-07 03:04:20 +00:00
|
|
|
/* keep leftmouse select for outliner, regardless of user pref */
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
if(soops->type==SO_OUTLINER) {
|
|
|
|
|
switch(event) {
|
|
|
|
|
case LEFTMOUSE:
|
2004-10-11 11:54:14 +00:00
|
|
|
outliner_mouse_event(sa, event);
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
|
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
|
|
|
|
break;
|
2004-10-10 11:33:19 +00:00
|
|
|
case RIGHTMOUSE:
|
2005-10-03 19:50:05 +00:00
|
|
|
outliner_operation_menu(sa);
|
2004-10-10 11:33:19 +00:00
|
|
|
break;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
|
|
|
|
|
case AKEY:
|
2005-10-03 19:50:05 +00:00
|
|
|
if(G.qual==LR_SHIFTKEY)
|
|
|
|
|
outliner_toggle_selected(sa);
|
|
|
|
|
else
|
|
|
|
|
outliner_toggle_visible(sa);
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
2004-10-10 11:33:19 +00:00
|
|
|
case WKEY:
|
2005-10-03 19:50:05 +00:00
|
|
|
outliner_operation_menu(sa);
|
2004-10-10 11:33:19 +00:00
|
|
|
break;
|
|
|
|
|
|
2004-10-07 21:45:04 +00:00
|
|
|
case HOMEKEY:
|
|
|
|
|
outliner_show_hierarchy(sa);
|
|
|
|
|
break;
|
2004-10-11 11:54:14 +00:00
|
|
|
case PAGEUPKEY:
|
|
|
|
|
outliner_page_up_down(sa, 1);
|
|
|
|
|
break;
|
|
|
|
|
case PAGEDOWNKEY:
|
|
|
|
|
outliner_page_up_down(sa, -1);
|
|
|
|
|
break;
|
2004-10-07 21:45:04 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
case RETKEY:
|
|
|
|
|
case PADENTER:
|
|
|
|
|
outliner_mouse_event(sa, event);
|
|
|
|
|
break;
|
|
|
|
|
case PERIODKEY:
|
|
|
|
|
case PADPERIOD:
|
|
|
|
|
outliner_show_active(sa);
|
|
|
|
|
break;
|
2004-10-08 16:03:43 +00:00
|
|
|
case PADPLUSKEY:
|
|
|
|
|
outliner_one_level(sa, 1);
|
|
|
|
|
break;
|
|
|
|
|
case PADMINUS:
|
|
|
|
|
outliner_one_level(sa, -1);
|
|
|
|
|
break;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
}
|
|
|
|
|
}
|
2004-10-07 03:04:20 +00:00
|
|
|
else {
|
|
|
|
|
/* swap mouse buttons based on user preference */
|
|
|
|
|
if (U.flag & USER_LMOUSESELECT) {
|
2004-11-26 20:20:42 +00:00
|
|
|
if (event==LEFTMOUSE) event = RIGHTMOUSE;
|
|
|
|
|
else if (event==RIGHTMOUSE) event = LEFTMOUSE;
|
2004-10-07 03:04:20 +00:00
|
|
|
}
|
2004-11-26 20:20:42 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
switch(event) {
|
|
|
|
|
case LEFTMOUSE:
|
|
|
|
|
gesture();
|
|
|
|
|
break;
|
|
|
|
|
case MIDDLEMOUSE:
|
|
|
|
|
case WHEELUPMOUSE:
|
|
|
|
|
case WHEELDOWNMOUSE:
|
|
|
|
|
view2dmove(event); /* in drawipo.c */
|
|
|
|
|
break;
|
|
|
|
|
case RIGHTMOUSE:
|
|
|
|
|
mouse_select_oops();
|
|
|
|
|
break;
|
|
|
|
|
case PADPLUSKEY:
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
dx= 0.1154*(v2d->cur.xmax-v2d->cur.xmin);
|
|
|
|
|
dy= 0.1154*(v2d->cur.ymax-v2d->cur.ymin);
|
|
|
|
|
v2d->cur.xmin+= dx;
|
|
|
|
|
v2d->cur.xmax-= dx;
|
|
|
|
|
v2d->cur.ymin+= dy;
|
|
|
|
|
v2d->cur.ymax-= dy;
|
|
|
|
|
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
2003-10-27 23:55:38 +00:00
|
|
|
scrarea_queue_winredraw(curarea);
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case PADMINUS:
|
|
|
|
|
|
|
|
|
|
dx= 0.15*(v2d->cur.xmax-v2d->cur.xmin);
|
|
|
|
|
dy= 0.15*(v2d->cur.ymax-v2d->cur.ymin);
|
|
|
|
|
v2d->cur.xmin-= dx;
|
|
|
|
|
v2d->cur.xmax+= dx;
|
|
|
|
|
v2d->cur.ymin-= dy;
|
|
|
|
|
v2d->cur.ymax+= dy;
|
|
|
|
|
test_view2d(G.v2d, curarea->winx, curarea->winy);
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case HOMEKEY:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
do_oops_buttons(B_OOPSHOME);
|
|
|
|
|
break;
|
2005-12-16 13:50:45 +00:00
|
|
|
|
|
|
|
|
case PADPERIOD:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
do_oops_buttons(B_OOPSVIEWSEL);
|
|
|
|
|
break;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
|
|
|
|
|
case AKEY:
|
|
|
|
|
if((G.qual==0)) {
|
|
|
|
|
swap_select_all_oops();
|
|
|
|
|
scrarea_queue_winredraw(curarea);
|
2004-01-07 12:26:40 +00:00
|
|
|
}
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
|
|
|
|
case BKEY:
|
|
|
|
|
if((G.qual==0))
|
|
|
|
|
borderselect_oops();
|
|
|
|
|
break;
|
|
|
|
|
case GKEY:
|
|
|
|
|
if((G.qual==0))
|
2005-04-30 21:19:19 +00:00
|
|
|
transform_oops('g', 0);
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
|
|
|
|
case LKEY:
|
|
|
|
|
if((G.qual==LR_SHIFTKEY))
|
|
|
|
|
select_backlinked_oops();
|
|
|
|
|
else if((G.qual==0))
|
|
|
|
|
select_linked_oops();
|
|
|
|
|
break;
|
|
|
|
|
case SKEY:
|
|
|
|
|
if((G.qual==LR_ALTKEY)) {
|
|
|
|
|
if (okee("Shrink blocks")) {
|
|
|
|
|
shrink_oops();
|
|
|
|
|
}
|
|
|
|
|
} else if((G.qual==LR_SHIFTKEY)) {
|
|
|
|
|
if (okee("Shuffle blocks")) {
|
|
|
|
|
shuffle_oops();
|
|
|
|
|
}
|
|
|
|
|
} else if((G.qual==0)) {
|
2005-04-30 21:19:19 +00:00
|
|
|
transform_oops('s', 0);
|
2004-01-07 12:26:40 +00:00
|
|
|
}
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
break;
|
|
|
|
|
case PKEY:
|
|
|
|
|
if((G.qual==LR_CTRLKEY)) {
|
|
|
|
|
make_parent();
|
|
|
|
|
} else if((G.qual==LR_ALTKEY)) {
|
|
|
|
|
clear_parent();
|
|
|
|
|
}
|
|
|
|
|
break;
|
2004-06-03 14:26:44 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
case ONEKEY:
|
|
|
|
|
do_layer_buttons(0); break;
|
|
|
|
|
case TWOKEY:
|
|
|
|
|
do_layer_buttons(1); break;
|
|
|
|
|
case THREEKEY:
|
|
|
|
|
do_layer_buttons(2); break;
|
|
|
|
|
case FOURKEY:
|
|
|
|
|
do_layer_buttons(3); break;
|
|
|
|
|
case FIVEKEY:
|
|
|
|
|
do_layer_buttons(4); break;
|
|
|
|
|
case SIXKEY:
|
|
|
|
|
do_layer_buttons(5); break;
|
|
|
|
|
case SEVENKEY:
|
|
|
|
|
do_layer_buttons(6); break;
|
|
|
|
|
case EIGHTKEY:
|
|
|
|
|
do_layer_buttons(7); break;
|
|
|
|
|
case NINEKEY:
|
|
|
|
|
do_layer_buttons(8); break;
|
|
|
|
|
case ZEROKEY:
|
|
|
|
|
do_layer_buttons(9); break;
|
|
|
|
|
case MINUSKEY:
|
|
|
|
|
do_layer_buttons(10); break;
|
|
|
|
|
case EQUALKEY:
|
|
|
|
|
do_layer_buttons(11); break;
|
|
|
|
|
case ACCENTGRAVEKEY:
|
|
|
|
|
do_layer_buttons(-1); break;
|
|
|
|
|
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
void init_v2d_oops(ScrArea *sa, SpaceOops *soops)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
View2D *v2d= &soops->v2d;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
if(soops->type==SO_OUTLINER) {
|
|
|
|
|
/* outliner space is window size */
|
2005-01-31 18:37:54 +00:00
|
|
|
calc_scrollrcts(sa, v2d, sa->winx, sa->winy);
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
|
|
|
|
|
v2d->tot.xmax= 0.0;
|
|
|
|
|
v2d->tot.ymax= 0.0;
|
|
|
|
|
v2d->tot.xmin= -(v2d->mask.xmax-v2d->mask.xmin);
|
|
|
|
|
v2d->tot.ymin= -(v2d->mask.ymax-v2d->mask.ymin);
|
|
|
|
|
|
|
|
|
|
v2d->cur= v2d->tot;
|
|
|
|
|
|
|
|
|
|
v2d->min[0]= v2d->tot.xmin;
|
|
|
|
|
v2d->min[1]= v2d->tot.ymin;
|
|
|
|
|
|
|
|
|
|
v2d->max[0]= v2d->tot.xmax;
|
|
|
|
|
v2d->max[1]= v2d->tot.ymax;
|
|
|
|
|
|
|
|
|
|
v2d->minzoom= 1.0;
|
|
|
|
|
v2d->maxzoom= 1.0;
|
|
|
|
|
|
|
|
|
|
v2d->scroll= L_SCROLL;
|
|
|
|
|
v2d->keepaspect= 1;
|
|
|
|
|
v2d->keepzoom= 1;
|
|
|
|
|
v2d->keeptot= 1;
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
v2d->tot.xmin= -28.0;
|
|
|
|
|
v2d->tot.xmax= 28.0;
|
|
|
|
|
v2d->tot.ymin= -28.0;
|
|
|
|
|
v2d->tot.ymax= 28.0;
|
|
|
|
|
|
|
|
|
|
v2d->cur= v2d->tot;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
v2d->min[0]= 10.0;
|
|
|
|
|
v2d->min[1]= 4.0;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
v2d->max[0]= 320.0;
|
|
|
|
|
v2d->max[1]= 320.0;
|
|
|
|
|
|
|
|
|
|
v2d->minzoom= 0.01f;
|
|
|
|
|
v2d->maxzoom= 2.0;
|
|
|
|
|
|
|
|
|
|
/* v2d->scroll= L_SCROLL+B_SCROLL; */
|
|
|
|
|
v2d->scroll= 0;
|
|
|
|
|
v2d->keepaspect= 1;
|
|
|
|
|
v2d->keepzoom= 0;
|
|
|
|
|
v2d->keeptot= 0;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
static void init_oopsspace(ScrArea *sa, int outliner)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceOops *soops;
|
|
|
|
|
|
|
|
|
|
soops= MEM_callocN(sizeof(SpaceOops), "initoopsspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, soops);
|
|
|
|
|
|
|
|
|
|
soops->visiflag= OOPS_OB+OOPS_MA+OOPS_ME+OOPS_TE+OOPS_CU+OOPS_IP;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
if(outliner) soops->type= SO_OUTLINER;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
soops->spacetype= SPACE_OOPS;
|
2004-11-01 20:50:42 +00:00
|
|
|
soops->type= SO_OUTLINER; // default starts new ones in outliner mode
|
2004-04-19 22:05:37 +00:00
|
|
|
soops->blockscale= 0.7;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
init_v2d_oops(sa, soops);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: NLA ********************** */
|
|
|
|
|
|
|
|
|
|
static void init_nlaspace(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceNla *snla;
|
|
|
|
|
|
|
|
|
|
snla= MEM_callocN(sizeof(SpaceNla), "initnlaspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, snla);
|
|
|
|
|
|
|
|
|
|
snla->spacetype= SPACE_NLA;
|
|
|
|
|
snla->blockscale= 0.7;
|
|
|
|
|
|
|
|
|
|
snla->v2d.tot.xmin= 1.0;
|
|
|
|
|
snla->v2d.tot.ymin= 0.0;
|
|
|
|
|
snla->v2d.tot.xmax= 1000.0;
|
|
|
|
|
snla->v2d.tot.ymax= 1000.0;
|
|
|
|
|
|
|
|
|
|
snla->v2d.cur.xmin= -5.0;
|
|
|
|
|
snla->v2d.cur.ymin= 0.0;
|
|
|
|
|
snla->v2d.cur.xmax= 65.0;
|
|
|
|
|
snla->v2d.cur.ymax= 1000.0;
|
|
|
|
|
|
|
|
|
|
snla->v2d.min[0]= 0.0;
|
|
|
|
|
snla->v2d.min[1]= 0.0;
|
|
|
|
|
|
|
|
|
|
snla->v2d.max[0]= 1000.0;
|
|
|
|
|
snla->v2d.max[1]= 1000.0;
|
|
|
|
|
|
|
|
|
|
snla->v2d.minzoom= 0.1F;
|
|
|
|
|
snla->v2d.maxzoom= 50;
|
|
|
|
|
|
|
|
|
|
snla->v2d.scroll= R_SCROLL+B_SCROLL;
|
|
|
|
|
snla->v2d.keepaspect= 0;
|
|
|
|
|
snla->v2d.keepzoom= V2D_LOCKZOOM_Y;
|
|
|
|
|
snla->v2d.keeptot= 0;
|
|
|
|
|
|
|
|
|
|
snla->lock = 0;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: Text ********************** */
|
|
|
|
|
|
2003-03-24 01:46:05 +00:00
|
|
|
extern void drawtextspace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadtextspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
static void init_textspace(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceText *st;
|
|
|
|
|
|
|
|
|
|
st= MEM_callocN(sizeof(SpaceText), "inittextspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, st);
|
|
|
|
|
|
|
|
|
|
st->spacetype= SPACE_TEXT;
|
|
|
|
|
st->blockscale= 0.7;
|
|
|
|
|
st->text= NULL;
|
|
|
|
|
st->flags= 0;
|
|
|
|
|
|
|
|
|
|
st->font_id= 5;
|
|
|
|
|
st->lheight= 12;
|
|
|
|
|
st->showlinenrs= 0;
|
|
|
|
|
st->tabnumber = 4;
|
|
|
|
|
st->currtab_set = 0;
|
|
|
|
|
|
|
|
|
|
st->top= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-12-14 01:18:09 +00:00
|
|
|
/* ******************** SPACE: Script ********************** */
|
|
|
|
|
|
|
|
|
|
extern void drawscriptspace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadscriptspace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
|
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
static void init_scriptspace(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceScript *sc;
|
|
|
|
|
|
|
|
|
|
sc = MEM_callocN(sizeof(SpaceScript), "initscriptspace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, sc);
|
|
|
|
|
|
|
|
|
|
sc->spacetype = SPACE_SCRIPT;
|
|
|
|
|
sc->blockscale= 0.7;
|
|
|
|
|
sc->script = NULL;
|
|
|
|
|
sc->flags = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/* ******************** SPACE: Time ********************** */
|
|
|
|
|
|
|
|
|
|
extern void drawtimespace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadtimespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
|
|
|
|
|
|
|
|
|
static void init_timespace(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceTime *stime;
|
|
|
|
|
|
|
|
|
|
stime= MEM_callocN(sizeof(SpaceTime), "init timespace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, stime);
|
|
|
|
|
|
|
|
|
|
stime->spacetype= SPACE_TIME;
|
|
|
|
|
stime->blockscale= 0.7;
|
2005-05-11 20:01:42 +00:00
|
|
|
stime->redraws= TIME_ALL_3D_WIN|TIME_ALL_ANIM_WIN;
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
|
|
|
|
|
stime->v2d.tot.xmin= -4.0;
|
|
|
|
|
stime->v2d.tot.ymin= 0.0;
|
2005-05-11 20:01:42 +00:00
|
|
|
stime->v2d.tot.xmax= (float)EFRA + 4.0;
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
stime->v2d.tot.ymax= (float)sa->winy;
|
|
|
|
|
|
2005-05-11 20:01:42 +00:00
|
|
|
stime->v2d.cur= stime->v2d.tot;
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
|
|
|
|
|
stime->v2d.min[0]= 1.0;
|
|
|
|
|
stime->v2d.min[1]= (float)sa->winy;
|
|
|
|
|
|
|
|
|
|
stime->v2d.max[0]= 32000.0;
|
|
|
|
|
stime->v2d.max[1]= (float)sa->winy;
|
|
|
|
|
|
|
|
|
|
stime->v2d.minzoom= 0.1f;
|
|
|
|
|
stime->v2d.maxzoom= 10.0;
|
|
|
|
|
|
|
|
|
|
stime->v2d.scroll= 0;
|
|
|
|
|
stime->v2d.keepaspect= 0;
|
|
|
|
|
stime->v2d.keepzoom= 0;
|
|
|
|
|
stime->v2d.keeptot= 0;
|
|
|
|
|
|
2005-05-12 12:33:43 +00:00
|
|
|
stime->flag |= TIME_DRAWFRAMES;
|
|
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
}
|
|
|
|
|
|
2005-12-18 13:46:01 +00:00
|
|
|
/* ******************** SPACE: Time ********************** */
|
|
|
|
|
|
|
|
|
|
extern void drawnodespace(ScrArea *sa, void *spacedata);
|
|
|
|
|
extern void winqreadnodespace(struct ScrArea *sa, void *spacedata, struct BWinEvent *evt);
|
|
|
|
|
|
|
|
|
|
static void init_nodespace(ScrArea *sa)
|
|
|
|
|
{
|
|
|
|
|
SpaceNode *snode;
|
|
|
|
|
|
|
|
|
|
snode= MEM_callocN(sizeof(SpaceNode), "init nodespace");
|
|
|
|
|
BLI_addhead(&sa->spacedata, snode);
|
|
|
|
|
|
|
|
|
|
snode->spacetype= SPACE_NODE;
|
|
|
|
|
snode->blockscale= 0.7;
|
|
|
|
|
|
|
|
|
|
snode->v2d.tot.xmin= -10.0;
|
|
|
|
|
snode->v2d.tot.ymin= -10.0;
|
|
|
|
|
snode->v2d.tot.xmax= (float)sa->winx + 10.0f;
|
|
|
|
|
snode->v2d.tot.ymax= (float)sa->winy + 10.0f;
|
|
|
|
|
|
|
|
|
|
snode->v2d.cur.xmin= 0.0;
|
|
|
|
|
snode->v2d.cur.ymin= 0.0;
|
|
|
|
|
snode->v2d.cur.xmax= (float)sa->winx;
|
|
|
|
|
snode->v2d.cur.ymax= (float)sa->winy;
|
|
|
|
|
|
|
|
|
|
snode->v2d.min[0]= 1.0;
|
|
|
|
|
snode->v2d.min[1]= 1.0;
|
|
|
|
|
|
|
|
|
|
snode->v2d.max[0]= 32000.0f;
|
|
|
|
|
snode->v2d.max[1]= 32000.0f;
|
|
|
|
|
|
|
|
|
|
snode->v2d.minzoom= 0.5f;
|
|
|
|
|
snode->v2d.maxzoom= 1.21f;
|
|
|
|
|
|
|
|
|
|
snode->v2d.scroll= 0;
|
|
|
|
|
snode->v2d.keepaspect= 1;
|
|
|
|
|
snode->v2d.keepzoom= 1;
|
|
|
|
|
snode->v2d.keeptot= 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
|
|
|
|
|
/* ******************** SPACE: GENERAL ********************** */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
void newspace(ScrArea *sa, int type)
|
|
|
|
|
{
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
int xtra= type & 256; // hack to enforce outliner with hotkey from toets.c
|
|
|
|
|
|
|
|
|
|
type &= ~256;
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(type>=0) {
|
|
|
|
|
if(sa->spacetype != type) {
|
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
|
|
|
|
sa->spacetype= type;
|
|
|
|
|
sa->headbutofs= 0;
|
|
|
|
|
|
|
|
|
|
uiFreeBlocks(&sa->uiblocks);
|
|
|
|
|
wich_cursor(sa);
|
|
|
|
|
|
|
|
|
|
if (sa->headwin) addqueue(sa->headwin, CHANGED, 1);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
|
|
|
|
|
addqueue(sa->win, CHANGED, 1);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
|
|
|
|
|
areawinset(sa->win);
|
|
|
|
|
|
|
|
|
|
bwin_clear_viewmat(sa->win);
|
|
|
|
|
|
|
|
|
|
for (sl= sa->spacedata.first; sl; sl= sl->next)
|
|
|
|
|
if(sl->spacetype==type)
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
if (sl) {
|
|
|
|
|
BLI_remlink(&sa->spacedata, sl);
|
|
|
|
|
BLI_addhead(&sa->spacedata, sl);
|
|
|
|
|
} else {
|
|
|
|
|
if(type==SPACE_VIEW3D)
|
|
|
|
|
initview3d(sa);
|
|
|
|
|
else if(type==SPACE_IPO)
|
|
|
|
|
initipo(sa);
|
|
|
|
|
else if(type==SPACE_INFO)
|
|
|
|
|
init_infospace(sa);
|
|
|
|
|
else if(type==SPACE_BUTS)
|
|
|
|
|
init_butspace(sa);
|
|
|
|
|
else if(type==SPACE_FILE)
|
|
|
|
|
init_filespace(sa);
|
|
|
|
|
else if(type==SPACE_SEQ)
|
|
|
|
|
init_seqspace(sa);
|
|
|
|
|
else if(type==SPACE_IMAGE)
|
|
|
|
|
init_imagespace(sa);
|
|
|
|
|
else if(type==SPACE_IMASEL)
|
|
|
|
|
init_imaselspace(sa);
|
|
|
|
|
else if(type==SPACE_OOPS)
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
init_oopsspace(sa, xtra);
|
2002-10-12 11:37:38 +00:00
|
|
|
else if(type==SPACE_ACTION)
|
|
|
|
|
init_actionspace(sa);
|
|
|
|
|
else if(type==SPACE_TEXT)
|
|
|
|
|
init_textspace(sa);
|
2003-12-14 01:18:09 +00:00
|
|
|
else if(type==SPACE_SCRIPT)
|
|
|
|
|
init_scriptspace(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
else if(type==SPACE_SOUND)
|
|
|
|
|
init_soundspace(sa);
|
|
|
|
|
else if(type==SPACE_NLA)
|
|
|
|
|
init_nlaspace(sa);
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
else if(type==SPACE_TIME)
|
|
|
|
|
init_timespace(sa);
|
2005-12-18 13:46:01 +00:00
|
|
|
else if(type==SPACE_NODE)
|
|
|
|
|
init_nodespace(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sl= sa->spacedata.first;
|
|
|
|
|
sl->area= sa;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* exception: filespace */
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
if(sa->spacetype==SPACE_FILE) {
|
|
|
|
|
SpaceFile *sfile= sa->spacedata.first;
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
if(sfile->type==FILE_MAIN) {
|
|
|
|
|
freefilelist(sfile);
|
|
|
|
|
} else {
|
|
|
|
|
sfile->type= FILE_UNIX;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sfile->returnfunc= 0;
|
|
|
|
|
sfile->title[0]= 0;
|
|
|
|
|
if(sfile->filelist) test_flags_file(sfile);
|
|
|
|
|
}
|
2003-04-30 13:22:26 +00:00
|
|
|
/* exception: imasel space */
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
else if(sa->spacetype==SPACE_IMASEL) {
|
|
|
|
|
SpaceImaSel *simasel= sa->spacedata.first;
|
2002-10-12 11:37:38 +00:00
|
|
|
simasel->returnfunc= 0;
|
|
|
|
|
simasel->title[0]= 0;
|
|
|
|
|
}
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
else if(sa->spacetype==SPACE_OOPS) {
|
|
|
|
|
SpaceOops *so= sa->spacedata.first;
|
|
|
|
|
if(xtra && so->type!=SO_OUTLINER) {
|
|
|
|
|
so->type= SO_OUTLINER;
|
|
|
|
|
init_v2d_oops(sa, so);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
void freespacelist(ScrArea *sa)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
for (sl= sa->spacedata.first; sl; sl= sl->next) {
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sl->spacetype==SPACE_FILE) {
|
|
|
|
|
SpaceFile *sfile= (SpaceFile*) sl;
|
|
|
|
|
if(sfile->libfiledata)
|
|
|
|
|
BLO_blendhandle_close(sfile->libfiledata);
|
2005-04-17 15:50:52 +00:00
|
|
|
if(sfile->filelist)
|
|
|
|
|
freefilelist(sfile);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_BUTS) {
|
|
|
|
|
SpaceButs *buts= (SpaceButs*) sl;
|
2005-12-21 22:21:43 +00:00
|
|
|
if(buts->ri) {
|
|
|
|
|
if (buts->ri->rect) MEM_freeN(buts->ri->rect);
|
|
|
|
|
MEM_freeN(buts->ri);
|
|
|
|
|
}
|
2005-08-20 19:18:35 +00:00
|
|
|
if(G.buts==buts) G.buts= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_IPO) {
|
|
|
|
|
SpaceIpo *si= (SpaceIpo*) sl;
|
|
|
|
|
if(si->editipo) MEM_freeN(si->editipo);
|
|
|
|
|
free_ipokey(&si->ipokey);
|
2005-08-20 19:18:35 +00:00
|
|
|
if(G.sipo==si) G.sipo= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
View3D *vd= (View3D*) sl;
|
|
|
|
|
if(vd->bgpic) {
|
|
|
|
|
if(vd->bgpic->rect) MEM_freeN(vd->bgpic->rect);
|
|
|
|
|
if(vd->bgpic->ima) vd->bgpic->ima->id.us--;
|
|
|
|
|
MEM_freeN(vd->bgpic);
|
|
|
|
|
}
|
|
|
|
|
if(vd->localvd) MEM_freeN(vd->localvd);
|
2005-08-20 19:18:35 +00:00
|
|
|
if(vd->clipbb) MEM_freeN(vd->clipbb);
|
|
|
|
|
if(G.vd==vd) G.vd= NULL;
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
if(vd->ri) {
|
New:
- ZTransp render now also delivers Z values and Speed vectors in passes
Note that speed vectors accumulate within a pixel to store the minimum,
so rendering ztransp on top of a non-moving plane won't give speed...
Best results you get is by rendering it in a separate layer.
The Z value stored is the closest visible transparent face in the pixel.
Fixes:
- Render to 'spare page' has been enabled again. Because of the strict
separation of Render and UI, but especially because a 'render result' now
can consist of unlimited images, I've not made this a Render feature.
Instead, the render-window itself stores the 'spare' image... I also
had to change the convention for it a bit.
Now, instead of having two "render buffers" (which was a render feature),
the RenderWindow will store each previous frame on a re-render. This
storing will only start after you've pressed 'Jkey' once, but then always
will happen for as long the rendered image is same size as previously.
For clarity, I've also renamed the window title, to 'previous frame'.
- RenderWindow shows alpha again on Akey
- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
closest, and the color range goes from camera clip-sta to clip-end.
- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
not always freed correctly, potentially causing crashes or memory leaks.
2006-02-08 16:51:09 +00:00
|
|
|
BIF_view3d_previewrender_free(vd);
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_OOPS) {
|
|
|
|
|
free_oopspace((SpaceOops *)sl);
|
|
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_IMASEL) {
|
|
|
|
|
free_imasel((SpaceImaSel *)sl);
|
|
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_ACTION) {
|
|
|
|
|
free_actionspace((SpaceAction*)sl);
|
|
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_NLA){
|
|
|
|
|
/* free_nlaspace((SpaceNla*)sl); */
|
|
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_TEXT) {
|
|
|
|
|
free_textspace((SpaceText *)sl);
|
|
|
|
|
}
|
2003-12-14 01:18:09 +00:00
|
|
|
else if(sl->spacetype==SPACE_SCRIPT) {
|
|
|
|
|
free_scriptspace((SpaceScript *)sl);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
else if(sl->spacetype==SPACE_SOUND) {
|
|
|
|
|
free_soundspace((SpaceSound *)sl);
|
|
|
|
|
}
|
2006-01-09 23:52:51 +00:00
|
|
|
else if(sl->spacetype==SPACE_IMAGE) {
|
|
|
|
|
SpaceImage *sima= (SpaceImage *)sl;
|
|
|
|
|
if(sima->cumap)
|
|
|
|
|
curvemapping_free(sima->cumap);
|
|
|
|
|
}
|
2005-12-18 13:46:01 +00:00
|
|
|
else if(sl->spacetype==SPACE_NODE) {
|
Christmas coding work!
********* Node editor work:
- To enable Nodes for Materials, you have to set the "Use Nodes"
button, in the new Material buttons "Nodes" Panel or in header
of the Node editor. Doing this will disable Material-Layers.
- Nodes now execute materials ("shaders"), but still only using the
previewrender code.
- Nodes have (optional) previews for rendered images.
- Node headers allow to hide buttons and/or preview image
- Nodes can be dragged larger/smaller (right-bottom corner)
- Nodes can be hidden (minimized) with hotkey H
- CTRL+click on an Input Socket gives a popup with default values.
- Changing Material/Texture or Mix node will adjust Node title.
- Click-drag outside of a Node changes cursor to "Knife' and allows to
draw a rect where to cut Links.
- Added new node types RGBtoBW, Texture, In/Output, ColorRamp
- Material Nodes have options to ouput diffuse or specular, or to use
a negative normal. The input socket 'Normal' will force the material
to use that normal, otherwise it uses the normal from the Material
that has the node tree.
- When drawing a link between two not-matching sockets, Blender inserts
a converting node (now only for value/rgb combos)
- When drawing a link to an input socket that's already in use, the
old link will either disappear or flip to another unused socket.
- A click on a Material Node will activate it, and show all its settings
in the Material Buttons. Active Material Nodes draw the material icon
in red.
- A click on any node will show its options in the Node Panel in the
Material buttons.
- Multiple Output Nodes can be used, to sample contents of a tree, but
only one Output is the real one, which is indicated in a different
color and red material icon.
- Added ThemeColors for node types
- ALT+C will convert existing Material-Layers to Node... this currently
only adds the material/mix nodes and connects them. Dunno if this is
worth a lot of coding work to make perfect?
- Press C to call another "Solve order", which will show all possible
cyclic conflicts (if there are).
- Technical: nodes now use "Type" structs which define the
structure of nodes and in/output sockets. The Type structs store all
fixed info, callbacks, and allow to reconstruct saved Nodes to match
what is required by Blender.
- Defining (new) nodes now is as simple as filling in a fixed
Type struct, plus code some callbacks. A doc will be made!
- Node preview images are by default float
********* Icon drawing:
- Cleanup of how old icons were implemented in new system, making
them 16x16 too, correctly centered *and* scaled.
- Made drawing Icons use float coordinates
- Moved BIF_calcpreview_image() into interface_icons.c, renamed it
icon_from_image(). Removed a lot of unneeded Imbuf magic here! :)
- Skipped scaling and imbuf copying when icons are OK size
********* Preview render:
- Huge cleanup of code....
- renaming BIF_xxx calls that only were used internally
- BIF_previewrender() now accepts an argument for rendering method,
so it supports icons, buttonwindow previewrender and node editor
- Only a single BIF_preview_changed() call now exists, supporting all
signals as needed for buttos and node editor
********* More stuff:
- glutil.c, glaDrawPixelsSafe() and glaDrawPixelsTex() now accept format
argument for GL_FLOAT rects
- Made the ColorBand become a built-in button for interface.c
Was a load of cleanup work in buttons_shading.c...
- removed a load of unneeded glBlendFunc() calls
- Fixed bug in calculating text length for buttons (ancient!)
2005-12-28 15:42:51 +00:00
|
|
|
/* SpaceNode *snode= (SpaceNode *)sl; */
|
2005-12-18 13:46:01 +00:00
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
Giant commit!
A full detailed description of this will be done later... is several days
of work. Here's a summary:
Render:
- Full cleanup of render code, removing *all* globals and bad level calls
all over blender. Render module is now not called abusive anymore
- API-fied calls to rendering
- Full recode of internal render pipeline. Is now rendering tiles by
default, prepared for much smarter 'bucket' render later.
- Each thread now can render a full part
- Renders were tested with 4 threads, goes fine, apart from some lookup
tables in softshadow and AO still
- Rendering is prepared to do multiple layers and passes
- No single 32 bits trick in render code anymore, all 100% floats now.
Writing images/movies
- moved writing images to blender kernel (bye bye 'schrijfplaatje'!)
- made a new Movie handle system, also in kernel. This will enable much
easier use of movies in Blender
PreviewRender:
- Using new render API, previewrender (in buttons) now uses regular render
code to generate images.
- new datafile 'preview.blend.c' has the preview scenes in it
- previews get rendered in exact displayed size (1 pixel = 1 pixel)
3D Preview render
- new; press Pkey in 3d window, for a panel that continuously renders
(pkey is for games, i know... but we dont do that in orange now!)
- this render works nearly identical to buttons-preview render, so it stops
rendering on any event (mouse, keyboard, etc)
- on moving/scaling the panel, the render code doesn't recreate all geometry
- same for shifting/panning view
- all other operations (now) regenerate the full render database still.
- this is WIP... but big fun, especially for simple scenes!
Compositor
- Using same node system as now in use for shaders, you can composit images
- works pretty straightforward... needs much more options/tools and integration
with rendering still
- is not threaded yet, nor is so smart to only recalculate changes... will be
done soon!
- the "Render Result" node will get all layers/passes as output sockets
- The "Output" node renders to a builtin image, which you can view in the Image
window. (yes, output nodes to render-result, and to files, is on the list!)
The Bad News
- "Unified Render" is removed. It might come back in some stage, but this
system should be built from scratch. I can't really understand this code...
I expect it is not much needed, especially with advanced layer/passes
control
- Panorama render, Field render, Motion blur, is not coded yet... (I had to
recode every single feature in render, so...!)
- Lens Flare is also not back... needs total revision, might become composit
effect though (using zbuffer for visibility)
- Part render is gone! (well, thats obvious, its default now).
- The render window is only restored with limited functionality... I am going
to check first the option to render to a Image window, so Blender can become
a true single-window application. :)
For example, the 'Spare render buffer' (jkey) doesnt work.
- Render with border, now default creates a smaller image
- No zbuffers are written yet... on the todo!
- Scons files and MSVC will need work to get compiling again
OK... thats what I can quickly recall. Now go compiling!
2006-01-23 22:05:47 +00:00
|
|
|
BLI_freelistN(&sa->spacedata);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void duplicatespacelist(ScrArea *newarea, ListBase *lb1, ListBase *lb2)
|
|
|
|
|
{
|
|
|
|
|
SpaceLink *sl;
|
|
|
|
|
|
|
|
|
|
duplicatelist(lb1, lb2);
|
|
|
|
|
|
New:
- ZTransp render now also delivers Z values and Speed vectors in passes
Note that speed vectors accumulate within a pixel to store the minimum,
so rendering ztransp on top of a non-moving plane won't give speed...
Best results you get is by rendering it in a separate layer.
The Z value stored is the closest visible transparent face in the pixel.
Fixes:
- Render to 'spare page' has been enabled again. Because of the strict
separation of Render and UI, but especially because a 'render result' now
can consist of unlimited images, I've not made this a Render feature.
Instead, the render-window itself stores the 'spare' image... I also
had to change the convention for it a bit.
Now, instead of having two "render buffers" (which was a render feature),
the RenderWindow will store each previous frame on a re-render. This
storing will only start after you've pressed 'Jkey' once, but then always
will happen for as long the rendered image is same size as previously.
For clarity, I've also renamed the window title, to 'previous frame'.
- RenderWindow shows alpha again on Akey
- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
closest, and the color range goes from camera clip-sta to clip-end.
- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
not always freed correctly, potentially causing crashes or memory leaks.
2006-02-08 16:51:09 +00:00
|
|
|
/* lb1 is copy from lb2, from lb2 we free stuff, rely on event system to properly re-alloc */
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sl= lb2->first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
if(sl->spacetype==SPACE_FILE) {
|
|
|
|
|
SpaceFile *sfile= (SpaceFile*) sl;
|
|
|
|
|
sfile->libfiledata= 0;
|
|
|
|
|
sfile->filelist= 0;
|
|
|
|
|
}
|
New:
- ZTransp render now also delivers Z values and Speed vectors in passes
Note that speed vectors accumulate within a pixel to store the minimum,
so rendering ztransp on top of a non-moving plane won't give speed...
Best results you get is by rendering it in a separate layer.
The Z value stored is the closest visible transparent face in the pixel.
Fixes:
- Render to 'spare page' has been enabled again. Because of the strict
separation of Render and UI, but especially because a 'render result' now
can consist of unlimited images, I've not made this a Render feature.
Instead, the render-window itself stores the 'spare' image... I also
had to change the convention for it a bit.
Now, instead of having two "render buffers" (which was a render feature),
the RenderWindow will store each previous frame on a re-render. This
storing will only start after you've pressed 'Jkey' once, but then always
will happen for as long the rendered image is same size as previously.
For clarity, I've also renamed the window title, to 'previous frame'.
- RenderWindow shows alpha again on Akey
- Display of the Zvalues in ImageWindow has been tweaked. White now denotes
closest, and the color range goes from camera clip-sta to clip-end.
- Bugfix: on splitting/merging/duplicating windows, the 3D Previewrender was
not always freed correctly, potentially causing crashes or memory leaks.
2006-02-08 16:51:09 +00:00
|
|
|
else if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
BIF_view3d_previewrender_free((View3D *)sl);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
else if(sl->spacetype==SPACE_OOPS) {
|
|
|
|
|
SpaceOops *so= (SpaceOops *)sl;
|
Version 1.0 of the new Outliner
The outliner is a hierarchical diagram displaying a list of data in Blender
and its dependencies. The 'databrowse' doesn't really show it, and Oops is
too chaotic still. And most of all, the former two don't offer much tools.
After discussions on irc, Matt came with this design proposal;
http://mke3.net/blender/interface/layout/outliner/
Which is closely followed for the implementation.
The current version only shows all 'library data' in Blender (objects,
meshes, ipos, etc) and not the 'direct data' such as vertex groups or NLA.
I decided to make it inside the Oopw window, as an option. You can find the
option in the "View" pulldown, or directly invoke it with ALT+SHIFT+F9
Here's a quick overview of the Outliner GUI:
- Header pulldown has options what it can show (Visible = in current layers)
- click on triangle arrow to open/close
- press AKEY to open/close all
- Leftmouse click on an item activates; and does based on type a couple of
extra things:
- activates a scene
- selects/activates the Object
- enters editmode (if clicked on Mesh, Curve, etc)
- shows the appropriate Shading buttons (Lamp, Material, Texture)
- sets the IpoWindow to the current IPO
- activates the Ipo-channel in an Action
- Selected and Active objects are drawn in its Theme selection color
- SHIFT+click on Object does extend-select
- Press DOTkey to get the current active data in center of view
TODO;
- rightmouse selection; for indicating operations like delete or duplicate
- showing more data types
- icon (re)design...
- lotsof options as described in Matts paper still...
2004-10-06 18:55:00 +00:00
|
|
|
so->oops.first= so->oops.last= NULL;
|
|
|
|
|
so->tree.first= so->tree.last= NULL;
|
|
|
|
|
so->treestore= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_IMASEL) {
|
|
|
|
|
check_imasel_copy((SpaceImaSel *) sl);
|
|
|
|
|
}
|
2005-12-18 13:46:01 +00:00
|
|
|
else if(sl->spacetype==SPACE_NODE) {
|
|
|
|
|
SpaceNode *snode= (SpaceNode *)sl;
|
|
|
|
|
snode->nodetree= NULL;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sl= lb1->first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
sl->area= newarea;
|
|
|
|
|
|
|
|
|
|
if(sl->spacetype==SPACE_BUTS) {
|
|
|
|
|
SpaceButs *buts= (SpaceButs *)sl;
|
2005-12-21 22:21:43 +00:00
|
|
|
buts->ri= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_IPO) {
|
|
|
|
|
SpaceIpo *si= (SpaceIpo *)sl;
|
2005-08-20 19:18:35 +00:00
|
|
|
si->editipo= NULL;
|
|
|
|
|
si->ipokey.first= si->ipokey.last= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
else if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
View3D *vd= (View3D *)sl;
|
|
|
|
|
if(vd->bgpic) {
|
|
|
|
|
vd->bgpic= MEM_dupallocN(vd->bgpic);
|
2005-08-20 19:18:35 +00:00
|
|
|
vd->bgpic->rect= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
if(vd->bgpic->ima) vd->bgpic->ima->id.us++;
|
|
|
|
|
}
|
2005-08-20 19:18:35 +00:00
|
|
|
vd->clipbb= MEM_dupallocN(vd->clipbb);
|
2006-01-23 22:59:22 +00:00
|
|
|
vd->ri= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
2006-01-09 23:52:51 +00:00
|
|
|
else if(sl->spacetype==SPACE_IMAGE) {
|
|
|
|
|
SpaceImage *sima= (SpaceImage *)sl;
|
|
|
|
|
if(sima->cumap)
|
|
|
|
|
sima->cumap= curvemapping_copy(sima->cumap);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* again: from old View3D restore localview (because full) */
|
2002-10-12 11:37:38 +00:00
|
|
|
sl= lb2->first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
if(sl->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
View3D *v3d= (View3D*) sl;
|
|
|
|
|
if(v3d->localvd) {
|
|
|
|
|
restore_localviewdata(v3d);
|
2005-08-20 19:18:35 +00:00
|
|
|
v3d->localvd= NULL;
|
2002-10-12 11:37:38 +00:00
|
|
|
v3d->localview= 0;
|
|
|
|
|
v3d->lay &= 0xFFFFFF;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2003-04-30 13:22:26 +00:00
|
|
|
/* is called everywhere in blender */
|
2002-10-12 11:37:38 +00:00
|
|
|
void allqueue(unsigned short event, short val)
|
|
|
|
|
{
|
|
|
|
|
ScrArea *sa;
|
|
|
|
|
View3D *v3d;
|
|
|
|
|
SpaceButs *buts;
|
|
|
|
|
SpaceFile *sfile;
|
|
|
|
|
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
Result of 2 weeks of quiet coding work in Greece :)
Aim was to get a total refresh of the animation system. This
is needed because;
- we need to upgrade it with 21st century features
- current code is spaghetti/hack combo, and hides good design
- it should become lag-free with using dependency graphs
A full log, with complete code API/structure/design explanation
will follow, that's a load of work... so here below the list with
hot changes;
- The entire object update system (matrices, geometry) is now
centralized. Calls to where_is_object and makeDispList are
forbidden, instead we tag objects 'changed' and let the
depgraph code sort it out
- Removed all old "Ika" code
- Depgraph is aware of all relationships, including meta balls,
constraints, bevelcurve, and so on.
- Made depgraph aware of relation types and layers, to do smart
flushing of 'changed' events. Nothing gets calculated too often!
- Transform uses depgraph to detect changes
- On frame-advance, depgraph flushes animated changes
Armatures;
Almost all armature related code has been fully built from scratch.
It now reveils the original design much better, with a very clean
implementation, lag free without even calculating each Bone more than
once. Result is quite a speedup yes!
Important to note is;
1) Armature is data containing the 'rest position'
2) Pose is the changes of rest position, and always on object level.
That way more Objects can use same Pose. Also constraints are in Pose
3) Actions only contain the Ipos to change values in Poses.
- Bones draw unrotated now
- Drawing bones speedup enormously (10-20 times)
- Bone selecting in EditMode, selection state is saved for PoseMode,
and vice-versa
- Undo in editmode
- Bone renaming does vertexgroups, constraints, posechannels, actions,
for all users of Armature in entire file
- Added Bone renaming in NKey panel
- Nkey PoseMode shows eulers now
- EditMode and PoseMode now have 'active' bone too (last clicked)
- Parenting in EditMode' CTRL+P, ALT+P, with nice options!
- Pose is added in Outliner now, with showing that constraints are in
the Pose, not Armature
- Disconnected IK solving from constraints. It's a separate phase now,
on top of the full Pose calculations
- Pose itself has a dependency graph too, so evaluation order is lag free.
TODO NOW;
- Rotating in Posemode has incorrect inverse transform (Martin will fix)
- Python Bone/Armature/Pose API disabled... needs full recode too
(wait for my doc!)
- Game engine will need upgrade too
- Depgraph code needs revision, cleanup, can be much faster!
(But, compliments for Jean-Luc, it works like a charm!)
- IK changed, it now doesnt use previous position to advance to next
position anymore. That system looks nice (no flips) but is not well
suited for NLA and background render.
TODO LATER;
We now can do loadsa new nifty features as well; like:
- Kill PoseMode (can be option for armatures itself)
- Make B-Bones (Bezier, Bspline, like for spines)
- Move all silly button level edit to 3d window (like CTRL+I = add
IK)
- Much better & informative drawing
- Fix action/nla editors
- Put all ipos in Actions (object, mesh key, lamp color)
- Add hooks
- Null bones
- Much more advanced constraints...
Bugfixes;
- OGL render (view3d header) had wrong first frame on anim render
- Ipo 'recording' mode had wrong playback speed
- Vertex-key mode now sticks to show 'active key', until frame change
-Ton-
2005-07-03 17:35:38 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
if(event==REDRAWALL) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
else if(sa->win != val) {
|
|
|
|
|
switch(event) {
|
|
|
|
|
|
|
|
|
|
case REDRAWHEADERS:
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWVIEW3D:
|
|
|
|
|
if(sa->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
if(val) scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWVIEW3D_Z:
|
|
|
|
|
if(sa->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
v3d= sa->spacedata.first;
|
|
|
|
|
if(v3d->drawtype==OB_SOLID) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
if(val) scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWVIEWCAM:
|
|
|
|
|
if(sa->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
v3d= sa->spacedata.first;
|
|
|
|
|
if(v3d->persp>1) scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWINFO:
|
|
|
|
|
if(sa->spacetype==SPACE_INFO) {
|
2004-10-03 13:49:54 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWIMAGE:
|
|
|
|
|
if(sa->spacetype==SPACE_IMAGE) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWIPO:
|
|
|
|
|
if(sa->spacetype==SPACE_IPO) {
|
|
|
|
|
SpaceIpo *si;
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
if(val) {
|
|
|
|
|
si= sa->spacedata.first;
|
2005-10-10 17:42:48 +00:00
|
|
|
if (si->pin==0)
|
2002-10-12 11:37:38 +00:00
|
|
|
si->blocktype= val;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(sa->spacetype==SPACE_OOPS) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case REDRAWBUTSALL:
|
|
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts= sa->spacedata.first;
|
|
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWBUTSHEAD:
|
|
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-10-07 18:24:02 +00:00
|
|
|
case REDRAWBUTSSCENE:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_SCENE) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-10-07 18:24:02 +00:00
|
|
|
case REDRAWBUTSOBJECT:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_OBJECT) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-10-07 18:24:02 +00:00
|
|
|
case REDRAWBUTSSHADING:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_SHADING) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWBUTSEDIT:
|
|
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_EDITING) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWBUTSSCRIPT:
|
|
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_SCRIPT) {
|
Another huge commit!!!
First, check on the new files, which are listed below.
The new butspace.h is a local include, only to be used for the buttons
drawn in the buttonswindow.
- editbuts, animbuts, gamebuts, displaybuts, paintbuts, work now
- i quite completely reorganized it, it's now nicely telling you what
context it is in
- sorting error in panel align fixed (tabs were flipping)
- align works correctly automatic when you click around in Blender
- editsca.c renamed to buttons_logic.h
- button names are truncated from the right for allmost all buttons
(except text buttons and number buttons)
- while dragging panels, you cannot move them outside window anymore
And of course fixed loads of little bugs I encountered while testing
it all. This is a version I really need good test & feedback for.
Next step: restoring material/lamp/texture/world
2003-10-10 17:29:01 +00:00
|
|
|
buts->re_align= 1;
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-10-07 18:24:02 +00:00
|
|
|
case REDRAWBUTSLOGIC:
|
2002-10-12 11:37:38 +00:00
|
|
|
if(sa->spacetype==SPACE_BUTS) {
|
|
|
|
|
buts= sa->spacedata.first;
|
2003-10-07 18:24:02 +00:00
|
|
|
if(buts->mainb==CONTEXT_LOGIC) {
|
2002-10-12 11:37:38 +00:00
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-10-07 18:24:02 +00:00
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
case REDRAWDATASELECT:
|
|
|
|
|
if(sa->spacetype==SPACE_FILE) {
|
|
|
|
|
sfile= sa->spacedata.first;
|
|
|
|
|
if(sfile->type==FILE_MAIN) {
|
|
|
|
|
freefilelist(sfile);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
else if(sa->spacetype==SPACE_OOPS) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWSEQ:
|
|
|
|
|
if(sa->spacetype==SPACE_SEQ) {
|
|
|
|
|
addqueue(sa->win, CHANGED, 1);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWOOPS:
|
|
|
|
|
if(sa->spacetype==SPACE_OOPS) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWNLA:
|
|
|
|
|
if(sa->spacetype==SPACE_NLA) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
case REDRAWACTION:
|
|
|
|
|
if(sa->spacetype==SPACE_ACTION) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case REDRAWTEXT:
|
|
|
|
|
if(sa->spacetype==SPACE_TEXT) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2003-12-14 01:18:09 +00:00
|
|
|
case REDRAWSCRIPT:
|
|
|
|
|
if (sa->spacetype==SPACE_SCRIPT) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2002-10-12 11:37:38 +00:00
|
|
|
case REDRAWSOUND:
|
|
|
|
|
if(sa->spacetype==SPACE_SOUND) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
case REDRAWTIME:
|
|
|
|
|
if(sa->spacetype==SPACE_TIME) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2005-12-18 13:46:01 +00:00
|
|
|
case REDRAWNODE:
|
|
|
|
|
if(sa->spacetype==SPACE_NODE) {
|
|
|
|
|
scrarea_queue_headredraw(sa);
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2006-02-19 14:55:16 +00:00
|
|
|
case RECALC_COMPOSITE:
|
|
|
|
|
if(sa->spacetype==SPACE_NODE) {
|
|
|
|
|
addqueue(sa->win, UI_BUT_EVENT, B_NODE_TREE_EXEC);
|
|
|
|
|
}
|
|
|
|
|
break;
|
2005-05-11 20:01:42 +00:00
|
|
|
case REDRAWANIM:
|
|
|
|
|
if ELEM6(sa->spacetype, SPACE_IPO, SPACE_SOUND, SPACE_TIME, SPACE_NLA, SPACE_ACTION, SPACE_SEQ) {
|
|
|
|
|
scrarea_queue_winredraw(sa);
|
|
|
|
|
if(val) scrarea_queue_headredraw(sa);
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void allspace(unsigned short event, short val)
|
|
|
|
|
{
|
|
|
|
|
bScreen *sc;
|
|
|
|
|
|
|
|
|
|
sc= G.main->screen.first;
|
|
|
|
|
while(sc) {
|
|
|
|
|
ScrArea *sa= sc->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
SpaceLink *sl= sa->spacedata.first;
|
|
|
|
|
while(sl) {
|
|
|
|
|
switch(event) {
|
|
|
|
|
case REMAKEIPO:
|
|
|
|
|
if(sl->spacetype==SPACE_IPO) {
|
|
|
|
|
SpaceIpo *si= (SpaceIpo *)sl;
|
|
|
|
|
{
|
|
|
|
|
if(si->editipo) MEM_freeN(si->editipo);
|
|
|
|
|
si->editipo= 0;
|
|
|
|
|
free_ipokey(&si->ipokey);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case OOPS_TEST:
|
|
|
|
|
if(sl->spacetype==SPACE_OOPS) {
|
|
|
|
|
SpaceOops *so= (SpaceOops *)sl;
|
|
|
|
|
so->flag |= SO_TESTBLOCKS;
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
sl= sl->next;
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
sc= sc->id.next;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-07 18:20:44 +00:00
|
|
|
/* if header==1, then draw header for curarea too. Excepption for headerprint()... */
|
|
|
|
|
void force_draw(int header)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2005-05-08 11:24:46 +00:00
|
|
|
/* draws all areas that show something identical to curarea */
|
2004-09-29 18:08:04 +00:00
|
|
|
extern int afterqtest(short win, unsigned short evt); //editscreen.c
|
2002-10-12 11:37:38 +00:00
|
|
|
ScrArea *tempsa, *sa;
|
|
|
|
|
|
|
|
|
|
scrarea_do_windraw(curarea);
|
2004-11-07 18:20:44 +00:00
|
|
|
if(header) scrarea_do_headdraw(curarea);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
tempsa= curarea;
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa!=tempsa && sa->spacetype==tempsa->spacetype) {
|
2005-10-03 09:04:57 +00:00
|
|
|
areawinset(sa->win);
|
|
|
|
|
scrarea_do_windraw(sa);
|
|
|
|
|
scrarea_do_headdraw(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
screen_swapbuffers();
|
|
|
|
|
|
2004-09-29 18:08:04 +00:00
|
|
|
#ifndef __APPLE__
|
2005-08-11 13:08:08 +00:00
|
|
|
if(tempsa->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
/* de the afterqueuetest for backbuf draw */
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa->spacetype==SPACE_VIEW3D) {
|
|
|
|
|
if(afterqtest(sa->win, BACKBUFDRAW)) {
|
|
|
|
|
areawinset(sa->win);
|
|
|
|
|
backdrawview3d(0);
|
|
|
|
|
}
|
2004-09-29 18:08:04 +00:00
|
|
|
}
|
2005-08-11 13:08:08 +00:00
|
|
|
sa= sa->next;
|
2004-09-29 18:08:04 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
if(curarea!=tempsa) areawinset(tempsa->win);
|
|
|
|
|
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
2005-05-11 20:01:42 +00:00
|
|
|
/* if header==1, then draw header for curarea too. Exception for headerprint()... */
|
2004-11-07 18:20:44 +00:00
|
|
|
void force_draw_plus(int type, int header)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-04-30 13:22:26 +00:00
|
|
|
/* draws all areas that show something like curarea AND areas of 'type' */
|
2002-10-12 11:37:38 +00:00
|
|
|
ScrArea *tempsa, *sa;
|
|
|
|
|
|
|
|
|
|
scrarea_do_windraw(curarea);
|
2004-11-07 18:20:44 +00:00
|
|
|
if(header) scrarea_do_headdraw(curarea);
|
2002-10-12 11:37:38 +00:00
|
|
|
|
|
|
|
|
tempsa= curarea;
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa!=tempsa && (sa->spacetype==tempsa->spacetype || sa->spacetype==type)) {
|
|
|
|
|
if(ELEM5(sa->spacetype, SPACE_VIEW3D, SPACE_IPO, SPACE_SEQ, SPACE_BUTS, SPACE_ACTION)) {
|
|
|
|
|
areawinset(sa->win);
|
|
|
|
|
scrarea_do_windraw(sa);
|
2004-11-02 15:58:36 +00:00
|
|
|
scrarea_do_headdraw(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
if(curarea!=tempsa) areawinset(tempsa->win);
|
|
|
|
|
|
|
|
|
|
screen_swapbuffers();
|
|
|
|
|
}
|
|
|
|
|
|
2004-11-07 18:20:44 +00:00
|
|
|
/* if header==1, then draw header for curarea too. Excepption for headerprint()... */
|
|
|
|
|
void force_draw_all(int header)
|
2002-10-12 11:37:38 +00:00
|
|
|
{
|
2003-04-30 13:22:26 +00:00
|
|
|
/* redraws all */
|
2002-10-12 11:37:38 +00:00
|
|
|
ScrArea *tempsa, *sa;
|
|
|
|
|
|
|
|
|
|
tempsa= curarea;
|
|
|
|
|
sa= G.curscreen->areabase.first;
|
|
|
|
|
while(sa) {
|
|
|
|
|
if(sa->headwin) {
|
|
|
|
|
scrarea_do_headdraw(sa);
|
2004-11-07 18:20:44 +00:00
|
|
|
if(sa!=curarea || header) scrarea_do_headchange(sa);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
if(sa->win) {
|
|
|
|
|
scrarea_do_windraw(sa);
|
|
|
|
|
}
|
|
|
|
|
sa= sa->next;
|
|
|
|
|
}
|
|
|
|
|
if(curarea!=tempsa) areawinset(tempsa->win);
|
|
|
|
|
|
|
|
|
|
screen_swapbuffers();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/***/
|
|
|
|
|
|
|
|
|
|
SpaceType *spaceaction_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Action");
|
2003-06-21 21:34:40 +00:00
|
|
|
spacetype_set_winfuncs(st, drawactionspace, changeactionspace, winqreadactionspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spacebuts_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Buts");
|
|
|
|
|
spacetype_set_winfuncs(st, drawbutspace, changebutspace, winqreadbutspace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spacefile_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("File");
|
|
|
|
|
spacetype_set_winfuncs(st, drawfilespace, NULL, winqreadfilespace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceimage_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Image");
|
Compositing workflow upgrade;
You now can set a Preview panel in the Image window, to define a sub-rect
of an image to be processed. Works like the preview in 3D Window. Just
press SHIFT+P to get it activated. Very nice speedup!
This is how it works:
- The compositor still uses the scene image size (including % setting) for
Viewer or Composite output size
- If a preview exists, it calculates the cropped rect from its position
in the Image window, and stores that in the Scene render data
- On composite execute, it copies only this part from the 'generator nodes',
right now Images or Render Results. That makes the entire composite tree
only using small rects, so it will execute fast.
- Also the render window will only display the cropped rect, and on F12
only the cropped part is being executed
- On rendering in background mode, the cropping is ignored though.
Usability notes:
- translating or zooming view will automatically invoke a recalculation
- if you zoom in on details, the calculated rect will even become smaller
- only one Imagewindow can have this Preview Panel, to prevent conflicts of
what the cropped area should be. Compositing is on Scene level, not local
per image window. (Note; 3D Previews are local per window!)
- Closing the preview panel will invoke a full-size recalculation
- All passes/layers from rendering are nicely cropped, including Z and
vectors.
The work to make the compositor do cropping was simple, but getting the
Image window displaying correctly and get all events OK was a lot of work...
indeed, we need to refactor Image Window usage once. Sorry for making the
mess even bigger now. :) I've tried not to interfere with UV edit or Paint
though... only when you're in compositing mode the panel will work.
BUG fix:
3D Preview render didn't work when multiple layers were set in the current
scene.
2006-02-09 11:07:04 +00:00
|
|
|
spacetype_set_winfuncs(st, drawimagespace, changeimagepace, winqreadimagespace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceimasel_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Imasel");
|
2003-03-24 00:06:40 +00:00
|
|
|
spacetype_set_winfuncs(st, drawimaselspace, NULL, winqreadimaselspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceinfo_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Info");
|
|
|
|
|
spacetype_set_winfuncs(st, drawinfospace, NULL, winqreadinfospace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceipo_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Ipo");
|
2003-03-24 01:46:05 +00:00
|
|
|
spacetype_set_winfuncs(st, drawipospace, changeview2dspace, winqreadipospace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spacenla_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Nla");
|
2003-03-24 01:46:05 +00:00
|
|
|
spacetype_set_winfuncs(st, drawnlaspace, changeview2dspace, winqreadnlaspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceoops_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Oops");
|
2003-03-24 01:46:05 +00:00
|
|
|
spacetype_set_winfuncs(st, drawoopsspace, changeview2dspace, winqreadoopsspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spaceseq_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Sequence");
|
2003-03-24 01:46:05 +00:00
|
|
|
spacetype_set_winfuncs(st, drawseqspace, changeview2dspace, winqreadseqspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spacesound_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Sound");
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
spacetype_set_winfuncs(st, drawsoundspace, changeview2dspace, winqreadsoundspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
|
|
|
|
SpaceType *spacetext_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Text");
|
|
|
|
|
spacetype_set_winfuncs(st, drawtextspace, NULL, winqreadtextspace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
2003-12-14 01:18:09 +00:00
|
|
|
SpaceType *spacescript_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st = NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st = spacetype_new("Script");
|
|
|
|
|
spacetype_set_winfuncs(st, drawscriptspace, NULL, winqreadscriptspace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
2002-10-12 11:37:38 +00:00
|
|
|
SpaceType *spaceview3d_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("View3D");
|
2003-03-24 01:46:05 +00:00
|
|
|
spacetype_set_winfuncs(st, drawview3dspace, changeview3dspace, winqreadview3dspace);
|
2002-10-12 11:37:38 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
Added the new Timeline Window, copied from Tuhopuu, coded by Matt Ebb.
Main change is that it's an own Space type now, not part of the Audio
window... the audio window should restrict to own options. This way
functionality is nicely separated.
Since it's the first time I added a new space (since long!) I've made an
extensive tutorial as well. You can find that here:
http://www.blender3d.org/cms/Adding_new_Space_Window.557.0.html
Notes for using timewindow;
- Add time markers with MKey
- CTRL+M gives option to name Marker
- Markers cannot be moved yet...
- Pageup-Pagedown keys moves current frame to next-prev Marker
- Xkey removes Markers
- If an object has Ipos or an Action, it draws key lines
- CTRL+Pageup-Pagedown moves current frame to next-prev Key
- Press S or E to set start/end frame for playback
Notes about the implementation in Tuhopuu:
- Add new Marker now selects new, deselects others
- Selecting Marker didn't work like elsewhere in Blender, on click it
should deselect all, except the indicated Marker. Not when holding SHIFT
of course
- Not exported functions are static now
- Removed unused defines (MARKER_NONE NEXT_AVAIL)
- Drawing order was confusing, doing too many matrix calls
- Removed not needed scrollbar, added new function to draw time values.
(Has advantage the MMB scroll works not confusing on a scrollbar)
- Added proper support for 'frame mapping'
- The string button (name Marker) had a bug (checked str[64] while str
was only 64 long)
- String button itself didn't allow "OK on enter"
- Made frame buttons in header larger, the arrows overlapped
- Removed support for negative frame values, that won't work so simple!
2005-05-05 17:19:21 +00:00
|
|
|
SpaceType *spacetime_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Time");
|
|
|
|
|
spacetype_set_winfuncs(st, drawtimespace, NULL, winqreadtimespace);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|
2005-12-18 13:46:01 +00:00
|
|
|
|
|
|
|
|
SpaceType *spacenode_get_type(void)
|
|
|
|
|
{
|
|
|
|
|
static SpaceType *st= NULL;
|
|
|
|
|
|
|
|
|
|
if (!st) {
|
|
|
|
|
st= spacetype_new("Node");
|
2005-12-18 23:08:22 +00:00
|
|
|
spacetype_set_winfuncs(st, drawnodespace, changeview2dspace, winqreadnodespace);
|
2005-12-18 13:46:01 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return st;
|
|
|
|
|
}
|