Commit Graph

254 Commits

Author SHA1 Message Date
b535c738d9 further reading, need to untrack tracked PyObjects before clearing their trackable vars. 2011-03-03 06:14:55 +00:00
c42f3b4e59 support for mathutils GC wasn't complete since PyObject_GC_Track is supposed to be called once the fields are filled in. 2011-03-03 06:01:31 +00:00
7348a50d79 change return values from mathutils callbacks to match pythons (-1 is error), so error macro's can be used in both. 2011-02-28 18:42:41 +00:00
Nathan Letwory
5a760e22fc doxygen: blender/python tagged. 2011-02-27 20:10:08 +00:00
18c7354bd2 remove warning left in by mistake and comment unused function. 2011-02-25 02:27:54 +00:00
fbd9364944 revert part of own commit r35117 which modified mathutils initialization functions, found this could be done in a better way which doesnt have to deal with partly initialize instances being freed. 2011-02-24 05:46:57 +00:00
b1639dc118 support pythons cyclic garbage collector for mathutils types. 2011-02-24 04:58:51 +00:00
Nathan Letwory
5b607701a7 doxygen: prevent GPL license block from being parsed as doxygen comment. 2011-02-23 10:52:22 +00:00
8186ba15ab last commit used py3.2 function, inline for py3.1 2011-02-22 08:29:25 +00:00
1e120098fc pyapi, use direct access to the frame rather then python attributes. 2011-02-22 07:57:18 +00:00
Nathan Letwory
322ff7dfe4 I swear, it was just an innocence change in guardedalloc!
The butterfly wing flap, causing a nice storm in the rest of blender.

Now all dependencies should point ok again. CMakers, do double-test.
2011-02-21 12:35:04 +00:00
Nathan Letwory
8c8ae3dedf doxygen: entry for gpu, modifiers, nodes, python and render 2011-02-21 06:58:46 +00:00
6524d27462 py api was raising SystemError exception incorrectly, this is intended for internal interpreter problems.
Replace most with RuntimeError.
2011-02-18 06:04:05 +00:00
669cffdb1e fix [#26098] python API: quaternion.rotate never seems to work. 2011-02-16 02:05:36 +00:00
8b7482892b made most variables which are only used in a single file and not defined in header static for blenlib, blenkernel and editors. 2011-02-14 17:55:27 +00:00
7b201c7693 SVN maintenance. 2011-02-14 04:47:55 +00:00
72bc3f22b7 python api renaming and added headers for some files which didnt have one, no functionality change. 2011-02-14 04:15:25 +00:00
0955c664aa fix for warnings from Sparse static source code checker, mostly BKE/BLI and python functions.
- use NULL rather then 0 where possible (makes code & function calls more readable IMHO).
- set static variables and functions (exposed some unused vars/funcs).
- use func(void) rather then func() for definitions.
2011-02-13 10:52:18 +00:00
867fc4b463 enforce string limits (reported by pedantic checking tools & some developers).
mostly replace strcpy with BLI_strncpy and multiple strcat's with a BLI_snprintf().
also fix possible crash if CWD isnt available.
2011-02-13 03:21:27 +00:00
55f68c3657 fix for more warnings.
- modifier code was using sizeof() without knowing the sizeof the array when clearing the modifier type array.
- use BLI_snprintf rather then sprintf where the size of the string is known.
- particle drawing code kept a reference to stack float values (not a problem at the moment but would crash if accessed later).
2011-02-12 16:54:24 +00:00
81a00cf2eb use static functions rather then defines for internal matrix__apply_to_copy() and similar.
+ other minor internal changes.
2011-02-09 09:20:17 +00:00
53afd19808 fix [#25975] Quaternion/Vector.negated() isn't available
theres no need for value.negated(), better use -vec / -quat. however -quat didn't exist.
2011-02-08 03:37:49 +00:00
33265983da fix own error in recent commit [#25970] cannot create scale matrix after mathutils updates 2011-02-08 00:10:30 +00:00
d9aa3f66a6 mathutils.Matrix.Scale(factor, size, axis)
- 'axis' arg was not coerced from a tuple like other args now do.
- 'axis' arg was being modified in-place (VERY BAD).
- also made new function matrix_3x3_as_4x4().
2011-02-06 11:17:22 +00:00
1cdab667bc - cmake was missing an inclide (IDE's wouldnt index)
- made doc generation always sumlink newly built docs to static URL. http://www.blender.org/documentation/250PythonDoc/
2011-02-06 10:18:20 +00:00
d694115ac4 mathutils fixes noticed when refactoring.
- comparing eulers was ignoring the order.
- printing Euler()'s now prints the order too.
- un-orderable types (all except for Vector's), were not raising an exception when compared with >=, >, <, <=.
2011-02-05 10:40:42 +00:00
998198a041 mathutils rotate functions for Euler/Quaternion/Matrix/Vector types.
each accept Euler/Quaternion/Matrix types.

eg:
  Euler.rotate(Quaternion(axis, angle))
  Vector.rotate(Euler((pi/2, 0, 0)))

matrix.resize_4x4() and euler.make_compatible() were still returning an instance of themselves, now return None.
2011-02-05 09:57:02 +00:00
dd08305e75 Rename python mathutils functions and split in-place methods from those that return new values.
http://wiki.blender.org/index.php/Dev:2.5/Source/Python/Mathutils
This completes the changes proposed.

This will break scripts (fixing coming up next), for full list of changes see mathutils.c comments.
2011-02-05 06:14:50 +00:00
2ef93b1d92 swap Matrix.Shear(...) arguments so matrix size is the second argument, matching other constructors. 2011-02-04 09:41:59 +00:00
feed9c3d1f mathutils.Matrix.OrthoProjection(plane, size, axis), merged axis and plane args. since axis was only allowed when plane was 'R'.
This was already done with Matrix.Rotation().
2011-02-04 09:35:20 +00:00
4be9583894 small mathutils changes.
- fix for returning empty slices (was returning list rather then tuple).
- report invalid type when mathutils_array_parse_fast() fails.
2011-02-04 03:39:06 +00:00
36786c18d7 PyAPI: coerce mathutils values. (vectors, quats, eulers) as proposed here:
http://wiki.blender.org/index.php/Dev:2.5/Source/Python/Mathutils#Coerce_Method_Arguments
2011-02-04 03:06:23 +00:00
ffe7bde02c correct fix for bug #23871, __main__ module was being overwritten in nested functions, so on returning from calling operators the __main__ module could be cleared and imported modules turn into None
calling
  bpy.ops.wm.read_factory_settings()
... would clear a scripts namespace if running directly, not in a module.


Fix by backing up and restoring the __main__ module.

Also found BKE_reportf wasnt printing all reports in background mode as BKE_report() was doing.
2011-02-01 12:37:53 +00:00
0362d19f2d Pythons path functions - os.walk(). os.path.exists(). etc support bytes for paths as well as strings, support this with blender/rna too.
- bpy.data.*.load() functions were only accepting UTF-8 paths.
- rna functions/properties now accept byte values rather then strings for file paths.
- bpy.path.resolve_ncase now supports byte objects.
2011-02-01 04:24:47 +00:00
89c617a116 remove nan-makefiles 2011-01-30 15:29:22 +00:00
d8539d8801 small internal cleanup, have matrix.scale_part() use same method to extract the scale as matrix.decompose() 2011-01-25 16:32:41 +00:00
1bd0db59f4 use cmake defined names for jpeg, png, zlib and python libs, building on *nix with non-standard libjpeg/png/zlib locations was broken.
in the case of python this makes it easier to move to find_package(PythonLibs) when 3.x is supported.
2011-01-25 14:43:13 +00:00
552b36733b bugfix + minor mathutils.Vector edits.
- multiplying a 2D vector by a 3x3 or 4x4 matrix would use un-initialized memory, now throw an exception.
- use more variable length array BLI_math functions.
2011-01-23 08:37:34 +00:00
262a33cbe4 change mathutils.Matrix.Shear() for 3x3 or 4x4 matrices
The plane which defined the shear had the factor applied to each axis equally.
This meant that the shear for any 3x3 or 4x4 matrix would be diagonal on the positive values of each axis.
Only being able to create diagonal shear matrices seems stupid, now take a pair of floats for the shear factor corresponding to the plane axis values, so its possible to shear on only one axis of the plane.
2011-01-21 03:18:01 +00:00
d7c6ddd7e9 correct spelling 2011-01-21 02:32:58 +00:00
022511d5ad [#25732] Incorrect shear matrix in XY plane
fix included by Lawrence D'Oliveiro (ldo)
2011-01-21 02:27:04 +00:00
3b0c2accc6 support building with python3.2 2011-01-18 21:39:50 +00:00
2431e8e045 bgl.Buffer()
- invalid dimension type could be passed without raising an error.
 - negative dimensions could crash blender, now they raise errors.
 - zero length dimension arg was not detected.
 - floating point lengths were accepted, now only allow ints.

 also comment unused vars.
2011-01-18 03:49:28 +00:00
8cf1184c04 bad spelling; 'indicies' --> 'indices' 2011-01-18 01:58:19 +00:00
5b3bf80dd8 detect mathutils types with mathutils_array_parse(), was using PySequence_Fast(), converting into a tuple every time then back to a float array.
gives approx 6x speedup with eg mathutils.Vector(some_vector).
2011-01-16 11:26:01 +00:00
86bbab7de5 remove/comment unused defines. 2011-01-15 16:14:57 +00:00
c8df192de6 misc python api improvements
- rna array parsing was using PySequence_Size() in a loop, this can  be slow to run so only call once.
- assigning a single value to a multi-dimensional array was missing type check.
- improve exception messages for rna array type errors.
- simplify vector slice assignment by using mathutils_array_parse(...)
2011-01-13 21:44:18 +00:00
ca3d4052de py/mathutils fix for eternal loop with Matrix.Rotation().
rotation range clamping used a while loop which would run forever when the value was so big subtracting a full revolution didnt change the value.

Solve by using fmod() and double precision angle.
2011-01-11 09:41:26 +00:00
00b8c9e7ea rename BKE_assert() --> BLI_assert(). 2011-01-09 15:12:08 +00:00
c9f353956c use PySequence_Size() rather then PySequence_Length(), this is only kept in python for backwards compatibility. 2011-01-09 14:53:18 +00:00