Commit Graph

3485 Commits

Author SHA1 Message Date
01de7c2979 fix for mathutils mat*vec for non sqyare matrices by Andrew Hale 2011-12-21 11:36:28 +00:00
ea88a0bec5 recent commit missed swapping args for MATRIX_ITEM in mathutils_Vector.c, breaking matrix*vector. 2011-12-20 11:37:55 +00:00
436295026a patch [#29662] Modifications to Mathutils Vectors for Consistency with Commit 42752
from Andrew Hale
2011-12-20 05:48:35 +00:00
a8ed803b66 rename internal matrix struct member vars to avoid confusion
Matrix.contigPtr --> matrix
Matrix.row_size --> num_col
Matrix.col_size --> num_row
2011-12-20 04:11:23 +00:00
3d8ee28750 __str__ functions for other mathutils types 2011-12-20 03:37:55 +00:00
553cf289a7 patch [#29651] Add a __str__ Method to Matutils Matrices so print(matrix) Shows Columns as Columns
from Andrew Hale

converted from python string formatting to using BLI_dynstr
2011-12-20 02:54:25 +00:00
53f88b231a corrections to some comments 2011-12-19 05:23:52 +00:00
0bc83a2f35 - mathutils matrix creation - use memcpy rather than copying every matrix row/col individually.
- creating a new non-square matrix would use uninitialized memory.
2011-12-19 05:14:09 +00:00
c3675c0e90 remove mathutils internal variable for storing pointers to each matrix row, instead use macros to access row/column's.
also add an assert so invalid index access will raise an error in debug mode, without this it was quite easy to access invalid memory without meaning to.

no functional change.
2011-12-19 03:12:10 +00:00
9c9099a805 formatting edits in py api, no functional changes 2011-12-18 08:50:06 +00:00
414370b8d4 Support for arbitrary sized vectors - (was limited by 2-4 previously)
patch http://codereview.appspot.com/5482043
from Andrew Hale

* Text from the submission *

This patch adds the ability to use arbitrary sized vectors from mathutils.
Currently vectors are only of size 2, 3 or 4 since they are generally restricted
to geometric applications. However, we can use arbitrary sized vectors for
efficient calculations and data manipulation.
2011-12-18 07:27:11 +00:00
ad96dacbc5 style edit only - move parenthesis onto second line of function definition (in keeping with most of blenders code)
also split some long lines in own code.
2011-12-17 00:52:36 +00:00
cad9cb563d fix own error [#29631] frame is lost from driver namespace after reload 2011-12-16 03:06:56 +00:00
dbebf4ff53 fix [#29635] Attempts to import the site module are met with a TypeError exception. 2011-12-16 00:06:01 +00:00
a7823dda69 fix for py noise doc string (not a show stopper :) ) 2011-12-13 22:30:23 +00:00
965c287630 fixes scale on derivative maps 2011-12-09 23:26:06 +00:00
6f7ae034fd fix for noise module in driver namespace (was infact mathutils). 2011-12-07 00:36:57 +00:00
3167a9a899 add library support for rna collection __contains__, eg
("Cube", "//lib.blend") in bpy.data.objects
2011-12-03 06:10:32 +00:00
Dalai Felinto
1936b31cd0 renaming BooleanProperty to BoolProperty (rna structs shouldnt affect scripters)
Talked with Brecht and Campbell and they both agreed that bpy.types should match bpy.props
In the ideal world we would rename bpy.props to BooleanProperty. This would break scripts though. So we go for a compromise and at least have some consistency.
2011-12-01 22:08:42 +00:00
4afc0e80a7 fix [#29462] libraries.load can't have link=False when relative=True
was doing an unnecessary (and incorrect) library lookup.
2011-11-30 06:15:35 +00:00
6ec3313e2d Fix: defining properties would fail with argument update=None instead of not
specifying the argument.
2011-11-29 22:57:35 +00:00
083297fbf1 formatting edits (120 width max) and remove some redundant casts 2011-11-29 20:22:35 +00:00
9d9fbae7bc treat 4d vectors as 3d for vector.angle(other) 2011-11-29 19:40:27 +00:00
f62ad8f69b remove header text:
"The Blender Foundation also sells licenses for use in proprietary software under the Blender Licens"

also remove NaN references from files that have been added since blender went opensource.
2011-11-29 10:54:47 +00:00
53d14a78b5 missed removing these files 2011-11-29 10:34:23 +00:00
f95d7c9e66 patch [#29421] Python Noise Module Updates
from Andrew Hale (trumanblending)

Tracker description
*******************

The current python noise module included with Blender has yet to be updated to the new Py API. This patch does so, with the following major points:

- The noise module has now been moved to a submodule of mathutils, it can be accessed by mathutils.noise. It was moved from it's own module as it will now return mathutils types and also have greater visibility to the user.
- All functions which return vectors will now return mathutils.Vector types to be consistent with the rest of the API. Previously (x, y, z) tuples were returned.
- A different implementation of random_unit_vector is now used, this allows 2D, 3D and 4D vectors to be returned. Previously only 3D was possible.
- Some function names have been changed to remove ambiguities and make naming consistent within the module. noise.vector is now noise.noise_vector and noise.vl_vector is now noise.variable_lacunarity
- Doc strings have been updated to be compatible with auto docs.
- Code style and internal naming has been changed to match the conventions in other mathutils code.

Thanks,
Andrew
2011-11-29 10:28:52 +00:00
3db309ee50 fix for own error with id props when adding byte strings 2011-11-26 17:22:11 +00:00
d52a811052 minor bpy api edits
- strict check for rna properties
- formatting edits (120 line width)
- use PyDoc_STRVAR macros for getset docstrings
2011-11-26 15:18:30 +00:00
6736576f6d replace FILE_MAXDIR + FILE_MAXFILE with FILE_MAX 2011-11-26 04:07:38 +00:00
491526e5ed add null check, crashes py 3.3 which isn't released but adding the check is harmless 2011-11-26 02:33:57 +00:00
6e28ac2d7b pep8 edits and avoid naming conflicts with python builtins 2011-11-24 19:36:12 +00:00
3b9b6051d9 rename mathutils constructors to match other parts of the bpy/api (no functional changes) 2011-11-24 04:45:36 +00:00
c62d33c540 patch: [#29382] Arbitrary Length Array Function Additions and Modifications
from Andrew Hale (trumanblending), with some edits to use these in mathutils.Vector added.

Added Functions:
- dot_vn_vn - Dot product of two arrays
- normalize_vn_vn - Normalize an array and store the result in a second array
- normalize_vn - Normalize an array inplace

Renamed Functions:
Some functions have been renamed to make them consistent with the naming conventions used by fixed length array functions.
- fill_vni to fill_vn_i
- fill_vn to fill_vn_fl
2011-11-24 04:12:16 +00:00
676c2924d9 fix [#29319] bus error with python with link_append and {}
patch from Emil Brink
2011-11-22 14:05:08 +00:00
e5f40a1aac - pyapi mathutils.geometry.intersect_plane_plane
- isect_plane_plane_v3 uses better method
- minor refactor - arg name changes & some args as const.
2011-11-20 05:56:21 +00:00
4924abaad6 replace fabs with fabsf where both input and output are floats. 2011-11-19 01:10:05 +00:00
92ed90d2fa pyapi feature from 2.4x
allow collection subscript to contain the library or None.

eg:

  bpy.data.objects["Mesh", "/subsurf_test.blend"]

  bpy.data.scenes["Scene", None]

  # also works with get()
  bpy.data.armatures.get(("some_armature", "//some_lib.blend"), None)
2011-11-17 08:47:34 +00:00
db44a92a11 pydrivers: 'frame' is now in the driver namespace,
- no need to link to scenes when using a frame from the pydriver, this made linking rigs for eg, quite messy.
- advantage that we get subframe values (where scenes from was fixed to a whole number).
2011-11-17 07:08:09 +00:00
ba7fbf6ae7 formatting edits & doc correction, no functional changes. 2011-11-16 03:56:34 +00:00
6a340c1eb0 py/rna api was calling RNA_property_type more often then needed (no functional change) 2011-11-15 11:56:54 +00:00
4de917326b de-duplicate some idproperty py api code, also improve some exception messages. 2011-11-15 10:19:44 +00:00
d4d80ee0a1 rename IDProp.c/h to idprop_py_api, since it was same name as BKE idprop.c with case changed. 2011-11-15 09:28:15 +00:00
8623935aa8 pass a pointer to IDP_New's IDPropertyTemplate rather then a copy. 2011-11-15 09:22:52 +00:00
2ab1732613 support for non-null terminated byte strings in id properties (as a subtype of IDP_STRING types) 2011-11-15 09:12:10 +00:00
d6c1009195 bytestring support for py/rna - this is so py can access data which
isn't meant to be accessed as unicode text.
2011-11-15 07:09:41 +00:00
0b1066af8e fix [#29251] Properties options={'SKIP_SAVE'} not working, patch attached
patch from Domino Marama (domino)
2011-11-14 15:05:41 +00:00
c993ee678a new math utility function isect_plane_plane_v3 2011-11-13 16:28:52 +00:00
963e39e417 formatting edits only - no functional changes 2011-11-13 09:38:53 +00:00
72a7101576 include invalid type name in mathutils error messages. 2011-11-13 09:20:04 +00:00
817b6cb9a8 mathutils.geometry.distance_point_to_plane(pt, plane_co, plane_no) - utility function, BLI math version too. 2011-11-12 10:06:56 +00:00