Commit Graph

3701 Commits

Author SHA1 Message Date
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
1add07821b fix [#30925] successful import of keyconfig dependant on current object context?
revert r34885,

The hack was to fix poselib UI but is REALLY BAD - don't modify properties when accessing them.

This bug must be fixed some other way.
2012-04-13 09:25:50 +00:00
9e663017d8 py rna/api: fix for error running RNA_property_collection_type_get on non collection property types. 2012-04-11 10:35:09 +00:00
85908b498b fix [#30906] dict(prop) crashes if prop is a PropertyGroup with nested PropertyGroup
the ID of a python ID property can be NULL.
2012-04-11 08:37:48 +00:00
63e2763842 Fix #30698: python console nodetree paths were not accurate, now show ... like
in some other cases to at least show these are not accurate.
2012-04-10 16:37:05 +00:00
1b74ec9564 fix for too small MATHUTILS_TOT_CB when the game engine runs. 2012-04-10 12:35:15 +00:00
8fa17c5362 code cleanup: no functional changes
- memset(..., -1) is used incorrectly even though it worked: MOD_solidify.c - thanks Halley from IRC for noticing this. use fill_vn_i() instead.
- quiet warnings in editmesh_slide.c
- cleanup comments in bmesh and some other minor comment additions.
2012-04-07 12:37:15 +00:00
1635d8e873 add option not to delete edges/verts when joining faces, needed so we can loop over edges and join them without having to check if they have been removed. 2012-04-04 14:48:10 +00:00
b07f9446c7 Hopefully last change to matrix orthogonal check, touches Py API only
- is_orthogonal now checks matrix in the same way as it's defined
  by linear algebra, meaning that it'll use is_orhonormal C check
- Added is_orthogonal_axis_vectors to check if vectors which defines
  axises are orthogonal
2012-04-02 12:36:00 +00:00
c563eb71b7 wrap RNA's RNA_property_collection_clear from python. 2012-04-02 11:28:26 +00:00
26b0255049 Fix for is_orthogonal check which in fact was checking for orthonormal matrix.
Separated it into two functions so now it'll be clear if check happens for
orthonormal or just orthogonal.
2012-04-01 00:14:41 +00:00
21ac9ae461 code cleanup: use uppercase defines and change drawFCurveFade into static function. 2012-03-31 04:04:58 +00:00
5b88712ff9 move debug flag into its own global var (G.debug), split up debug options.
--debug
  --debug-ffmpeg
  --debug-python
  --debug-events
  --debug-wm

This makes debug output easier to read - event debug prints would flood output too much before.

For convenience:
  --debug-all turns all debug flags on (works as --debug did before).

also removed some redundant whitespace in debug prints and prefix some prints with __func__ to give some context.
2012-03-31 00:59:17 +00:00
89b83f0060 patch to add __deepcopy__ to mathutils types, this is no different to __copy__, except some py utilities expect __deepcopy__ to exist, so better have them. 2012-03-30 11:35:58 +00:00
79871ded0b fix for finding the python exception line number when running a script in the text editor.
- filename comparison was invalid
- was stopping on the first traceback, which would reference the caller but not the error line (when the error was in a function).
2012-03-30 05:26:08 +00:00
20e2330434 added Mesh.calc_tessface(), needed to update mesh tessface after bmesh edits.
also add py api BMDeformVert.clear()
2012-03-29 13:44:30 +00:00
c9e1ced4dd code cleanup: (dont include ';' in defines), last commit also missed changes to paint_image.c 2012-03-28 01:06:43 +00:00
7f1e9b8c41 bmesh py api:
added access to deform weights, access to weights acts like a python dict so you can do...

  print(group in dvert)
  dvert[group] = 0.5
  print(dvert[group])
  del dvert[group]
  print(dvert.items())
2012-03-27 10:30:10 +00:00