Commit Graph

47594 Commits

Author SHA1 Message Date
fd3be2e3ef added sequence editor pull-down menus.
TODO: fix "Enter/Exit Meta Strip" to work correctly for nested
meta strips.
2003-10-20 20:12:01 +00:00
bac66d0a19 Exppython: small changes in NMesh internals and docs 2003-10-20 18:57:31 +00:00
824c9e92da - fixed correct themecolor for popup menus 2003-10-20 18:15:06 +00:00
382d802427 - made a template function for editmesh enthusiasts.
- goes in a loop,
  - draws current window
  - sets view transform to correct matrix
  - you can draw stuff
  - swapbuffers
  - event queue test to escape

Test: CTRL+R in editmode.
Right now it hilites the closest edge to to mouse cursor, just for fun!
Goofster will use it for the loop-cutter tool later. But the template
will remain there, commented out, for others to play with.
2003-10-20 17:46:33 +00:00
7f5d06d638 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
628b002583 - Added nicer, smoother tooltip drawing 2003-10-20 04:05:31 +00:00
3804cbe0b6 - Cleaned, compacted the 3D View header
- Cleaned, compacted and slightly re-arranged 3D View edit menus
- Added Undo and Knife Subdivide to 3D View menus
- Added undo_push_mesh to a couple of menu entries to make them work
  properly with undo
2003-10-20 03:33:29 +00:00
e6a86ce8cf Added
void selectall_type(short obtype);
void selectall_layer(int layernum);
2003-10-20 02:19:48 +00:00
2aec1fee77 Object selection from tuhopuu2:
Select All by Type / Select All by Layer

User info:
Found in (object mode) 3D View header menu > Select >
Select All by Type selects all objects on visible layers of a certain type
Select All by Layer selects all objects on a certain layer (visible / invisible)

These used together are useful for managing a complex scene, for example
quickly selecting all the lamps and moving them to a separate layer, or
selecting the contents of a layer without having to disrupt the view
configuration of visible/invisible layers.

Coder Info:
Added two functions in editview.c
void selectall_type(short obtype);
void selectall_layer(int layernum);

I committed both of these together since the code/changes are both
very similar.
2003-10-20 02:19:17 +00:00
052b909ee6 Knifetool bugfix:
The call to headerprint left GL environment in wrong state to draw knife
	line in all but top view. Moved persp() call to after headerprint().
2003-10-20 00:46:03 +00:00
147895715a Dynamic Face/Vert/Halo/Lamp tables:
User Info:
	Hard coded limits on the total number of face, verts, halos, and lamps
	is gone.  Blender now allocates the tables for these on an as needed
	basis.  As long as your system can come up with the memory, you won't
	run out.  As a bonus, it also uses slightly less memory on smaller scenes.

Coder info:
	This has been in tuhopuu for a while, but I don't know how hard it
	has been tested.  Since it now allocates only an initial 1024 tables
	(of 256 verts/faces/halos each), it seems like it has been put through
	it's paces. Lamps are allocated one at a time, and I start with 256.
 	I rendered 2.5M Faces/Verts/Halos. 4444 lamps. None the less, I left
	a few printf's in the realocation to hunt bugs.  I'll take them out
	just before the release freeze.

	Also, be on the lookout for other "sanity checks" that assume
	a limited number of the above items.  I think I got them all, but
	you never know.
2003-10-19 21:47:03 +00:00
7ac2731e63 Unified renderer OSA sample clipping:
User info:
	This change limits the contribution of any OSA sample to 1.0 per color
	in the Unified renderer.  Because color=1.0 gives fully saturated color,
	samples contributing more than 1.0 were overweighted in the OSA average
	causing aliasing (sometimes quite severe).

	Samples can contribute more than 1.0 because a material's spec and refl
	values are not normalized (In real world spec+refl <= 1.0).  This solves
	a large class of aliasing problems in the unified renderer.

Coder Info:
	None.
2003-10-19 21:08:44 +00:00
d5322a6352 Editmesh Undo:
User Info:
	Pressing UKey in mesh edit mode now undoes only last step.  Undo can save
	upto 64 steps of undo info.  This is configurable under User Prefs->
	Edit Methods.  The default is 32.  High numbers of undo steps use a
	lot of memory, since each step stores a copy of the mesh.

	Shift-U redoes the last undone step (Undoes the undo.)

	Alt-U brings up a menu of possible steps that can be undone.  Selecting
	an item on the list undoes that item plus all items before it on the list.
	The top selection "Undo All" is identical to the old Ukey.  It undoes
	all editing since entering Editmode, even if all regular undo steps are
	used up.

	Undo info is only saved for one object at a time.  You can leave and re-
	enter editmode for the same object, and all undo steps for that object are
	preserved.  Undo info for an object is lost once a different object is
	edited.

Coder Info:
	In order for undo to work, a checkpoint save has to be made.  This is
	done with a call to undo_push_mesh("name of step").  This should be done
	after the last quick abort for a function (typ. the
	"if (G.obedit==0) return;", or similar).  the undo_push_mesh() does alter some
	flags, so don't try to be too tricky and call undo_push_mesh() too late.
	The step name is what shows up in the undo_menu.  The name "U" is reserved.
2003-10-19 20:52:34 +00:00
de64d218a0 Adding Knife tool as to be released in 2.3
User Info:
	To use this tool, select a group of verts, it can be larger than the
	desired cut as explained below.  Then hit Shift-K.
	The tool will  prompt for cut type (Exact line or Edge centers),
	Select, then use LMB to draw a "cut-line".  Holding down LMB causes
	a freehand draw, clicking LMB causes a polyline draw.  MMB locks the axis.
	When done press enter to divide mesh on cut line. Subdivide routines have
	been modified to produce fewer triangles as part of this tool.
	Edge Centers preserves UV info, Exact Line does not (it will be there, just
	slightly distorted).

	Since the cut line exists in 2D space, and does not make a persistant
	selection that can be modified in another 3D view, the knife selection
	is the AND of the vertex selection and the knife line, ie; the edge will
	be subdivided only if both verts are selected, and the knife line crosses
	the edge.  Select your verts first, but you don't have to be overly
	precise. If you want to cut a few faces on the front of a sphere, you
	can select the whole front of the sphere, then knife the faces you want.

Coder Info:
	KnifeSubdivide is called with 1 of 3 modes. KNIFE_PROMPT, KNIFE_EXACT,
	KNIFE_MIDPOINTS.  The hotkey calls KNIFE_PROMPT.  When adding to a menu
	or button, explicitly call out the mode.

	Part of the tool provides get_mouse_trail() that returns a CutCurve struct
	that defines a knife line.  There are modes defined, but currently they are not
	implimented.

	Another part of this tool defines new behaviour for subdivideflag().
	Setting beauty param to B_KNIFE	tells subdivideflag() that the edges
	are preselected ans to skip the vert check.  Also setting B_PERCENTSUB tells
	subdivideflag() to divide the edge at a percentage of the distance from
	eed->v1 to eed->v2.  This percentage is passed in the eed->f1 flag as a
	short (ie, setting eed->f1 to 16384 cuts the edge half-way).
2003-10-19 19:50:17 +00:00
a56d3d189a included "BLI_arithb.h" for normal calculations... 2003-10-19 16:03:18 +00:00
cd97a17b16 - fix to prevent the following-mouse frame number display
from disappearing when mouse pointer is moved above
the window space edge
2003-10-19 12:53:46 +00:00
c6a2f42dba - simplified Theme API. No need to include 'current active area' anymore.
like: BIF_ThemeColor(TH_GRID); will be sufficient. Blender does the rest.
- fixed bug in CTRL-X (reload home file) with themes
- fixed bug in horizontal alignment of different height panels. Seems also
  to solve the drawing error with constraints...
2003-10-19 09:19:58 +00:00
Stephen Swaney
c19d84f89e Fix unchecked pointer reference when adding sitedirs to sys.path.
This is a bugfix against the 2.28c release.
2003-10-19 06:26:32 +00:00
56ad0d31b9 Added support for returning the normal of a NMFace 2003-10-19 03:15:43 +00:00
f420f87610 - added Theme for File Window
- made grid drawing using the main theme color
- was annoyed with the primitive grid... so coded something that allows
  zooming in and out a 100fold without losing gridlines
- brought back 'NKEY' for mesh editmode
- added to this a 'median' option; when more vertices selected you see
  the average coordinate. works nice when inputting values as well
  (todo: make this for other editmodes)
- renamed the 'NKEY' panel to 'Transform Properties', also fixed in
  pulldown menu.

I am off for the rest of the day. More committing fun tomorrow!

-Ton-
2003-10-18 12:21:41 +00:00
b6d30dddd7 A few small tweaks to the panel drawing 2003-10-18 12:02:03 +00:00
43243009b7 - Added ICON_PANEL_CLOSE 2003-10-18 07:37:37 +00:00
362d2470a1 - Updated panel style based on funboard feedback
- Added white 'close panel' icon ICON_PANEL_CLOSE to blenderbuttons
2003-10-18 07:36:46 +00:00
23189d1ef0 - A few small wording edits
- Added Copy/Pase/Paste Flipped pose to the Armature menu
2003-10-18 03:41:22 +00:00
a9af685011 - further work on theme colors:
- panels work
  - ipo window done
  - buttonswindow done

Please be warned that saving  Themes now wont work... it will also save
BLACK for all uninitalized colors... so dont panic when you see weird
things, just go back the default theme and copy a new one.
2003-10-17 23:18:18 +00:00
d622706883 Preliminary work on faceloop selection and faceloop cutting. Commiting in steps to prevent Ton from sneaking in between me! :D
some small things to fix:

- cutting on 1 face doesn't work
- options now under shift/ctrl R, they will be under a K menu that will contain DetectiveThorn's Knife tool too.

Roel
2003-10-17 19:59:32 +00:00
f948e31bac - forget to mention: Panel (3d win) header and back color is part of
Theme now. Try black transparant... neat. :)
2003-10-17 19:06:13 +00:00
58a0811ad9 - fixed bug in windows with extreme small height... it didnt accept
input
- was needed for usage of this windowtype (headerless) as 'timeline'
  dragger, which was supposed to be...
- as extra I fixed 'home', it sets start/end frame for sound window
- at mouselocation the current frame or time is printed
- rightmouse menu switches seconds/frames (should be in header as option...)
- displaybutton 'frs/sec/' updates soundwindow too

So, its not perfect... but try opening a tiny high headerless audio
window on top of buttonswin or somewhere full width. not bad...
2003-10-17 19:03:53 +00:00
8ce5ece950 - fixed reopen last file (in file pulldown menu)
- fixed delay in drawing active item in pop menus...
2003-10-17 16:24:10 +00:00
f8671b2cb2 - fixed AA font drawing in view3d Panels... forgot to clear a pixelzoom 2003-10-17 16:17:21 +00:00
fe925541a2 - fatal error: when reloading .B.blend (CTRL+X) the themes were not freed. 2003-10-17 15:20:13 +00:00
e78bb262c2 - fixed redraw for copy button in new themes editor
- typo in include DNA_ListBase.h... has to be DNA_listBase.h
2003-10-17 15:12:45 +00:00
3583d2fdeb - color for 'Panel' was not defined in resources yet... :) 2003-10-17 14:18:53 +00:00
8380bc9cab - one button was invisible... 2003-10-17 14:11:17 +00:00
0321602b65 - 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
00cf36d6a5 - accidentally removed 2 lines in this file that made previewrender not
showing up...
2003-10-17 00:49:59 +00:00
7a7956509d - fixed edge selecting... :) 2003-10-16 20:36:29 +00:00
1f226c943b - bone selection armatures fixed! 2003-10-16 16:13:01 +00:00
77b37c9927 - fix for drawing buttons in fileselectors, it used an old exception
and special 'EMBOSSF' drawing function. Now complies to standard.
2003-10-16 12:03:03 +00:00
a7cd8b5951 - fixed correct drawing of frontbuffer vertices... it still gives some
nice increased interactivity when selecting in slow drawing situations.
  nevertheless, can be worked on later once, to make it less hackish. :)
2003-10-16 09:56:23 +00:00
5d1438ad96 - fixed editing vertices again!
I had to clean up very old calls to switch matrices for 3d windows.
To make it more clear, I've introduced defines for the infamous persp()
function:

persp(PERSP_WIN);  sets matrices at pixel level window
persp(PERSP_VIEW); restores matrices back to 3d drawing
persp(PERSP_STORE); only called once, to store correct matrices

I will now check on frontbuffer drawing of vertices... it's very doubtful
if it's used still correctly, was only meant for visual speed in the
early nineties you know. :)
2003-10-16 09:39:19 +00:00
c7618783fb - further work on view3d panels:
- you can close them (x icon) or press ESC
- option to open panel at mouse location (try Nkey)
- using 'collapse' (triangle icon) stows header in bottom
- opening again restores at old location
- dragging panels or zooming clips nicely with window

evaluate: an 'auto close' when mouse goes outside panel

Warning: vertex selecting still broken! :) It's 2 am now, bedtime...
2003-10-16 00:17:24 +00:00
10333bd1d3 - removed all #include "interface.h" from files. this is a local/internal
include only (use BIF_interface.h instead)
- split up interface.c in two files: NEW: interface_panel.c
- removed the temporal text files

WARN: FIX AUTOMAKE AND MSVC!
2003-10-15 19:23:54 +00:00
478f61563a - fixed drawing errors in constraint panel
- join 3d window could crash... unchecked pointer in interface.c
- setting align in buttonswin caused stripes to draw in view3d-panels
- fixed events for new 'background and view settings menu'
2003-10-15 17:41:40 +00:00
bb79e92225 - Added ICON_MENU_PANEL 2003-10-15 16:28:57 +00:00
3f9b4439b1 - Added icon to indicate floating panels in menus: ICON_MENU_PANEL
- Added it plus tiny edits to view3d menus
2003-10-15 16:28:00 +00:00
44344b3501 - More code for handling Panels in other windows.
Added the 'Nkey' object menu as Panel now. Live updates, whoohoo!

closing them, minimizing, etc will follow. first bring back vertex
selection :)
2003-10-15 16:01:08 +00:00
669a570a73 - Various cosmetic fixes to menu buts in headers, alignment etc.
- Make text fields' text black when deselected, white when selected (editing)
2003-10-15 15:23:58 +00:00
c2c7bb6648 - Modified drawing of ICONROW controls to be clearer,
more consistent and logical. (ICONROWs haven't
scrolled left/right in years!

More detailed tweaking of headerbuttons positions can come when
more menus are finished

- added text labels to the drawtype menu in 3d view header
2003-10-15 13:47:15 +00:00
3bf09a5447 - fixed warnings in drawmesh.c
- with mouse in Panel, padplus/minus defines scaling of Panel... dunno if
  this is the correct key. thats for later to worry!

Forgot to mention in previous commit:

- Panels now have a uiSetPanelStyle() API call. Is under construction...
  now for test purposes mostly.
2003-10-15 12:51:01 +00:00