Commit Graph

2716 Commits

Author SHA1 Message Date
4bd3163ea6 py api: fix for context returning None for an empty list such as 'context.selected_objects', now returns [] 2010-04-24 19:26:05 +00:00
ace1c998c4 warning cleanup, also made voxel.c and volumetric.c use BM_INLINE define rather then having their own ifdefs in each file. 2010-04-24 10:08:07 +00:00
a56b72fd82 BugFix:
[#20854] PROPERTIES STAMP: Rendering stamp flickers in output renders

Blenfont was not thread safe, that is why one thread can change
the font properties (size, dpi, color, etc) at the same time
that the stamp draw on the image, and then the problem.

To make blenfont thread safe I have to change two important things:

1) Every BLF_* function take one argument, the font id.
2) We have two new function to make font "thread safe":
	BLF_load_unique
	BLF_load_mem_unique

This two function are for case like stamp, that need and own font
that don't share the glyph cache, so can draw without problem
in a different thread.

Why the BLF_*_unique function ?

Because blenfont keep only one copy of a font and keep a list of
"glyph cache". Every glyph cache have size and dpi, so if two
different thread access the same font at the same time, they can
change value and finish with something like the stamp problem.

Why don't remove the glyph cache ?

Because if we do that, we finish with a font object for every size
and dpi, and the stamp is really a special case that happen in
the rendering process, so I really thing is better keep the
glyph cache and make this two new function to handle this
special case.

(When I say "font object" I mean have the same freetype font multiple
times just to have differents size and dpi)

As Matt point we still can have one case that two thread access
the BLF_*_unique function at the same time, but I am looking to
fix this with some class of thread lock.

For now I test and work fine, so if some one found problem, please
let me know.

Campbell I have to change the python api (python/generic/blf_api.c)
to the new syntax, so maybe you can take a look at this.
2010-04-22 10:56:45 +00:00
4d39e04102 change mathutils 'repr' functions to closer match input 2010-04-19 22:02:53 +00:00
454470e0bd setting array slices wasnt running rna update
eg:
 scene.visible_layers[:] = obj.layers
2010-04-19 13:37:44 +00:00
4fde9823fd possible fix for [#22057] Autoname L/R in bones names center bones as .R
Bone would get a '.' added even when there was no extension.
(center limit would still be useful)

- name flipping function used sizeof() incorrectly.
- ED_lorem should be extern.
2010-04-18 14:47:45 +00:00
8f1500da00 remove config.h references, was added for automake build system rev around 124-126 but isnt used by any build systems now. 2010-04-18 10:28:37 +00:00
2241299c20 -->Fix for compile on MSVC
Expansion of BASE_MATH_MEMBERS macro meant that
two consecutive semicolons were in the source in
most header files that used it.
2010-04-16 16:19:36 +00:00
182587fce1 [#22045] Memory leak in Mathutils.Matrix
own fault when adding mathutils callbacks, generic destructor didnt free the matrix accessor array, made the array apart of the matrix struct since its not worth malloc'ing to save at most 16bytes.
2010-04-16 08:17:13 +00:00
0b99fd9164 SVN maintenance. 2010-04-11 16:41:43 +00:00
67cfc427ee PyAPI
- added new mathutils.Color() type, use with rna so we can do for eg:
 material.diffuse_color.r = 1.0
 # also has hsv access
 material.diffuse_color.s = 0.6

 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
fe9a22a018 py api file rename
- prefix mathutils api.
- 2 blf.c files (annoying for debugging)
- py api docs ignore keying sets as with operators.
2010-04-11 12:05:27 +00:00
ee0a217be3 python function to remove drivers.
eg:
 bpy.context.object.driver_remove("location")

ANIM_remove_driver now accepts -1 as an index for removing all drivers from one path.
2010-04-11 09:13:37 +00:00
9eb838ce24 bpy.app was writing members more then once. 2010-04-10 19:06:18 +00:00
6e3920e8fa rna/py/reference doc improvements..
- vectors now respect min/max settings.
- keyframing and adding drivers raises an error in an index is set on a non array, keyframing raises an error if it fails.

reference docs...
- added docstrings for remaining python bpy_struct functions
- added fake class for docs, bpy_struct, which is the base class of everything in bpy.types
- improved inherictance references for struct classes, include bpy_struct members.
2010-04-10 18:35:50 +00:00
c3ab6bc509 rna reference docs, list inherited properties and functions at the bottom of each type. 2010-04-09 20:43:58 +00:00
40273931a6 Fix, python changes to array properties were not yet calling update
and notifiers like other properties.
2010-04-06 09:11:33 +00:00
bad41fcff5 - new docstrings for bpy.type.Struct methods & some corrections.
- struct.path_to_id() --> path_from_id().
2010-04-06 07:49:10 +00:00
56b67d41aa Bugfix #21916: Baking NLA strips doesn't group transforms
- Added an optional string arg to struct.keyframe_insert() and struct.keyframe_delete() for the name of the group to add the keyframes to (for newly created F-Curves), instead of doing this as post process.

- Added error prints to the RNA function for setting an F-Curve's group. The old way of setting the groups afterwards couldn't be used anymore, since there was no way to find the action the F-Curve belonged to. This is necessary if the F-Curve list is to be kept in a valid state, since adding to any random group that may not be in the same Action does not work well. There were other issues with the list being iterated over changing while it was still being iterated over too...

TODO: 
Find a way to allow the iterator there to still work ok?
2010-04-06 04:25:48 +00:00
e302f33be7 document bpy.types.Struct methods C methods, currently only keyframe_delete() and keyframe_insert() have useful docstrings.
http://www.blender.org/documentation/250PythonDoc/bpy.types.Struct.html?highlight=bpy.types.struct#bpy.types.Struct.keyframe_insert
2010-04-05 22:37:09 +00:00
cddd6a56dd [#21867] Add rotate option to blf module
by Dan Eicher (dna)
2010-04-04 13:05:38 +00:00
Dalai Felinto
822dcc48cd bgl/BGE: glCopyTexImage2D + bgl.buffer creation error more verbose + dome post_draw (it draw only for the last overlayed scene)
1) glCopyTexImage2D - www.opengl.org/sdk/docs/man/xhtml/glCopyTexImage2D.xml

2) dome post_draw. Now dome mode can also use scene.post_draw. It only runs for the last scene. It's really useful. I'm working on a nice showcase for this (a dome visualizer for the dome mode running with bgl. In the mean time this is a (lame) example of both working together (the buffer is being copied and draw on top of the window):
http://blenderecia.orgfree.com/blender/tmp/dome_bgl_copytex2d.jpg
2010-03-28 10:20:26 +00:00
cb6d2685bd rna/py-api fix.
C functions and python used different argument order, this relied on mapping non-keyword arguments to 'REQUIRED' arguments but meant that you could not have an optional, non-keyword argument.

next commit will make order of arguments consistant (currently only changed order that rna wrapped).
(commit 27674 by Campbell from render25 branch)
2010-03-23 15:25:33 +00:00
d87e7393e3 report an error parsing args, will try fix properly but this involves many changes so do this for now.
(commit 27671 by Campbell from render25 branch)
2010-03-23 15:21:08 +00:00
5bc2d53507 fix for parsing python args to rna functions, was using allocated size as argument count.
(commit 27670 by Campbell from render25 branch)
2010-03-23 15:04:06 +00:00
5fad6edcb0 getting an item from a collection wasnt being checked correctly.
(commit 27665 by Campbell from render25 branch)
2010-03-23 14:48:32 +00:00
1e9bf0cfdb spaces -> tabs, (4 spaces == 1 tab, only for white space preceding text) 2010-03-22 09:30:00 +00:00
42ac4a3e7d Fix syntax for ID keyword. 2010-03-21 01:14:04 +00:00
d55cf90bb6 SVN maintenance. 2010-03-20 23:43:50 +00:00
391cc2d004 merge own commits into render branch into trunk since 27560
27562, 27570, 27571, 27574, 27576, 27577, 27579, 27590, 27591, 27594, 27595, 27596, 27599, 27605, 27611, 27612, 27613, 27614, 27623
2010-03-20 16:41:01 +00:00
9a986d194c fix for nasty bug where registering properties would register them in the parent classes SRNA, made for confusing rigify args turning up in add sequencer adding collection.
(commit 27433 by Campbell from render25 branch)
2010-03-16 17:20:15 +00:00
46ed51ce26 made argument conversion for much more verbose, wasnt giving enough info with bad operator args.
(commit 27432 by Campbell from render25 branch)
2010-03-16 17:19:42 +00:00
1cf95d2494 Keying Set Fixes:
* 'Export Keying Set' operator works again - a change in the previous commit broke the created code
* Relative Keying Sets don't get their paths shown 
* Keying Set paths show options for inserting keyframes too now

---

Another attempt at fixing compile troubles, and removed some commented out + obsolete stuff.
2010-03-16 10:18:19 +00:00
e7fad67fab Compile fix for MSVC
- missing #define for finite and isnan
2010-03-15 18:52:22 +00:00
5576b3aabf disallow 'nan' for button input and pydriver's 2010-03-14 21:04:02 +00:00
07d4307af2 attempt to fix build error on msvc 2010-03-14 17:54:08 +00:00
e3c746659e strip quites off buildinfo at startup (was doing this for splash screen and python api) 2010-03-14 17:18:36 +00:00
431db9d478 remove unused includes 2010-03-14 16:06:43 +00:00
15f0907563 PyAPI Bugfix - Fix for crash on struct.path_to_id() 2010-03-14 11:44:24 +00:00
969b4673c7 Python/RNA: added collection.move(from, to) for python defined
collection properties.
2010-03-10 20:54:14 +00:00
0ef0caaedf RNA/Python: support for layer subtype with BoolVectorProperty. 2010-03-10 20:33:57 +00:00
a53ef075ae python api function for rna objects: object.as_pointer()
This means we can write low level apis in pyton or C where blender data is passed to external C modules without having to have blender support this directly.

Example use case is to get an image pointer then use ctypes to get the image buffer and pass it to a C image processing function.
2010-03-06 12:37:29 +00:00
f09efddcda fix for minor errors/warnings 2010-03-03 13:59:57 +00:00
560de5e6e5 set the context on importing bpy module. 2010-03-03 08:56:48 +00:00
aec7174a42 fix for OBJ exporting Texface images 2010-03-02 14:57:28 +00:00
46d50b0d1f bugfix for displaying ID properties
- fixed memleak from 2.4x with setting arrays from python
- basic support for IDPropertyArrays

 context.object["foo"] = [{"smap": 10}, {"foo": 2}]
2010-03-02 11:35:28 +00:00
c0984d59cc Delete keyframe API method now takes array_index = -1 to delete keyframes from entire arrays, as for insert keyframe.
Enabled the 'keyframe_delete' method for RNA structs.
2010-03-01 10:43:02 +00:00
d975351f51 parts of the Python API are unstable, big discalmer in API docs main page, API Docs title and interactive console banner. 2010-03-01 10:34:54 +00:00
fbb8672da4 replace operator options bl_undo and bl_register with bl_options
eg.
 bl_options = {'REGISTER', 'UNDO', 'BLOCKING', 'GRAB_POINTER'}

This didnt exist when operators were originally wrapped.
2010-03-01 00:03:51 +00:00
b5d6d11abb patch from Clark Gaebel, use const char * for buildinfo strings, also updated bpy_app.c 2010-02-28 22:48:50 +00:00