Commit Graph

41927 Commits

Author SHA1 Message Date
Benoit Bolsee
4213eca5fc BGE VideoTexture: add depth buffer access to ImageViewport and ImageRender.
2 new attributes to ImageViewport and ImageRender object:
depth: set to True to retrieve the depth buffer as an array of float
       (not suitable for texture source).
zbuff: set to True to retrieve the depth buffer as a grey scale pixel array
       (suitable for texture source).

A new mode 'F' is added to VideoTexture.imageToArray() to allow returning the image
buffer as a one dimensional array of float. This mode should only be used to retrieve
the depth buffer of ImageViewport and ImageRender objects.

Example:

viewport = VideoTexture.ImageViewport()
viewport.depth = True
depth = VideoTexture.imageToArray(viewport,'F')
# show depth of bottom left pixel
# 1.0 = infinite, 0.0 = on near clip plane.
print(depth[0])
2012-10-20 22:28:44 +00:00
Campbell Barton
7deb8d8a26 code cleanup: spelling 2012-10-20 20:36:51 +00:00
Campbell Barton
c56a911cd9 style cleanup: comments 2012-10-20 20:20:02 +00:00
Bastien Montagne
80d3423b00 Atempt to get rid of those ugly "long locales" under windows. Tested by me (win7 64, VC2008) and by Sergey. However, older OS (XP) may not work...
The idea behind this is that gettext lib has a func that mimics usual setlocale, but doing also the conversion to windows locale names. Let's hope it works everywhere!
2012-10-20 19:54:09 +00:00
Bastien Montagne
c1b39d3461 Fix for r51447 (my CMake 2.8.9 did not like it, looks like with quotes it suites it...). 2012-10-20 19:36:08 +00:00
Campbell Barton
bc8f602601 style cleanup 2012-10-20 18:46:57 +00:00
Campbell Barton
3da4b08110 bmesh-decimator, skip recalculating face normals on each edge collapse. (they are not used so faster to avoid) 2012-10-20 18:12:22 +00:00
Thomas Dinges
ba7a7c0925 Cycles / OSL:
* Fix Mapping node, used wrong identifiers for Vector In/Out.
2012-10-20 17:50:24 +00:00
Campbell Barton
eee64aeccf bmesh-decimate now only does CustomData_has_math for loop layers, add CustomData_has_interp() for vert & edges. 2012-10-20 17:39:56 +00:00
Campbell Barton
8944dab58a bmesh decimator support for loop & edge customdata. (most importantly UVs and vertex colors). 2012-10-20 17:31:07 +00:00
Sergej Reich
0a590aadf5 Add option to set object origin to the center of mass
This uses the weighted average of polygon centroids based on area
It work well in most cases but will be slightly wrong when polygons have 
many vertices.
2012-10-20 16:48:54 +00:00
Campbell Barton
d20128bbbc fix for BM_edge_other_loop() not working right (own error in recent commit), and add new function BM_vert_step_fan_loop() for stepping around the loops of a face fan with manifold edges. 2012-10-20 16:48:04 +00:00
Campbell Barton
29392dc2b4 don't print mousemoves with wm_handlers_do and --debug-events 2012-10-20 16:04:15 +00:00
Brecht Van Lommel
73b79a6763 Cycles OSL: light path, texture coordinate, bump and blended box mapping now up
to date and working.
2012-10-20 15:09:36 +00:00
Brecht Van Lommel
e287c97fea Cycles: disable motion blur for CUDA entirely now, also goes wrong on other
architectures. Still did not find a good solution.
2012-10-20 15:09:27 +00:00
Campbell Barton
18fa7589ef add comment about misuse of enum set function. 2012-10-20 14:16:56 +00:00
Ton Roosendaal
add48983ca Bugfix #32641
User preferences, keymap editor: it allowed to set any event for "key modifier", and not
even to NULL the option. Now it limits to keyboard events, on mouseclicks it clears,
on ESC it exits without changes.
2012-10-20 14:13:14 +00:00
Thomas Dinges
950524722c Cycles:
* Build system fixes for closure refactor.
2012-10-20 14:08:49 +00:00
Campbell Barton
a9e2e22797 dont ise -Wuninitialized on gcc 4.2 and older, it gives annoying warnings. 2012-10-20 13:29:07 +00:00
Lukas Toenne
d36dc6d8de Integer socket support in Cycles. Int values are already supported natively in OSL, but were not used as actual ints on the SVM stack. This patch implements all the necessary functionality to support reading input values from RNA properties and convert between SHADER_SOCKET_INT and other types. 2012-10-20 13:11:45 +00:00
Campbell Barton
cf7dec94fe switch order cmake includes warning flags so its possible to disable them 2012-10-20 13:08:51 +00:00
Brecht Van Lommel
9a1c1f132d Cycles OSL: most closure code is now shared between OSL and SVM. Also fix
transmission pass and filter glossy option.

The BSDF closure class is now more similar to the SVM closures, and includes
some flags and labels that are needed to properly categorize the BSDF's for
render passes. Phong closure is gone for the moment, needs to be adapated to
the new structure still.
2012-10-20 12:18:00 +00:00
Brecht Van Lommel
3abef3a2e6 Cycles OSL: some build system tweaks to avoid global includes and definitions,
which ensures there is no conflict with other libraries, and avoids full rebuild
when toggling OSL on/off.
2012-10-20 12:17:45 +00:00
Campbell Barton
1820d3529c add TIMEIT_VALUE_PRINT() macro for printing timing between start/end macros. 2012-10-20 10:37:15 +00:00
Bastien Montagne
a99b377167 More UI messages fixes and tweaks, and BKE_report<->BKE_reportf. 2012-10-20 10:28:34 +00:00
Campbell Barton
deeecc2029 code cleanup: remove unused members of BMIter struct to save some space. (this iterator is used everywhere).
also rename vars in the struct.
2012-10-20 10:11:26 +00:00
Campbell Barton
23d43396ff code cleanup: quiet -Wshadow warning, var name changes for splice functions and add assert for BM_edge_splice() when edges don't use the same vertices. 2012-10-20 09:56:40 +00:00
Campbell Barton
a7a723283b add BM_edge_find_double() and use in bmesh decimator to fix crash. 2012-10-20 09:48:41 +00:00
Bastien Montagne
95a414955c Remove six languages from Blender UI (rational: very low level of translation, 1-2% at most, and no commit done in branch since more than one year): fi (Finnish), ca (Catalan), bg (Bulgarian), el (Greek), ne (Nepali) and pl (Polish).
Also fix compile in paranoid warning=errors mode for own last commit.
2012-10-20 08:52:54 +00:00
Bastien Montagne
494aa37f94 Fix unix language setting fallback (long_locale is windows only!). This was preventing setting language when you did not have the relevant locale installed under Linux... 2012-10-20 08:33:54 +00:00
Campbell Barton
9f8070d047 code cleanup:
- define array sizes for functions that take vectors.
- quiet some -Wshadow warnings.
- some copy/paste error in readfile.c made it set the same particle recalc flag twice.
2012-10-20 08:02:18 +00:00
Dan Eicher
08dd8a6849 rna_sequencer_api.c doc string cleanup 2012-10-20 05:51:45 +00:00
Joshua Leung
0cac505221 Code cleanup 2012-10-20 05:08:26 +00:00
Joshua Leung
e010c29fa8 Grease Pencil: Tweaks to make tooltips show up for the different drawing tool
types available
2012-10-20 04:56:24 +00:00
Nicholas Bishop
3a52a876b6 Fix for drawing meshes with VBOs disabled in sculpt mode
* This is another fix for r51118. Was drawing flat-shaded GPU buffers
  with VBOs even when VBOs were disabled in the preferences.
2012-10-20 00:45:44 +00:00
Bastien Montagne
2256c8e25f Fix [#32925] Center cursor (shift+C) crashing blender after duplicating bone in armature edit mode.
Center Cursor uses BKE_object_minmax(), which uses pchans' bone member to check whether a bone is visible or not. But after a duplication, the duplicated pchan->bone are NULL, skiping in this case (as if they were hidden, not optimal but should do the work for now - anyway, using pchan's values in Edit mode does not really make sense, imho).
2012-10-19 19:16:18 +00:00
Bastien Montagne
3fec74ec1a Minor fix to BKE_reportf(): also output the report's type when printing to console. 2012-10-19 17:08:46 +00:00
Brecht Van Lommel
7e620f04a1 Fix #32920: cloth physics with collision exploding in some cases, due to
uninitialized memory usage.
2012-10-19 16:44:08 +00:00
Bastien Montagne
f72f1dca6c More UI messages fixes and tweaks, BKE_report<->BKE_reportf, and stuff to translate... 2012-10-19 16:43:10 +00:00
Lukas Toenne
97c68098cc Additional debug assert in the compositor for checking correct conversion of Nodes to Operations. This will trigger an assert failure whenever a node has remaining socket connections after conversion. This would mean that not all sockets have been properly relinked and helps detect incomplete code. 2012-10-19 16:29:17 +00:00
Bastien Montagne
1b2d2da69a Add stub for new ED_view3d_grid_scale(). 2012-10-19 14:38:32 +00:00
Thomas Dinges
ef80ff105f Cycles/ Layer Weight Node:
* Small tweak for the blend value, to avoid division by zero. 

Thanks to Brecht for pointing out the solution.
2012-10-19 13:51:37 +00:00
Sergey Sharybin
a75f11d036 Fix #32219: Inconsistent influence of Units Scale on new objects
Made it so meshes, curves, surfaces and metaballs are scaling to a grid cell size,
which makes them behave consistently now.

There're still issues to be resolved still:

- Lattice is not scaled to grid cell size yet, it uses slightly different add
  function which makes scaling a bit tricky and hacky. Would prefer to do a
  bit bigger refactor here, so it's a TODO for now.

- Cameras, speakers and other helpers are not scaling. They don't have data
  on which scale could be applied and perhaps it should be some kind of draw
  scale. Also would consider it's a TODO for now.
2012-10-19 12:53:03 +00:00
Campbell Barton
3a41ab73ff fix for some issues with modal mesh tool interaction.
When inset and bevel used the mouse input as a distance value, the change could be far too great when zoomed in, or far too small when zoomed out. Now get the pixel-size based on the center point of the selection.
2012-10-19 12:45:31 +00:00
Sergey Sharybin
4c936221a3 Fix #32705: Esc a value change doesn't recalc compositor
Seems the issue was caused by G.is_break set to Truth on both escape
press and release. This ended up in situation when after press event
compositor was tagged to redraw and new job was started. On escape
release this compositor job was cancelled.

Made it so G.is_break is setting on escape press event only.
2012-10-19 11:47:33 +00:00
Campbell Barton
e527ce552e add option to initialize heap with a known number of elements, since this may be known in advance - it avoids re-allocing too much. 2012-10-19 10:40:32 +00:00
Campbell Barton
b7642348e4 simplify addon install print, Now it only prints the source and destination dirs, with a list of addons added.
don't think its needed to print the full path of each addon.

also remove the __MACOX check, its harmless and people can make sure there zips dont have cruft in them before distributing them.
2012-10-19 10:37:24 +00:00
Gaia Clary
9d1873154f [#32921] Fix: Python error triggered when installing an addon via 'install addon' button 2012-10-19 08:51:31 +00:00
Joshua Leung
cf4f4e8a9b Fix: Text fields for Generator FModifier were too small
This was caused by the x^n labels being far too large. Also, replaced old string
functions with "safer" versions
2012-10-19 08:49:49 +00:00
Campbell Barton
e648542872 decimate modifier rewrite to use bmesh (#ifdef-disabled by default for now).
- maintains quads & ngons
- supports some customdata (weight paint for example works fine).

TODO
- add suppory for loop data (UV's / VCol's).
- outputs invalid geometry when heavily reducing some meshes, needs to be made stable in these cases.
2012-10-19 07:31:51 +00:00