Commit Graph

3718 Commits

Author SHA1 Message Date
352cd241a3 fix [#31597] Operator Preset: Python Warning whenever a preset is executed (seen on Windows) 2012-05-25 14:08:50 +00:00
dab1d8e487 style cleanup 2012-05-22 22:03:41 +00:00
3fc3c9f3b4 style cleanup: relating to skin modifier 2012-05-22 16:09:31 +00:00
c63602286c Fix for customdata layer copying. Issue was caused by mixing up of destination and source in copy function. Also fixed an error in Py API, check to see if layers were different should be check to see if they're the same. 2012-05-22 12:03:56 +00:00
ea11bc980a debugging check for bmesh (commented since its very slow), but useful for debugging some scripts. 2012-05-21 12:30:06 +00:00
65b2385448 py api integration: __import__(... , level=0)
default changed to work with python3.3
2012-05-21 07:00:23 +00:00
3896ad4cbb code cleanup: spelling 2012-05-20 21:23:26 +00:00
2d2d36fe3b code cleanup:
- style - multi-line ifs move braces onto new lines.
- iterators - convert some to macros, other split up and move brace.
2012-05-20 19:49:27 +00:00
518ff6995d BMesh Py API Fix: hide attribute of BMesh elements was returning the select flag. Fixed for all elements including loops, although this is commented out anyway. Reported by Crouch in IRC. 2012-05-20 12:52:46 +00:00
dd7229aee0 Added 'LIBRARY_EDITABLE' flag to bpy.props.*
Rationale: custom props on linked objects are editable through ops and the console but the UI code calls RNA_property_editable() which returns false if (id->lib && !(prop->flag & PROP_LIB_EXCEPTION))

Setting the 'LIBRARY_EDITABLE' flag allows UI templates to change these props (but the changes aren't saved!) for things like indices into CollectionProperties which live on the linked object
2012-05-19 21:22:01 +00:00
af3e348430 code cleanup: use TRUE/FALSE rather then 1/0 for better readability, also replace do prefix with do_ for bool vars. 2012-05-19 13:28:19 +00:00
2f5173887e disable overwriting the PYTHONPATH for windows - reported as [#31506] 2012-05-19 10:10:49 +00:00
181f3670c9 patch [#31507] site not automatically imported when using external python package
made some modificatons to normal python startup also.
2012-05-18 10:19:49 +00:00
c0bd076bfd style cleanup: and add missing files to cmake 2012-05-17 23:12:15 +00:00
ed33320e3f Code cleanup: simplify standard GHash creation.
Added four new functions as shortcuts to creating GHashes that use the
standard ptr/str/int/pair hash and compare functions.

GHash *BLI_ghash_ptr_new(const char *info);
GHash *BLI_ghash_str_new(const char *info);
GHash *BLI_ghash_int_new(const char *info);
GHash *BLI_ghash_pair_new(const char *info);

Replaced almost all occurrences of BLI_ghash_new() with one of the
above functions.
2012-05-16 00:51:36 +00:00
7b31c3c198 Fix cosmetic typos
Patch provided by Matteo F. Vescovi, thanks!
2012-05-15 16:11:04 +00:00
b667f29a84 no need to clamp python values twice when assigning. 2012-05-11 10:25:12 +00:00
ce45c004a3 classic compile error: GLEW_STATIC needs to be define when we use opengl functions 2012-05-09 09:49:24 +00:00
Dalai Felinto
b651f61278 bgl new methods (for glsl shaders - #version 120)
** I did not update rst docs. I will post on the quick-hack list. If no one volunteers to do it, I have it done before next release. **

this patch add the barebone functions to do glsl shaders in an addon.
For simplicity sakes it supports old GLSL, but not all the new modern methods (glBindFragDataLocation, ...).

It should be enough to make an addon to help with bge 2d filters.
I'm using this with a 3dview callback and it's working nicely:
self._handle = context.region.callback_add(draw_callback_px, (self, context), 'POST_VIEW')

I was considering not to commit this patch due to it not covering all OpenGL new methods.
But frankly it's not the first time bgl is expanded upon individual needs (guilty of that myself).
If a python developer knows enough to use OpenGL and need new functions, s/he should also be able to patch Blender for that,
so I see no problems here.

Another solution is to move to PyOpenGL or similar any soon. 

glShaderSource implemented differently than opengl standards. It's taking one source at a time (instead of an array of sources).
This is similar with PyOpenGL solution.

glActiveTexture
glAttachShader
glCompileShader
glCreateProgram
glCreateShader
glDeleteProgram
glDeleteShader
glDetachShader
glGetAttachedShaders
glGetProgramInfoLog
glGetProgramiv
glGetShaderInfoLog
glGetShaderiv
glGetShaderSource
glGetUniformLocation
glIsProgram
glIsShader
glLinkProgram
glShaderSource
glUniform1f
glUniform2f
glUniform3f
glUniform4f
glUniform1fv
glUniform2fv
glUniform3fv
glUniform4fv
glUniform1i
glUniform2i
glUniform3i
glUniform4i
glUniform1iv
glUniform2iv
glUniform3iv
glUniform4iv
glUniformMatrix2fv
glUniformMatrix3fv
glUniformMatrix4fv
glUniformMatrix2x3fv
glUniformMatrix3x2fv
glUniformMatrix2x4fv
glUniformMatrix4x2fv
glUniformMatrix3x4fv
glUniformMatrix4x3fv
glUseProgram
glValidateProgram
2012-05-09 02:42:30 +00:00
d9ce1cda94 Python/context: python could get invalid bpy.data in scene update handler after
undo.

The way this got updated from the context is a bit unreliable, and for handlers
the update couldn't happen because there is no context passed in. Now it's
updated from setup_app_data, which is where the change actually happens. I left
in the other updates to be sure but they should not be needed anymore.
2012-05-08 22:07:06 +00:00
3ef11693f5 Style cleanup: displist module 2012-05-07 06:58:03 +00:00
4c5502bfd6 code cleanup: function naming for BLI functions. 2012-05-05 00:23:55 +00:00
133bdac1d0 Patch [#31279] clarifiy a python error-string (when incorrectly specifying enum
items from python)

Thanks Philipp Oeser (lichtwerk)
2012-05-04 14:34:10 +00:00
933b3166fc style cleanup: guys - set your editors to tabs! 2012-05-01 17:51:03 +00:00
9fe1fe0aa8 bmesh py api:
add mtexpoly image access
2012-05-01 06:50:43 +00:00
1d743d11dc bmesh - python api
- bm.*.layers.*.verify()
- bm.*.layers.*.is_singleton
- bm.*.layers.*.copy_from(other)


also added api functons
- BM_data_layer_copy(...)
- CustomData_layertype_is_singleton(type)
2012-04-30 18:54:14 +00:00
a5af5e8f50 style cleanup: re - http://wiki.blender.org/index.php/Dev:Doc/CodeStyle#Braces_with_Macros 2012-04-30 16:22:40 +00:00
112162e09e code cleanup: header cleanup 2012-04-30 14:24:11 +00:00
60c9addf79 - improve select grouped prefix/suffix from recent patch
- added select similar direction (Y axis)
2012-04-30 08:24:44 +00:00
f88cfd9168 Code and style cleanup in own modules in BKE and also mball module
- Make sure functions are named in way BKE_<object>_<action> (same way as RNA callbacks)
- Make functions which are used by mball.c only static and remove their prototypes
  from public header file.

Further cleanup is coming.
2012-04-28 16:49:00 +00:00
ef054e165c style cleanup: format 'for' loop macros the same as for loops, some renaming to BLI_array macros. 2012-04-28 15:14:16 +00:00
d3c1ece201 fix [#31113] bmesh.types.BMLayerCollection getter calculate key indices wrong (own fault)
also add check so layer.name won't crash incase the layer becomes invalid.
2012-04-26 16:32:30 +00:00
4782522379 Add libMV and Scons support for MinGW-w64, patches by Caleb Joseph with slight modifications.
Thanks!
2012-04-24 12:57:58 +00:00
bfcdd45245 corrections from an article about using PVS-Studio static checker with blender - http://www.viva64.com/en/b/0145/ 2012-04-23 15:54:43 +00:00
4c873fec53 bmesh py api: functions to add/renmove customdata layers, eg.
bm.loops.layers.color.new("Testing")
2012-04-23 14:52:28 +00:00
16ff7e40e6 code cleanup: change C naming convention (so py and C api match), eg:
C: BM_face_calc_area(f), Py: BMFace.calc_area()
2012-04-23 01:19:50 +00:00
5c89138684 style cleanup: comments 2012-04-22 11:54:53 +00:00
49ff0eeec4 bmesh py api: expose BM_face_split_n() to the python api;
face_fill(..., coords=(v1, v2, ...))

This is the same function the knife tool uses. should be handy for dicing up geometry in py.
2012-04-22 10:19:24 +00:00
d5023f0e91 correction to py docs from mgschwan on IRC. 2012-04-22 08:36:39 +00:00
6701933f5c style cleanup 2012-04-21 12:51:47 +00:00
80ff1984f8 bmesh py api: remove bmesh.loops.index_update(), it wasn't working, as joe noticed. 2012-04-19 23:23:29 +00:00
417117e207 bmesh py api: expose BMVert.calc_shell_factor() 2012-04-19 19:13:57 +00:00
b40476455e code cleanup: remove unused BMesh args. 2012-04-19 14:38:09 +00:00
475ecbb0ce remove BM_ITER, BM_ITER_INDEX macros, use ELEM or MESH variants only (the maceros had unused args in both cases). 2012-04-19 13:47:58 +00:00
75b869e428 style cleanup: BM_ITER / BM_ITER_INDEX / BMO_ITER 2012-04-19 11:44:12 +00:00
db2edfcfde bmesh api function: BM_edge_face_tangent()
was used by inset but make into an api function since scripts can use this too.
2012-04-19 11:25:05 +00:00
6520aa97a9 add 'idprop' module so we can document idprop.types.*, currently doc generator has no access to ID Property types. 2012-04-15 14:54:15 +00:00
db53faffa3 make ngon_perimeter into a public api function and expose to python. 2012-04-15 10:09:27 +00:00
455b8212b6 Scons:
* Compile fix for r45609, pthreads include was missing.
2012-04-13 19:34:15 +00:00
440f449265 Fix #30858: UI losing buttons at some random moment after using Blender for a
while. This may not fix all cases but should at least solve the issue when
rendering with cycles.

The cause was a race condition on C->data.recursion, with multiple threads
accessing context at the same time. Cycles itself does not access context
from the render thread, but the bpy api would do a context update for any
callback in case e.g. a new file got loaded. Disabled that now in non-main
threads.

The ideal solution would be to not allow any context access at all from threads
but that's not so simple to implement, especially not this close to release.
2012-04-13 16:03:52 +00:00