Commit Graph

3399 Commits

Author SHA1 Message Date
Stephen Swaney
ece00ff04a Roll back changes from Big Mathutils Commit on 2005/05/20. 2005-05-22 17:40:00 +00:00
910b0f2cda Local constraint uses center mode again. This fixes a bug in the tracker, wasn't really a "bug", but anyway... 2005-05-22 12:01:12 +00:00
2f3dbcc5b7 BPython bug fixes:
- bug #2033 reported by Ken Hughes: Vertices of mesh parented to lattice is scaled incorrectly:
https://projects.blender.org/tracker/?func=detail&aid=2033&group_id=9&atid=125

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

(#2211's hang was already fixed with previous commit, but this way should work better)

- doc updates (Ken reported missing info about Render slinks, thanks).
2005-05-22 07:22:34 +00:00
ae2acbf49b late night commit:
* build blenderplayer on linux/ppc
* fix 'make clean' for darwin
2005-05-22 01:21:01 +00:00
e441c57d22 fix for bug #2588
objects with circular dependancies where not handled correctly
when sorting bases.

the fix is actually a workaround only and may evolve later

also add changes to xcode project for recent commits
2005-05-21 21:52:58 +00:00
33832f52ea Part one of the final yafray commit.
Totally updated blender shader in yafray, hopefully better matches blender
results. Though ramps are now partially supported, they cannot work in all
cases properly in yafray, and in fact are a bit useless probably as far as
yafray is concerned. In fact the 'Result' ramp input mode is not supported
at all, because it works on the total lighting result, and in a yafray
shader this is not possible since it works per light.
Also, since Blender and Yafray have totally different lighting models,
the 'Energy' ramp input mode also won't generally give the same results
as in Blender, since it works with light energy and in yafray this is
different from Blender. Even worse, the only ramp shader that will work
properly when used with GI is the 'Normal' ramp input mode.
As contradictory as this might seem, at various stages of the GI process,
lighting is not known, so properly getting light (ramp 'energy' mode)
or shader information (ramp 'shader' mode, which depends on lighting)
is not possible. Which all means that when the ramp is in 'energy' or
'shader' mode and using it with GI enabled, yafray can only 'see' the
underlying material color, not the ramps, which results in a mix of the
ramp colors (from direct light) with the material color (from indirect light).
There is currently nothing that can be done about that.

The supported texture mapping modes now includes raymir as well, transparency
as far as texturing is concerned now works similar to Blender, with the
exception that you still have to set alpha to a low value to get any
transparency effect at all in yafray. So the Blender 'filter' parameter
now also will affect yafray.
All texture blending modes are now supported (same for ramps).
'Translu' and 'Amb' texture modulation are not supported.
Texture interpolation can be switched off ('InterPol' switch in blender
image texture button section).

All Blender brdf models (aka 'shaders' for the Blender users) are now supported,
and again, you won't necessarily get the same results as in Blender.
The reason for that is partially of course the lighting differences, but also,
not all Blender 'shader' implementations are  actually correct, and copying
those errors just for the sake of matching Blender results doesn't really
seem like a good idea...
Though this really is only the case for WardIso, less so for Minnaert and
Blinn, which in yafray are more or less (but not totally) a copy of
the Blender code.
In any case, in practice those differences might not be
too noticable at all (I hope).

Continue to the next part...
2005-05-21 20:49:24 +00:00
Stephen Swaney
21d07f7ea3 Matrix_Determinant() was returning its input arg rather than
the determinant.  bugfix via LetterRip.
2005-05-21 20:05:28 +00:00
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