Commit Graph

143 Commits

Author SHA1 Message Date
d10862a9da Fix for negative scaling & Mirror menu in Object mode (CTRL+M)
Hope Martin likes this simple hack. :)

Also; added flag in constraint to denote whether its local or not. That
way its possible to:

- prevent local scale and rotate on multiple objects to change own position
- draw constraint lines cleaner
2005-05-07 21:04:55 +00:00
6db7d23b5f On click-release for Manipulator handles, without moving mouse, it will
stick to transform() until another mouse press (or ESC etc)
2005-05-04 15:13:25 +00:00
3b2c30dae4 Another big cleanup, thanks to transform recode. Could do this stage
because Martin recoded the Mirror().

- removed old globals like 'tottrans' or 'centre' or 'centroid' as used
  by old transform
- removed a lot of code from editobject.c
- moved all transform related code to transform_conversions.c
  (Note for Martin; sorry that's a mess... it now has all the weird
   functions for finding posemode dependencies... thats for the depgraph
   phase to remove)
2005-05-04 12:53:35 +00:00
e05e85523f Mirror function reuses new Transform (basicly calls the split off ElementResize function on the data).
Updated the menus to work with that too.

Of course, this doesn't work in object mode right now, because resize I haven't fixed negative resize (yet).

Again, this would have easily benefited of a stand alone init and post Transform functions. When I have time... :|
2005-05-04 00:37:11 +00:00
422b69fe1e UI cleanup work;
Proportional edit:

- Proportional mode added to header as button/menu. Including new option
  to have only connected geometry influenced.
- Added icons for proportional & proportional modes
- Make proportional edit data part of Scene, so all gets saved.
  The Global flag G_PROPORTIONAL was removed
- Made sure #defines get used properly, also tweaked order for proportional
  so it starts with regular 'smooth' by default.
- Use ALT+O in editmode to switch to new proportional 'connected' mode

Other UI stuff:

- in EditMode, the layer buttons get hidden... the amount of icons in
  3d header grows to fast. :)
- made less ugly icons for the Manipulators. Still can be better.
- Added alpha-filter for pre-processing Icon-image, giving nicer display
  of icon-antialising on dark or bright backdrops
- disabled Manipulators when in editmode, and current layers don't show
  the edited data.
- Added the value used to define Normal size (editmode draw) in Scene too,
  so it gets saved.
2005-05-03 10:54:42 +00:00
61f2736ec3 Local axis constraint external call. Had to do it in a very hackish way which highlight a design problem in the code. To solve it (and would solve other problems too), we'd have to split off the initialisation function. Not terribly hard to do but I'm overwhelmed with work...
Push/Pull had a problem with constraints enabling/disabling. Fixed

Restablished infinite line for constraint draw (when not using manipulator) as discussed in meeting.
2005-05-02 02:18:13 +00:00
42ae9128fa Removal of old transform() <sob> part one.
- added in new transform the (not so useful but yah) old feature that
  does scrollwheel zoom during transform
- had to change transform call arguments for uv-window/sequence/oops to
  match new transform for mouse callback

TODO (for martin?)

- pulldown menu support to call with local axes compliant as for pressing
  it with hotkey
- mirrormenu() still uses old transform stuff...
2005-04-30 21:19:19 +00:00
6379ff9b70 Toying a bit with MMB behavior:
MMB click with no constraint selects a constraint right away (the axis selector doesn't flash on screen)
MMB click with a constraint removes the constraint
MMB click-drag in both case (with and without a constraint) uses the axis selector.

stopConstraint didn't remove the CON_SELECT flag, so cancelling transform while selecting a constraint and then reentering transform was funny. Fixed
2005-04-24 01:18:13 +00:00
c1a7b8b7a1 Local axis constraints for pose mode. Added
Camera rotation fix (was off centered because it used persinv instead of viewinv. Now rotation center is always center screen in camera mode. (Still need to fix the helpline not showing)
Numinput constraint function was no good, didn't check if a constraint was even on... Fixed.
Rotation was missing constraint text in header print. Fixed.
2005-04-22 01:14:15 +00:00
1bde293997 Bug fix #2394
While in camera view, going to local axis rotation (R, X, X) the view
became instable. Was still using the view3d view matrix, instead of
initialized TransInfo->viewmat.

Martin; you could check on the mouse motion in this case, for some reason
it only uses horizontal motion?

ALso; renamed button in InfoWindow "Disable sound" to "Disable Game Sound".
2005-04-12 10:08:04 +00:00
2123721b5b Transform constraints with Ykey were mixed up, setting text to global
instead of local and vice versa.

Thanks to GSR's email for helping me notice that.
2005-04-11 22:29:20 +00:00
a3e5727f75 Small transform fixes.
Rotation acted weird in perspective mode. Works much better using viewinv
instead of persinv to get the rotation axis. What would be even better is
using real view vector depending on transformation center (with
getViewVector), but that can wait a bit.

Meta Element resize needed some code to reset radius changes or axis size
changes when switching from one to the other (my fault, I didn't think of this
when telling Jiri how to implement it).
2005-04-11 21:19:38 +00:00
78939c0cc0 - It is possible to scale radius of MetaElem again.
- It is possible to change dx, dy and dz params in 3Dview with manipulators
    or with some shortcuts (S-X, S-Y, S-Z).
 - User can scale stiffness when green circle is selected.
 - MetaElem is selected with RMB click at green or red circle, then user can
    grab or rotate with MetaElem as usual.

 - Screenshot:
    http://e-learning.vslib.cz/~hnidek/pics/scale_stiffness.jpg

 - Captured video:
    http://e-learning.vslib.cz/~hnidek/captured-videos/scale_stiffness.avi
2005-04-11 19:31:05 +00:00
218ee423d9 Resize didn't work with bezier handles correctly. That is because bezier has preleminary work for Individual Center in edit mode.
While I was there, I cleaned up individual center a bit, it was messing with helpline.

For fun, set the center mode to Individual Center, create a bezier circle, change handle to free (H) and Resize or Rotate. Fun isn't it! :)
2005-04-10 20:09:31 +00:00
4ea8947ea7 Merged all the internal transform includes into transform.h and moves it to /src to /include.
Split the conversion fonctions and sorting functions from transform.c into transform_conversions.c
Update MSVC 6.0 projectiles and SConscript accordingly.
Editview still included transform.h, replaced that for BIF_transform.h, the external include.
2005-04-10 18:33:19 +00:00
Chris Want
ae91ba8ba6 Fix for bug #1576.
Constraints on bones that point to objects/bones outside of
an armature weren't working. The figure_pose_updating()
does a bunch of flagging based on the constraints on the
scene to figure out what armatures/bones need updating
(even when it is not the armature that is being manipulated).
2005-04-09 23:38:35 +00:00
dac6c90742 Toggle between Connected and Normal PET.
Alt-C during transform (hotkey subject to change)

No visual clue right now other than what is transformed and it gets resetted everytime (not kept as a global flag).

So, still a lot to do regarding that.
2005-04-07 18:28:41 +00:00
6bfa7c8157 Crease transformation
Behavior is a bit different. Instead of showing the weird two value thing like the old transform did, it always show the weight variation in +/- that is applied to every edge. Works a bit like scale. Move away from center to increase, move closer to decrease (between -1.0 and 1.0).
Works with PET (not using connection yet).

Also removed some missed global Trans variable abuse.
2005-04-04 23:37:15 +00:00
fad97122aa Added a NO_NOR_RECALC context flag. With Individual extrude, the normals are already set by the extrude code, recalculating breaks them.
Cosmetic changes, renamed CTX_NOPET to CTX_NO_PET

CKey during transform now clears the constraint.
2005-04-04 02:16:56 +00:00
f186388b91 Removes global variable access from TransData conversion fonctions.
Added a NULL check on TransInfo->data before sorting. At that point, the conversion could have been cancel if there's no selected elements (caused segfaults with PET).
Another NULL check on TransInfo->data in postTrans fonction, since that is called on cancel on no selection too.

Was missing a matrix multiplication when setting TransData->dist on meshes which caused PET on scaled meshes to be bad. (bug report 2395: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2395&group_id=9 )
2005-04-03 21:52:11 +00:00
9ec8778288 SoftBody:
- on add new SoftBody, it creates automatically edges in Mesh now, gives
  too confusing results otherwise
- if no edges exist in mesh, it also doesnt add diagonals for faces in
  softbody

Transform;

- fixed stupid 'used unitialized' gcc warning (sorry theeth!)
- made dualAxisConstraint() accept string too
- little cleanup of prints in using Manipulators
2005-04-03 20:13:10 +00:00
555287021a Hidden verts using mesh connected PET caused segfaults.
Was caused by the scratch array offsets counting hidden verts when, obviously, it shouldn't.

Also simplified the check for non connected when setting dist. This *might* have caused some errors.
2005-04-03 06:09:31 +00:00
312c8d146c Removed casting warnings from transform_manipulator.
PET is now checked as a transform flag during transform. Much cleaner that way for NOPET context (extrude, duplicate)
Added Sphere as a new PET falloff mode (icon and all) and reordered them around in a more logical fashion (IMHO).

Also brought back Subsurf toggle with Shift-O (was supposed to be for PET object mode but that was canned).
2005-04-01 18:39:39 +00:00
9184b03ddf Sacre bleh another bugfix!
Mesh Connected PET was acting weird on geometry that curved on itself (reported by Desoto). Turned out the part of the floodfill working on verts already connected was just doing one case out of the two useful ones (little drawings helped :P).
2005-04-01 01:25:00 +00:00
4db0cbc741 Push/Pull (aka: non proportionnal resize, original idea by Robert Tiess) slipped in my last commit a bit, so might as well finish it.
Accesible with Shift-P (was free), the behavior is much like Shrink/Fatten. Pull mouse toward you to pull toward center, push away to push away. Constraint and PET works with it too, of course.
2005-03-31 22:18:08 +00:00
7532aa248f Transform fixes
Connected PET for mesh had an infinite loop in some case. Fixed an made a bit faster.
Renamed the numinput flag.
Corrected a conflict in TransInfo flags. This was a crash waiting to happen.
NO_CONSTRAINT flag now correctly used to disable MMB and constraint hotkeys when needed.


Added check for the manipulator flag when drawing them before applying transformation matrix. Was really weird when doing MMB with rotation.
2005-03-31 21:02:35 +00:00
e62740fa01 Different floodfill method for PET connected with mesh. More accurate but needs two temporary scratch arrays to keep vectors and nearest element pointers.
Will comment the code more later tonight, I'm a bit pissed at the moment (stupid errors right in your face. grrrr)
2005-03-30 23:19:42 +00:00
fa37194082 Prop mode goodie;
- Made proportional edit in Mesh editmode use connectivity to clip the
  area where proportional editing is allowed.
  Uses some kind of manhattan distance for clip area still, so is slightly
  too large for diagonals. Will be worked on!

- Fix; in constraint code, using (0 0 0) delta caused NaN.
2005-03-29 17:05:43 +00:00
da0a55d2b4 Tiny error in Jiri's commit. Unselected meta elements needs the quat flag too if they want to rotate using PET. 2005-03-29 16:12:42 +00:00
53437f9536 - it is possible to rotate with MetaBalls in edit mode now 2005-03-29 10:03:30 +00:00
9c48ebeaa3 Fix stupid error in connected code.
No more crashes, wheee!
2005-03-28 16:11:35 +00:00
927425608c Alright, this hopefully fixes some problems with the last transform commit.
Replaced old transform call when extruding and duplicating. Added a CTX_NOPET context flag for extrude. This is done rather a bit hackishly in Transform right now, better to do it with a on/off pet flag in TransInfo and check that everywhere instead.

Made sure transinfo Ext was initialised at NULL (I'm pretty sure it was in another spot, but LetterRip reported some crash leading me to believe that it might not be all the time. Better be safe than sorry).

Connected PET for curves uses the real distance for the fall off calculations now.
2005-03-28 00:56:00 +00:00
9f2f13aa99 Transform was still prototyped as having only one parameter in transform.h. Caused some warnings and possibly errors since some calls were missing the context.
The rest is proof of concept goody for a CONNECTED limiter for PET.
That is, PET affecting only elements which are connected together.

Only affects Curves right now since that was easier to test connectivity with. Still some polishing to do (falloff is based on distance of effect, not real distance), but it's a proof of concept, so...
2005-03-27 23:13:52 +00:00
05685e6ca7 Context parameter for Transform.
For tex space edit, crease (soon) and future use.


Manipulator assumes no context.
2005-03-27 21:25:15 +00:00
9cfcd5d82e Two small fixes in transform, committed so Martin can work...
- scale negative draws widget OK (scale widget only now)
- scale negative threshold (for flip) was on vertical Y, now is perpen-
  dicular to center of axis.
2005-03-27 19:54:18 +00:00
b8d59ccb69 Transform goodies;
- Added icons for the Widgets to blenderbuttons pic
- Added in header - if widget in use - three buttons to choose widget type
  (hold shift for combo widgets)
- Hotkey CTRL+space now switches widgets on/off

I also noticed negative scaling doesn't work satisfying yet;
- for scale widget, using center didn't work correct anymore (fixed)
- negative scaling didn't even get applied! (fixed)
- but; scaling somethig negative now flips back to positive... ????

Last one i need Martin P for! Note that I had to change Mat3ToSize....
2005-03-27 18:17:48 +00:00
c4971c2082 Transform fix; in PoseMode you now can do multiple chains again. 2005-03-25 13:31:59 +00:00
727a056de4 A couple of wee transform featurettes;
- center of rotation for camera in cameraview rotate has to remain the
  camera center itself, drawing the dashed helpline then doesn't work,
  since it's behind the camera clipplane. Just disabled that line.

- made MMB switch for cameraview grab to become quadratic, for a dolly
  this feels OK, and makes it possible to move in small and large scenes.

- restored SHIFT modifier for translation and scaling. This based on old
  convention that allowed precision editing on top of the transform you
  already applied before pressing SHIFT.
  Solved it with a new flag (T_SHIFT_MOD), since the G.qual cannot be
  used. Transform() innerloop has to detect the SHIFT event itself.
  Also coded it with storing the mouseposition while SHIFT event happened.
  Hope Martin can approve! :)

- Martin's last commit made Manipulator Translate not work, it passed on
  a zero translation to the constrainter, causing NaN's. Nicely catched the
  exception.

- Fixed 'Trackball' to accept number input too
2005-03-25 11:17:59 +00:00
4bcf80bf4f Reworked the camera dolly/parallel axis constraint code a bit. Works pretty much like the Shrink/Fatten code, meaning pull the mouse toward you pulls the camera, push pushes it away.
Also added a T_CAMERA flag for camera grab, which gets set on TransData conversion.
2005-03-24 21:32:52 +00:00
76f2346080 Transform fixes;
- Camera translate in camera view, with MMB, works again. Code needs
  verification by Martin... it does it different now too.
- Camera rotate in camera view works again. MMB switches to 'trackball',
  as formerly. Isn't consistant with other rotate+MMB though...
- rotate camera in cameraview around cursor doesn't 'feedack' anymore

Martin; I only use the TransInfo->persinv[4][4] now, but I think it's
safe to use viewmat and viewinv too?
2005-03-24 18:47:09 +00:00
7b6ec97182 Bug fix #2311
File name (40) and dirname (80) were too short in sequence data. Made it
compliant using defines FILE_MAXFILE and FILE_MAXDIR.
Also replaced all strcpy() and strcat() with strncpy/strncat, with the
defines in it.
Oh, also fixed plugin path length for sequence, was just 80!

Bug fix #2366

Restored old convention that made using SHIFT+CTRL while using button-
sliders go with 0.1 stepsize of CTRL.
(noticed too late that Chris Burt assigned to self... sorry!)
2005-03-24 09:37:06 +00:00
09ed2cef75 New feature, since long on todo;
The grid function (transform translate, snap-to) now uses the grid step as
displayed in the 3d window, so it depends on how much you zoomed in/out.

The threshold for it is a bit tricky... it follows the drawing, but the
blending in/out of grid makes it sometimes not obvious.  might need slight
tweak?
2005-03-23 14:24:43 +00:00
1a4138e184 - Removed temporal hack that switched manipulator type on G, R, S hotkeys.
That was blocking immediate hotkey access for normal blendering.
- New, experimental, hotkey to switch: CTRLKEY! Added code in such a way
  it detects a CTRL key press and release without using it as modifier.
  Pressing CTRL will cycle through the 3 manipulator types.

- Fix for yesterday's commit; click on centerpoint for switching
  orientation happened too on a click for other widgets. Not nice...
2005-03-22 15:01:36 +00:00
f0112406ed Added call in creating transform data Mesh editmode to calculate vertex-
normals for the ALT+S "shrink/fatten" option.
2005-03-22 11:10:04 +00:00
86d84f54c8 Size flipping, for kaito. Move pointer to the other side (horizontal) of the pointer to see. (Does affects size member, so just object position and edit mode) 2005-03-21 20:35:00 +00:00
c2121fb855 Fix for possible divide by zero error in Rotate.
Fix for MMB behavior when two axis were exactly on one another or very close. It now defaults like this: X, Y, Z (meaning if as near as X as Y, it chooses X). This could be fixed further.
2005-03-21 19:16:39 +00:00
e5520d955c Created initConstraint. It basicly just checks if the CON_APPLY has been set up (by the BIF_setConstraint calls for example) and calls startConstraint. This must be done because startConstraint uses data initialised when starting transform so it needs to be called after that.
Also changed some strcpy into strncpy.
2005-03-21 18:25:17 +00:00
bc77092959 Added string to BIF_setSingleAxisConstraint() function for headerprint.
Needed for martin to further work on print stuff
2005-03-21 17:52:45 +00:00
bc9291d806 Shrink/Fatten behavior change. This time for good I hope.
Technically, it now works by getting the mouse motion in 3D (just like Translation/Grab), projecting it on the vertical view axis, using the vector length as the shrink/fatten factor. If the motion is downward (on the screen), shrink, if it is upward, fatten.
In layman terms: move up to fatten, down to shrink and it adapts to the viewport zoom, like Translation.

I changed to snapgrid factors to match those of Translation to, so it really acts like grabbing.
2005-03-21 17:36:21 +00:00
981df9983f Transform:
- cleaner code for selection of handles in transform widget. in ortho views
  selecting the center handle defaults, to prevent Inf. overflows for
  perpendicular handles. While holding SHIFT it works the opposite!

- removed redraws on modifier (CTRL, SHIFT) key release. that ensures you
  can apply to grid nicely (functioned that way in all blender releases)
2005-03-21 16:36:43 +00:00