Commit Graph

49420 Commits

Author SHA1 Message Date
Martin Poirier
d213b7d0db Small constraint loop detection and calculation fix that now allows two objects to track each other (normal track or LockTrack).
This is done by disabling the object position refresh call when calculating these constraints. From the tests I did, this doesn't cause any problem at all.

The main point of this is to create pistons and the like.

For coders:

the detect_constraint_loop function now takes an additional parameter that determines the constraint type of the object it's looping from.
2003-10-22 23:17:48 +00:00
Martin Poirier
46f0ef2c57 fixed a warning that slipped by :| 2003-10-22 22:13:23 +00:00
Ton Roosendaal
6963bd3947 - material editor: each texture channel can be individually switched,
instead of the old 'septex' which only showed the active one

- rendering: the 'stencil' option now works to stencil out normals as well

(special requests from our manual master, s68)
2003-10-22 18:58:46 +00:00
Ton Roosendaal
dbdc116909 - fixed bug: 'header select' themecolor had no alpha, causing antialiased
lines not drawn (triangles in buttons for example)
- correct colors for channels in texture buttons
- fixed bug: using proportional editing, the extra wire draw had incorrect
  matrix
- fixed bug: drawing in imagewindow didnt work anymore... was a very old
  one! the wrong pointer was read, and it accidentally went OK, until now
- selecting vertices with multiple 3d wins open works again
2003-10-22 17:34:51 +00:00
Ton Roosendaal
389b06c91e More fixes in object drawing:
- transparent faces in editmode don't write in zbuffer anymore (prevents
  drawing errors) but still read (so behind the subsurf faces for example)
- improved drawing 'handles' for subsurf editing
- going in editmode to Solid view, will draw extra wire always, including
  transparent faces when set
- works in all combos... http://www.blender.org/docs/ton/subsurf.html

- fixed error; padplus/padminus didnt work in buttonswindow anymore
- improved buttonswin: when dragging window edge, the buttons dont
  rescale, but stay same size
2003-10-22 09:06:30 +00:00
Martin Poirier
26698cfa3f Added mirror function to the code and to the Wkey menu (at the end) 2003-10-22 02:05:51 +00:00
Martin Poirier
c7bf552213 Added PADENTER confirmation to transform. 2003-10-22 01:25:11 +00:00
Robert Wenzlaff
ed290ebf19 - Added PADENTER to knife confirm, to make it more consistant
with okee() et. al.
2003-10-22 01:21:37 +00:00
Robert Wenzlaff
5e64eb72a2 - Preserved selections in undo.
- Fixed spurious "recalc norm" enties in Undo.
2003-10-22 00:52:26 +00:00
Martin Poirier
da095d6092 Numerical input in transformation modes (Grab, Rotate, Scale,
Warp, Shear, Shrink/Fatten). It works with the transformations mode,
it doesn't replace them, so just enter grab, scale or rotate mode
as usual and start typing. Both numpad and non-numpad works for the
numbers.

Tab switches between axis (the axis that is being modified has
parenthesis)
Backspace clears the current axis. Twice clears all axis.
Minus (-) switches between positive and negative value.

The mouse is now disabled when you type (as soon as you use one of
the numerical keys). You can use Nkey to switch between numerical
and mouse driven mode.

The minus key on the numpad still affects the PET in mouse-driven
mode, but affects the sign of the number in numerical input.
2003-10-21 23:39:47 +00:00
Ton Roosendaal
e0e45e81da - fixed error; the vertices didnt draw anymore in editmode with sold draw.
was caused because i only tested the new cool 'draw wire extra'. :)

- by default, in solid draw mode & editmode, it does a 'draw wire extra'
  now, giving nice clean editmesh drawing.

- there's still a few quirks, i do a test now... this commit is to have
  a good working blender in cvs. the whole drawing system is such chaos...
2003-10-21 21:59:00 +00:00
Joseph Gilbert
594f3cddca A few bugfixes to the vgrouping methods 2003-10-21 17:25:27 +00:00
Martin Poirier
193dce6d98 Axis constraint in transform for grab mode
Axis constraint in size mode

note: the original behavior when constraining with middle mouse in object mode is weird. I've leave it that way, but I think it would be a good time to fix it. Another thing: in object mode, you can only constrain size to local axis. Global axis would involve either screwing the matrix (which stinks) or modifying the vert coords directly (which is a no no)

Please also note that this breaks the mirroring combo.
I'll be commiting my edit mode mirror function soon to fix that.

Coder note:

You can now call the transform function with an additional parameter to constraint to an axis.
example:

transform('g'*'X')
transform('s'*'y')
transform('r'*'z')

Capital axis letter for global axis, lower case for local axis
2003-10-21 17:01:10 +00:00
Martin Poirier
2486c52f89 fixed warnings and errors in buttons_object.c 2003-10-21 16:56:25 +00:00
Ton Roosendaal
a0824f8fb9 Mesh drawing stuff!
- in zbuffer mode, vertices will be blended 50% in... and when you increase
  vertex size larger than 2 pixels, it will draw them smaller
- removed all 'wire extra' calls (there were dozens!) and replaced it with
  simple call where it belongs.
  This drawing mode is becoming nice & stable... maybe something to make
  default on for new objects? Makes selecting quite easier...

- Subsurf: in editmode, with new 'Optimal' option set, the mesh itself
  will not draw, but instead it draws 'handles' to the vertices. Looks
  extremely clean!

- matched drawing of default grid-floor (persp) to ortho grid

- killed drawing vertices outside of main drawing loop, apart from the
  routine that uses mouse-selecting. (tekenvertices_ext()). It was an old
  optimize routine which became quite useless.
2003-10-21 16:41:28 +00:00
Martin Poirier
41f4940bff Helpline drawing in transform (semi broken in this commit)
This is only usefull for rotate now, but the axis constraining code has a part that depended on this, so I commit this part first.

For coders:

void constline(float *center, float *dir, int col)
	Draw an infinite line on the screen. col is the color argument. It must be cpack compatible

void project_short_infiniteline(float *vec, float *dir, short *adr1, short *adr2);
	clips infinite line to screen border
2003-10-21 16:25:00 +00:00
Martin Poirier
8280cab690 For coders:
Axis CONST and variable rename in transform in preparation of further commits
Parsing code to supply axis constraint with the mode (Broken knows what I'm talking about)
2003-10-21 15:57:16 +00:00
Martin Poirier
4efdabfbbc Constraint stuff from tuhopuu including (but probably not limited too):
Axis options for TrackTo
LockTrack
FollowPath

Auto creation of TrackTo constraint from Ctrl-T (old track still an option)

Auto creation of FollowPath when parenting to path (Normal parent still an option)

Backward compatibility stuff to convert the per object axis settings to per constraint when a Track constraint is present.

Function to convert old track to constraint (commented out)

Revamped the constraints interface with Matt's work from tuhopuu and the stuff we were discussing earlier.

--------------------
For coders:

unique_constraint_name and *new_constraint_data  moved to the kernel (constraint.c)

new Projf function in arithb gives the projection of a vector on another vector

add_new_constraint now takes a constraint type (int) parameter

add_constraint_to_object(bConstraint *con, Object *ob) to link a constraint to an object

add_constraint_to_client(bConstraint *con) to link constraint to current client (object or bone)

add_influence_key_to_constraint (bConstraint *con) to (eventually) add a keyframe to the influence IPO of a constraint
2003-10-21 13:22:07 +00:00
Ton Roosendaal
2da9cb5db2 fixed bugs:
- faceselect mode works again
- selecting vertices for lattices, surfaces and curves works again
- in previewrender sometimes a square was drawn, which was texture-crop
2003-10-21 12:23:38 +00:00
Ton Roosendaal
0d1f7f1c72 - forgot to set 'minimal theme' callback for sliders, causing a crash when
displaying Constraint Panel in F7 menu.
2003-10-21 11:46:12 +00:00
Ton Roosendaal
8e2225e027 - another formula for 'draw wire extra'. this time it doen't scale, but
only moves z-values in drawing in zbuffer. still matrix art I don't
  fully grasp... but it seems to work!
2003-10-21 08:43:29 +00:00
Matt Ebb
e3f3491ac3 Made pupmenu() separators consistent with pulldowns
TODO: same for popup menu buttons
2003-10-21 07:28:44 +00:00
Matt Ebb
c6ef2afb3f Added a function to shade alpha as well as colour 2003-10-21 07:02:38 +00:00
Matt Ebb
4405113308 - Lots of tweaks to interface colours, shading, etc.
- Fixed alignment/width of menus

Still needs more work.
2003-10-21 07:02:04 +00:00
Ton Roosendaal
ff89daceb0 - fixed drawmode 'wire extra'.
it was using some unsupported linewidth trick... I've been trying to
  get the official glPolygonOffset to working, but my silly Mac doesnt
  support it, it seems.
  So! I thought of another trick, and that's just moving the window
  matrix a little to the front. :)

- for those interested; the code for glPolygonOffset is still there,
  commented out. (drawobject.c)

- btw: the drawobject.c routines are a TOTAL mess!
2003-10-20 23:20:37 +00:00
Ton Roosendaal
7893cc25d1 - added new drawing type for subsurf editing. Is called 'Optimal' and
can be found under the 'SubSurf' button.
  Optimal drawing only shows the subdivided original edges. Quite nice!
  And; it's a load faster!

- to evaluate: do we want this in editmode too?
2003-10-20 21:58:15 +00:00
Simon Clitherow
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
Willian Padovani Germano
bac66d0a19 Exppython: small changes in NMesh internals and docs 2003-10-20 18:57:31 +00:00
Ton Roosendaal
824c9e92da - fixed correct themecolor for popup menus 2003-10-20 18:15:06 +00:00
Ton Roosendaal
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
Ton Roosendaal
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
Matt Ebb
628b002583 - Added nicer, smoother tooltip drawing 2003-10-20 04:05:31 +00:00
Matt Ebb
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
Matt Ebb
e6a86ce8cf Added
void selectall_type(short obtype);
void selectall_layer(int layernum);
2003-10-20 02:19:48 +00:00
Matt Ebb
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
Robert Wenzlaff
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
Robert Wenzlaff
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
Robert Wenzlaff
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
Robert Wenzlaff
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
Robert Wenzlaff
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
Joseph Gilbert
a56d3d189a included "BLI_arithb.h" for normal calculations... 2003-10-19 16:03:18 +00:00
Matt Ebb
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
Ton Roosendaal
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
Joseph Gilbert
56ad0d31b9 Added support for returning the normal of a NMFace 2003-10-19 03:15:43 +00:00
Ton Roosendaal
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
Matt Ebb
b6d30dddd7 A few small tweaks to the panel drawing 2003-10-18 12:02:03 +00:00
Matt Ebb
43243009b7 - Added ICON_PANEL_CLOSE 2003-10-18 07:37:37 +00:00
Matt Ebb
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
Matt Ebb
23189d1ef0 - A few small wording edits
- Added Copy/Pase/Paste Flipped pose to the Armature menu
2003-10-18 03:41:22 +00:00