Commit Graph

47594 Commits

Author SHA1 Message Date
Johnny Matthews
0d1738e285 Fix for building on win32 2005-03-19 17:15:25 +00:00
Stephen Swaney
c87eb1d628 Added curly braces around an #ifdef NEWTRANSFORM.
Needed when NEWTRANSFORM was not defined.
2005-03-19 13:26:03 +00:00
Ton Roosendaal
a2ed880c9f Transform widgets; Scale and Rotate versions
To use; press the (temporal) icon in header. Switching widget types is by
pressing G, R or S once, if current widget type is different it switches,
otherwise it goes to normal Transform().

Widgets need a bit test for picking accuracy, correct drawing etc.
The rotate widget has a center button for 'trackball' rotate. That latter
can also be used for hotkey-based rotate.

In current code, all widgets remain in "Global" space, also in editmode.
Also widget updates while using normal transform has to be done.

2 Bugfixes:
- rotate in PoseMode had error for 2d 'around' center
- transform in postemode could crash, due to typo (& or |)
2005-03-19 12:17:06 +00:00
Willian Padovani Germano
a96ed881dc BPython:
- Scripts:
    fixed error in "Save Current Theme" which prevented it from automatically updating script registration in menus.
    cosmetic changes in a couple of Campbell's sel_same.py script strings + more descriptive name for its new menu place (3d view, face mode -> select menu).
    small updates to help_browser.py script.

 The above changes are related to this:
- Added new script menu entries: Render (for exporters to renderers), Themes, FaceSelect (this already at the proper place).  Updated Scripts win->Scripts menu so it won't show all available entries, only  the ones we mean to see there.
- Updated menu registration so that scripts folders can become trees.  The release/scripts/ dir should be updated soon with subdirs like converters/, modifiers/, generators/ or whatever -- better discuss first (or is it? /me afraid of long irc discussions during meetings :) ).

- Modules:
    Blender: added 'udatadir' option to .Get() function and added var Blender.mode to tell if Blender is in bg or interactive mode.
    NMesh: added Campbell's nmesh.transform(matrix, recalc_normals = False) method (reworked, so my fault if it doesn't work).

- Bugs fixed:
    #2123: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2123&group_id=9
    Reported by Ken Hughes (thanks!), who also found the exact problem later (it was in Text.Load, not with script links -- if only I had checked emails these days ... lost > 1 hour today to find the problem: passed filename to M_Text_Load was later being written over by a function called by add_text).  Also saw that Text.Load wasn't checking existence of passed filename (duh!), now it does.

    #1655: http://projects.blender.org/tracker/?func=detail&atid=125&aid=1655&group_id=9
    Reported by Chris Want (thanks!): command line "blender -P script" not working properly for bg mode ("blender -b blendfile -P script").
    Had to make some small updates to get it working (bg mode for scripts was never explicitely handled, it worked due to collateral effects, let's say), interested readers can check the report after I update it or the API_intro.py doc file.  After more testing we can make further updates.  Updated many places to not call redraws if in bg mode, now it is officially available.  Blender outputs its own info when rendering in bg mode, if that is considered a nuissance we'll have to add a few "if (during_script())" calls outside bpython.

- Removed a few warnings here and there and also updated docs.
2005-03-19 06:24:55 +00:00
Joseph Gilbert
cbbe236f92 - patch submitted by guitargeek
-includes:
*Text3d accessors - ablity to manipulate FONT objects through python
*update to Object.link - calls text_to_curve upon ob_font link for drawing
*update to constant.h - constant type checking define
*update to curve.c - clamp values on getters/setters
*clean up of Text3d module
2005-03-19 03:24:00 +00:00
Martin Poirier
f08504c525 Individual Element (object) center for Rotate and Resize. Note that using this in edit mode is a bit useless right now, but we have some surprises in our bozo bin :P
Transform can switch mode on the fly again (GRS).

Fixed a bug with the BIF constraint call, needed to call startConstraint and normalise the space matrix (this affected the manipulator).
2005-03-18 15:08:02 +00:00
Ton Roosendaal
ecdf0d3412 Forgot to cvs add a file!
Also did the SConscript file.

MSVC users have to add this!
2005-03-17 21:46:05 +00:00
Ton Roosendaal
17bd00a851 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
Joilnen Leite
ab21276aaf fixed example of use the GetScreenInfo
.
2005-03-17 14:41:36 +00:00
Martin Poirier
38dff43877 Needed to normalise the axis orientation matrix.
This fixed the scaling bug intrr and LetterRip reported.
2005-03-17 13:55:48 +00:00
Ton Roosendaal
5a382e094f Ack, typo in previous commit, bugfix for confusing edge selection. Passed
a face pointer to edge function... tsk tsk!
2005-03-17 12:01:07 +00:00
Martin Poirier
9a30f56937 Trying a little something with the MMB behavior.
Constraint selection is now based on mouse motion (instead of pointer position).

What that means is that if you simply click MMB, it works exactly like it did with old transform (in 90% of the case, the last 10% is when MMB click was unpredictable in old transform because of extreme viewport orientation)

Also, since this means you don't really have a referential on which to base yourself, it draws a dashed line representing the mouse motion, starting at the center of the axis lines.


Please test and discuss, if this is better than before or not.
2005-03-17 02:34:25 +00:00
Martin Poirier
07c26eb397 Fixed constraint center calculation. Much smarter to do it when calculating transformation center...
Fixed Extrude constraint. Needed to premul the normal by the object's matrix to but it in global space.

Also, moved the Locking Axis modifier (for constraints) from Alt to Shift. Alt was conflicting with middle mouse button emulation (reported in the test builds forum).

Tilt Transformation.
2005-03-16 21:55:57 +00:00
Martin Poirier
1b61771d9e Optimising transformations in PET mode.
Sorting elements in TransData array according to their distance. That means we can always stop loops when it finds the first element that doesn't apply. That makes PET factor calculation and actual transformations faster since it stops at the first element outside of the area.

The Sorting algo is a no swap version of quicksort using the start of each subset as the pivot (random would be better and easy to implement. Need 3 additional lines of code really).
2005-03-15 17:31:46 +00:00
Ton Roosendaal
e9381e61aa Bug fix #2320
Silly 2.36 bug! In FaceSelect mode, other solid objects didn't show. Bad!

Additional; when using Halo material, and setting 'X Alpha', and disabling
Halo option, the 'Only Shadow' option turned on... uses same bit...
No time for real fix here, so for now the bit is always cleared after
disabling Halo.
2005-03-15 12:30:58 +00:00
Martin Poirier
9efe92bbaa Matrix multiplcations for Multiple Object local constraints for Resize was done backward. Didn't show in my test case because they were too crude. Fixed now. (in essence, resize with multiple selected objects and local constraint was not good) 2005-03-14 23:24:37 +00:00
Jean-Luc Peurière
3ca88c4e7f ome more warnings cleaning 2005-03-14 20:10:22 +00:00
Ton Roosendaal
7e2e2b2370 Bugfix #2324
Somehow, not proven how, edges can be selected in a mesh, and not faces or
vertices. When entering editmode these selection flags are checked too.
2005-03-14 20:09:57 +00:00
Kent Mein
ecf6de151c This commit reverses the OpenEXR specific stuff in the OpenEXR commit I
did last friday.  A patch will be available in the patches tracker
that will have the current stuff there until everything is working.

Kent
2005-03-14 14:56:40 +00:00
Ton Roosendaal
cce74ab4d0 Transform: brought back axis constraint default after extruding. When
choosing 'individual faces' it uses the ShrinkFatten option.

Note for Martin: center of axis is still wrong, but you know!
Note for non-testers: unfortunately axis constrainting for old
transform now doesn't work anymore. New code is much nicer, I dont restore
hacks!
2005-03-14 14:16:59 +00:00
Martin Poirier
fd4ad35d4c New AFFECTALL flag for numinput
When that flag is set, numbers typed when the cursor is on the first position will affect all positions who do not currently have something typed for them.

Enabled Skey, 2, Enter to quickly double the size of something.

All modesty asside, it's coded rather smartly so it shows the cursor in every position that it will affect and lets you tab in undefined position to type in values there.

Thanks to Samadam for reminding me that the old code permitted that.
2005-03-13 21:42:22 +00:00
Martin Poirier
60b0e67e32 Fixed edit mode armature bug reported by Gabio (transdata conversion wasn't setting data center correctly).
Brought back Shrink/Fatten. Changed the behavior a bit, move the cursor to the right to move toward the normal, to the left to move backward. Please comment.
Only works with meshes, defaults to resize otherwise.
2005-03-13 20:17:39 +00:00
Ton Roosendaal
e76a63635b Transform:
Camera grab from camera mode works, but not the middlemouse-toggle, that
has to become a new "Dolly" constraint coded by Martin P! :)
2005-03-13 19:48:17 +00:00
Stephen Swaney
8c564af147 A little editing on the doc for the newest member of our Bpy module familily: Text3d. 2005-03-13 13:17:59 +00:00
Martin Poirier
7d520a16c4 Made warp use TransData members instead of G.obedit. Made it work with PET and Objects at the same time. 2005-03-13 02:15:32 +00:00
Martin Poirier
597cbb1b4f Local axis with multiple objects wasn't working for Scaling.
Also, splitted of Translation's applying loop (for eventually macro interface).
2005-03-12 23:15:26 +00:00
Martin Poirier
8f47841536 NumInput is now applied correctly to constraints and prints correctly in the header.
What that means is that you can grab/resize an object, press Xkey, type 2 (to resize/move by 2 on the x axis) and then press Ykey and the numeric value will be applied to the transformation on the Y axis.

Fixed a small glitch where constraint center wasn't readjusted for edit mode when using MMB (graphical bug only).
2005-03-12 20:34:02 +00:00
Ton Roosendaal
d3202c5fcc Added a #ifdef WITH_OPENEXR around this entire file. It doesn't compile for
Makefiles otherwise...
2005-03-12 13:37:05 +00:00
Joilnen Leite
4aeaa7a7a2 doc about set/getDupliVerts method
.
2005-03-12 12:31:33 +00:00
Ton Roosendaal
1f284bb583 Bug fix as reported by Fish-Face/Chris Le Sueur on IRC
After deleting an object, the call free_and_unlink_base() takes care of
NULLifying object pointers. But, with exception of constraints. Silly!!!

So, in the end of a function additionally the test_scene_constraints()
has to be called to prevent crashes. This was missing in join_mesh and
convert_object.
2005-03-12 12:10:07 +00:00
Joilnen Leite
e1e6b10488 added getDupliVerts and setDupliVerts methods
.
2005-03-12 11:38:51 +00:00
Daniel Dunbar
f8a8f355b5 - made makesdna print how many bytes of padding should be added in
a struct on alignment errors, simplifies fixing.
2005-03-11 21:20:33 +00:00
Daniel Dunbar
18c01053cb - dna_error wasn't set on two errors in makesdna, allowed bad compilation 2005-03-11 21:15:20 +00:00
Kent Mein
a1919e6db4 Gernot Ziegler's patch to add OpenEXR support to blender.
To enable it you will need to download OpenEXR and install it.
For the Makefiles you will need to set WITH_OPENEXR=true
and set NAN_OPENEXR to point to where OpenEXR is installed.

For scons you'll need to remove config.opts to get the new options
so you can enable OpenEXR, I was not able to get blender to link
with scons so the scons stuff may need to be tweaked a little but
I think it should work.

For other platform managers  The OpenEXR stuff is similar to QUICKTIME
you need to define WITH_OPENEXR and setup the library stuff and
as you'll notice in this commit there are two extra files.

Kent
2005-03-11 20:16:14 +00:00
Ton Roosendaal
c6d5124560 Bug fix 2301
Halo render had too narrow clipping for left/right or top/bottom part of
image. Was caused by fix for 2.36, incorrect clipping for distance...
distance was OK, but the old hack should be still there for X or Y clip!
2005-03-11 18:55:09 +00:00
Martin Poirier
8129e55940 It's fun to set flags correctly and not have everything crash down on you. 2005-03-11 18:48:14 +00:00
Ton Roosendaal
409e0a5c82 Bug fix 2309
Move calls to exit editmode and posemode to "set_scene()". Was causing
errors when, in posemode, switching to empty scene.
2005-03-11 18:24:15 +00:00
Kent Mein
7a0e2a012c Found some messed up code that assumed abgr instead of rgba
In IMB_gamwarp which is used by the blur sequence plugin.
It should be fixed now.  Also fixes a warning with gcc.

Kent
2005-03-11 13:00:31 +00:00
Martin Poirier
3bc2ae130d IMPORTANT NOTE: Locking axis (planar constraints) now works with ALT instead of CTRL. Ctrl might have caused problems in the long run, with people holding down ctrl for precision and then having to release it so to press an axis key if they don't want to lock it.
Finish adding local constraints for multiple objects: One of the objects will have its axis highlighted lighter than the others. You control this one with your mouse and the others copy the motion on their respective axis.

Code changes: the TD_OBJECT flag is now a flag in TransInfo with the new T_POSE, T_EDIT and T_TEXTURE
2005-03-11 01:33:43 +00:00
Ton Roosendaal
cce375fa92 Bugfix 2062
Stringcopy to a buf[32] without checking stringsize caused errors.

All credits for Martin P who found it. I'm assistant-committer. :)
2005-03-10 20:29:28 +00:00
Joilnen Leite
53b578d090 Text3d submodule document
.
2005-03-10 02:49:27 +00:00
Ton Roosendaal
cd3b11f41e - Added more space in icons image (blenderbuttons.png)
It now only uses 1 extra row of 21 buttons. More can simply be added
- Added new icons for the new proportional edit options Root, Linear and
  Constant
- Made sure pulldown and pop-up menu work for new prop options

- Transform fix; proportional edit circle was drawing in Object mode
2005-03-09 21:10:30 +00:00
Jean-Luc Peurière
c78e44cdc5 big warning hunt commit
lot of casts, added prototypes, missing includes and some true errors
2005-03-09 19:45:59 +00:00
Ton Roosendaal
77d44e88e9 Transform project; restored "auto key" after transform. It now inserts
always loc/rot/size ipos. The old method had a quite questionable
heuristic for detecting what changed, not sure if we want it back.

Added note in code, good candidate for later recode with dep graphs.
2005-03-09 19:32:23 +00:00
Ton Roosendaal
3e5200f1db - Restored 'align mode', which allows rotate/scale with only object centers
- commented out debug prints from theeth :)
2005-03-09 16:58:42 +00:00
Joilnen Leite
7968cf078e doc about Text3d module
.
2005-03-09 02:06:35 +00:00
Daniel Dunbar
0cb8cac4d3 - replaced min() by MIN2() and max() by MAX2()... my bad. 2005-03-08 19:31:16 +00:00
Daniel Dunbar
5936870006 Bug fix #2296
- Background image would jitter around on ATI card when zoomed in too
   far. It appears that the driver is was multiplying the image width
   by the zoom factor at some point and clamping this number, before
   clipping the visible image. Somehow this then fed back in to clipping
   the zoom factor.

   Fix is to only tell GL to draw the smallest number of pixels (width
   and height) that would be visible on the screen. Since this is not
   a generally bad thing to do applied fix for all users of
   glaDrawPixelsSafe.
2005-03-08 19:27:58 +00:00
Daniel Dunbar
af092210db - switch draW_bgpic to calculate window coordinates as floats, smoother
zooming of background pic now.
2005-03-08 19:18:40 +00:00
Daniel Dunbar
a26d91fddf - replaced call to project_short_noclip with direct implementation
because project_short_noclip doesn't do the calculation if
     the value would be near-clipped. For background picture we
     don't care about this.
2005-03-08 18:58:27 +00:00