Commit Graph

4277 Commits

Author SHA1 Message Date
a619de52cf simplify & improve error handling for id-property python-api. 2013-10-17 02:57:59 +00:00
f5660a05b1 fix [#37105] Long int IDproperties produces errors at weird spots. 2013-10-17 02:36:33 +00:00
089d0ad8f9 add IDP_FreeFromGroup(), replaces IDP_RemFromGroup(), IDP_FreeProperty(), MEM_freeN(). 2013-10-16 05:29:28 +00:00
Dalai Felinto
7c2fae19b4 cmake/openimageio - partially reverting #60692
We now have openimageio building when cycles builds or when it's
manually set to build.

(I reverted the _IMAGE_ in the define name because I think the closer
the cmake flags match the defines in the software the better, and there
is no reason to rename all the existent WITH_OPENIMAGEIO references in
CMakeLists.txt - which would be the alternative)
2013-10-12 23:56:21 +00:00
b6db417ee4 code cleanup: use const's for vector args. 2013-10-12 02:19:37 +00:00
90cd0a37a9 Fix build scripts related to PSD support. Both CMake and SCons builds were broken. 2013-10-11 23:14:01 +00:00
Dalai Felinto
029f4b9767 adding WITH_IMAGE_OPENIMAGEIO and removing the PSD build option
As per Brecht van Lommel's suggestion.
2013-10-11 16:38:04 +00:00
Dalai Felinto
4abb8fde95 Photoshop PSD support
We now support the combined layer of Photoshop files (stored as layer 0
in the file). This way users can keep their files as multilayer PSD and
Blender always handle them as flat images.

For perfect alpha this requires an OpenImageIO update:
342cc2633f

Photoshop sample files:
https://github.com/OpenImageIO/oiio-images

Brecht has some pending fixes to push for OIIO as well, so we may as
well wait to update our libraries.

What works:
===========
* 8bit images (with or without alpha)
* 16bits images (alpha discarded)
* Photoshop files saved with 'Maximum Compatibility'
* Cycles, Blender internal,  BGE (and player)

Known limitations
(due to OIIO dependency):
=========================
* Images with less than 4 channels show a wrong thumbnail (bug may be in  OIIO)
* Packed images are not supported
* We do not write PSD files.

Note: old Blenders have support for PSD via Quicktime library. But due
to license issues this was discontinued.

Many thanks for Brecht van Lommel for reviewing the patch, suggesting
multiple improvements and to help solving the alpha issue.
2013-10-08 21:17:24 +00:00
91e020eea9 fix [#36924] Calling .define(...) on Macro subclass crashes Blender, if subclass wasn't registered 2013-10-03 05:27:39 +00:00
d6b21df2e6 correct include guards and add checks in check_style_c.py for them. 2013-09-19 23:17:52 +00:00
4dd7d4110a replace macro PYC_INTERPRETER_ACTIVE for PyC_IsInterpreterActive() function call,
(indirectly referenced Python define of ~30 lines, most were optimized out but still caused some code bloat).
2013-09-18 23:21:24 +00:00
b6631b8be7 fixes for python api docs.
also move foreach_get/set examples into their own py example files (prefer not to have example code built into blenders binary).
2013-09-18 05:20:43 +00:00
9d6f05edb8 fix relating to bug [#36758],
When printing operator reports, ommit unset properties.
This is needed because in some cases operators check if a value is set or not, so filling in default arguments may change behavior.
2013-09-18 01:22:28 +00:00
daa87ff0b4 Update foreach_get/_set doc. 2013-09-17 14:02:13 +00:00
1576565932 minor changes needed for building standalone mathutils. 2013-09-14 00:30:56 +00:00
365c368b5f add back library linking warning when renaming library datablocks in the outliner, also typo corrections. 2013-09-12 22:08:56 +00:00
2f6c748bb9 fix [#36020] SmartUV Project is messy on a cube
was using very simple/stupid check to rotate us islands, replace with box_fit_2d() function.

missed docstring last commit.
2013-09-11 07:10:15 +00:00
d2d1025e4a add mathutils.geometry.box_fit_2d() to wrap BLI_convexhull_aabb_fit_points_2d() 2013-09-11 06:56:51 +00:00
ab8d88ac18 add angle_to_mat2 utility function. 2013-09-10 20:45:47 +00:00
92d94ccb08 misc minor changes
- make cmake osx use of -ftemplate-depth match scons.
- use array size within sizeof(), more compact.
- replace AT with __func__ where the function is unique enough.
- BLI_box_pack_2D -> 2d to match other functions.
- rename new mesh normal calculation to mesh.calc_normals_split()
2013-09-10 19:23:39 +00:00
5dbe17cc12 add 2d convex hull utility function, BLI_convexhull_2d(), and python api mathutils.geometry.convex_hull_2d()
uses Andrew's monotone chain 2D convex hull algorithm.
2013-09-10 07:52:10 +00:00
890cafface fix for error in bmesh api, selection setting needs to go via BM_elem_select_set else the total selected elements count isn't mantained. 2013-09-05 08:38:06 +00:00
bebaa41047 Tweaks to New Driver creation behaviour
* 'Show Debug' now enabled for all newly created drivers. For most users, it is
useful to be able to see this to help figure out what's going on

* Removed failed experiment of creating new drivers with Generator FModifiers. I
had hoped that this would make it easier to create drivers that doubled or
halved the input values, but that has proved to not be the case, and instead
made harder for most users to set things up (as they'd have to remove these
first).

Now, when adding drivers from the UI, these get created with two keyframes (at
(0,0) and (1,1) for a 1-1 mapping), which can be easily tweaked normally.

However, for backwards compatability of scripts (notably rigify, and perhaps
some others out there), when creating drivers from scripts, they will still get
created with Generator FModifiers for now. We can review this situation again
for 2.7, but for now it seems ok.
2013-09-03 00:28:23 +00:00
c0ca93c9b2 Add poll message when poll fails because of window missing from the context.
This means calling invoke operators from python in states that dont support will give a meaningful error message.

also reduce context lookups when polling.
2013-09-02 19:28:44 +00:00
54310b8086 bmesh: internal api change, remove BMOElemMapping, its not needed since the values can be stored in the ghash directly.
saves 24 bytes per element (per vertex/edge/face on a 64bit system), for bmesh operators.
2013-09-02 03:13:51 +00:00
8e46cf637c tweak mempool loop comparisons when we know there is no chance for skipping past the last value.
also correct typo.
2013-08-31 02:12:31 +00:00
11c988ba00 Simplify line/plane intersection, add line_plane_factor_v3().
Remove no_flip option for isect_line_plane_v3(), its quite specific and only used for ED_view3d_win_to_3d().
2013-08-31 02:06:23 +00:00
79f7a78637 fix [#36528] crash when reinitializing bmesh from mesh 2013-08-27 00:39:51 +00:00
1679cd7f96 This commit adds optional parameters for pyfunc implementations of RNA API (i.e. callbacks, e.g. draw functions of panels, uiLists, or exec/poll/etc. of operators). Thanks to Brecht for he review!
Any parameter after the first flagged with PROP_PYFUNC_OPTIONAL will be considered as optional, hence the python code does not have to define/use it. This will ease API evolutions by avoiding to break existing code when adding non-essential new parameters.

Note: this will need some update to API doc generation, patch is ready, will have it reviewed by Campbell asap.
2013-08-26 21:11:52 +00:00
384b8aafbf patch to add backkbacks for game engine start/end,
by sjoerd_de_vries
2013-08-23 15:45:18 +00:00
09ff49755f math api edits - replace point-normal form for a plane with dist_to_plane_v3()
also correct python mathutils api, was missing vector checks.
2013-08-23 14:37:22 +00:00
9470754fd3 bmesh api cleanup, face creation args now accept an example face (as with vertex and edge),
also replace BM_face_create_quad_tri_v with BM_face_create_verts
2013-08-21 07:51:47 +00:00
8937a8b839 use BM_CREATE_NOP arg rather then zero, with pointer and bool args in either side in some cases it gets a bit confusing.
also correct edge-rotate where bool->flag conversion worked by accident.
2013-08-21 05:39:46 +00:00
57f8a252d6 fix own regression [#36443] Vertex to UV index doesn't match with 2.68a
add BM_face_create_verts wrapper for BM_face_create which creates its own edge array.
2013-08-21 05:11:11 +00:00
38338a51c9 add is_finite_v# functions, use bool's 2013-08-20 09:34:52 +00:00
f3654ce6b6 fix incorrect docs [#36518] Vector.rotate() does not return value as documented 2013-08-20 08:41:34 +00:00
880a86230f bmesh_vert_separate: remove unused return value 2013-08-12 23:49:56 +00:00
4f29aeeff2 code cleanup: some structs were declaring data when only typedef's were intended, make local vars and functions static. 2013-08-07 03:44:05 +00:00
b8c3efc8c3 code cleanup: compiler warnings 2013-07-21 16:40:34 +00:00
7db1d6556d code cleanup: add break statements in switch ()'s, (even at the last case). 2013-07-21 08:16:37 +00:00
a2492e0603 style cleanup: braces/indentation 2013-07-19 16:44:17 +00:00
7fec23ae0a fix for problem with edge slide where it would stop shapekey modifier from being applied (because of added vertices),
now, instead of making hidden copies of faces, the faces are copied into a temp bmesh.

also remove a hash that was being created and not used (old code).
2013-07-11 04:24:36 +00:00
14ab39c5e0 minor improvements
- calc normals only check flag when needed.
- keymap, dont get name unless its needed.
- keymap, avoid property lookup.
- idprop debug print, include pointer, helpful for troubleshooting.
2013-07-09 00:13:17 +00:00
37d1984c53 edit on own commit r57801, don't check the size of dynamic arrays 2013-07-08 01:28:43 +00:00
418011907c remove nan copyrights from code added since blender become opensource (copy paste errors), also remove BKE_script.h 2013-07-02 10:14:59 +00:00
46808dd22c fix for python api bug: assigning the wrong size array to an RNA property wasn't checking the length and could crash, eg:
mesh.polygons[0].vertices = (10,)
2013-06-27 01:01:11 +00:00
8107c543ec remove redundant casts 2013-06-27 00:37:42 +00:00
c0c9f5386b fix [#35507] BMesh module: Crash on to_mesh() if faces.layers.tex is used but no loops.layers.uv 2013-06-26 04:17:41 +00:00
423ee06625 use booleans for bpath api. 2013-06-24 03:06:32 +00:00
65047099b2 fix for pythons __dir__ returning registrable functions on class instances (which may not have the functions defined).
gave odd behavior of including members in __dir__ that couldn't getattr()
2013-06-13 11:35:25 +00:00