Commit Graph

3535 Commits

Author SHA1 Message Date
b81bfd86b4 use ValueError when vector/matrix multiplications sizes are not supported, was using TypeError for mat*vec and ValueError for vec*mat. 2012-02-11 14:27:36 +00:00
5a42ff381c correct 2 sphinx warnings. 2012-02-08 16:36:04 +00:00
1f74789d12 Correct mathutils documentation, also correct some python spelling errors and add makefile target check_spelling 2012-02-08 04:37:37 +00:00
4acab3eb33 Code Cleanup: line length and use Py_ssize_t for PyC_AsArray utility function. 2012-02-05 02:04:26 +00:00
e3958015db Code Cleanup: check is / is not when comparing singletons. 2012-02-02 21:07:56 +00:00
697e77a494 fix [#29666] Duplicate entries in bpy.types
Python operator subclasses and operator types each get their own SRNA, causing double ups for bpy.types.__dir__()

From the operator type - these share names.
* ot->ext.srna
* ot->srna

Note that this conflict is still there, this only disables 'ot->ext.srna' from being included in dir(bpy.types).
2012-02-02 04:43:35 +00:00
5a221dd0de Fix for possible memory leak on creation of a vector using Vector.Range.
It was possible to allocate an array of size<2 which would then raise an error on vector creation without freeing.

Fix to ensure the behaviour of Vector.Range was the same as for builtin range() function. When specifying 3 arguments, the step argument wasn't being used to correctly calculate the vector size.

Minor formatting edits for error messages.
2012-02-02 01:07:04 +00:00
40f1686f47 Fixes to Python matrices str function.
1) The width of columns was incorrectly determined on windows, fixed by increasing the size of the dummy buf.
2) Added additional brackets to string for consistent formatting
2012-02-01 01:42:36 +00:00
54dc5f1654 apply back changes made since moving this file. 2012-01-31 05:02:24 +00:00
427cde6f16 svn cp \
https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/python/generic/noise_py_api.c@r42248 \
 https://svn.blender.org/svnroot/bf-blender/trunk/blender/source/blender/python/mathutils/mathutils_noise.c
2012-01-31 04:59:57 +00:00
b42feff554 previous move lost history on this file, restoring next commit. 2012-01-31 04:58:06 +00:00
e634cb2607 Add the .Identity() classmethod to mathutils matrices. This allows the user
to create an identity matrix of a specific size without having to specify
all the values in the matrix and then use the .identity() method.
2012-01-24 01:56:44 +00:00
c5d7f8e416 formatting edits (<120 line length), remove invalid 'defaults' keyword arg from docs. 2012-01-21 10:27:24 +00:00
57ad3b85d8 fix [#27589] Random crash with python UI
This script was defining an operator within the panels draw function, while its possible to support this its really asking for trouble.

the fix is to raise an error when this happens.

also fix crash passing non classes to register_class/unregister_class
2012-01-18 19:50:44 +00:00
af6f753400 fix for segfault with bpy compiled as python module (dont register atexit)
update `make lite` built target to remove some newly added features.
2012-01-17 15:19:11 +00:00
3123ad12a3 middle mouse jump scrolling for text window. 2012-01-16 10:48:52 +00:00
3cad3521a9 Change function for nb_invert so that ~matrix returns the inverted matrix rather than inverting inplace. 2012-01-16 09:01:11 +00:00
8c9c018c90 note on compating RNA pointers and compare RNA types for RNA-Properties too. 2012-01-15 12:35:40 +00:00
0f34ce27cf fix for error comparing py-struct members
if 2 pyrna structs used the same pointer they could incorrectly compare as true, this caused an error in theme saving because an item could match its parent and stop writing (to prevent recursive writing of same data).

eg:
  context.user_preferences.themes[0].user_interface.wcol_regular == context.user_preferences.themes[0].user_interface
2012-01-13 11:36:32 +00:00
309f3f31e7 remove redundant trailing slashes 2012-01-12 06:11:08 +00:00
02560d748f add RNA_property_is_set function, use for WM_menu_invoke to avoid double lookup and py api to de-duplicate some checks 2012-01-11 16:48:22 +00:00
f66f33cefc rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name. 2012-01-11 16:32:12 +00:00
51bada696f Longer names support for all ID and other object names
This commit extends limit of ID and objects to 64 (it means 63 meaning
characters and 1 for zero-terminator). CustomData layers names are also
extended.
Changed DNA structures and all places where length constants were hardcoded.

All names which are "generating" from ID block should be limited by MAX_ID_NAME-2,
all non-id names now has got own define called MAX_NAME which should be used all
over for non-id names to make further name migration stuff easier.

All name fields in DNA now have comment with constant which corresponds to
hardcoded numeric value which should make it easier to further update this
limits or even switch to non-hardcoded values in DNA.

Special thanks to Campbell who helped figuring out some issues and helped a lot
in finding all cases where hardcoded valued were still used in code.

Both of forwards and backwards compatibility is stored with blender versions newer
than January 5, 2011. Older versions had issue with placing null-terminator to
DNA strings on file load which will lead to some unpredictable behavior or even
crashes.
2012-01-11 08:51:06 +00:00
d7932ceea8 Cycles: multi GPU rendering support.
The rendering device is now set in User Preferences > System, where you can
choose between OpenCL/CUDA and devices. Per scene you can then still choose
to use CPU or GPU rendering.

Load balancing still needs to be improved, now it just splits the entire
render in two, that will be done in a separate commit.
2012-01-09 16:58:01 +00:00
e039a631a9 add bpy collection method .find(key), so you can get the index of an item in a collection, -1 if not found.
use this to replace bge text ui py function.
2012-01-05 06:05:45 +00:00
f0e3c3c68f fixes to mathutils from Andew Hale
- docstring edits
- normalize ignores W axis as its supposed to.
2012-01-03 14:34:41 +00:00
9a37e2682d slice and iterator access for matrix.col/row so you can do...
a, b = mat.col[0:2]

  and...

  for a in mat.col: ...
2012-01-02 09:04:37 +00:00
5c8c1a7358 PyAPI - remove Matrix.row_size / col_size. these were rather awkwardly named, but its more clear to use len().
mat.col_size --> len(mat.row)
mat.row_size --> len(mat.col)
2011-12-30 06:43:17 +00:00
4f0b7e8c6a py - fix for error which made enums not through errors when assigned non string types 2011-12-29 14:46:26 +00:00
85a97f64a7 add UNLIKELY / LIKELY util defines to help optimize iterators that are called a lot, only defined for gcc at the moment.
also some cmake formatting edits.
2011-12-29 01:46:58 +00:00
6e94bdd8e4 Scons/FFMPEG:
* Fixing compile error, ffmpeg include was missing.
2011-12-28 15:08:58 +00:00
5b88e16306 WIP loading bmesh in trunk, some conversion functions for this purpose. 2011-12-28 13:50:33 +00:00
c5a81536ca Add FFmpeg libraries versions to system-info.txt 2011-12-28 12:35:58 +00:00
6d878810c6 for bpy.props, when 'name' argument is not initialized, vallback to the attribute name rather than an empty string. 2011-12-28 04:25:46 +00:00
e17fd46c71 formatting edits only to use more consisted style 2011-12-26 12:26:11 +00:00
f48fb385ea formatting edits & minor corrections 2011-12-26 00:42:35 +00:00
986e62f3b6 fix for a bug in mathutils when a vector was accessing a matrix and the matrix size increased, future access too the vector would write past the allocated bounds. now raise an exception. 2011-12-26 00:05:41 +00:00
67effc8aef use docstrings for mathutils getset's, also some formatting edits, no functional changes. 2011-12-25 11:36:26 +00:00
f3ac865cc0 picky formatting of mathutils 2011-12-24 13:26:30 +00:00
2a80368005 mathtils, convenience attributes added 'row' and 'col', this makes the row/col swap a lot easier to deal with, since
now you can still use column access

previously...
  mat[2] = 1, 2, 3

needed to be converted into...
  mat[0][2] = 1
  mat[1][2] = 2
  mat[2][2] = 3

but with column access you can do...
  mat.col[2] = 1, 2, 3


Having 'row' attribute is a bit redundant since direct indexing on a matrix uses row but included for completeness.
2011-12-24 07:03:19 +00:00
28a5549ecf fix for error with matrix access and negative indices with recent row/col swap. 2011-12-24 06:13:58 +00:00
b42497b460 mathutils get/set function rename + minor changes to matrix functions (no functional changes) 2011-12-24 04:58:01 +00:00
33bd38ebc7 minor edits to cycles c/python module
- rename 'bcycles' --> '_cycles', since this is the python convention when a py module uses a C module internally.
- use macros for returning None
- make with_osl an attribute rather then a function.
- changes methods METH_VARARGS --> METH_O when single args are used.
2011-12-24 02:47:13 +00:00
b21a0f4fa1 formatting edits 120 line length 2011-12-24 02:37:42 +00:00
b59d8c6ba3 fix for own mistake [#29031] Importing BGL Can Crash the BGE and Blender
was adding the Buffer type to the module without increffing
2011-12-23 05:42:06 +00:00
c9f1ca961a fix for matrix assignment with recent changes which broke for eg:
ob.matrix_world = matrix
2011-12-22 08:44:08 +00:00
89db50a712 patch [#29534] Change Matrix Representation and Access in Python to Conform with Standard Notation
from Andrew Hale

Scripts which access matrix row/columns directly and scripts that create new matrices with elements defined will need updating.


For more info see...

* Guide for updating scripts
  http://wiki.blender.org/index.php/User:TrumanBlending/Matrix_Indexing

* Discussion thread
  http://markmail.org/message/4bpqpxkcvq4wjyfu
2011-12-22 01:05:03 +00:00
26f69488ca Matrix.translation wrapper vector, continent accessing to matrix[3][0:3].
this is a part of patch 29534, being applied separately

from patch [#29534] Change Matrix Representation and Access in Python to Conform with Standard Notation
by Andrew Hale (trumanblending)
2011-12-21 23:12:16 +00:00
96bd647c4f split some >120 lines, no functional changes 2011-12-21 22:56:06 +00:00
840dfcd56d cleanup and some fixes to mathutils by Andrew Hale
* 1. Resize 4x4, code was ridiculously complex (cleanup only)
* 2. matrix * matrix checking for compatibility wasn't working right (bug in last release)
* 3. fix for result size for matrix * vector if matrix is 4x4 and vector size 3 (bug in recent patch)
* 4. fix for result size vector * matrix if matrix is 4x4 and vector size 3 (bug in recent patch)
2011-12-21 21:21:27 +00:00