Commit Graph

50156 Commits

Author SHA1 Message Date
e34b7a62c4 Hack to workaround scene update lock caused by GIL
Couple of RNA callbacks would imply scene update routines
to trigger. This works fine for until some objects does have
drivers.

If some object does have driver, it'll try to lock GIL
when evaluating this driver, and GIL is already locked by
a python API, which causes deadlock.

For now made it so RNA callbacks doesn't do threaded update.
This is not so much nice, especially since Cycles might
use the same API for motion blur, but for now don't see
better way to solve the deadlock.
2013-08-01 03:58:22 +00:00
702bf77b34 Cycles / Squared Samples:
* After some feedback decided to remove this option from the Progressive integrator, it only makes sense for Non-Progressive where we have different values for the sample types.
2013-07-31 22:51:48 +00:00
ac8e379a87 Fix linking issue, we use bundled static glew so we should define static glew in ghost as well. 2013-07-31 22:39:17 +00:00
cb0cb84127 Fix typo which lead to crash when applying lattice modifier 2013-07-31 22:37:54 +00:00
0f591cbb51 Small optimization to previous change of statistics output
Use boolean flag for detecting whether there're updated
objects instead of doing real object counter (which required
spin lock).
2013-07-31 21:56:11 +00:00
983137ed74 Remove annoying statistics ifdef from code
All the statistics is already inside if() block, so
it doesn't have any noticeable affect on overall
performance.
2013-07-31 21:56:06 +00:00
a196de9a79 Made task scheduler follow command line argument number of threads 2013-07-31 21:56:00 +00:00
f5db3dc220 Made it so threaded update statistics only prints when something was updated
This prevents infinite prints of statistics while blender is idling.
2013-07-31 21:55:54 +00:00
038cb9ccdb Code cleanup: get rid of unneeded thread count in statistics structure 2013-07-31 21:55:47 +00:00
c756a4466c Added check for whether thread lock is being removed while thread is using guarded alloc. 2013-07-31 21:55:41 +00:00
c847198a7b Use one global task scheduler for all the tasks
Instead of allocating scheduler and starting threads
on every object_update call make it so scheduler is
global and threads are always ready to run.

This was we could avoid quite hacky thing which is
counting how much objects need to be updated before
starting threaded update.

It'll also allow using the same scheduler to do all
sorts of tasks, not only objects update in the same
scheduler. This is nice from load balancing point of
view.

Couple of changes were needed to be done in task
scheduler itself:

- Free tas before sending notifier.
- Free TaskThread structures outside from thread.

This is needed to make it possible use begin/end
threaded malloc from the main thread before/after
running the pool. Without this change it was possible
that allocation will switch to non-thread mode while
thread is freeing the task.

This required storing TaskThread array in Scheduler,
but it's not so much bad actually, since it also
reduces memory overhead caused by per-thread allocation.
2013-07-31 21:55:36 +00:00
853f2e05c8 Optimization and threading fix for shapekeys weights calculation
This commit fixes two different issues, which were caused by
how weights are being calculated for relative shapekeys.

Weights for key block used to saved in KeyBlock DNA structure,
which lead to situations when different objects could start
writing to the same weights array if they're sharing the same
key datablock.

Solved this in a way so weights are never stored in KeyBlock
and being passed to shapekeys routines as an array of pointers.
This way weights are still computed run-time (meaning they're
calculated before shapekey evaluation and freed afterwards).

This required some changes to GameEngine as well, to make it
never cache weights in the key blocks.

Another aspect of this commit makes it so weight for a given
vertex group is only computed once. So if multiple key blocks
are using the same influence vertex group, they'll share the
same exact weights array. This gave around 1.7x speedup in
test chinchilla file which is close enough to if we've been
caching weights permanently in DNA (test machine is dual-code
4 threads laptop).

Some further speed is optimization possible, but it could be
done later as well.

Thanks Brecht for idea of how the things might be solved in
really clear way.
2013-07-31 21:55:25 +00:00
0d9364463f Merged revision(s) 58779, 58783-58784 from trunk/blender into soc-2013-dingto. 2013-07-31 21:49:10 +00:00
e48acb7dec Code cleanup, use bools here. Forgot to change that. 2013-07-31 21:40:52 +00:00
7913604bda remove unused headers and NULL check 2013-07-31 21:34:25 +00:00
2a2f0319bc Cycles / HSV Separator and Combine node:
* Added nodes to separate and combine hsv colors.

Part of my GSoC 2013 project, SVN merge of r57981.
2013-07-31 21:27:48 +00:00
34009da32e Cycles / Vector Transform node:
* Add a note to convert a Vector, Point or Normal between World <=> Camera <=> Object coordinate space. 

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Vector_Transform

Part of my GSoC 2013 project, SVN merge of r57599, r57670, r57918, r57919, r58245 and r58775.
2013-07-31 21:18:23 +00:00
6d9720ef63 Cycles / Blackbody to RGB node:
* Added a node to convert a temperature in Kelvin to an RGB color. This can be used e.g. for lights, to easily find the right color temperature. 
= Some common temperatures =
Candle light: 1500 Kelvin
Sunset/Sunrise: 1850 Kelvin
Studio lamps: 3200 Kelvin
Horizon daylight: 5000 Kelvin

Documentation: http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Blackbody

Thanks to Philipp Oeser (lichtwerk), who essentially contributed to this with a patch! :)

This is part of my GSoC 2013 project. SVN merge of r57424, r57487, r57507, r57525, r58253 and r58774
2013-07-31 20:56:32 +00:00
22dae3e600 fix for BLI_ghash_clear from Sv. Lockal (lockal) 2013-07-31 20:50:55 +00:00
86cb81abb9 Merging r58756 through r58777 from trunk into soc-2013-depsgraph_mt 2013-07-31 20:49:39 +00:00
3840e0b234 Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce.
This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. 

http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path

This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
2013-07-31 20:30:37 +00:00
2a25acb108 Cycles / Vector Transform node:
* Code cleanup to avoid duplicated enum code.
* Added a third type for conversion next to Point and Vector: Normal. This is basically the same result as with the Vector type, but normalizes the vector at the end. 

Thanks to Brecht for code review!
2013-07-31 20:05:13 +00:00
b6024a0e75 Cycles / Blackbody Node:
* Some optimizations to avoid divisions on runtime, avoid possible division by zero and code cleanup. 

Thanks to Brecht for code review!
2013-07-31 19:03:42 +00:00
380ee3d30a Cycles / Non-Progressive integrator:
* Code cleanup, to avoid separate code for CPU and GPU.
2013-07-31 18:46:11 +00:00
6a902d1a81 Cycles / Ray Depth:
* Fix some things which came up in code review. Includes some fixes for background lights and changes to variables, to avoid some castings.

Thanks to Brecht for code review! :)
2013-07-31 18:40:11 +00:00
a3e34e5fbc Merged revision(s) 58682-58770 from trunk/blender into soc-2013-dingto. 2013-07-31 18:14:18 +00:00
c15ae082bb Code cleanup: libmv C API
Clean up inconsistencies in the libmv C API:
- All type identifiers are libmv_TypeName
- All function identifiers libmv_functionName
- Prefer libmv_nounVerb function names (e.g. libmv_featuresDestroy)
- Match Blender code formatting rather than Google
- Spelling corrections

Code review: https://codereview.appspot.com/11494044/
2013-07-31 13:48:12 +00:00
Lukas Toenne
81fd056d61 Fix #36267 part 2 of 2: Fix for reroute node values in old shader node stack system. They were overwriting stack values from their input nodes, because the system would not detect that these sockets
actually just point to existing defined stack values. To make the link check work, set the socket->link pointer if internal node connections exist, this works for both muted and reroute nodes.
2013-07-31 12:26:03 +00:00
Lukas Toenne
3a69398288 Fix #36267, part 1 of 2: fix for reroute node type updates. The reroute nodes change their socket type based on what they are connected to, to work as pass-through nodes with as little conversion as
necessary.

Problem was/is that the nodes can set the 'type' property, but in order to actually change the data type they would also need to update the typeinfo pointer (and idname), which is strongly discouraged.
Solution is to just replace the input/output sockets of the reroute node with new sockets of the desired type and port all links over.
2013-07-31 12:26:01 +00:00
43ab02db14 code cleanup: remove redundant NULL checks 2013-07-31 09:18:40 +00:00
e129211605 add NULL checks in eyedropper_color_sample_fl since BKE_area_find_region_type may not find a region. 2013-07-31 09:17:58 +00:00
fc598dbf38 Merging r58747 through r58755 from trunk into soc-2013-depsgraph_mt 2013-07-31 07:34:09 +00:00
adfc77c1db Use bool instead of int. 2013-07-31 03:44:45 +00:00
bf6ea3d717 Fix #36302: Multires baking to zero 0 was showing error but still was baking
We do not support baking to level 0, disabled this completely now.
2013-07-31 03:35:45 +00:00
24b0f8247f Merging r58701 through r58746 from trunk into soc-2013-depsgraph_mt 2013-07-30 19:05:29 +00:00
61c9c82b62 Use malloc in cases when data is getting overwriten after allocation. 2013-07-30 18:49:40 +00:00
3d57740a38 Cycles / Non-Progressive integrator:
* Avoid check for !LABEL_TRANSPARENT in "kernel_path_non_progressive_lighting", transparency is either handled in the outer loop or in the "kernel_path_indirect" function, but not here.
2013-07-30 12:56:39 +00:00
f7169cd47d fix: [#36148] Collada instance nodes are not scaled properly during import 2013-07-30 12:18:24 +00:00
5c69338fe6 apply world matrix only to armature, Bones and children get it implicit via parenting 2013-07-30 11:10:04 +00:00
76e989d7b1 function renaming for own recently added BLI_math functions, suggested by Brecht. 2013-07-30 10:58:36 +00:00
298a03ee63 fix for error in own recent changes to transform initialization, proportional editmode needs to skip hidden faces. 2013-07-30 09:50:17 +00:00
5ce3588c6c Cycles:
* Increase the maximum amount of closures per shader from 16 to 64, so more complex closure trees can be rendered.

I measured performance on CPU and GPU (Geforce 540M) and couldn't find a performance impact, but if someone encounters a noticeable impact on his system, please report.
2013-07-30 09:26:45 +00:00
6c5a4aedc2 Fix for [#36321] 'Mark Freestyle Edge' still showing with Cycles renderer
* Now we hide Freestyle properties when "use_shading_nodes" is true.
2013-07-30 09:00:31 +00:00
793e17ef6c Remove superfluous iterations (caused by typo) and type casts in outliner
This significantly lowers the position of outliner_draw_tree_element in profiler
and partially fixes [#36260] (2,300 Objects Makes Blender Unresponsive)
2013-07-30 08:45:45 +00:00
Lukas Toenne
7e02d82036 Minor change to the custom_nodes.py template that has some consequences for addons: use bpy.types.* base classes instead of bpy_types.*
The bpy_types classes cause issues when used in addons when loading on Blender startup (subclasses cannot be properly registered).
2013-07-30 08:30:15 +00:00
90eec89125 Collada: renamed size_mat to scale_mat for clarity. removed obsolete variable definition 2013-07-30 07:32:37 +00:00
8140f56575 Collada: unit converter was not initialized for ArmatureImporter 2013-07-30 07:22:40 +00:00
620323a12c Missed a couple of files for the vsync commit (r58729). 2013-07-29 22:36:51 +00:00
29f8dfd37a BGE: Adding vsync control. Users can enable vsync, disable vsync, or use adaptive vsync via UI options in the render properties, or by using the new Python method bge.render.setVsync(). Win32 and X11 support are done via EXT_swap_control. Support for using EXT_swap_control on OS X still needs to be added to Ghost. 2013-07-29 22:31:32 +00:00
2840edba84 BGE: Adding bge.physics as another alias for the PhysicsConstraints module. 2013-07-29 22:20:06 +00:00