Commit Graph

3569 Commits

Author SHA1 Message Date
Daniel Dunbar
12107e6af2 - update new conversion to DLM routine to use match subsurf
(means optim, seams, selection should work same now, but I am
   not super familiar with all this stuff so can't test very well).

   These hacks to the DLM structure are disgusting btw Ton. What
   a waste of memory! All the information that is so meticulous to
   kept and managed in the old structure is essentially explicit (or
   easily made so) in the new one.
2005-03-21 04:22:58 +00:00
Daniel Dunbar
2ea128b86e - remove some duplicate prototypes, causes problems for some compilers 2005-03-21 02:03:42 +00:00
Daniel Dunbar
6555ca29ab - Part of CCGSubSurf integration, this is the actual blender side of the
integration.
2005-03-21 01:37:14 +00:00
Daniel Dunbar
887b598d71 - Initial integration of CCGSubSurf library into blender. The lib is
only in one C file and not worth dropping in extern but presumably
   will be synced with public CCGSubSurf release I hope to be making
   soon.
 - Currently the implementation must be enabled by defining
   USE_CCGSUBSURFLIB somewhere with your build system. The code should
   be considered highly experimental.
2005-03-21 01:34:27 +00:00
Daniel Dunbar
6e41cb0a97 - switch BLI_memarena to use stdlib malloc/free (alloc errors
will be caught by containing structure)
 - fixed off-by-one bug (reallocated one byte before necessary)
2005-03-21 00:48:19 +00:00
Daniel Dunbar
99676b7bfb - another BLI_winstuff.h removal 2005-03-21 00:47:21 +00:00
Martin Poirier
630bb7f7bf Warp was acting weird if the cursor wasn't centered in the data space, that is fixed.
Helpline for warp was wrong in edit mode if the object wasn't centered on global space.
Boundbox calculation for warp is done in view space now, so it is always maximised since aligned with the view.

Switch the negative/positive switch for Shrink/Fatten from horizontal motion to vertical motion. Pull down to shrink, pull up to fatten. This could still use some work.

BugFix: Constraint center was wrong with MMB (was bypassing the fix I commited the other day).
BugFix: Changing modes while in transform and switching to local constraints in edit mode crashed. This was due to resetting the TransInfo flag in initTransModeFlags. Now done correctly in initTrans.
2005-03-21 00:39:09 +00:00
Daniel Dunbar
6a70653577 - kill some warnings (open/seek/read/write need io.h on win32) 2005-03-20 20:48:40 +00:00
Daniel Dunbar
ca030aeab7 - apologies, accidentally commited code w/ game engine disabled 2005-03-20 20:36:46 +00:00
Johnny Matthews
03cafb856d Adding some docs for material insertIpoKey additions 2005-03-20 19:52:15 +00:00
Stephen Swaney
7df1facbfa New Material method: insertIpoKey( key_type )
inserts material ipo key at current frame.
contributed by Johnny Matthews.
2005-03-20 18:28:36 +00:00
Ton Roosendaal
dedad185ba Three rotate manipulators to play with;
G.rt = 0: one handle for each rotate axis
G.rt = 2: traditional half-circle rotate handles
G.rt = 3: mixed version
2005-03-20 17:25:00 +00:00
Stephen Swaney
99bffa9cc0 correct bad reference to getDrawMode. 2005-03-20 12:34:36 +00:00
Ton Roosendaal
c2140d28c1 - Fixed flipped orientation of getViewViewvector(), was opposite in ortho
versus perspective.
  Note for Martin; still an issue with defining what positive/negative
  rotation is in perspective... needs more math here!
- Added Transform Widgets for PoseMode
- made adding bones in EditMode setting G.moving, so it doesn't draw other
  selected objects nor Widgets

Warning in commit of Martin yesterday: Trackball and initTrackball were
declared static, whilst also in transform.h. Quez; why are these functions
exported in the .h file?
2005-03-20 09:45:54 +00:00
Johnny Matthews
836d576730 Adding some docs for Object insertIpoKey additions 2005-03-20 03:50:56 +00:00
Johnny Matthews
66b8984cd8 Adding some docs for Text3d additions 2005-03-20 03:42:04 +00:00
Martin Poirier
e65b0beea8 Ton broke a couple of things in his last commit including PET in rotation mode and local axis constraints on objects.
Bringing that back and enabling PET in trackball rotate.

Changed the rotation manipulator drawing code to really align the Trackball rotate ball with the view (using getViewVector) so that it always looks centered on the selection.
This was particularly ugly in perspective mode with a selection far from the center of the screen: http://www.clubinfo.bdeb.qc.ca/~theeth/screenie.jpg

Moved getViewVector from transform_constraints.c to transform_generics.c since it is not really a constraint related function. Also made it independant on the TransInfo structure so it might be useful elsewhere too.
2005-03-20 02:00:16 +00:00
Stephen Swaney
0d2179774d New Bpy Object method: insertIpoKey()
inserts Object IPO key for LOC, ROT, SIZE, LOCROT, or LOCROTSIZE
Contributed by Johnny Matthews (guitarGeek)
2005-03-19 23:47:39 +00:00
Ton Roosendaal
52417aeb6e - added helper lines in rotation widget
- switched to Local mode for widgets by default, will be a key/button later
2005-03-19 22:03:14 +00:00
Stephen Swaney
c0ebb826fa fix warning: initialization makes integer from pointer without a cast 2005-03-19 21:28:40 +00:00
Daniel Dunbar
8e92ee8684 - remove all obsolete inclusions of BLI_winstuff.h (due to recent changes)
NOTE: BLI_winstuff.h was meant to be a wrapper around windows.h to handle
undefining various crap that windows.h defines. Platform specific headers
should only have to be included in a few places. This reduces the number
of inclusions of BLI_winstuff.h to 16 which is a much more reasonable
number (than the 144 or whatever it used to be)
2005-03-19 21:08:13 +00:00
Daniel Dunbar
f74662dcc1 - add some windows specific defines to BIF_gl.h so that OpenGL can
be used without including windows.h - this is the main reason windows.h
   is included in so many places and this change allows most of those
   inclusions to die.
2005-03-19 20:48:39 +00:00
Ton Roosendaal
35ab8a32a1 Global G.moving got nice define flags, and additional meaning.
- move object mode
- move editmode/pose mode
- move with widgets
2005-03-19 20:27:13 +00:00
Daniel Dunbar
0542e1ebe3 - part of BLI_winstuff.h cleanup 2005-03-19 20:19:10 +00:00
Daniel Dunbar
b3bb3f06ba Some cleaning up of BLI_winstuff.h usage
- removed reference in render.h (really bad, shouldn't include a platform
   specific header so widely unless really necessary)
 - added M_PI, M_PI_2, M_SQRT, M_SQRT_2 defines to BLI_arithb.h... this is
   a better place as it is more the "standard" blender math header. left
   in winstuff.h as well for the moment for simplicity
 - other changes are patches to code so everything works ok with this
   shuffling.
2005-03-19 20:04:25 +00:00
Ton Roosendaal
c8d6515ad7 Little fix; while Transform() in editmode, and other objects were select,
these objects were drawn in transform color (white usually)
2005-03-19 20:00:23 +00:00
Ton Roosendaal
e07f2f1226 New version of rotate handlers. I like it! Now the rest of you ;) 2005-03-19 18:54:45 +00:00
Willian Padovani Germano
dd17f7e725 BPython:
- Added Blender.Run(script) + doc update (forgot to mention in my previous commit).

Trying to fix two mistakes from my previous commit:

- nmesh.transform(): forgot yesterday that affine vectors have 4th component = 0, now updated normals transformation accordingly.

- As Ton pointed, recursive parsing of scripts dirs in search of scripts was a mess.  I simply forgot about the "//" trick and much worse, to protect against worst cases ("/", for example). Now the code uses BLI_convertstringcode to take care of "//", doesn't process if dir = "/" and there are limits:

max depth for traversing subdirs = 4
max dirs in the tree = 30.

I'll work more on this, check more, but these changes were tested and should make the code safer, of course, so I'm committing.  Sorry about the mess, I should take lessons on defensive programming ...
2005-03-19 18:23:05 +00:00
Johnny Matthews
0d1738e285 Fix for building on win32 2005-03-19 17:15:25 +00:00
Roel Spruit
1ec0238bd6 Added transform_manipulator.c to the windows MSVC 6.0 projectfile 2005-03-19 14:13:45 +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
Joseph Gilbert
f61c5b1eec - adds /GR to compiler options for generating run time type info for c++ classes in the debug release
- add support for new transform files
2005-03-18 16:12:17 +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