Commit Graph

3392 Commits

Author SHA1 Message Date
Stephen Swaney
73c162dfef Ipo doc update. Contributed by Ken Hughes. 2005-05-21 04:20:57 +00:00
0945b86a63 O_BINARY define for unix compilers 2005-05-20 20:52:47 +00:00
244a1a71b3 Bug fix #2591
Dependency issue... could solve it by calling an extra where_is_object
when a displaylist is made for vertex-parenting on deformed objects.
2005-05-20 20:44:33 +00:00
7586eb28a1 -rewrite and bugfixes
----------------------------------
Here's my changelog:
-fixed Rand() so that it doesn't seed everytime and should generate better random numbers
- changed a few error return types to something more appropriate
- clean up of uninitialized variables & removal of unneccessary objects
- NMesh returns wrapped vectors now
- World returns wrapped matrices now
- Object.getEuler() and Object.getBoundingBox() return Wrapped data when data is present
- Object.getMatrix() returns wrapped data if it's worldspace, 'localspace' returns a new matrix
- Vector, Euler, Mat, Quat, call all now internally wrap object without destroying internal datablocks
- Removed memory allocation (unneeded) from all methods
- Vector's resize methods are only applicable to new vectors not wrapped data.
- Matrix(), Quat(), Euler(), Vector() now accepts ANY sequence list, including tuples, list, or a self object to copy - matrices accept multiple sequences
- Fixed Slerp() so that it now works correctly values are clamped between 0 and 1
- Euler.rotate does internal rotation now
- Slice assignment now works better for all types
- Vector * Vector and Quat * Quat are defined and return the DOT product
- Mat * Vec and Vec * Mat are defined now
- Moved #includes to .c file from headers. Also fixed prototypes in mathutils
- Added new helper functions for incref'ing to genutils
- Major cleanup of header files includes - include Mathutils.h for access to math types
- matrix.toQuat() and .toEuler() now fixed take appropriate matrix sizes
- Matrix() with no parameters now returns an identity matrix by default not a zero matrix
- printf() now prints with 6 digits instead of 4
- printf() now prints output with object descriptor
- Matrices now support [x][y] assignment (e.g. matrix[x][y] = 5.4)
- Matrix[index] = value now expectes a sequence not an integer. This will now set a ROW of the matrix through a sequence.  index cannot go above the row size of the matrix.
- slice operations on matrices work with sequences now (rows of the matrix) example:  mymatrix[0:2] returns a list of 2 wrapped vectors with access to the matrix data.
- slice assignment will no longer modify the data if the assignment operation fails
- fixed error in matrix * scalar multiplication
- euler.toMatrix(), toQuat() no longer causes "creep" from repeated use
- Wrapped data will generate wrapped objects when toEuler(), toQuat(), toMatrix() is used
- Quats can be created with angle/axis, axis/angle
- 4x4 matrices can be multiplied by 3D vectors (by popular demand :))
- vec *quat / quat * vec is now defined
- vec.magnitude alias for vec.length
- all self, internal methods return a pointer to self now so you can do print vector.internalmethod() or vector.internalmethod().nextmethod() (no more print matrix.inverse() returning 'none')
- these methods have been deprecated (still functioning but suggested to use the corrected functionality):
  * CopyVec() - replaced by Vector() functionality
  * CopyMat() - replaced by Matrix() functionality
  * CopyQuat() - replace by Quaternion() functionality
  * CopyEuler() - replaced by Euler() functionality
  * RotateEuler() - replaced by Euler.rotate() funtionality
  * MatMultVec() - replaced by matrix * vector
  * VecMultMat() - replaced by vector * matrix
-  New struct containers references to python object data or internally allocated blender data for wrapping
* Explaination here:  math structs now function as a 'simple wrapper' or a 'py_object' - data that is created on the fly will now be a 'py_object' with its memory managed by python
*    otherwise if the data is returned by blender's G.main then the math object is a 'simple wrapper' and data can be accessed directly from the struct just like other python objects.
2005-05-20 19:28:04 +00:00
d99f64b823 Manipulators now draw on location of optimal subsurf vertices. Looks
nicer, but be aware that these locations are 'virtual', derived from
the actual Mesh Cage vertices you don't see.

Normal transform (and actual transform with Manipulators) remains on
the original vertices, which also shows with dashed line towards pivot
on scale/rotate.
2005-05-20 18:16:18 +00:00
bc62536fac Different drawing code for darkened part in TimeLine window, to indicate
the start/end frame. It uses a GL_BLEND which doesnt work nice for darker
backdrops. Now it uses ThemeColorShade() which does it OK.
2005-05-20 16:01:36 +00:00
Nathan Letwory
b7cc5b790a * Check path for NULL. Fixes potential crash on non-win32 systems at startup, but also future passes of null. 2005-05-20 12:37:48 +00:00
Nathan Letwory
1071d4a16e This commit fixes two related issues:
1:
* when a blendfile gets loaded, paths are corrected with OS specific slashes (see blender.c)
* made available BLI_char_switch(char *string, char from, char to)
* made available BLI_clean(char *string);. This function should be called whenever you're doing path stuff, so paths are correctly saved, and thus avoiding other path functions stopping to work

2:
* relative paths work now in sequencer too (due to slash mess that didn't work all too well).
2005-05-20 12:18:11 +00:00
Stephen Swaney
f8ae055f4b corrections and missing ipo channels for Camera, World, Material
and Lamp.  Contributions from Ken Hughes.
2005-05-20 12:16:54 +00:00
83792faa3f Two softbody thingies;
- fixed error in option "Enable Goal" which didn't work with Vertex groups
  assigned

- renamed some buttons & fixed tooltips. A doc online will be there soon
2005-05-20 12:15:50 +00:00
32fd7ad4c9 Fix for TimeLine "Play" with sound-sync set.
Added check for audiostream_pos() - which should return current frame
corrected for audio playback - to be at least 1 frame larger than current
frame. It caused in some situations even a backwards playback!
2005-05-20 10:27:11 +00:00
5862e1a883 Bugfix reported by Basse; adding a new strip in Sequencer didn't initialize
the sequence "Mult" value properly when the "Properties" Panel was open.
That resulted in images displaying black...
2005-05-20 09:35:33 +00:00
8f080e024f BPython: bug fixes / patches from trackers
(excuse me for not committing earlier)

Patches by Ken Hughes (thanks for all bug fixes!):

1) Setting a scene's MapOld and MapNew values in python does nothing:
bug #2566 submitted by Dominic Agoro-Ombaka (dmao):
https://projects.blender.org/tracker/?func=detail&aid=2566&group_id=9&atid=125
patch #2571:
https://projects.blender.org/tracker/index.php?func=detail&aid=2571&group_id=9&atid=127

2) Calling the file selector after setting the progress bar crashes Blender:
bug #2418 submitted by Alessandro Garosi (brandano):
https://projects.blender.org/tracker/?func=detail&aid=2418&group_id=9&atid=125
patch #2568:
https://projects.blender.org/tracker/index.php?func=detail&aid=2568&group_id=9&atid=127

3) Menus always generate same event when canceled:
bug #2429 submitted by Campbell Barton:
https://projects.blender.org/tracker/?func=detail&aid=2429&group_id=9&atid=125
patch #2579:
https://projects.blender.org/tracker/?func=detail&aid=2579&group_id=9&atid=127

4) Add a vertex to a mesh with groups using a script and then edit that mesh hangs blender:
bug #2211 reported by German Alonso Tamayo (servivo):
https://projects.blender.org/tracker/index.php?func=detail&aid=2211&group_id=9&atid=125
patch #2580
#https://projects.blender.org/tracker/index.php?func=detail&aid=2580&group_id=9&atid=127

About bug #2033, I'm still looking at it, committing a small fix now.

=====

Patches by Campbell Barton (thanks!):

#2482: BGL pydocs fix broken links
https://projects.blender.org/tracker/index.php?func=detail&aid=2482&group_id=9&atid=127

#2426: Large text in Draw.Text and Draw.GetStreingWidth
https://projects.blender.org/tracker/index.php?func=detail&aid=2462&group_id=9&atid=127

#2521: scene.getActiveObject()
https://projects.blender.org/tracker/index.php?func=detail&aid=2521&group_id=9&atid=127

#2523: NMesh.GetNames()
https://projects.blender.org/tracker/index.php?func=detail&aid=2523&group_id=9&atid=127

- docs also updated
2005-05-20 05:14:03 +00:00
fcadf9cc34 Pressing ESC now stops 'animated UI playback' too. It doesnt conflict with
ESC for other situations... so might work well after all.
2005-05-19 20:57:48 +00:00
3fb7442d35 Made TimeLine "Play" also play sound and synchronize with it. Added the
feature with a header button.

Works like audio playback on ALT+A, meaning you have to add the audio
strips in Sequencer. The 'only sync' option for ALT+A doesn't work here.

Also: fixed crash on ESC in audio playback in sequencer.
2005-05-19 19:58:53 +00:00
dee5af12e3 Back to the Future bugfix!
When a new space (window) type gets added, older Blender binaries will
crash on reading files saved with such spaces. This breaks the so nice
upward compility on files...  With addition of SpaceTime I got an occasion
to verify & fix that. If Blender detects a non-existant space it will
degrade it to a 3D window now. Tested on a full 2.34 compile.
2005-05-19 15:47:42 +00:00
461768db47 I've decided to not include this Zblur implementation in the release.
It fails in all criticial tests, not to mention the confusing UI even. :)

Code is still there, just the options for zblur are removed now, and
Output Panel restored.

Belongs actually as an effect in the Sequencer, nice todo for a next
release.
2005-05-19 08:27:38 +00:00
78a395d3d5 Fix MMB code again. (I'm near the "set an accronym for that so it's shorter to time next time" phase...)
This time, probably for good since I've really tested it through and the z factor used there never gives overflow and is correctly calibrated with both the real zfac and the zoom level.
2005-05-19 04:33:38 +00:00
Stephen Swaney
615c2f40a1 text editor patch by antihc3.
fixes 'Memoryblock free: attempt to free NULL pointer' errors.
2005-05-19 03:15:49 +00:00
c1936cff60 fixed it sending null to MEM_freeN
.
2005-05-18 23:54:56 +00:00
35ee2c2b4e fix a little mem leak
.
2005-05-18 23:53:00 +00:00
803d440871 On start vertexpaint of subsurf, the initialized vertex colors were wrong.
It tries to use the shaded colors, but these are from the subsurfed mesh.

Didn't feel like hacking here, so for this case colors are initialized
as black.
2005-05-18 20:32:32 +00:00
95ad5ce1a8 Bug fix #2585
Separate All Loose Parts crashed with subsurf on. Just copied the fix
from Separate itself, by Daniel last week.
Yes, its a nasty piece of code... :)
2005-05-18 20:06:23 +00:00
682eb13456 Bug #2583
Pulldown Mesh in editmode didn't allow to set Proportional edit. Also the
name 'Sphere' for proportional mode was missing.
2005-05-18 20:00:39 +00:00
698f7974b9 Bug #2582
This combo didnt render OK:
1 Armature has Empties parented to Bones
2 Curve has these Empties as Hooks
3 Mesh is deformed with this Curve

Could be solved with calling makeDispList() earlier on, and it seems like
the depgraph already does a great job here. :)
2005-05-18 19:50:39 +00:00
780412f1ae Bug fix #2577
With rendering a border, the amount of scanlines can be 'odd', which
wasn't checked for correctly on OSA thread render.
2005-05-18 10:43:08 +00:00
7018576bfd Bugfix #2576
The ALT+F "Beauty Fill" could crash, for example on the already legendary
monkey head CTRL+T,J test. :)
Found out there was a necessary check for edge/face selection flags missing
2005-05-18 10:27:52 +00:00
704867c4c9 Bug fix #2578
My fix to make subloops more idling was not needed in the case for
drawing the knife cut 'mouse trail'. This uses a proper qread() which
has a wait builtin for events.
2005-05-18 09:19:16 +00:00
1b3498b3f3 Fixing MMB selection code for good.
zfac needed to be inverted to be used properly. Works for extreme close ups and extreme zoom out.
2005-05-18 06:13:50 +00:00
Stephen Swaney
6356b6e8bd add python 2.4ish macro Py_RETURN_NONE.
does incref and returns Py_None.
2005-05-17 20:23:06 +00:00
859959b49c BPython:
- fixing bug reported by Paolo Colombo: space handler slinks set for a 3d view were not set when the area got maximized;
- Blender.Object: added object.isSB() method to know if an object is a soft body (has ob->soft != NULL).  Used in fixfromarmature.py.

Scripts:
- updates: batch_name_edit (Campbell), fixfromarmature (JMS);
- additions:
   X3D exporter by Bart;
   Envelope Suite by Jonas Petersen;
   BVH 2 Armature by Jean-Baptiste Perin;
   Camera Changer by Regis Montoya (3R);
   Interactive Console by Campbell (ideasman).
- tiny updates in other scripts.
2005-05-17 07:17:52 +00:00
7f4ff24462 Unitialized variable in resize function.
Was caused by a previous commit, disabling Element Center mode for edit mode, since it's not working properly yet.

Fixing bug #2558: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2558&group_id=9
2005-05-16 23:23:19 +00:00
7373dcf705 Transform MMB code fixing Ton's last fix.
His fix was good, except that it switched to project_float instead of project_short, and that's not good because we're renormalizing the vector after that, which maximizes the float errors. Since it's scalling the axis anyway with the zfac method, it can use project_short safely (I tested it with the bug tracker file that triggered the fix in the first place).
2005-05-16 08:25:49 +00:00
9306ff787e Corrected the python keywords list for syntax highlighting (it was missing "and" and "break").
Used the official list: http://docs.python.org/ref/keywords.html

While "as" is not a keyword, it is (should be) always used as such, so I've added it to the list too.
2005-05-16 03:57:43 +00:00
70c0f60df5 Fixing bug #2556: http://projects.blender.org/tracker/?func=detail&atid=125&aid=2556&group_id=9
MEMSET was clearing the TransInfo struct after the constraint setup call has been made.

Temporary fix until the manipulator transform init is split off, like normal transform.
2005-05-15 05:44:11 +00:00
1533b6fd32 Variable declaration in the middle of some code. (MSVC complained, as it should) 2005-05-15 05:41:55 +00:00
35df374297 fix for bug in timeline found by Ztonzy on Irc
when zooming in with frame enabled, partial of frame were drawn with
multiple same int labels. confusing if harmless.


Ton, can you check this fix is the proper one ?
2005-05-14 11:28:53 +00:00
b20fe83751 New buttons image with syntax color icon 2005-05-13 16:18:01 +00:00
2d6481c41c TextEditor: syntax color support.
Patch provided by Ricki Myers. Works quite obvious, see Theme editor too!

Notes about the provided code;
- The default syntax colors were screaming! Toned it down to match the
  default dark on lightgrey background better.
- Added: initializing colors in saved themes (usiblender.c)
- The implementation of the button for this option was quite clumsy...
  Blender UI options services this a lot easier.
  (Same fixed for 'line numbers' option)
- Bracket matching now uses as color a mix of backdrop and the
  selected-text color. Noticed my texteditor did it too...

-> I really miss comments in code describing a little bit the thought
   process behind the code. Like a short introduction on this feature
   in the top of the drawtext.c, little remarks on new functions.
   ALso in patch tracker or the mailinglist no docs was mentioned?

-> drawtext.c now gets messy quickly... lack of overview, structure,
   and confusing mix of personal coding styles.
   For not-active supported code dangerous...
2005-05-13 16:11:28 +00:00
ec2cbb2689 Bug fix: Beauty Fill crashed on non-regular geometry. Pointers NULL...
Also: fixed tooltips for icon buttons for Transform Widgets
2005-05-13 14:10:34 +00:00
c7942efdba Deform with Curves didn't take the 'tilt' value into account.
Note, the tilting only works for '3D' curves, and is accessible in
EditMode curve with TKEY.
2005-05-13 13:06:20 +00:00
05b985d6c8 Fix for bug #2201: Subdivide code not doing UV and VCol properly when not cutting in the middle (knife and loop cut)
http://projects.blender.org/tracker/index.php?func=detail&aid=2201&group_id=9&atid=125

I had to redo the uv/vcol splitting loop, merging triangles and quads code together for efficiency and cleanliness. Added a lots of comments too, so people more interested can look at that (nice ascii art too).
2005-05-13 10:20:10 +00:00
3268ebddd7 Baking softbody: when 'frame mapping' is used, the baking process
should disable that, since animation systems remain in their own local
system time. Framemap is only for playback!

Not doing this caused corrupt baking, bug #2531 reported it.
2005-05-13 10:07:14 +00:00
49dbf781de Three fixes in 1 commit. :)
- Bug #2530
  The MMB Transform constraint 'chooser' used projection code that didnt
  work when zoomed in extreme. Needed a correction to scale projected
  coordinate according zoomlevel.

- NKEY panel for objects: click on left/right side of scale button now
  goes with increments of 0.1 (was 1.0)

- Moving window edges in Screen: prevented top header from becoming too
  small due to grid-snapping. Was visible now with using Texture Font.
2005-05-13 09:22:37 +00:00
d4b2824b24 Bug fix #2535
Armatures with > 100 bones can deliver a 'parent IK menu' that doesn't
fit on screen anymore. Fixed it with changes;

- when menu doesnt fit to right/left, it places it aligned to left hand
  of window
- when more than 8 collums in a menu exist, it makes collums 25 items
  instead of 20.

Also fixed for the popup menu on Bone parenting. On a 1280 screen we now
can have a menu with over 300 bones (even more when you zoom down the
buttons window a bit). Still not optimal, but at least it's less annoying.
2005-05-12 20:06:30 +00:00
a7bbf8245a Fixed various errors with Blender allowing editing Library linked data.
CTRL+V on buttons
NKEY Panels
join mesh
join curve
editing buttons
boolean
vpaint
faceselect
Manipulator

Also; Transform() got in useless loop when you entered without anything
selected. Not sure why Martin recoded it this way... maybe as a first
step to handlerify it? For evil Python Aussie Bosses? :P
2005-05-12 19:17:12 +00:00
2579d377a3 Bug fix #2542
Fun, the error is in code committed by Kent Mein, in a patch provided by
Campbell, who also reported the bug. :)
There was a line that set ALL selected objects (on click) to become active,
in succession, in a loop... very bad.

Activating in Oops better be restricted to ctrl+click. Fixed!
2005-05-12 17:24:47 +00:00
e3c11a0bcc Bugfix #2541
Using as Pivot the "individual object centers" didn't do any rotation or
scaling in editmode. I think it was supposed to give some kind of
'connected' centers, for individual faces/edges rotate. That'll be some
more coding work to get to work. :)
2005-05-12 17:11:32 +00:00
6bb1232b06 Bug fix #2533
Made face-looping code idling correctly (hotkey K in editmode)
2005-05-12 14:37:47 +00:00
34d8522431 bugfix #2532
Grab Time marker didn't idle correctly... was not checking for correct
previous mousecoordinate.
2005-05-12 14:30:17 +00:00