1
1

Compare commits

...

1862 Commits

Author SHA1 Message Date
56c7dcbc03 Some comments. 2015-05-21 16:48:20 +02:00
c876fc76c2 Compilation fixes, disable getPrincipalDirections. 2015-05-21 15:52:09 +02:00
94ecc00d96 Revert "Delete GradientFlowSystems, adapt makeOrientationsMesh function and harmonic gradients generation."
This reverts commit f0672fb586.
2015-05-21 14:03:23 +02:00
ed65dc99fd Merge remote-tracking branch 'origin/master' into soc-2014-remesh 2015-05-21 13:28:12 +02:00
4b8dcfc0f5 Fix T44795: same menu item for different command in node editor.
We have too much of those cases in our UI, if we want to keep operators doing
several similar/related but yet different tasks, we should have a real way to
support it on label/icon/tip side too. Easier to say than to do though. :|
2015-05-21 13:20:54 +02:00
7938bd1877 Cycles: Remove OSL from split headers
Split kernel is mainly useful for GPUs which can not support OSL in visible
future anyway.
2015-05-21 16:12:50 +05:00
329f704601 Cycles: Move utility atomics function to util_atomic.h
No functional changes, just better to keep all atomic function in a single place,
they might become handy later.
2015-05-21 16:12:50 +05:00
e37c4e5819 Fix T44780: Decimate planar creates concave edges
Float precision was causing problems for decimate,
small faces that create a nearly flat surface were detected as having no 'cost' to collapse.
2015-05-21 21:06:30 +10:00
6ee653352b Math Lib: double versions of vector funcs
- add_vn_vn_d
- add_vn_vnvn_d
- mul_vn_db
2015-05-21 21:06:29 +10:00
6b40a4bcb1 Fix T44794: Blend From Shape tool X Icon UI Bug?
Note: maybe we could even make `RNA_property_is_unlink()` always return false
for enum properties? But well, guess being explicit here does not hurt...
2015-05-21 12:00:31 +02:00
d4c676e81b Cycles: CYCLES_OPRNCL_DEBUG now affects on split kernel as well 2015-05-21 14:30:33 +05:00
f18d77b874 Cycles: Restore some lost custom cflags passed to the kernel compilation
They were lost during simplification of kernel loading but might be rather
crucial for the performance.

Also made it so cflags are shared across kernels. Surely it might lead to
some unwanted kernel re-compilation but at the same time they might easily
run out of sync with the changes in kernel and so.
2015-05-21 14:05:53 +05:00
aa54d93a29 BMesh: decimate improvement for flat surfaces
Previously decimate on flat areas of a mesh would more or less randomly collapse edges.
(giving bad topology).

This commit includes a topology 'cost', so smaller edges on flat surfaces collapse first.
2015-05-21 16:41:08 +10:00
2c000cc9fc Fix mesh mirror failing on isolated verts 2015-05-21 13:01:44 +10:00
9bfea67751 UI: Use Ctrl+Wheel to cycle values
Conflicted with Alt for editing multiple values.
This could also conflict with global frame change at times.
2015-05-21 11:06:24 +10:00
1aa1a53115 UI: ignore mouse wheel while editing text
Mouse wheel was used as home/end.
Was annoying since it could happen by accident.
2015-05-21 10:46:22 +10:00
2b0613b948 Fix: GPU_shader_export fails /w some lamp attrs
first/last vars missed some values.

D1309 by @NHA
2015-05-21 08:48:21 +10:00
148ed4e05e Cycles: Cleanup, synchronize name across file name, program and kernel names 2015-05-20 23:10:07 +05:00
6f48df45ee Cycles: Simplify code around kernel loading 2015-05-20 23:10:07 +05:00
093d11df35 BGE: Some changes for the constraint document
* Change the constraint type alignment to vertical.
* Changed PHY_CONE_TWIST_CONSTRAINT to the correct value.
* Some minor changes.
2015-05-20 18:49:18 +02:00
2c5d5a9feb BGE: Remove chapter in KX_WorldInfo python API 2015-05-20 18:36:02 +02:00
Martijn Berger
8dd9b7cc5f Cycles standalone, add device type in output listing 2015-05-20 17:11:09 +02:00
b5bf5b36f1 BMesh: decimate, test for face flip was too low
Created overlapping faces in T44780
2015-05-21 00:00:13 +10:00
24e1d7f4f4 BMesh: decimate wasn't using face/edge centers
When calculating quadrics, using the first-vertex isn't correct.
2015-05-21 00:00:13 +10:00
8edfcf653a Movie Clip: Invlaidate clip cache when changing timecode 2015-05-20 17:52:58 +05:00
44a6109ca9 Clip Editor: Make it more obvious that Rebuild Proxy also rebuilds Timecode 2015-05-20 17:52:57 +05:00
77ef3f9041 Fix T44717: use_negative_frames ignored /w graph-editor
D1303 by @barfot
2015-05-20 21:58:33 +10:00
eb6bab25ba Add dedicated command argument to switch depsgraph to a single-threaded evaluation
This way it is possible to have single threaded depsgraph but threaded other areas
which is handy for torubleshooting.

he argument is: --debug-depsgraph-no-threads
2015-05-20 15:48:29 +05:00
8c6a9b9edc Fix reserve frames in sequencer failing with big frame ranges.
Detect frame range automatically from number of digits.
2015-05-20 12:42:00 +02:00
f4d064a5b2 Send color managed signal if input spaces changes during image saving
We're currently only supporting save to a default format color space, which
makes it a bit tricky to prevent ImBuf from being changed.

For until when saving to a custom colorspace works we'll just reload image
if the space changes.
2015-05-20 15:33:30 +05:00
28b2977be9 Atomic operations: Add function declarations at the top of the header
No functional changes, just helps grasping what operations are actually
supported.
2015-05-20 11:57:17 +05:00
5d30c23c35 doxygen: corrections/updates
Also add depsgraph & physics
2015-05-20 14:12:22 +10:00
922d5ed939 doxygen: update config 2015-05-20 14:09:43 +10:00
f0c143ca72 doxygen: rename included files (they were ignored) 2015-05-20 13:06:42 +10:00
a1e8547877 BGE: Use CameCase code style for KX_WorldInfo python API. 2015-05-19 23:13:30 +02:00
377822729c BGE: Fix T40555: LibLoad material caching issue
Previously we don't merge material cached list, it create dangling pointer and memory leak.
Now we merge material cache list during the scene merge, and remove material in this list during the library free.

Reviewers: agoose77, dfelinto, hg1, pgi, campbellbarton, moguri

Reviewed By: campbellbarton, moguri

Subscribers: campbellbarton, youle, kupoman

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1278
2015-05-19 19:24:14 +02:00
fccf253e36 Support string metadata loading for OpenEXR files. 2015-05-19 18:32:41 +02:00
150a4b23ba Fix part of T44768 Yet another Intel driver failing on viewport Ambient
occlusion

(Maybe we should add drivers that DO work instead, but in the future
those will be much more since Intel claims to have fixed the issue)
2015-05-19 16:25:42 +02:00
158c891520 Clear animation list to avoid referencing freed memory. 2015-05-19 16:15:55 +02:00
df0a1fa3c5 Fix T44766: Connect fails /w selected ngon edges 2015-05-19 23:51:57 +10:00
07e9fb8ec6 BMesh: calls to store selection at the list head 2015-05-19 23:51:57 +10:00
d3cc7419a3 BMesh: add BM_edge_pair_share_face_by_len 2015-05-19 23:51:57 +10:00
78411dc7d7 Fix T44755 set_value node output in node tree not properly converted to
color in GLSL

Issue here is that intermediate result was clipped as an optimization in
such nodes and thus not converted to the correct type properly. Now only
clip those values if types match.
This keeps both the optimization and the conversion. I looked at
converting uniform types always but it's more involved to compare types
at conversion time for such links because the type was getting
overridden during link duplication.
2015-05-19 15:37:08 +02:00
dc3533030a Fix T44553.
Front face option did not get the correct normals to function - area
normal would always point to the direction of the stroke
2015-05-19 11:49:46 +02:00
e8561e966d Fix T44762: Materials flicker in edit-mode 2015-05-19 19:13:25 +10:00
ac636a3c97 Fix T44759: Blender has problems reading and writing 42k images to PNG 2015-05-19 13:02:52 +05:00
293df68ebd Object Drawing: avoid redundant material update 2015-05-19 18:00:20 +10:00
eb05e87e16 BMesh: editmode drawing set every faces material
Check for changes in material (as other drawing code already does)
2015-05-19 18:00:19 +10:00
da34136de1 Cycles: Check for validity of the tiles arrays in progressive refine
In certain configurations (for example when start resolution is set to small
value for background render and progressive refine enabled) number of tiles
might change in the tile manager. This situation will confuse progressive
refine feature and likely cause crash.

We might also add some settings verification in the session constructor, but
having an assert with brief explanation about what's wrong should already be
much better than nothing.
2015-05-19 12:42:07 +05:00
f868be6295 Cycles: Check for whether update/write callbacks are set prior to calling them
This changes the progressive refine part, regular update was already checking
for whether callbacks are set.
2015-05-19 12:42:07 +05:00
ddb1a068e9 SCons: install Python executable when its bundled 2015-05-19 16:44:19 +10:00
e698299e4f CMake: install Python executable when its bundled 2015-05-19 16:44:19 +10:00
d5a85f87b0 Python: search for 'python' and 'python#.#' 2015-05-19 16:44:19 +10:00
3d70a04a8a CMake: remove temp assignment, unused vars 2015-05-19 16:44:18 +10:00
183b643774 Building without Python works again 2015-05-19 11:38:07 +10:00
65328fadc3 Final solution for Intel card Ambient Occlusion in T43987.
Forgot to account for offscreen case in addition to compositing
2015-05-18 22:10:54 +02:00
Julian Eisel
598c2dffe9 Fix T44708: UI label should use plural
Just to keep commit ratio up while being busy preparing for final exams
;)
2015-05-18 21:29:57 +02:00
192fddb324 BGE: Fix blenderplayer bad call stubs not updated.
Please (dfelinto) compile the bge to avoid these kind of problems.
2015-05-18 18:54:13 +02:00
5fa0b8778b BGE: Set default envMap resolution to 512 pixels
I propose to change  the environment map render default resolution (600) to 512 (Thanks brecht for the correction... I don't know why I said dpi) (to make it compatible with this script: http://en.wikibooks.org/wiki/GLSL_Pr...cting_Surfaces ) to make cubeMap reflections easier and avoid this error:

invalid envmap size please render with CubeRes @ power of two
unable to initialize image(0) in MAMaterial, image will not be available

http://blenderartists.org/forum/showthread.php?371232-BGE-proposal-Set-default-envMap-resolution-to-512-dpi

http://blenderartists.org/forum/showthread.php?370026-Problem-with-cube-map-textures (post 11)

Author : youle (Ulysse MARTIN)

Reviewers: hg1, agoose77, lordloki, moguri, panzergame, dfelinto

Reviewed By: panzergame, dfelinto

Subscribers: brecht

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1306
2015-05-18 18:12:40 +02:00
Dalai Felinto
947b756d5e Multi-View: small cleranup/refactor with RE_pass_find_by_type and RE_RenderLayerGetPass 2015-05-18 10:57:59 -03:00
cecd1f98a4 Fix T44752: Clip Editor doesn't respect ColorSpace setting when playback after Prefetch 2015-05-18 16:40:52 +05:00
45afc02f11 Solve threading conflict related on proxy group's inverse matrix
It was possible that two threads will start calculating proxy group's inverted
matrix and store it in the object itself. This isn't good idea because it means
some threads might be using partially written matrix.
2015-05-18 16:40:52 +05:00
61f9f508a4 Make object material drivers evaluation thread safe
Previously it was very easy to run into situation when two objects are sharing
the same materials with drivers which will cause threading access issues.

This actually only needed for the old depsgraph, but since it's still the one
we're using by default we'd better solve this issue.
2015-05-18 16:40:52 +05:00
8540907d60 Attempt to make drivers more safe for threading
There were some reported data race conditions in the python interpreter which
seems to be rather valid.

Surely this is not very pretty solution, but it might solve some annoying bugs
related on threading.
2015-05-18 16:40:52 +05:00
40091ff83a Correction to early output in the parallel range implementation
The used heuristic of checking the value prior to lock is not totally safe
because assignment is not atomic and check might not give proper result.
2015-05-18 16:40:51 +05:00
b88597c218 Make switching to threaded malloc safe to be called from threads
For a long time this function was only intended to be used from the main thread,
but since out implementation of parallel range (which is currently only used by
mesh deform modifier) we might want to switch to threaded alloc from object
update thread.

Now we're using spinlock around the check, which makes the code safe to be used
from all over the place.

We might consider using a bit of atomics operations magic there, but it's not so
much important for now, this code is not used in the performance critical code
path.
2015-05-18 16:40:51 +05:00
17388794ce Filebrowser: Do not intent to draw empty strings, loss of time.
Fixes assert raised in `UI_text_clip_middle_ex()` when trying to draw (empty) 'size' string
for appended/linked blender datablocks.
2015-05-18 13:02:05 +02:00
bf93316c52 Fix assert in outliner regarding WM and SCR ID types... 2015-05-18 12:53:31 +02:00
5dfe88adba Fix T44553: Dyntopo ignores front-face option
When 'Front Faces' brush option was enabled, dyntop would still adjust detail on back-faces.
2015-05-18 18:22:31 +10:00
3dfce097e4 Cleanup: use const for Imbuf file types 2015-05-18 16:27:08 +10:00
924f31e54f Fix T44543: painted texture lost after first save
Fix for T36639 caused all path changes to reload (which could loose user content).

Change behavior:

- Only reload data when a flag is explicitly passed
  (currently only used by Find Files operator)
- Don't reload images which have been painted onto and not saved (dirty flag set).
2015-05-18 13:42:47 +10:00
662746fdd4 Fix multi-drag & multi-select, Alt press mid-drag
This would enable multi-value-editing in the middle of the drag action.
2015-05-18 11:52:59 +10:00
88acb3c599 Fix T44707: cycles border render regression 2015-05-18 11:37:19 +10:00
29aae4db38 UI: errors in buttons now show in info report
Mistakes in button expressions were previously only printed to the console.
2015-05-18 10:02:29 +10:00
3ed009af96 Change behavior of cycles xml to conform the spec: "Each XML document has exactly one single root element" 2015-05-17 23:41:38 +02:00
0b5bf9d419 BGE: Fix T42244 LibLoad crash with logic brick KX_TouchSensor
I remove duplicate and wrong code which treat the special case of KX_TouchSensor.
And Also the re-conversion of linked logic brick.
2015-05-17 22:19:09 +02:00
Julian Eisel
d1230ca723 Fix Node Editor using wrong snap element menu when called from shortcut
Kudos to @kopias for notifying me :)
2015-05-17 19:47:03 +02:00
105b87a3f7 Cycles: Enable advanced shading on AMD / OpenCL.
That is needed for Motion Blur and Render Passes to work properly.
I hope there are no nasty side effects, but we need to test this.
2015-05-17 19:29:33 +02:00
dae566894a Cycles / OpenCL: Enable Camera Motion and Hair for AMD.
Only enabled for the Experimental kernel though, so the feature set must
be changed in the UI to use the features.
2015-05-17 18:46:25 +02:00
14c2bc53c0 Cleanup: Typos, typos everywhere. :D 2015-05-17 18:32:31 +02:00
4139686817 Fix T44713: GLSL and BI inconsistency converting color to float node socket. 2015-05-17 18:18:04 +02:00
3cff7768d5 Fix T44718: Cycles GLSL not working for NURBS objects. 2015-05-17 17:25:57 +02:00
43ee3f4040 Fix T44739: OS X RMB emulation giving wrong mouse button release event. 2015-05-17 16:55:18 +02:00
48ed2b6309 UV editor: make Ctrl+E menu with mark/clear seam, instead of always marking. 2015-05-17 16:54:14 +02:00
a622cdaad8 Buildbot: Make sure files are readable by www group 2015-05-17 19:28:12 +05:00
2b9d806432 Fix T44084 - Cursor gets reset after MMB scrolling in another area while in GPencil Continous Draw Mode 2015-05-18 02:25:32 +12:00
206f29c12c Fix T44685 - In grease pencil stroke editing, selecting points is offset by a few pixels
The problem was that it was aborting too early after stumbling across a point which
might fit within the bounds required. This commit improves the logic here to solve
this and a few other little bugs like that.

Disclaimer: There are still a few cases where it randomly ends up picking something
way off. However, this only seems to occur very sporadically, so it's hard to say
how bad the problem may be.
2015-05-18 02:03:39 +12:00
30b45d5591 BMesh: don't check winding for uv-vert-map
Made link-select separate front/back with projected UV's
2015-05-17 23:06:41 +10:00
b68fa820d6 Fix T44715: crash compositing with undefined node due to re-save in older version 2015-05-17 13:44:22 +02:00
3b359f1fea BGE: Fix T43761 No re-creation of display list after a mesh modification.
I also removed unused flags in RAS_ListRasterizer.cpp.
2015-05-17 12:53:57 +02:00
4d45f47920 Fix T44737: Missing 'Spin' op entry in surface (NURBS) tools/menu. 2015-05-17 12:45:07 +02:00
effb912061 Cycles Standalone: Expose various light settings. 2015-05-17 12:36:42 +02:00
dad2850cc5 Numeric Input for Pose Breakdowner/Slide/Push Tools 2015-05-17 22:28:25 +12:00
347843f6fe Cycles Standalone: Update help screen. 2015-05-17 12:10:30 +02:00
f51fef63aa Fix own error deleting previews 2015-05-17 17:26:01 +10:00
847ec075eb Cleanup: pep8 2015-05-17 17:26:01 +10:00
02cbc3c1e0 Cleanup: indentation 2015-05-17 17:25:57 +10:00
daeb3069cf Cleanup: typos 2015-05-17 16:09:32 +10:00
6ba128129d CMake: correct file listing 2015-05-17 16:09:15 +10:00
60f60ed496 CMake: fixes for own checking script
don't error if generated files are missing.
2015-05-17 16:05:38 +10:00
6c15f3044b Yet another attempt to fix Intel case for T43987 2015-05-16 23:09:11 +02:00
dcacc54e07 Freestyle: Fix for stroke rendering performed with multi-views enabled.
Per-view Freestyle stroke rendering needs to be done without multi-views.
2015-05-16 23:59:14 +09:00
4c0f0eb338 Fix T44691 Freestyle render crashes when Views is on (Blender Internal).
In pipeline.c the function add_freestyle() was supposed to be called once
per frame, but after the Multi-view merge the function are called as many
as the number of views.  There were however a few Freestyle parameters
that have to be initialized per frame, and initializing one of the
parameters for each view was causing double freeing of allocated memory
which was enough to result in a crash.
2015-05-16 23:59:11 +09:00
a49534ae48 setting some RNA defaults for nodes 2015-05-16 13:04:40 +01:00
dddb4f655c BMesh: link-select-pick now supports redo
Without this you can't change delimiter options without editing the keymap.
2015-05-16 20:53:35 +10:00
3aa4a0e787 BMesh: add UV delimit for select-linked, dissolve 2015-05-16 12:21:31 +10:00
05c4c2409e BMesh: add sharp edge delimiter 2015-05-16 10:18:38 +10:00
5cc55486ee BMesh: select linked, support other delimiters
Use same options as limited dissolve (adds material & winding)
2015-05-16 10:17:46 +10:00
1bb3d0d485 Select linked seam limit, now works for picking
Second half of fix for also T42510
2015-05-16 09:35:35 +10:00
eeadd19eb5 Cleanup: use define for playback frame limiter 2015-05-16 08:35:25 +10:00
80c0097210 Only initialize icons in background mode.
Also enable this for headless builds too.

Calling UI_icons_init would initialize matcaps, brushes etc...
2015-05-16 06:21:26 +10:00
b931afe55e Fix new 'custom previews/icons' py feature crashing in background mode.
We want this even without UI, some scripts may use it in a background processing
mode to avoid too heavy process in actual 'user' blender...
2015-05-15 20:12:25 +02:00
08f30ef31c Fix T44724: missing menu entries for 'view fit' (F) in clip/image editors. 2015-05-15 19:49:00 +02:00
2d479421af Fix crasher in new lazy-rebuild outliner's treehash.
treehash must always been checked before used!

Reported on irc by sebastian_k and investigated by sergey, thanks!
2015-05-15 19:29:18 +02:00
5dc22fbbfb BGE: Fix T41299 Group API for child object in dupli instance group. 2015-05-15 19:17:15 +02:00
ce0d3112e4 Scene audio naming cleanup:
Remane sound_scene_handle to playback handle.
sound_scene_handle was a part of scene so we could see code like scene-
often in the same function.

If I understand things correctly, in audaspace lingo, the
playback_handle corresponds to a Reader while the scene_sound
corresponds to a Factory.

More cleanups will be done here later, but changing this now because my
brain hurts trying to remember which is which...
2015-05-15 16:51:46 +02:00
3d658bf7a7 BGE: Fix stupid typo error in DupliGroupRecurse 2015-05-15 16:25:45 +02:00
371e5f25a0 BGE: Cleanup : merge 3 loop in 1 in function DupliGroupRecurse. 2015-05-15 16:20:06 +02:00
f4e8e70b5d Add really simple memory reduction scheme for internal animation player.
Holds 30 frames in memory. Could make it check memory instead but that
should suffice for now to make sure blender does not crash on me with
movie files.

Previously the system would load eveything in memory so something like
playing caminandes in player would swap after 30 seconds in local
computer.
2015-05-15 16:01:01 +02:00
31e96cbf96 Cleanup: style, spelling 2015-05-15 23:38:53 +10:00
2fa4a48bce BGE: Fix T44700 mesh without material in blenderplayer.
If a mesh doesn't have a material we don't initialize the mSavedData in KX_BlenderMaterial to avoid crash.
2015-05-15 14:54:38 +02:00
7c06190882 Cycles: Make animated seed a builtin feature.
For animations, you often want an animated render seed (noise pattern).

This could be done by e.g. setting a driver on the seed value.
Now it's a little checkbox, that can be enabled.

The animated seed is based on the current Blender frame and
the seed value itself. Simply enabling it, will already result in an animated
seed (different on each Blender frame), but it can be randomized further
by setting a different seed value.

Disabled per default, so no backward compatibility break.

Differential Revision: https://developer.blender.org/D1285
2015-05-15 13:54:59 +02:00
e4c93dc7db Zoom to frame options, requested by the Hwoozeberry (dutch translation)
team.

There are 3 options here:

1) Keep range (previous behaviour)
2) Seconds - allows a specified offset in seconds around current frame
3) keyframes - zoom to include a number of keyframes around the cursor

Options 2 and 3 have their own properties to tweak the behaviour and all
options can be found in User Preferences->Interface under the 2D
viewports section.

Number 3 will probably need some refinement so commiting here for the
hwoozeberry team to test first.
2015-05-15 13:39:30 +02:00
48c60e2d62 Add initial principal curvature computation code. 2015-05-15 11:14:43 +02:00
c86a6f3efb Cycles: Enable CMJ for Intel/NVidia experimental split kernels
It is still disabled for AMD devices since can't test if it works fine
on this hardware.
2015-05-15 13:22:47 +05:00
c2b9f78415 Cycles: Pass __KERNEL_EXPERIMENTAL__ to OpenCL split kernels
Experimental feature set id currently unavailable for megakernel, it'll
require some changes to the cache system to distinguish cached regular
kernels from cached experimental kernels.

Currently unused, but some features will be enabled soon.
2015-05-15 13:22:47 +05:00
2ab909a88c Cycles: Make experimental kernel build option more generic
Previously it was explicitly mentioning it's NVidia kernel related option,
but in fact it's also handy for the OpenCL kernel.
2015-05-15 13:22:47 +05:00
c9e8888f87 Cycles: Disable bake OpenCL kernel for NVidia devices prior to sm_30
Driver fails to compile kernel in reasonable time for those devices here,
so for easier testing of the OpenCL split kernel work disabling bake kernel
for now.
2015-05-15 13:22:47 +05:00
960d7df56f Cycles: Pass device compute capabilities to kernel via build options
This way it's possible to do device-selective feature disabling/enabling.
Currently only supported for NVidia devices via OpenCL extension.
2015-05-15 13:22:47 +05:00
650fbd09f7 OpenCL wrangler: Add some of the extension defines 2015-05-15 13:22:47 +05:00
03f9d5a4cf Cycles: Cleanup, move build options string calculation into the device class
This way it's easier to access platform name, device ID and other stuff which
might be needed to define build options.
2015-05-15 13:22:47 +05:00
ba9dbaae64 Fix T42510: Limit by seams fails in edge/vert mode 2015-05-15 17:14:02 +10:00
547b676181 BMesh: add loop-shell walker 2015-05-15 17:07:57 +10:00
cfe54245a8 Correct recent cleanup
Removed call which was still needed
2015-05-15 11:29:34 +10:00
bc371030a7 BMesh: rename loop walker -> edgeloop 2015-05-15 10:55:56 +10:00
Julian Eisel
a92d8a34a8 Add material reorder buttons for Cycles as well 2015-05-15 01:25:03 +02:00
Julian Eisel
7549ec7301 Fix some issues found by Coverity Scan
Some of them are just brain dead code, some are potential bugs.
2015-05-15 01:08:41 +02:00
3c10ec96b5 Cycles: Enable object motion blur on Intel OpenCL platform
This required allocating some memory related on object transform needed
by ShaderData and currently it is done for all the platforms. Since we're
targeting full feature-complete platforms this is rather acceptable at
this point and in the future we'll do selective NO_HAIR/NO_SSS/NO_BLUR
kernels.

This is experimental still and in fact there're some major issues on
NVidia platform and it's not really clear if it's a bug in compiler,
some uninitizlied variable or other kind of issue.
2015-05-15 00:48:12 +05:00
03565218d5 Cycles: Various fixes
Some stupid fixes like spaces around operator and missing semicolon,
plus fix for wrong detecting of ShaderData SOA size. Thar was harmless
since there's only one closure array, but still better to fix this.
2015-05-15 00:42:05 +05:00
f6c6dd44de Cycles: Remove meaningless ifdef checks for features in device_opencl
This file was actually checking for features enabled on CPU and surely all
of them were enabled, so removing them does not cause any difference.

ideally we'll need to do runtime feature detection and just pass some stuff
as NULL to the kernel, or maybe also have variadic kernel entry points which
is also possible quite easily.
2015-05-14 23:44:19 +05:00
5c34266383 Cycles: Enable camera motion blur in split kernel for Intel/NVidia
It's good for testing and seems to work quite reliably here.

This probably not totally cheap in terms of performance, but this we
could solve quite easily by selective kernel compilation once other
things are tested/proved to be reliable.
2015-05-14 23:35:19 +05:00
0a60c7d8ee Cycles: Fix missing camera-in-volume update when using certain render layers configurations 2015-05-14 19:08:13 +05:00
3d3d805b64 Cycles: Prepare code for OpenCL camera/motion blur
The kernels are now compiling just fine, but there're some issues
during rendering. This is still to be investigated.
2015-05-14 18:48:56 +05:00
5a63edb929 Cycles: Use special _auto versions of transform function in motion blur code
Doing this as a separate commit so it's easier to revert in the future, once
OpenCL 2.0 is becoming our requirement.
2015-05-14 18:48:56 +05:00
33439626f1 Cycles: Add transformation functions with specified addrspace
This is required for OpenCL prior to 2.0 and those functions will become
handy when working on camera/motion blur support in split kernel.
2015-05-14 18:48:56 +05:00
79aa50dc53 Cycles: Enable hair for split kernels when using Intel or NVidia drivers
Apart from simply enabling this features needed changes to the code were done.
Technical change, replacing SD access from "simple" structure to SOA.
2015-05-14 18:48:56 +05:00
e7f2aec81b BGE: Add 'Lock Translation' for dynamic objects
The XYZ translation lock was missing for dynamic object.

Reviewed By: panzergame
2015-05-14 15:23:42 +02:00
1ccc417477 Invert value calculation for percentages it makes more sense that way 2015-05-14 14:22:57 +02:00
7aa74dfe5e Radial operator:
Percentage properties use interaction like factors with number feedback
and easier way to go predict lower percentages.
2015-05-14 14:01:33 +02:00
057a8c6250 Add clear seams to uv editor 2015-05-14 12:48:47 +02:00
8bf9e1412f BGE: Fix: Double jumps are not working with character motion actuator
The actual character motion actuator triggers every frame the jump method.
Adding an edge detection to trigger the jump method.

Reviewers: lordloki, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1220
2015-05-14 09:45:51 +02:00
687f6a9752 BGE: Code Cleanup: LOD hysteresis calculation
* Cleanup duplicated code.
* Remove unnecessary "this->"

Reviewers: kupoman, lordloki

Reviewed By: kupoman, lordloki

Differential Revision: https://developer.blender.org/D1293
2015-05-14 09:40:03 +02:00
434086dc53 install_deps.sh: correct typo 2015-05-14 13:13:13 +10:00
9207c8d669 Fix project paint worldspace coord calc from seam
Surprising this worked at all, would show errors with non-flat-quads.
2015-05-14 13:06:19 +10:00
0e80eb82e0 Cycles: Resize light_data after possible light removal. 2015-05-14 01:13:40 +02:00
67eb2c7897 Cycles: Remove Emission shaders from the graph if color or strength is 0. 2015-05-14 01:13:40 +02:00
b8d21735f9 Add normalized edge vectors to InputMesh. 2015-05-13 22:30:35 +02:00
da1038c768 UI: Copy to selected nodes now filtered by type
Was needed because sockets are very generic type which would match on unrelated values.
2015-05-14 06:27:51 +10:00
fc31bae66f Cleanup: Avoid temp variable in portal sampling code. 2015-05-13 19:54:52 +02:00
f0672fb586 Delete GradientFlowSystems, adapt makeOrientationsMesh function and harmonic gradients generation. 2015-05-13 17:36:45 +02:00
93867ae549 Cycles: Cleanup: use generic utility function to set kernel arguments 2015-05-13 19:56:24 +05:00
51a6bc8faa Cycles: Inline sizeof of elements needed for the split kernel
No need to store them in the class, they're unlikely to be changed
and if they do change we're in big trouble anyway.

More appropriate approach would be then to typedef this things in
kernel_types.h, but still use inlined sizeof(),
2015-05-13 19:56:24 +05:00
0a6e32173e Cleanup / Cycles: De-Duplicate Portal data fetch and side check. 2015-05-13 16:05:30 +02:00
730e61b446 Clip editor: Selecting curves in graph view always extends tracks selection
Was actually an old TODO, hopefully solved now in a way so everyone is happy.
2015-05-13 16:11:26 +05:00
0d64e26740 Clip editor: Deselecting with shift-LMB does not work in graph view 2015-05-13 15:55:32 +05:00
38eab96f9b Fix T44683: Unable to mute movie clip when using stabilized display 2015-05-13 14:28:24 +05:00
ae9e38c5ad Fix T44689: New Depsgraph crash
Simple highschool rated issue -- uninitialized variable :)
2015-05-13 14:07:37 +05:00
1a0fb7e9ae Project Paint: enable old bleed UV calculation
Was disabled because other values weren't quite right.
2015-05-13 18:26:56 +10:00
a050d6063c Project Paint: resolve ugly bleed artifacts
Use the bilinear reverse to find the pixel to bleed from.
Was using pixel space which didn't work well.
2015-05-13 18:04:46 +10:00
3e782756e3 Project Paint: simplify uv bleed factor calc 2015-05-13 17:48:54 +10:00
7969b238db Fix T39775: Skin modifier crash 2015-05-13 16:08:19 +10:00
7742a8f09c Cleanup: reduce scope for win32, Linux vars 2015-05-13 16:08:19 +10:00
Dalai Felinto
c78df8f9ee Duplicate Render->RenderData.views for thread safety (as we do for layers)
This fixes nothing at the moment, but better safe than sorry since there
are still a few strange multiview issues around.
2015-05-13 01:03:19 -03:00
abb80abf8a UI: check visible layers when reading context
This resolves a problem where selected items edited for multi-value-editig
could include objects not in any visible views (unlocked layers, local view... etc).
2015-05-13 11:00:23 +10:00
08bbea9362 UI: multi-value-edit, distable alt+lmb on sliders 2015-05-13 10:32:30 +10:00
898b6491ed UI: multi-value-edit, tint button while editing
Currently re-uses node-flag (which is only used to tint color too)
2015-05-13 10:01:13 +10:00
91ec8d8d1e UI: multi-value-editing, copy value when typed in 2015-05-13 09:50:08 +10:00
bbadc3aecd UI: nodes support for multi-value-editing 2015-05-13 09:48:41 +10:00
Dalai Felinto
274b0838c7 Multi-View: return correct number of views when rendering only one of the stereo pairs
Without this fix ViewerNode would continously trash the views/buffer
when disabling either stereo eye.
2015-05-12 18:46:09 -03:00
b3334d936f Edit last commit, redundant 'data' in RNA path 2015-05-13 07:40:21 +10:00
ee3dde2d49 UI: ObData support for copy-to-selected
Now multi-object editing works for obdata too.
2015-05-13 07:25:04 +10:00
Dalai Felinto
3e519860e5 Fix T44684 Compositor backdrop isn't updating correctly 2015-05-12 18:20:05 -03:00
e4cd4c383f Cleanup: style 2015-05-13 06:10:49 +10:00
3160740421 Fix T40762: Python can't access macro values 2015-05-13 05:26:29 +10:00
b01dd748b6 Dyntopo PBVH build optimization:
Optimize the full rebuild case for now (though same code can be adapted to
partial redraws)

Main changes here:

* Calculate bounding centroid for faces only once (instead of every intermediate node)
* Faces do not get added to GSets immediately, instead we track a face
array which has faces that belong in a node in consecutive order.
Nodes just keep accounting of start and length in the array.
* Due to faces not being added to GSets, we can skip doing cleanup of GSets
and readdition for each intermediate node and instead only
add the faces to the final leafs node GSets when those nodes are created.

Results:
For a 1.9 million face test model, PBVH generation time (roughly measured by undoing) is
dropped from 6 seconds to about 4 seconds. Still too high, but still a nice improvement.

TODO:
Thread some parts. Unfortunately threading the GSet assignment part might not help much since
we'd need a lot of locking to avoid collisions with node assignments, especially for unique vertices.
2015-05-12 21:03:16 +02:00
f097453006 Fix missing define in blenloader
It caused blender versions compiled with scons not having proper
build date/hash stored in the .blend file.
2015-05-12 19:53:31 +05:00
Dalai Felinto
15016e1497 small cleanup on render_result_new()
(making the duplicate code more like the original one)
2015-05-12 11:38:24 -03:00
f0f481031c Fix T44616: Cycles crashes loading 42k by 21k textures
Simple integer overflow issue.

TODO(sergey): Check on CPU cubic sampling, it might also need size_t.
2015-05-12 18:48:55 +05:00
7c2905b8ec Fix T44398: Compositing displace node makes image fuzzy with zero displacement
EWA filtering with zero derivatives is introducing some fuzzyness into the
image. Currently solved by using regular sampling for cases when derivatives
are zero, which should also make compo faster in that areas.

Still need to look into checking if EWA filter can be tweaked in a way so
no fuzzyness is introduced.
2015-05-12 17:24:07 +05:00
8697c19e91 Depsgraph: Don't use C++11 function binding with MSVC
It has some weird incompatibility with the way how Boost and GCC C++11
function bindings works, resulting in compilation errors.
2015-05-12 16:41:23 +05:00
909d3228b1 BGE : Fix Bullet shape margin for triangle mesh static objects 2015-05-12 13:38:46 +02:00
615a7aea55 Depsgraph: Attempt to fix alignment issue on 32bit platforms 2015-05-12 16:36:34 +05:00
29529d2ac3 ImBuf: Update stubs so strict compiler is happy about unused arguments
Also use C++-style unused arguments tagging instead of legacy c-style.
It's less annoying this way because does not require adding argument to
two places of the function.
2015-05-12 16:25:39 +05:00
bac7353801 Depsgraph: New dependency graph integration commit
This commit integrates the work done so far on the new dependency graph system,
where goal was to replace legacy depsgraph with the new one, supporting loads of
neat features like:

- More granular dependency relation nature, which solves issues with fake cycles
  in the dependencies.

- Move towards all-animatable, by better integration of drivers into the system.

- Lay down some basis for upcoming copy-on-write, overrides and so on.

The new system is living side-by-side with the previous one and disabled by
default, so nothing will become suddenly broken. The way to enable new depsgraph
is to pass `--new-depsgraph` command line argument.

It's a bit early to consider the system production-ready, there are some TODOs
and issues were discovered during the merge period, they'll be addressed ASAP.
But it's important to merge, because it's the only way to attract artists to
really start testing this system.

There are number of assorted documents related on the design of the new system:

* http://wiki.blender.org/index.php/User:Aligorith/GSoC2013_Depsgraph#Design_Documents
* http://wiki.blender.org/index.php/User:Nazg-gul/DependencyGraph

There are also some user-related information online:

* http://code.blender.org/2015/02/blender-dependency-graph-branch-for-users/
* http://code.blender.org/2015/03/more-dependency-graph-tricks/

Kudos to everyone who was involved into the project:

- Joshua "Aligorith" Leung -- design specification, initial code
- Lukas "lukas_t" Toenne -- integrating code into blender, with further fixes
- Sergey "Sergey" "Sharybin" -- some mocking around, trying to wrap up the
  project and so
- Bassam "slikdigit" Kurdali -- stressing the new system, reporting all the
  issues and recording/writing documentation.
- Everyone else who i forgot to mention here :)
2015-05-12 16:06:37 +05:00
a09341469e Depsgraph: Add evaluation callbacks for granular nodes update
This commit only adds callbacks which then later be used with major dependency
graph commit, keeping the upcoming commit more clean to follow.

Should be no functional changes so far still.
2015-05-12 16:06:37 +05:00
051688b34c Depsgraph: Make ob_get_parent_matrix() more public and reusable
Currently still only used from object.c, but in the next commit it'll be also
used from granular object update callbacks.
2015-05-12 16:06:36 +05:00
08d87514d3 Depsgraph: Add utility function to check whether modifier depends on time
Currently unused, based on the code from old depsgraph.c. The purpose is to
re-sue the code over old and new depsgraph in an easy way.
2015-05-12 16:06:36 +05:00
31f0c27ae7 Depsgraph: Add additional relations/id update tags
This calls are not strictly speaking needed for the old dependency graph, but
due to more granular nature of upcoming depsgraph more actions requires update
of relations of IDs.

On the one hand this extra tags could be wrapped with if() statements, but on
the other hand it makes sense to keep tag in sync so it's clear if some issue
is caused by missing/extra tag or by depsgraph itself.
2015-05-12 16:06:36 +05:00
87fd166654 Depsgraph: Add utility function to tag pose for recalc
Currently this function only tags pose itself, totally matching previous
behavior. But this will be needed in the future once new dependency graph
is landed, because of it's granular nature which relies on the fact that
pose channels are all up to date when building the graph.

Should be no functional changes so far.
2015-05-12 16:06:36 +05:00
dbbe721c2a Depsgraph: Move update-related functions into own files
Currently it is just moving existing functions into a new file,
but in the future those new files will be grown much more due
to upcoming more granular scene updates.

Should be no functional changes.
2015-05-12 16:06:36 +05:00
ae00e42bc2 Fix T44677: Normal Edit Modifier Radial Mode broken with target object.
Very stupid mistake, odd nobody hit this earlier... :/
2015-05-12 10:57:39 +02:00
20e561dd6a PyAPI: Remove release method, just use delitem 2015-05-12 18:43:30 +10:00
f6dc0e918b Minor tweaks to preview templates 2015-05-12 18:29:06 +10:00
34c78a659b Doc: add bpy.utils.previews
Updated sphinx_doc_gen.py to better handle pure py-classes.
2015-05-12 18:24:32 +10:00
f727df6076 Doc: correct rst syntax
also remove some API docs from example
2015-05-12 18:23:29 +10:00
311f6cac92 Doc: replace addons -> scripts in docstring
Theres nothing add-on specific here.
2015-05-12 18:23:29 +10:00
8a231185aa Doc: minor fixes
- check for class/static methods assumed nonzero args.
- subclass references and set-flag items are now sorted.
- use 'order' for Py operator mix-ins,
  so operator settings don't show in random order.
2015-05-12 18:23:24 +10:00
8478c71a7b BGE: Adding material IPO support to GLSL materials
Most of this patch was created by Daniel Stokes, I'm mostly just cleaning
it up and testing it. Still todo: hardness. I need to figure out how to
handle the integer -> float conversion on a dynamic uniform.

Reviewers: psy-fi, brecht

Reviewed By: psy-fi

Subscribers: psy-fi

Differential Revision: https://developer.blender.org/D511
2015-05-11 23:05:04 -07:00
ce504cffad Freestyle: Fix for assertion failure in viewport preview.
An assertion to check if `re->clipsta` < 0 (added as part of addressing
T36009 in rBrB795034c17d76bef2a15e576ac9c70ae2268a823b) was failing when
Freestyle viewport preview rendering takes place in the camera view with
an orthographic camera (in this case, the user-defined clipping range is
used without changes, so that `re->clipsta` is positive).  The
`re->clipsta` property has a negative value only when the 3D viewport is
in an orthographic view but not in the camera view.  It seems that this
viewport setting cannot be identified from rendering settings accessible
from Freestyle.  Now a negative `re->clipsta` value is directly checked
instead, without relying on other render flags.
2015-05-12 02:18:24 +09:00
c7bccb30bf Cycles: check for F16C support with __cpuid, as we do for BMI and BMI2 2015-05-11 15:49:36 +00:00
1bf685488c Collada Exporter: sanitize a bit lnor export.
In case `BKE_mesh_calc_normals_split()` would fail, exporter would read
uninitialized random mem... Should not happen, but better be safe than sorry.
2015-05-11 17:22:18 +02:00
2c4736e6db Clearing preview image shall also unset 'user edited' flag! 2015-05-11 17:12:31 +02:00
4fc3188112 Cycles: Get rid of one more OpenGL matrix manipulation/push/pop. 2015-05-11 16:41:18 +02:00
d30f664c04 Expose PreviewImage & custom icons to py API.
This commit mainly:

* Exposes PreviewImage struct in RNA, including ways for user to set images data.
* Adds a new kind of PreviewImage, using a file path and IMB_thumb to get image.
* Adds a new kind of custom icon using PreviewImage, unrelated to ID previews system.
* Adds a python API (utils.previews) to allow python scripts to access those custom previews/icons.

Note that loading image from files' thumbnails is done when needed (deferred loading), not
when defining the custom preview/icon.

WARNING: for release addons who would want to use this, please keep it to a strict minimum, really needed level.
We do not want our UI to explode under hundreds of different flashy icons!

For more info, see also the release notes of Blender 2.75 (http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.75/Addons)
and the example/templates featured with Blender.

Patch by Campbell (ideasman42), Inês (brita) and Bastien (mont29).

Differential Revision: https://developer.blender.org/D1255
2015-05-11 16:37:15 +02:00
e38f914421 Cycles: use vertex buffers when possible to draw tiles on the screen.
Not terribly necessary in this case, since we are just drawing a quad,
but makes blender overall more GL 3.x core ready.
2015-05-11 16:28:41 +02:00
cc1883468d Keep valgrind happy by using tight vec3 packing instead of lax vec4 with
an unused coordinate missing.
2015-05-11 14:14:06 +02:00
5588a51c9c Cycles OpenGL: Don't use full matrix transform when we can just use
simple addition.
2015-05-11 13:10:19 +02:00
dfbb876d46 UI: initial support for UI editing selected items
Add basic support (holding Alt) to edit all selected objects/bones/sequences.
2015-05-11 15:32:43 +10:00
097862cb26 GHash: avoid redundant casts 2015-05-11 12:39:39 +10:00
18cf235893 GHash: use const keys when only used for lookups 2015-05-11 12:39:08 +10:00
3141870c96 Outliner: postpone rebuilding the tree
On existing Blender could rebuild tree many times (on freeing each ID).
Use a flag instead of immediately rebuilding.
2015-05-11 11:09:21 +10:00
f4bae1f6d6 Outliner: cleanup flag was never cleared
Was running cleanup on every draw.
2015-05-11 10:58:53 +10:00
9e2e85a367 GHash: Add BLI_ghash_ensure_p_ex to copy the key
Needed in cases where the memory from each key is owned by the GHash.
2015-05-11 09:27:05 +10:00
98c8559db2 Add vert by vert map back. 2015-05-10 21:44:30 +02:00
fa40110732 Add vertex normals for InputMesh. 2015-05-10 21:39:26 +02:00
d55868c3b2 Cycles: And yet another compilation fix after half-float commit for clang.
Suggested by Brecht, tested with gcc > 4.4 and Clang
2015-05-10 19:32:32 +00:00
3ec168465d Cycles: fix compilation on 32-bit Windows for half-floats
Reported by IRC user HG1.
2015-05-10 19:06:43 +00:00
c20c07f27a Fix T44633: image cache broken for movies and sequences.
After multiview, it was continuously unloading/loading image buffers from
the cache due to mismatch in cache insert and lookup keys.
2015-05-10 20:51:18 +02:00
8db2a9a352 Cycles: Add -mf16c for previous commit for Scons
Thanks to Dingto for noticing!
2015-05-10 17:51:04 +00:00
4d8f7eddda BGE : Fix crash during physics mesh update.
Currently we can't update the physics mesh of an added rigid body.
The cause is that that we need to update all shapes to say that the mesh was changed, for static object we don't do that previously because we use a odd way to reallocate memory at the same place.
So now when a mesh is changed we iterate all physics controllers which use the same shape info and recreate its shape with the correct mesh.

example file : {F168100}

Reviewers: scorpion81, sergof, hg1, sybren, moguri, agoose77

Reviewed By: moguri, agoose77

Subscribers: sybren

Differential Revision: https://developer.blender.org/D1269
2015-05-10 19:21:21 +02:00
2ec221aa28 Cycles: Use native float->half conversion instructions for Haswell CPUs.
This makes OCIO viewport color correction a little bit faster (about -0.5s for 100 samples)
Also set max half float value to 65504.0 to conform with IEEE 754.
2015-05-10 16:35:51 +00:00
3a2c0ccdd0 Cycles: Correction to opencl whitelist check
Was using platform as a device id accidentally.
2015-05-10 20:02:06 +05:00
1c02a201ba BGE: Cleanup constraints documentation
* Fixing Python example. Behavior has changed with Blender 2.74
* Adding missing return type
* Fixing typo simbolic
* Fixing note for upper/lower limit
* Adding link to constraints constants
2015-05-10 15:58:17 +02:00
a47ade34c2 Cycles: Fix tiny greying out inconsistency for Volume settings. 2015-05-10 12:59:18 +02:00
e8be170e79 Cycles: Do not show Branched Path integrator for OpenCL.
Branched Path is not supported, neither in the Split nor Megakernel.
2015-05-10 12:59:18 +02:00
0525db39d1 fix T44648: Collada finding bone chains during import crashes when no bones are there 2015-05-10 11:04:37 +02:00
1fb97ffeed Fix T44644 Missing thread-protection (spinlock) of image in new multiview code.
Many thanks to Sergey, for practically giving the solution!

Note that it may also fix T44345, depends whether there are other missing
protections/locks or not...
2015-05-10 09:18:52 +02:00
45d9df853e UI: consistent naming for operator props 2015-05-10 15:23:41 +10:00
d6b57436ef UI: move sharp/smooth out of vertex menu
Was confusing to have shade smooth/soft in both edge & vertex menu named differently.

This is an edge-flag, so keep in the edge-menu, use vertex option when in vertex mode.
2015-05-10 15:06:44 +10:00
dc95ca92ca BGE: Fix T43822 Videotexture does not use sky color for off-screen
rendering

Make scene background color as default for render-to-texture instead of
current blue color (0, 0, 255).

It is very useful for mirrors setups.

Reviewers: moguri, ben2610, sybren, panzergame, hg1

Reviewed By: panzergame, hg1, moguri

Subscribers: mpan3

Differential Revision: https://developer.blender.org/D1287
2015-05-10 00:56:51 +02:00
583fd3af65 Cycles: Fix typo in global space version of normal transform
It was using direction transform, which is obviously wrong.
2015-05-10 00:53:32 +05:00
136d7a4f62 Cycles: Only whitelist AMD GPU devices in the OpenCL section
Only those ones are priority for now, all the rest are still testable
if CYCLES_OPENCL_TEST or CYCLES_OPENCL_SPLIT_KERNEL_TEST environment
variables are set.
2015-05-09 23:40:26 +05:00
8647c7d501 Fix T38335: incorrect triangle index in raycast with more than 2 quads
eb81153896 broke the fix for T38335, and this fix was incomplete, now we iterate by triangles and polys in the same while block.
2015-05-09 19:12:22 +02:00
2840a5de8f Cycles: Workaround for AMD compiler crashing building the split kernel
It's a but in compiler but it's nice to have working kernel for until
that bug is fixed.
2015-05-09 19:56:38 +05:00
7f4479da42 Cycles: OpenCL kernel split
This commit contains all the work related on the AMD megakernel split work
which was mainly done by Varun Sundar, George Kyriazis and Lenny Wang, plus
some help from Sergey Sharybin, Martijn Berger, Thomas Dinges and likely
someone else which we're forgetting to mention.

Currently only AMD cards are enabled for the new split kernel, but it is
possible to force split opencl kernel to be used by setting the following
environment variable: CYCLES_OPENCL_SPLIT_KERNEL_TEST=1.

Not all the features are supported yet, and that being said no motion blur,
camera blur, SSS and volumetrics for now. Also transparent shadows are
disabled on AMD device because of some compiler bug.

This kernel is also only implements regular path tracing and supporting
branched one will take a bit. Branched path tracing is exposed to the
interface still, which is a bit misleading and will be hidden there soon.

More feature will be enabled once they're ported to the split kernel and
tested.

Neither regular CPU nor CUDA has any difference, they're generating the
same exact code, which means no regressions/improvements there.

Based on the research paper:

  https://research.nvidia.com/sites/default/files/publications/laine2013hpg_paper.pdf

Here's the documentation:

  https://docs.google.com/document/d/1LuXW-CV-sVJkQaEGZlMJ86jZ8FmoPfecaMdR-oiWbUY/edit

Design discussion of the patch:

  https://developer.blender.org/T44197

Differential Revision: https://developer.blender.org/D1200
2015-05-09 19:52:40 +05:00
f680c1b54a Cycles: Communicate number of closures and nodes feature set to the device
This way device can actually make a decision of how it can optimize the kernel
in order to make it most efficient.
2015-05-09 19:28:00 +05:00
6fc1669679 Cycles: Initial work towards selective nodes support compilation
The goal is to be able to compile kernel with nodes which are actually needed
to render current scene, hence improving performance of the kernel,

The idea is:

- Have few node groups, starting with a group which contains nodes are used
  really often, and then couple of groups which will be extension of this one.

- Have feature-based nodes disabling, so it's possible to disable nodes related
  to features which are not used with the currently used nodes group.

This commit only lays down needed routines for this approach, actual split will
happen later after gathering statistics from bunch of production scenes.
2015-05-09 19:22:16 +05:00
17c95d0a96 Cycles: Add utility function to count maximum number of closures used by session
This will be used by split kernel in order to compile most optimal kernel.

Maximum number of closures is actually being cached in the session, so viewport
rendering will not trigger kernel re-loading when number of closures goes down.
2015-05-09 19:17:49 +05:00
5068f7dc01 Cycles: Add utility function to graph to query number of closures used in it
Currently unused but will be needed soon for the split kernel work.
2015-05-09 19:13:32 +05:00
b3299bace0 Cycles: Pass requested tile size to the device via device task
This is currently unused but crucial for things like calculating amount of
device memory required to deal with the tasks.

Maybe not really best place to store it, but consider it good enough for now.
2015-05-09 19:09:07 +05:00
0e4ddaadd4 Cycles: Change the way how we pass requested capabilities to the device
Previously we only had experimental flag passed to device's load_kernel() which
was all fine. But since we're gonna to have some extra parameters passed there
it makes sense to wrap them into a single struct, which will make it easier to
pass stuff around.
2015-05-09 19:05:49 +05:00
d69c80f717 Cycles: Presumably correct workaround for addrspace in camera motion blur 2015-05-09 19:04:19 +05:00
c9133778cf Cycles: Add CPU compat headers to some of the OSL implementation files
This header was already included into some of the implementation files already,
and this change is needed for some upcoming changes in the way how kernel_types.h
works.
2015-05-09 19:04:16 +05:00
7eac672e4f Cycles: Set default closure values to some of the nodes
Previously it was only set at compilation time which is all fine but does
not let us to check which closure the node corresponds to prior to the
compilation.
2015-05-09 19:04:09 +05:00
20268778a3 Add default values definitions, fix QRM_quadremesh.h header. 2015-05-09 09:26:52 +02:00
8c1b805f87 Freestyle: Partial fix for a crash with Save Buffers option enabled.
Prevents null pointer references in the case of the Save Buffers option
enabled.  This is a regression likely due to rBd5f1b9c22233.
2015-05-09 13:20:40 +09:00
eb81153896 Cleanup: warning (sequence-point) 2015-05-09 11:00:50 +10:00
d28e119403 Change fill_vn_i to copy_vn_i. 2015-05-09 00:17:38 +02:00
d5921873a8 Merge remote-tracking branch 'origin/master' into soc-2014-remesh 2015-05-08 22:33:37 +02:00
Julian Eisel
54ac84f2b8 Fix 3D View Properties scrollbar being not set to top in startup.blend 2015-05-08 22:20:18 +02:00
a643034177 Add method for displaying quad orientation directions. 2015-05-08 21:23:01 +02:00
a2e5530d77 Add new method of cleaning up mesh after generation. 2015-05-08 21:22:30 +02:00
8e5e5c8f23 Change name of angle_signed_on_axis_normalized_fast_v3v3v3 to conform to the standard. 2015-05-08 21:21:26 +02:00
6ee0327594 Fix T38335: incorrect triangle index in raycast result
Previously we forgot to do a special operation for indexes to convert a quad to two triangles.
2015-05-08 21:12:36 +02:00
a08d90f070 matcaps browser: changing emboss style and grid direction according to T44613 2015-05-08 19:22:41 +01:00
b65c77e664 Add Intel's 3000 driver to exceptions for df/dy calculations. Should fix
another case of SSAO effect reversal.
2015-05-08 19:25:51 +02:00
2e6634e4a8 BGE: Cleanup function UpdateMesh and SetMesh in CcdPhysicsController.cpp
"if (value == true)" -> "if(value)"
"if (ptr == NULL)" -> "if (!ptr)"
"vector<bool>" -> "std::vector<bool>"
And other blender typo.
2015-05-08 18:17:37 +02:00
4c79608b3b Revert "Motionpaths: Use scene range option, takes start/end frame and
preview"

Looks like this does not work for animators here after all, will use a
different code for this (probably not hardcoded)

This reverts commit 3bbb4020e7.
2015-05-08 17:16:59 +02:00
2143d4d0d6 Add angle function to math_vector.c. 2015-05-08 13:40:58 +02:00
99e83dba47 Reset runtime cache_system to NULL on file load. 2015-05-08 13:40:28 +02:00
852dce4d58 Changes to UI.
Add optional auto_update feature.
Add 3 stages of "dirtyness":
 - input, for when input mesh changes
 - field, for when we want to recompute the ufield(separated from input, because it is really a separate step)
 - remesh, to remesh when the field didn't change (eg. change rng seed, line spacing)
Auto update - dirty the input on each applyModifier invocation.
Remove unused callbacks (computeflow/remesh)_get.
2015-05-08 13:40:00 +02:00
434f59ca61 Move all quadremesh code to a separate project.
It was all getting very big, and may even get much bigger eventually.
2015-05-08 13:35:02 +02:00
3bbb4020e7 Motionpaths: Use scene range option, takes start/end frame and preview
settings into account.
2015-05-08 12:35:52 +02:00
900fc43bb4 Cleanup: Remove unused ray type flags.
They were added for completeness, but it seems we don't need them.
2015-05-08 12:10:26 +02:00
945e302409 Cleanup: #define -> enum, and get rid of useless braces in case's. 2015-05-08 10:44:18 +02:00
9190d18b74 Fix T44634: Slide edge not responding to ALT + WHEEL to change reference edge in "even mode".
Modal events (TFM_MODAL_EDGESLIDE_UP/_DOWN) were eaten by NOP generic transform event handling...
2015-05-08 10:29:59 +02:00
a8da11c014 Add missing TEXTEDIT_UPDATE option 2015-05-08 08:58:29 +10:00
a077be3658 Cleanup: use r_* prefix for return args 2015-05-08 07:25:39 +10:00
e010960431 DNA; document how to ignore a struct 2015-05-08 06:54:13 +10:00
0a82c3cfef Minor cleanup 2015-05-07 18:32:35 +02:00
a5dead2e8c Fix T44604 bad quality of rake with bezier curves.
We can calculate tangents analytically for bezier curves, so just make
them awesome. New code uses forward differencing calculation for
efficiency just like curve calculation.

Picture before/after:

http://www.pasteall.org/pic/87843
2015-05-07 18:10:48 +02:00
a2eb94b470 Fix T44631: Custom Normal Data Transfer crash.
Own stupid mistake in rBcdabf7e3...
2015-05-07 15:32:37 +02:00
aa3fc89257 Fix T44611: 'make_links_data' modifiers would fail and crash with multires modifier.
Since it was not ensuring dest has valid mdisp data matching new multires modifier subdiv level...

Also, fixed a bug in `multires_subdivide()`, which would crash when trying to
increase from level 0 (aka no subdiv) to > 1 (wrong check, trying to interpolate
when it should not). And added a few sanity checks.
2015-05-07 15:19:32 +02:00
15fd37fab2 Rake: store last position from mouse, don't store halfpoint between last
and current position.

patch by Bastien
2015-05-07 15:04:11 +02:00
e6a7fdd309 Fix T44627, black spots with lock alpha in projection paint:
Painting would revert alpha even on unpainted pixels, where values would
contain garbage.
2015-05-07 14:49:40 +02:00
e39ec27bba Fix crash when rendering opengl from sequencer. 2015-05-07 14:09:30 +02:00
e3b0d5e99b EdgeSlide: support for un-clamped sliding
Functionality matches vertex slide.
2015-05-07 21:31:24 +10:00
94b9b259e7 Cleanup: remove unneeded context arg 2015-05-07 21:31:24 +10:00
2ec808a4bc EdgeSlide: use pairs for TransDataEdgeSlideVert
no functional changes
2015-05-07 21:31:24 +10:00
cb7fdf45cd EdgeSlide: fix divide by zero 2015-05-07 21:31:24 +10:00
9ca2b76a9f Cycles: Cleanup, make it more clear what endif closes what ifdef 2015-05-07 15:02:43 +05:00
11cf1ebdd1 Fix first part of T44627, locking alpha should happen in straight space
for float images or we get inconsistent premultiplied values.
2015-05-07 11:42:37 +02:00
0e9b210595 Fix T44630: incorrect mirror modifier merge limit tooltip. 2015-05-07 10:57:37 +02:00
3ec8bcebf3 Fix T27642: Add version in .exe installer properties 2015-05-07 10:31:21 +02:00
165598e49e Correct typo: ifdef'd now, but obviously wrong 2015-05-07 10:12:12 +10:00
2d590670b4 Fix T44614: Maya keymap left mouse click to add cut not working. 2015-05-06 23:59:21 +02:00
236360c838 Change fix for T44530 which caused a "regression".
Looks like the previous commit here is really correct and fixes cases of
distortion that were in mirror-subsurf combination since blender 2.5.

This may cause some changed files in which case we will be adding an
option, but it is expected this will only happen with low res models,
and hand painted textures, and the better distortion here compensates
for that enough to consider not adding a compatibility option yet.

Leaving the facemap winding argument as is just in case we do consider
to add the option.
2015-05-06 23:30:15 +02:00
e73f1035d7 Fix T44598: blender internal not giving same result on repeated texture bakes. 2015-05-06 23:06:47 +02:00
fb0dd596e9 BGE : KX_VertexProxy support for more than 2 UV channel.
I have added an optional named "index" argument for methode get/setUV, I have also modified the and set to deprecated methodes setUV2 and getUV2 : the doc was wrong and the methode can't be called anyway because it declared as VARARG in the .h and convert directly the args value to a vector in the .cpp.

Reviewers: sybren, lordloki, hg1

Reviewed By: lordloki, hg1

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D1240
2015-05-06 22:55:46 +02:00
de180aba35 Feature request: Dyntopo detail expressed in percentage of brush radius.
Not sure how useful this will be but people have requested it so, here
it is...
2015-05-06 22:51:49 +02:00
7c3a714124 Fix T44624: world menu appears in node editor header with Blender internal. 2015-05-06 21:55:35 +02:00
4a5933bb74 Rip tool, support filling-edges with fill enabled 2015-05-07 05:34:07 +10:00
4d7b0e4fe3 Correct own error: is_manifold_region on wire vert 2015-05-07 05:23:07 +10:00
c740027e30 Fix T44381: Text Editor: Un-indent undo fails
D1284 by @mikidep
2015-05-07 05:04:05 +10:00
4487358da7 Fix T44618: Rip Fill on a single vert would only generate one of the two expected faces.
Was tagging (for filling) the wrong edge for one of the two involved loops...
2015-05-06 17:51:39 +02:00
51f33a2e55 collada:custom normals generated by normals modifier have not been exported correctly. Also triangulating during export did not work. 2015-05-06 17:03:38 +02:00
14d55ab7a3 Cleanup: use ntreeFromID 2015-05-07 00:18:11 +10:00
1d88bfce40 Shader node: support native render capabilities
D1188 by @a.romanov
2015-05-06 23:53:51 +10:00
5ffd10a6da OpenGL render: Update metadata as before, for every frame written to a
file, since we need the updated times and frames.

This was lost during stamp code refactoring. The refactoring moved the
stamp when render is initialized so we would be guaranteed to have
correct cameras even when saving render stills at a later time (and even
if cameras were changed). For regular render this would work since
render init takes care of stamp, but for openGL rendering we need to do
this manually.

Still not 100% correct, does not apply multiview cameras to metadata
2015-05-06 15:30:00 +02:00
aaa6b39bfe Quick patch-up for opengl render metadata.
Camera here is incorrect for multiview (as is in real multiview render)
but at least it works now.
2015-05-06 14:47:01 +02:00
15751238d5 BGE: Fix compound child shape added on instance game object 2015-05-06 14:23:22 +02:00
df422314c1 Only use render view name in render filenames if we are actually using
multiview.
2015-05-06 13:58:06 +02:00
d80ff8ce80 Image proxies now correctly support metadata (needs to regenerate
proxies though)
2015-05-06 13:05:59 +02:00
27c3886064 Cleanup: use functions we already use elsewhere for bone detection
instead of the ninja code that we use now.
2015-05-06 12:53:33 +02:00
Martijn Berger
3f04f64eea [cmake] move FindLLVM to its own file 2015-05-06 12:35:48 +02:00
69bf3a9e94 Updating node standard value won't work if node is hidden, patch by
Alexander Romanov with minor changes.
2015-05-06 11:59:39 +02:00
0abb6f3ef0 Patch D1283 by Alexander Romanov fixes reroute node type update not
correct when root reroute node is plugged in a different type of input
2015-05-06 11:46:47 +02:00
bc2f77e1da Add bpy.app.binary_path_python
Access to the python binary distributed with Blender,
fallback to system python executable (matching Blender's version).
2015-05-06 11:13:42 +10:00
c246e0c3b6 Prefer name 'program' over 'binary'
binary-search is confusing!
2015-05-06 06:34:19 +10:00
e00142bfa7 BLI_path: add PATH search utility functions 2015-05-06 06:21:16 +10:00
c641a5563f Fix T44612: add support for mouse button 6 and 7 on OS X. 2015-05-05 21:52:09 +02:00
1d0f1a1ec9 Fix T44593: particle volume distribution not working with large meshes. 2015-05-05 21:43:24 +02:00
b45ad4b214 Cycles: Fix for wrong clamp usage in fast math 2015-05-06 00:01:40 +05:00
4616a7a4d3 BGE: Fix collision callbacks for compound controllers
It fix some mistakes in b5e9653035 and made a more safety behavior for collision callbacks used in compound controllers during adding and removing.
2015-05-05 19:54:12 +02:00
962d53e144 Workaround ld.gold failing with msgfmt 2015-05-06 03:23:20 +10:00
35c67d6750 Fix reading uninitialized memory finding paths 2015-05-06 02:22:00 +10:00
b5e9653035 BGE: Remove function DisableCcdPhysicsController and EnableCcdPhysicsController in CcdPhysicsEnvironment
Replace EnableCcdPhysicsController by AddCcdPhysicsController and DisableCcdPhysicsController by RemoveCcdPhysicsController.
Tested with compound shapes and collision sensors.

Reviewers:agoose77, ideasman42
2015-05-05 15:18:29 +02:00
d01b226870 Cleanup: Remove leftover from Distorted Noise node in XML reader. 2015-05-05 10:38:45 +02:00
e5e73ccc90 Math Lib: rename fill_*, to copy_*
matching convention for fixed length api, eg: copy_v3_fl
2015-05-05 17:08:29 +10:00
ea5f9fee8d Cleanup: function arg wrapping 2015-05-05 16:34:38 +10:00
1648feec94 Cleanup: rip tool 2015-05-05 16:34:37 +10:00
7201f6d14c Cycles: Use curve approximation for blackbody instead of lookup table
Now we calculate color in range 800..12000 using an approximation a/x+bx+c for R and G and ((at + b)t + c)t + d) for B.
Max absolute error for RGB for non-lut function is less than 0.0001, which is enough to get the same 8 bit/channel color as for OSL with a noticeable performance difference.
However there is a slight visible difference between previous non-OSL implementation because of lookup table interpolation and offset-by-one mistake.
The previous implementation gave black color outside of soft range (t > 12000), now it gives the same color as for 12000.

Also blackbody node without input connected is being converted to value input at shader compile time.

Reviewers: dingto, sergey

Reviewed By: dingto

Subscribers: nutel, brecht, juicyfruit

Differential Revision: https://developer.blender.org/D1280
2015-05-05 06:11:54 +00:00
22bbd1c512 BMesh: improve rip tool /w mon-manifold verts
Can now rip from multiple fans (mixed single faces or larger regions)

Also add BM_vert_is_manifold_region which only checks if a vert has disconnected fans.
2015-05-05 07:22:35 +10:00
e59bd19fa7 Cleanup: style & const's 2015-05-05 05:19:49 +10:00
7478eb9bd0 Cleanup: wrapped function indentation 2015-05-05 05:19:48 +10:00
cc81b58277 Cleanup: deduplicate code.
FileBrowser had its own 'shorten_string' func, when we have a full fledge one in interface_widget code...
2015-05-04 21:13:35 +02:00
db98586d64 Fix GCC compile warnings/errors. 2015-05-04 20:35:05 +02:00
e10ecb6494 Revert "Different drawing for object centers."
This reverts commit 5a8629c0d7.

It does not really work that well since objects can draw in front of
selection circles now.
2015-05-04 18:00:29 +02:00
1b8069bdd9 UI: location/scale were snapping to 10s
In practice this isn't useful (for scale especially).

For float buttons with a very large range, don't attempt to match the snap to the range.
2015-05-05 01:20:40 +10:00
fd5090ab41 UI: button snap (ctrl) was rounding down 2015-05-05 01:06:09 +10:00
1227e5c3d1 Fix T44503 full sample does not display any preview any more.
The fix exposes another error not fixed in this commit, escaping the
render will not flush the full sample render result correctly.
2015-05-04 16:57:48 +02:00
68fe630735 Fix eyedropper with quad-view 2015-05-04 23:50:38 +10:00
52b9d83417 Fix T44592: Zero scale on an axis, zeros all 2015-05-04 22:39:33 +10:00
9ff91acadb Follow up to previous commit, remove depth of field from UI in
wireframe/boundbox mode.
2015-05-04 14:38:02 +02:00
73c090fe81 Fix T44594 disable depth of field in wireframe/bounding box modes. We
don't supply depth information in those modes so supporting the effects
does not really make sense
2015-05-04 14:34:57 +02:00
c19f3ea1b2 Fixed comment. 2015-05-04 14:31:44 +02:00
66f96e555c Cycles: Fix copy / paste mistake in XML reader. 2015-05-04 14:31:20 +02:00
e560bbe1d5 Fix possible crash with datatransfer operator when source object was hidden.
Mismatch in poll and exec funcs when getting active (source) object...
2015-05-04 14:30:00 +02:00
5a8629c0d7 Different drawing for object centers.
Code here did depth test always and depth range 0.0.

There is no real reason for object centers to write and get tested
against depth buffer in this case, just disable the depth test instead
;)

Helps with blurry object centers in depth of field mode too (centers
wrote depth 0 and were always blurry)
2015-05-04 13:53:23 +02:00
be30070d86 BGE: Cleanup KX_BlenderSceneConverter.cpp
This commit is a little cleanup for whitspaces, braces, spaces around operators and useless keywords struct/class.

Reviewers:sybren
2015-05-04 13:36:11 +02:00
b7d0ff0ad6 Separate scene simplification into viewport and render
This way it is possible to have viewport simplification bumped all the way up,
making viewport really responsive but still have final render to use highest
subdivision possible.

Reviewers: lukastoenne, campbellbarton, dingto

Reviewed By: campbellbarton, dingto

Subscribers: dingto, nutel, eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1273
2015-05-04 16:31:10 +05:00
7e3ee2d15d Skin Modifier: remove redundant edge-calculation 2015-05-04 20:59:34 +10:00
abd68c6e45 Fix T42893: Skin Modifier, changes randomly toggling editmode
Own regression, previously it would do a full mesh normal calculation for each isolated shape
(could hang on meshes with many loose parts).

However the normals are needed, instead of doing a full calculation,
just set normals on new faces.

Thanks to Brecht for finding cause!
2015-05-04 20:56:57 +10:00
8d5eeab473 Skin Modifier: Add missing operator stack pop 2015-05-04 20:56:57 +10:00
93055b1c22 Fix metadata display in sequencer lost after doing a preprocess
transform.

IMB_makeSingleUser makes a copy and destroys metadata. I am not sure if
this is the safest way to make a single user ImBuf (setting the refcount
to 0 is simpler and there's less, but no zero, risk of dangling
pointers) but I will leave this as is for now in case there is an actual
need for a copy here. The alternative approach should be tested at some
point.
2015-05-04 12:53:16 +02:00
046388830a Freestyle: Fix for line style ID datablocks not copied when fully copying a scene. 2015-05-04 19:52:03 +09:00
b07c2961fa Don't scale metadata font with zoom - makes strings not consistently
adhere to the string length
2015-05-04 12:30:26 +02:00
711e2f71a8 Support displaying metadata for images in sequencer preview windows (not
backdrop)
2015-05-04 12:18:19 +02:00
23a79c42b5 BGE Player: Fix compilation error after cleanup commit da8a62a 2015-05-04 14:39:12 +05:00
4e1c27f646 Fix T29029: Grease pencil fails in Quad View 2015-05-04 19:12:54 +10:00
c46f40e9e2 Freestyle: Compilation error fix after recent changes in BKE_object_add() 2015-05-04 13:52:44 +05:00
7a8170e9c1 CMake: Only consider it INFO is ld.gold is missing 2015-05-04 18:33:37 +10:00
4edc9d50fd Correct own error in recent quad-view ruler fix 2015-05-04 18:32:47 +10:00
74dc4e87a6 Fix Buttons context, invalid object data access
Another instance of T44376.
Crash where the Python context would access a stale pointer to the active object.
2015-05-04 18:06:31 +10:00
c9e5e81064 Button Space: clear pin flag when NULL'ing pointer 2015-05-04 16:12:12 +10:00
77e6a001a9 Fix T44376: Buttons context, invalid data access
Removing a scene from the buttons window would crash from a Python operator.
2015-05-04 16:01:20 +10:00
8d5e57748a Cleanup: WM_main_remove_notifier_reference
Assumed the `reference` pointer is an ID, currently true, but may not always be.
Add a callback specifically for this purpose since cleaning up notifiers and space-types are different operations.
2015-05-04 16:01:20 +10:00
da8a62adce Cleanup: naming for callback wrappers 2015-05-04 16:01:20 +10:00
8515be8a73 Remove redundant outliner lookup freeing objects 2015-05-04 16:01:20 +10:00
fdc5f9c0a8 Add name argument to data creation API calls
Was adding then renaming, unnecessarily.
2015-05-04 16:01:20 +10:00
4e7ef3f5cd BGE: Added 'ghost' arg to KX_GameObject.suspendDynamics() method
The implementation of this 'ghost' argument already existed in the C++
source, but wasn't exposed to Python yet.
2015-05-04 12:04:09 +08:00
62b13c6d07 BGE: Fix: Activate collision mask/group in UI. 2015-05-03 19:16:27 +02:00
dbee634572 Fix typos. 2015-05-04 01:53:34 +09:00
ee7538613a Rigidbody: Fix viewport update when changing collision shape in toolbar 2015-05-03 18:01:47 +02:00
d33b564f91 Fix T44591: Set PBone Group operator did not handled predifined group index in its invoke func. 2015-05-03 16:53:43 +02:00
dced56f02a Fix T44185, Fix T44090: hair texture density working unreliable.
"Unexisting" particles must be freed after the unexist flag has been set,
which was no longer the case after 78c491e62a.

Reviewers: brecht

Differential Revision: https://developer.blender.org/D1213
2015-05-03 16:21:58 +02:00
6159f9a55a Fix T41739: 3D view solid draw mode missing some material node updates. 2015-05-03 15:39:25 +02:00
2775eaf01a Fix T41893: inconsistent color management on sculpt texture nodes previews. 2015-05-03 15:25:43 +02:00
944e0bd7b5 Cleanup: rename clear_skin & clear_mask operators to skin_clear and mask_clear.
So that they match all other op names around - and sensible logic as well.
2015-05-03 15:18:27 +02:00
3a808270df Fix T44589: No way to add a skin data layer manualy.
There are several ways to end up with an object with skin modifier, but no
skin data on the geometry. So we need an operator to add it by hands.

Also tweaked a bit UI of this modifier.
2015-05-03 15:09:48 +02:00
472b3c5828 We do need to transform lnors in BKE_mesh_transform(), much handy for scripts. 2015-05-03 11:55:58 +02:00
9715d4c778 Added name attribute to instance_geometry nodes (request for Second Life) 2015-05-02 23:17:40 +02:00
6bc8a3f8d3 BMesh: rip-tool can now split off isolated fans
Useful since there wasn't a good way to do this previously.
2015-05-03 06:17:32 +10:00
dd48ddd605 BMesh: utility to split isolated loop regions 2015-05-03 06:16:59 +10:00
33cc5ed495 Cleanup: redundant vars 2015-05-03 06:16:59 +10:00
4fca12e0fa Fix rna default value in BGE UI. 2015-05-02 21:09:29 +02:00
bd5e578804 BMesh: rework BM_vert_is_manifold (simplify logic)
- simplify boundary handling (walk from boundary - no need to reset walking)
- early exit when the vert has >2 boundaries
- use BM_vert_step_fan_loop to walk the fan
2015-05-03 04:46:24 +10:00
de031b7c89 BMesh: replace radial count with simple checks 2015-05-03 04:41:39 +10:00
c826566ce3 Sound now returns even if file fails to load
With various codecs its hard to ensure a sound will load or not.
2015-05-03 04:41:39 +10:00
8e4ac2d229 Fix ghash assert during BGE libload.
The assert message was caused by the multi call of BLO_library_append_begin in KX_BlenderSceneConverter::LinkBlendFile.
2015-05-02 18:43:39 +02:00
2c72edc7f1 Fix T44586: Viet language problem for Blender Interface
We were missing many of the complex diacritics combinations in latin extended additional code block...

Alawyas a pleasure to edit this font... :|
2015-05-02 17:02:08 +02:00
ca15ffb8ad CMake: use ld.gold linker when available
Gives noticeable speedup linking blender
2015-05-02 22:14:12 +10:00
929c9de3dc Turn bpy.utils into a package, so that we can easily add submodules to it. 2015-05-02 10:38:51 +02:00
53d08ec506 BMesh: BM_mesh_edgesplit
Did quite a few checks not to tag bad splits (which wasn't working perfectly)

Instead rely on BM_vert_separate not to create invalid geometry.
2015-05-02 16:24:46 +10:00
f283b959e7 BMesh: BM_vert_separate double edge fix
Splitting edges could give duplicates.
2015-05-02 16:24:35 +10:00
c276cfb3c0 BMesh: return error on mesh validate 2015-05-02 15:52:27 +10:00
a5869945c6 Cleanup: bmesh src/dst order in API args 2015-05-02 15:46:03 +10:00
5e1c729882 Cleanup: use function attrs for BMesh inline funcs 2015-05-02 15:45:57 +10:00
b50c6e3f6f Object Align Operator: Make it use modifiers in high quality bounding box calculation 2015-05-01 16:17:23 -06:00
bd6e1e6ad7 Updated install_deps' Collada to 3335ac164e68b2512a40914b14c74db260e6ff7d. 2015-05-01 21:18:37 +02:00
23abcc0636 OSX: remove collada from fading out 32bit buildbot 2015-05-01 21:09:21 +02:00
86f80c481c Fix T44353, Fix T43981: random particle distribution overlaps if number is greater than 256. 2015-05-01 19:21:41 +02:00
b6caefdaa9 Fix T43711: dual quaternion deform bug with shearing in deform matrix.
This also increases the tolerances in is_orthogonal / is_orthonormal functions,
which were much too low for practical purposes.
2015-05-01 19:21:41 +02:00
bf7098a93f Auto pack: don't show "No new files have been packed" on every .blend file save. 2015-05-01 19:20:42 +02:00
4e40bdd02c Fix T44433: print "unknown" rather than "1970-01-01" when .blend date is unknown. 2015-05-01 19:18:26 +02:00
d3c4553552 Fix a couple of harmless compiler warnings. 2015-05-01 19:18:26 +02:00
74d31279cd Fix T44560: Merge Collapse tool - UVs operator panel option ignored with Collapse but not with other merge types.
Was missing parameter for collapse bmesh operator...
2015-05-01 17:10:39 +02:00
f84135ee65 Fix T44577: writing tessellated cddata when we should not...
Own mistake in rBf75c89b3f42ffac51603e6e53459f9d94a8782cc...
2015-05-01 16:11:55 +02:00
535e75ea90 Use mono font for metadata 2015-05-01 14:27:44 +02:00
28ea3f5b94 Fix T44565 World background artifacts when world shader is void (or
compilation fails).
2015-05-01 12:06:05 +02:00
94d80c8ca4 Left some debug prints in here... 2015-05-01 12:44:37 +12:00
be0dcd4e34 Fix T43867: Clicking outside the viewport exits now Grease Pencil "Continous Draw" mode
When working with a pen only, it was previously impossible to exit Grease Pencil
draw mode (when continous drawing was enabled). Now, clicking outside the drawing region
(e.g. in the timeline, properties editor, or the header/properties/toolshelf regions)
where you are drawing will exit this mode.

Some corner cases to be aware of:
* When Region Overlap is enabled, clicking on the overlapping panels still exits
  draw mode (even though you can see behind the buttons)
* In the Nodes Editor, clicking on a node (while in drawmode) will still draw a
  dot/stroke. But, you can still exit drawmode by clicking on any of the panels
  (properties/toolshelf/header) mentioned earlier
* To cope with cases where the operator is launched from the toolshelf, the
  code now sets a new "active region" when the first stroke is performed
  (based on what region is under the cursor at the time of that stroke),
  overwriting the setting that got stored when invoking the operator (i.e. the toolshelf).
  This change doesn't have any real user-visible effects, other than making it possible for
  this fix to actually work without breaking that use case.
2015-05-01 12:44:35 +12:00
f8bdd8e6a8 BMesh: correct bmesh_edge_vert_swap
Missed swapping out loops.
2015-05-01 06:51:16 +10:00
6111da3629 BMesh: add bmesh_disk_vert_replace 2015-05-01 06:18:04 +10:00
a822106062 Cleanup: typos 2015-05-01 05:53:33 +10:00
cdabf7e353 Data transfer - Loop Islands Hell Fixes.
This commit fixes several issues:
* island_store->items_to_islands_num was reset each time we added a new island, this is stupid! Harmless too, though, afaikt.
* partial verts bvhtree (with several islands) was hugely over-allocated...
* we would 'leak' in neighbor islands when geometry itself was contiguous.
* best_nor_dot was used incorrectly, leading to smaller weights for better matching normal!

All those fixes are related to T44522 (through personal communications with reporter).
2015-04-30 20:58:34 +02:00
4d6584ba6a UI: use enum for thumbnail size 2015-05-01 01:49:58 +10:00
5ced6cb2bc Correct warning 2015-05-01 01:36:36 +10:00
a91c0b9095 Cleanup, diagnostic messages, changes to deleteDegenerateVerts 2015-04-30 17:25:57 +02:00
3a9726783f RNA defaults test
Alternative to T32894, simple test which creates new data and compares with RNA defaults.

Can be used to keep the values in sync without having to maintain a large set of defines.
2015-05-01 01:15:55 +10:00
Dalai Felinto
078e589263 Better fix for T44556: Crash on the World Properties > Preview 2015-04-30 12:12:22 -03:00
Dalai Felinto
179fff94e8 Revert "Fix T44556: Crash on the World Properties > Preview"
This reverts commit 4bcc7a2ec6.
2015-04-30 12:12:22 -03:00
69ef1a3a83 Py/RNA: support to load and remove sounds 2015-05-01 00:58:08 +10:00
5dd63a977f Fix opengl rendering always looking through camera
Actually check if we have a camera and looking through it before
rendering in multiview.
2015-04-30 15:06:28 +02:00
f271d85b86 Fix T44439: outliner's treestore could keep invalid ID pointers, could crash on undo due to invalid mem access.
We cannot nuke treestore in readfile's `blo_lib_link_screen_restore()`, because this will
destroy all UI-state data (like opened/closed items, etc.).

Since we cannot know for sure whether an ID pointer from tselem->id is valid here, we
have to ensure they are never invalid, i.e. to always set them to NULL when we delete them.

To do so, this commit uses a similar approach as what already exists for ID references
in WM notifiers - it extends `free_notifier_reference_cb()` to also nullify those IDs in
all outliners.

Note that some ID types are not used(shown) by outliner currently, so `TREESTORE_ID_TYPE` macro
was added, that checks whether an ID is possibly used by outliner. Avoids a few searches
in whole tree whene deleting some IDs.

Reviewers: campbellbarton, sergey

Maniphest Tasks: T44439

Differential Revision: https://developer.blender.org/D1272
2015-04-30 14:28:22 +02:00
d1c98520f7 Missed this last commit 2015-04-30 14:24:05 +02:00
2d491b8415 Minor tweaks to make fill and invert support gpixel operations 2015-04-30 13:52:44 +02:00
04b23af02d Code Cleanup: Simplified insert_keyframe_button and delete_keyframe_button
As a followup for the previous commit, do the same thing for the insert/delete
keyframe button operators as is done for the clear keyframes op. There really isn't
much need/reason for conducting the looping there, as those functions natively
handle this themselves already.
2015-04-30 22:59:41 +12:00
7369c4f4d5 Code Cleanup: Simplify Clear Keyframes operator's code
On second thought, the previous commit was just adding additional complexity which
wasn't needed, as the operator was wasting effort by doing this looping itself.
2015-04-30 22:59:40 +12:00
debcd6b217 Fix T44558 - "Clear Keyframes" complains when operating on an array property and it had deleted the action in the process 2015-04-30 22:59:39 +12:00
16794f908f Cycles: Fix possible uninitialized XML read state which might cause crashes 2015-04-30 15:46:09 +05:00
2909975385 Fix T44541 aka gigapixel image render support in blender.
Moral of the story: Make sure that size_t is used whenever pointer
arithmetic is involved. For images, that basically means whenever any
squared dimensions are involved. Casting an operand to size_t early in
the operation is usually sufficient to force the entire operation to
size_t.

There might still be places lurking where we don't support this
correctly. This has been tested with render pipeline, quite a few image
functions (meaning we can paint on such images now, albeit somewhat
slowly ;) ) and export to jpeg. Too many places in code to check so I
guess we'll be handling cases as they come.

Don't try this at home unless you have an immense ammount of RAM.
First GPixel render of suzanne in the multiverse can be found here:

http://download.blender.org/demo/test/suzanne-billion-pixel.jpg

Can be viewed from blender (takes about 3.3 GB after loading but may
take more during loading so 8GB might be more safe to try this).
2015-04-30 12:11:20 +02:00
4bcc7a2ec6 Fix T44556: Crash on the World Properties > Preview
Issue was caused by de-referencing NULL pointer, rres did not have any
views because nothing was rendered yet.

Needs more closer look about where else such a de-reference could happen.
2015-04-30 14:52:59 +05:00
41d817f15d Fix T44548: Cycles Tube Mapping off / not compatible with BI
Was a typo in original implementation, probably a result of some code reshuffle
happened for optimization reasons.
2015-04-30 14:27:16 +05:00
aa4c97faa3 View3D: expose size as a distance in units
also note that size/rotation doesn't work for camera views. see T44511
2015-04-30 18:59:35 +10:00
1721d47106 CMake: Solve compilation error from path with a space 2015-04-30 12:55:52 +05:00
f553aba69f Correct docstring 2015-04-30 09:55:54 +10:00
0ecce09288 Correct missing break 2015-04-30 08:18:32 +10:00
b640700597 Cleanup: style 2015-04-30 08:18:23 +10:00
4eab0e72b3 Cleanup: Update some comments and add ToDo. 2015-04-29 23:56:46 +02:00
b3def11f5b Cycles: Record all possible volume intersections for SSS and camera checks
This replaces sequential ray moving followed with scene intersection with
single BVH traversal, which gives us all possible intersections.

Only implemented for CPU, due to qsort and a bigger memory usage on GPU
which we rather avoid. GPU still uses the regular bvh volume intersection code, while CPU now uses the new code.

This improves render performance for scenes with:
a) Camera inside volume mesh
b) SSS mesh intersecting a volume mesh/domain

In simple volume files (not much geometry) performance is roughly the same
(slightly faster). In files with a lot of geometry, the performance
increase is larger. bmps.blend with a volume shader and camera inside the
mesh, it renders ~10% faster here.

Patch by Sergey and myself.

Differential Revision: https://developer.blender.org/D1264
2015-04-29 23:31:06 +02:00
e9dcb068c7 Fix T44484: Edge-split corrupts mesh
Splitting non-manifold edges could produce duplicate edges.
2015-04-30 07:22:18 +10:00
99811c283e BMesh: use BM_face_loop_separate_multi for rip
Resolves bug over-splitting non-manifold connected edges.
2015-04-30 06:24:33 +10:00
3ef27ec807 BMesh: add BM_face_loop_separate_multi
New utility function to handle splitting off multiple loops from a face at once.
2015-04-30 06:24:33 +10:00
53662bcaf1 BMesh: simplify/optimize loop splitting logic
To split off a single loop, was splitting all fans off the vertex, then merging back together (except for one).

Now simply splits off one loop.
2015-04-30 06:24:33 +10:00
26541b7488 BMesh: refactor edge-vert swapping into API call 2015-04-30 06:24:32 +10:00
67fcb04bbf BMesh: minor change to swap-vert api
- assert if the verts not in the edge (all callers assume success)
- rename to bmesh_disk_vert_swap
- swap src/dst arg order.
2015-04-30 06:24:32 +10:00
7aab5c6ca9 Cycles: Fix wrong termination criteria in SSS volume stack update
Another issue spotted with Thomas.
2015-04-30 01:20:17 +05:00
e5f3193df3 Cycles: Fix wrong order in object flags calculations
Object flags are depending on bounding box which is only available after
mesh synchronization.

This was broken since 7fd4c44 which happened quite close to the release
and oddly enough was not sopped by anyone. Render test is coming for this.

Was spotted by Thomas Dinges while working on another patch.
2015-04-30 01:09:48 +05:00
Dalai Felinto
3856d439db Fix filename has "new render view" suffix reported by Jason van Gumster (Fweeb)
Bug introduced in f8540d7fd5
2015-04-29 16:39:35 -03:00
054aa61f3c File browser - change thumbnails size with a slider
We can now scale from 32px up to 256px (default has been upgraded to 128px).
Thumbnails are now generated as 'large', i.e. 256px.

Previews are scaled up if necessary, unlike icons (for folders or files without preview images).

Note that .blend thumbnails themselves remain in 128px for now (they are embeded in .blend files,
not quite sure we want to make them four times bigger...).

Patch by DMS (Yaron Dames), with final edits by myself.

Reviewers: mont29

Subscribers: Severin, mont29

Differential Revision: https://developer.blender.org/D1260
2015-04-29 21:30:33 +02:00
3de45ee7fe Fix T44132: Crash after open EXR format
Was own mistake on adding Alpha socket for Combined pass.
2015-04-29 23:45:41 +05:00
ce32aae80c OSX: fix T44533, system_bookmarks not showing utf standard ( umlauts etc. ) 2015-04-29 20:07:53 +02:00
3878180a6f Fix typo using interp_v3_v3v3 over float[2] variables...
Found by asan! ;)
2015-04-29 19:44:06 +02:00
5782126d41 Make sure integer calculation uses large precision 2015-04-29 18:49:50 +02:00
d04ba6d562 Remove unused stubs
Noticed by TristanPorteries in IRC.
2015-04-29 21:47:30 +05:00
0dbc9060a6 Cleanup: make grumpy asan happy and do not use new [] to allocate data freed by free().
Probably nothing crucial, but asan build would crash on that stupid glitch... Annoying.
2015-04-29 17:46:03 +02:00
091832c955 fix for double call to update callback in uiTemplateIconView 2015-04-29 16:29:03 +01:00
611bbc696a cleanup for uiTemplateIconView 2015-04-29 16:29:03 +01:00
78956b6a83 Fix T44542: 'extend selection' editmode tool would select hidden elements. 2015-04-29 17:19:20 +02:00
Dalai Felinto
3e6a66b9de Multi-View cleanup: using RenderResult->rect* only for temporary RenderResults
Originally I wanted to get rid of RenderResult->rect* entirely, but it's
convenient to have for temporary structs.

This patch makes sure they are used only when really needed, which
should help clearing the code out.

(they are needed when using RE_AcquireResultImage() - which produces a
RenderResult with no RenderView)

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1270
2015-04-29 11:55:53 -03:00
18ba32df37 Don't check against scene notifier twice 2015-04-29 16:28:20 +02:00
Dalai Felinto
b033736eb7 Multi-View: new util functions RE_RenderViewGetById() and RE_RenderViewGetByName()
Both functions try to find a valid RenderView and if they can't they
fallback to the first RenderView of the RenderResult
2015-04-29 11:18:22 -03:00
3acc1ba49c Add macro BLI_SMALLSTACK_AS_TABLE
Use for edge-split (a little less overhead compare to popping each item).
2015-04-29 23:59:48 +10:00
d6b28bbb1d Cycles: Fix crashes when loading cache created with pre-leaf split builds 2015-04-29 15:48:49 +05:00
2e91bcfb9d Fix T44544: Cached BVH is broken since BVH leaf split
Still need to solve issues with reading old cache with new builds.
2015-04-29 15:38:07 +05:00
734fb30bda Use size_t to calculate size of tiles for rendering 2015-04-29 12:31:03 +02:00
7232157357 Correct comment 2015-04-29 20:16:40 +10:00
620cc762db Buildbot: Attempt to fix cudakernels target screwing up autotest cache 2015-04-29 14:51:50 +05:00
65a9592660 BMesh: optimize edge split
Avoid hashing edges when splitting into fans,
Instead, walk & split fans until they're all done, gives approx 40% speedup.
2015-04-29 19:43:32 +10:00
179ffefce5 BMesh: replace smallhash flag for checking doubles 2015-04-29 19:43:21 +10:00
e1ecd39f0e BMesh: avoid over-counting vert-edges 2015-04-29 19:42:06 +10:00
728d4f296f Cleanup: headers 2015-04-29 19:42:00 +10:00
615414fa36 SCons: Ignore .svn folder when installing site-packages 2015-04-29 14:30:37 +05:00
e37373d96e Revert commit with perspective depth offset, makes simple cases such as
loopcuts on cube have zfighting.
2015-04-29 11:19:23 +02:00
029bd44bbd SCons: Fix wrong flags usage after recent stdc89 changes
CCFLAGS are used for both C and C++ compilers and one is better not to pass
C-related flags to C++ compiler. C-compiler flags are to be passed via CFLAGS
variable.
2015-04-29 13:57:02 +05:00
f4d7f5216f Buildbot: Fix typo in error message 2015-04-29 13:47:47 +05:00
Dalai Felinto
f8540d7fd5 RenderResult should have a valid view whenever possible 2015-04-28 18:08:56 -03:00
f9d23b82fe Rewind fix for T44505 (leave in ifdef'd)
This makes selection fail in simple cases,
default cube subdiv 10x for eg.
2015-04-29 06:08:45 +10:00
f65bec8e45 Disable system caching. 2015-04-28 21:38:22 +02:00
cbb601346a Error in last commit 2015-04-29 05:36:39 +10:00
ed4d4c7cde Make feature edges at edges with inly one face attached. 2015-04-28 21:34:05 +02:00
5c1c526ff3 QREdgeLink cleanup. 2015-04-28 21:33:10 +02:00
e0ae693924 Store bit-depth for reuse, replace loop with shift 2015-04-29 05:32:25 +10:00
d2ac3abbc2 Compilation error fixes for strict compiler flags 2015-04-29 00:23:52 +05:00
d14b2fbbe0 Add error for modifier when system has no solution. 2015-04-28 21:04:42 +02:00
859ac8fbc6 Fix ortho part of T44505
In this case we can calculate an offset without worrying about
perspective correction. Unfortunately if looking from a camera we still
have depth issues here. There's no really general case that can fix this
so I'm leaving this as is.
2015-04-28 20:41:49 +02:00
85ae4b87af Fix T44404: freestyle crashes blender.
The reported crash case seems to be caused by freeing compiled Python
objects in a thread.  Now this issue is avoided by allocating a buffer to
store a Python script and using BPY_string_exec() to run the script.  This
makes it unnecessary to repeatedly create and destroy Text data blocks.

Many thanks to Campbell Barton for his help on the bug fix.
2015-04-29 00:57:56 +09:00
7851534541 disable ARRAY_SIZE fixed length check for Clang 2015-04-29 01:37:45 +10:00
7615498e6d Alleviate somewhat the issue of T44505
Issue is zfighting with wire of mesh when parts of the mesh are close
together. We can make this slightly better by reducing the offset,
however this offset is calculated pre-perspective division and can vary
greatly with distance. Correct approach would be using polygon offset,
however we draw mesh wireframes as lines, (not polygons with polygon
mode line) so this approach will not work.
Alternatively, we could set an offset in a shader, however we don't have
code for that either.
2015-04-28 17:18:32 +02:00
be228d33f1 Curves: don't use 'charidx' for regular curves
Code attempted to sync them with materials,
but its not needed (and wasn't reliable).
2015-04-29 00:29:32 +10:00
34abe82205 Fix T44522: loop remapping between meshes when using 'nearest vert, best matching normal' modes
would fail on coplanar faces (or smooth verts).

Loop remapping is really a tricky topic... For now, we enhance a bit more
our Frankenfunc by using distance between dest and source polygons as
fallback in case we have too much similar normals...

Probably not a perfect solution, but should be robust enough I hope.

One core question remains open though: do we want to stick to 'use only seams
to detect UV islands'? This makes things much simpler, but will obviously fail
in case of actual islands without matching seams. :/
2015-04-28 16:01:43 +02:00
57a107c7bc Minor cleanup in comments. 2015-04-28 16:01:43 +02:00
f8c383472a Fix T44516 grid lines obscuring selection outline.
Was changed to draw after meshes without depth mask to make grid not
contribute to compositing effects. Now only draw it like this when we do
compositing (unfortunately can't have both).
2015-04-28 15:42:01 +02:00
e2d60d180e Project Paint: Add symmetry support
- Access from symmetry panel (as with sculpt)
- Supports multiple axis at once.
- Supports all brush types including clone.
2015-04-28 23:34:40 +10:00
43616918f3 Cleanup: const correctness 2015-04-28 23:15:48 +10:00
1f9fe0626f BLI_utildefines: add MEMSET_STRUCT_OFS macro 2015-04-28 23:15:47 +10:00
5e423775da Cleanup: Move Cycles volume stack update for subsurface into kernel_volume.h. 2015-04-28 11:20:27 +02:00
d920b8e075 Fix T44530 UV islands fail on subsurf after mirror modifier.
Caused by own commit that changed island detection code. In the case of
modifiers we don't want to take winding information into account, but
left the code since there are use cases (like painting) which could use
this.
2015-04-28 11:18:02 +02:00
eee666583f Use gnu89 for GCC
GCC5 defaults to gnu11, which we may switch to later
but disable for now to prevent accidental use.
2015-04-28 18:59:52 +10:00
2edb342ffa Fix for Clang type check 2015-04-28 18:59:47 +10:00
5c6ec169cc Added missing update tag to recalculate data after permutating materials 2015-04-28 10:52:19 +02:00
7e36c280c2 Cleanup: redundant checks 2015-04-28 16:47:45 +10:00
e451c71f22 Merge branch 'master' into soc-2014-remesh 2015-04-28 02:23:31 +02:00
766fb459b0 Cleanup of unused routines. 2015-04-28 02:18:15 +02:00
f8634864d7 Some cleanup, change constants, make isDisabled work. 2015-04-28 02:13:25 +02:00
0219887e2b Add compile option for making polys on the output mesh. 2015-04-28 02:01:09 +02:00
76bc924cdb Use madd_v3_v3v3fl, make prevlen variable for clarity in queryDirection. 2015-04-28 01:45:21 +02:00
435141e53c Change nextSegment function to nextPointOnFace. 2015-04-28 01:36:06 +02:00
98d41ffe5f Cleanup of isectPointWithQREdge function to be consistent with isectSegmentWithOthersOnFace. 2015-04-28 01:16:08 +02:00
dfc95fd992 Use project_plane_v3_v3v3 instead of own function. 2015-04-28 00:46:48 +02:00
4288ab16e5 Add material slot reorder buttons 2015-04-28 07:30:04 +10:00
92c5da2962 Move segment isection to math_geom.c, minor cleanup. 2015-04-27 23:17:59 +02:00
58a2b10a65 Cycles: Initialize portal variable directly, so we can avoid the one NULL check. 2015-04-27 23:12:53 +02:00
b9b2da4a6d Add GFSysID replacing distinct tables for edges on faces of gfsys1 and gfsys2. 2015-04-27 22:57:35 +02:00
a4965249ec Math Lib: add range_vn_u 2015-04-28 06:54:50 +10:00
f478c2cfbd Cycles: Added support for light portals
This patch adds support for light portals: objects that help sampling the
environment light, therefore improving convergence. Using them tor other
lights in a unidirectional pathtracer is virtually useless.

The sampling is done with the area-preserving code already used for area lamps.
MIS is used both for combination of different portals and for combining portal-
and envmap-sampling.

The direction of portals is considered, they aren't used if the sampling point
is behind them.

Reviewers: sergey, dingto, #cycles

Reviewed By: dingto, #cycles

Subscribers: Lapineige, nutel, jtheninja, dsisco11, januz, vitorbalbio, candreacchio, TARDISMaker, lichtwerk, ace_dragon, marcog, mib2berlin, Tunge, lopataasdf, lordodin, sergey, dingto

Differential Revision: https://developer.blender.org/D1133
2015-04-28 01:30:16 +05:00
84836e8952 Cleanup: use strict flags 2015-04-28 06:24:06 +10:00
ae7d84dbc1 Cycles: Use native saturate function for CUDA
This more a workaround for CUDA optimizer which can't optimize clamp(x, 0, 1)
into a single instruction and uses 4 instructions instead.

Original patch by @lockal with own modification:

  Don't make changes outside of the kernel. They don't make any difference
  anyway and term saturate() has a bit different meaning outside of kernel.

This gives around 2% of speedup in Barcelona file, but in more complex shader
setups with lots of math nodes with clamping speedup could be much nicer.

Subscribers: dingto

Projects: #cycles

Differential Revision: https://developer.blender.org/D1224
2015-04-28 00:38:32 +05:00
014b91dd75 Changes to how segments are created. 2015-04-27 20:49:48 +02:00
278ff15c7f BLI_array: add permute utility function 2015-04-28 04:12:48 +10:00
6ada7a1a0b Usual UI messages fixes... 2015-04-27 20:10:32 +02:00
920fa0f963 Fix double-free on copied Text compiled py-code 2015-04-28 01:18:50 +10:00
84db9fdf4d Fix T44464: Viewport mipmaps no longer toggle off 2015-04-28 01:18:50 +10:00
8d8d1939fa Cleanup: use bool for mipmap args 2015-04-28 01:18:50 +10:00
c760c0dbb3 Cleanup: use mul_v3_mat3_m4v3 2015-04-28 01:18:50 +10:00
Dalai Felinto
4a80c4fade Multi-View: Code cleanup
I finally put the time into understanding what was going on here.
Basically RE_AcquireResultImage() produces RenderResults without
RenderViews. That will be fine for now since I'm planning to refactor
RenderResult soon.
2015-04-27 12:10:35 -03:00
Dalai Felinto
f809eef968 Muti-View: viewport crashes when empty is active camera - reported over IRC by Campbell Barton 2015-04-27 10:41:40 -03:00
Dalai Felinto
b315fcb7ed Fix T44514 Crash under cycles rendering using F12, based on patch from Gaia Clary 2015-04-27 10:41:40 -03:00
e1ed47eb5b Fix T44512: Cycles fails normal bake /w scale flip 2015-04-27 22:46:15 +10:00
4312442a6f Add makeFeatureEdges procedure. 2015-04-27 14:32:42 +02:00
9dadc8f599 Math Lib: add mul_v3_mat3_m4v3 2015-04-27 21:52:42 +10:00
3f80accfb3 Fix T44011: Ruler/Knife/Loop-cut fail in quad-view
This is a kind of sloppy-focus,
resolving long standing bug with loop-cut/knife/ruler /w quad-view.

Where activating a tool would lock onto one of quad-views,
especially problematic when activating from the toolbar or menus.
2015-04-27 19:17:07 +10:00
5df939fd15 Py API: expose operator runtime flags
eg from operator invoke/execute:
    self.options.is_grab_cursor
2015-04-27 19:00:10 +10:00
5e1eb8cdcf Cleanup: rename GRAB_POINTER -> GRAB_CURSOR
Term pointer is overloaded already.
2015-04-27 18:58:53 +10:00
ddb5f96295 Sculpt: symmetrize was leaving edge-tags dirty
This is used for the edge-queue
2015-04-27 03:35:16 +10:00
24448e11fb Correct own error in recent sculpt changes
mixed up squared nonsquared length, also remove invalid verify check.
2015-04-27 03:34:13 +10:00
Julian Eisel
cf366c8b66 UI: 'View Online Manual' Shortcut
D1031, implement proposal T37478 to give easy access to the online manual.

Use Alt+F1 while hovering over a button/setting.
2015-04-27 01:35:24 +10:00
5efbd2a407 BGE : addObject in python without reference object.
Making the reference argument optional for the addObject function.
```
scene.addObject("Cube")
```

This allows to keep the rotation, scale and position of the original object.
To avoid layer problems with lights if the reference arguments is None, the new object have the same layer than the active layers in scene.

Reviewers: lordloki, moguri, hg1, sybren

Reviewed By: hg1, sybren

Subscribers: agoose77

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1222
2015-04-26 16:29:58 +02:00
3524676036 BMesh: increase subdiv smooth strength
Now 1.0 gives near spherical output
2015-04-26 21:26:45 +10:00
2069187a1b Cleanup: bmesh subdivide
var names were a bit cryptic, set return arg last.
2015-04-26 20:34:03 +10:00
2374cb380b BMesh: subdiv smooth, use simpler even calculation
Was checking all vertices adjacent faces,
now just compare the difference between normal angles.

Also default to inverse-square for loopcut-subdiv falloff.
2015-04-26 19:20:34 +10:00
e1ca127419 Cleanup: subdivide smooth vertex placement 2015-04-26 19:12:20 +10:00
6e02f1da74 BMesh: use inverse-square falloff /w smooth-subdiv
Resolves ugly artifacts with multi-cut.
2015-04-26 18:35:42 +10:00
c2f7cffd56 Add inverse-square falloff to bmesh, mask & compo. 2015-04-26 18:31:54 +10:00
d33314393e BMesh: use const for API calls 2015-04-26 17:19:51 +10:00
12e7c7f674 BMesh: BM_ELEM_CD_GET_VOID_P cast removed const 2015-04-26 17:19:51 +10:00
3917e9f1f2 Macro GENERIC_TYPE_ANY map many types to one value 2015-04-26 17:19:51 +10:00
357f66fc54 Add GFSegment structure, redesign of GFLine procedures. 2015-04-26 00:58:23 +02:00
bc160d8a85 Cleanup: Code style. 2015-04-26 00:42:26 +02:00
8dd055cd47 Cleanup: Update Lookup table comments. 2015-04-26 00:06:38 +02:00
60c5a2f2d2 Cycles: Add Mirror ball mapping to camera panorama options
The projection code was already in place, so this just exposes the option.

Differential Revision: https://developer.blender.org/D1079
2015-04-25 23:51:56 +02:00
01dda9a434 correct own error in recent ngon creation edit 2015-04-25 21:16:58 +10:00
9eb191083a Fix neg-scaled project-paint in perspective mode 2015-04-25 20:47:19 +10:00
89f5a09ab4 Cleanup: use 8 space indent for multi-line args 2015-04-25 20:15:20 +10:00
81f63d3799 Introduce QR_GFLINE_QSIZE constant for easy resizing of GFLine queue. 2015-04-25 09:59:02 +02:00
a7381cca34 BMesh: simplify BM_face_create_ngon
Was doing quite a lot of unnecessary steps.
Now construct the sorted verts, edges /w error checking, in a single loop.
2015-04-25 17:26:22 +10:00
Julian Eisel
a4203814d1 UI: Panel drag-collapse
D1233, Adds a way to quickly open/close multiple panels by holding LMB and dragging over the desired panels,
Suggested by @maxon

The decision if the panels are opened or closed is made based on the first Panel the user drags over.
If it is closed, all panels he drags over are opened
(including the first one) if it's opened, they get closed (matching existing drag-toggle logic).
2015-04-25 13:11:32 +10:00
0221a11c95 Project Paint: save 8 bytes per pixel (re-align) 2015-04-25 12:54:55 +10:00
86d3a1f683 Cleanup 2015-04-25 12:29:52 +10:00
Julian Eisel
3bffcc675b Fix T42495: Fullscreen area icon glitch
Tried a couple of things to trigger an update/redraw for the exact right
moment (sending azone update event, timer, delayed redraw, etc) but this
seems to work rock solid without being *that* ugly.
2015-04-25 01:29:53 +02:00
7e2557fb0c RNG stuff. 2015-04-24 23:12:37 +02:00
c79e3613e0 Add TODOs 2015-04-24 23:12:17 +02:00
a1376d38bf Little code cleanup. 2015-04-24 23:11:32 +02:00
d92e630813 Fixes to GradientFlowSystem allocation/deallocation. 2015-04-24 23:09:00 +02:00
1529e39ece Add simple timer for remeshing. 2015-04-24 23:06:45 +02:00
5785577bd6 Make QR_NO_FACE constant for marking when there is no second face adjacent to edge. 2015-04-24 23:05:42 +02:00
05b84e59fe Remove "Compute Flow" and "Remesh" UI buttons for now. 2015-04-24 23:03:10 +02:00
Julian Eisel
de8e89d4f5 Fix T44405: Importing keyconfig with changed shortcut in "Screen Global"
causes rapid fullscreen toggeling
2015-04-24 20:08:52 +02:00
Dalai Felinto
7e66f0e9d4 Multi-View: Set Stereo 3D operator support for EXEC calls 2015-04-24 13:07:33 -03:00
Dalai Felinto
27ac96dbae Multi-View: rolls back to a non quadbuffer friendly window if displaymode changes from pageflip to something else
In some cases the graphic card supports quadbuffer, but not the display.
In this case it is nice to go back to a window that does not have
quadbuffer if you change back to anaglyph, interlace, ...

Otherwise you may be stuck with a flickering window
2015-04-24 13:06:49 -03:00
Dalai Felinto
fb17a3fb76 Multi-View: Time Sequencial (aka pageflip, aka quadbuffer) stereo support
TODO: I would be nicer if we could set win at file opening to the
current open window, but I'll implement this later.
2015-04-24 12:00:16 -03:00
324751259e correcting typos in python api docs 2015-04-24 14:08:31 +01:00
80d75cb3e4 Add debug option --debug-gpumem to show GPU memory used in status bar.
Only used in ATIs and NVIDIAs. Used extensions are:

https://www.opengl.org/registry/specs/ATI/meminfo.txt
http://developer.download.nvidia.com/opengl/specs/

If you read the documentation, the numbers are not supposed to be exact
and also depend on the time when the call is made. The numbers can also
change quite quickly. It's only meant to give a rough measure of what is
going on.
2015-04-24 14:11:21 +02:00
c2f861453e Fix T44492: knife tool should cut across a split edge.
Added filter condition in visibility check that prevented
a "butting-up-against" face from obscuring an edge.
2015-04-24 07:29:45 -04:00
546031b694 BGE : fix bugs with physics collision mask/group
Currently there are bugs with physics objects in inactive layers,
character and softbody.
I added a function in CcdPhysicsEnvironement to know if a physics
controller is currently active and for soft body I added the correct function in UpdateCcdPhysicsController to re-add a softbody in the dynamics world.

The bug was introduced in D1243 commit 3d55859

Reviewers: hg1, scorpion81, lordloki, moguri, agoose77, sergof

Reviewed By: sergof

Subscribers: youle, moguri

Differential Revision: https://developer.blender.org/D1253
2015-04-24 11:57:38 +02:00
c884ac28a7 3D Textures:
If we fail allocating a proxy texture don't fail, instead create a
smaller nearest filtered image to display in its place.

This can make viewing slow (it's an extra O^3 operation), but this will
probably help us render the tornado in 3D viewport in gooseberry and
still actually see something - despite the rendering taking longer.
I've added a debug print so we can know when this happens.
2015-04-24 11:35:57 +02:00
9576d03f50 CMake: add -Wformat-signedness 2015-04-24 19:11:02 +10:00
bdf6393c98 Math Lib: pow_i for int power-of 2015-04-24 11:37:48 +10:00
f829f556b4 Fix project painting on a negative scaled object 2015-04-24 11:04:27 +10:00
Dalai Felinto
efe41ae7fd Multiview: Quadbuffer (time sequential) working [debug builds only]
I'll enable this mode in Release builds once I figure out how to best
handle opening files that are saved with the quadbuffer mode.

In fact I think no display mode should be saved/read from a file.

Tested in Linux with NVidia 3D Vision and NVidia 3D Vision Pro with
NVidia Quadro FX 580 and Quadro FX 4600.

(kudos for the Visgraf Lab at IMPA, for having me around with all those
gadgets ;)

Thanks for Cédric Paille (cedricp) for the code snippets and tests -
T44327
2015-04-23 19:50:52 -03:00
0217e6517f Cleanup: minor edits 2015-04-24 07:32:43 +10:00
Dalai Felinto
1076adb458 OpenEXR: RenderResult should always have a RenderView 2015-04-23 18:16:55 -03:00
dc734da46e Cleanup: casts, correct debug ifdefs 2015-04-24 07:08:07 +10:00
3bbb4b6569 Merge branch 'master' into soc-2014-remesh 2015-04-23 22:53:34 +02:00
9c77c180b4 Change applyModifier function. Rename MOD_QUADREMESH_COMPUTE_FLOW flag. 2015-04-23 22:44:17 +02:00
97b1f22bc3 Project Paint: minor optimization comparing angles 2015-04-24 06:41:39 +10:00
f75c89b3f4 Fix T44461: Crash and file corruption after calc_normals_split, calc_tessface execution.
This one was nasty, issue comes with temp/nofree CD layers that get 'removed on the fly'
from saved mesh CDData. Since mesh struct itself was written before that cleanup, it would
still have the old, invalid number of layers. That would lead to a buffer overflow when
loading data later (odd you had to do this twice (i.e. have 2 'ghost' layers) to get the crash).

New code prevents that by always making a copy of the mesh (we were already doing that mostly
anyway, since we were saving without tessfaces), copying (by ref of course) in it cddata,
and then writing mesh struct. Makes code a bit more verbose, but... it works!
2015-04-23 20:53:12 +02:00
140430574b Redesign OutputMesh.
New QRVert type - holds connectivity data as well as coordinates and normal of the vertex.
Changes to makeResultMesh - now it generates the result mesh.
Avoid copying data between OutputMesh and CDDM.
2015-04-23 20:48:01 +02:00
18ee593729 Expose CD_PAINT_MASK to Python API
D782 by Stanislav Blinov
2015-04-24 04:10:51 +10:00
d2f35d6d50 3D textures: detect if we are pushing OpenGL too hard with the texture
size.
2015-04-23 19:02:37 +02:00
61ac5dd5ba Correct missing NULL check (own mistake) 2015-04-24 02:38:15 +10:00
372752c739 Math Lib: add count_bits_i utility function 2015-04-24 01:37:12 +10:00
27e03dcd21 Fix T44422: Zoom to mouse fails in camera view
Camera now supports all zoom styles too.
2015-04-24 00:18:42 +10:00
Dalai Felinto
22b564f93e Fix T44498 - Blender crashes in some files after render slots fix
This is a temporary fix until I get to investigate it more carefully.
It will help if the report could include the steps to reproduce it
besides the buggy file.

Note: RenderResult should *always* have at least a valid RenderView,
which is not what happens here.
2015-04-23 11:01:56 -03:00
bcac112dde Fix T44494 crop node changes values during execution.
We used the node data as a store for node execution,
bad idea, since the data itself is a template from which
execution data should be derived, never to be modified during execution.
2015-04-23 14:23:42 +02:00
Julian Eisel
2dfbf31a41 Display slot menu in Properties Region even if render slot is empty
For the records, this one is caused by 31f984bc3f, it wasn't
implemented at all ;)
2015-04-23 13:33:29 +02:00
Julian Eisel
85e455b245 Fix slot menu not displayed if render result slot is empty
Caused by own mistake in 31f984bc3f, reported by @sebastian_k in
IRC
2015-04-23 13:21:36 +02:00
8010672bbc BMesh: mesh-data picking, edge+vert improvement
When zoomed out vert bias over edges meant it wasn't possible to select edges.
Now pick the edge if the cursor is closer to its center.
2015-04-23 16:11:54 +10:00
87b3e62b3d Cleanup: warnings 2015-04-23 16:09:30 +10:00
0287b39468 Py API: Remove deprecated callback_add 2015-04-23 12:58:49 +10:00
Dalai Felinto
ecb3362a24 Fix T44396 - Compositing render slots don't work
Note 1: If you go to a render slot previously rendered and change
something in the compositing the buffer will still vanish.

This is an old bug, T44181, and not addressed here
(I'm basically just fixing the regression introduced with multiview)

Note 2: I have a work in progress patch to get rid of
RenderResult->rectf/rect32/rectz entirely. It still not working, and we
should have a working code base before doing refactoring anyways.
2015-04-22 18:48:31 -03:00
6a1c123df4 Fix broken uiTemplateIconView().
Was using enum **value** as **icon id**... tripple sigh!
Guess it was working for its only current use (matcaps), but still.
2015-04-22 22:48:40 +02:00
Julian Eisel
90b7652334 Fix T44472: Stereo 3D save options missing in File Browser 2015-04-22 21:50:49 +02:00
Dalai Felinto
4a8421faa4 Fix T44463 - crash on "Full Sample" 2015-04-22 16:40:21 -03:00
3b6f770643 New hideEdgesOnFaces procedure for hiding edges, which are on faces of input mesh. 2015-04-22 21:31:51 +02:00
Julian Eisel
31f984bc3f Show buttons to change render layer/pass in UV Editor header
Previousely this was "hidden" in the Properties Region, this makes it
more visible/usable.

Requested by @sebastian_k
2015-04-22 20:43:43 +02:00
147d0cdf98 Tracking: Show plane track outline if image failed to load 2015-04-22 23:20:00 +05:00
f35489fa94 Tracking: Fix missing pointer array check when reading plane track
This could cause memory corruption when moving files from system with one
bitness to another.
2015-04-22 23:00:41 +05:00
3174cbe8f2 Double click selection on animation channels selects all keyframes of the range 2015-04-22 19:28:07 +02:00
3da7226844 Freestyle: Fixed a crash due to missing call of StrokeShader.__init__() in Python.
Many thanks to the problem report by flokkievids (Folkert de Vries)
through a comment in Patch D963.
2015-04-23 01:12:55 +09:00
Julian Eisel
798facbff3 Fix crashes when moving game property with invalid index (from py/redo
panel)

Also hides index option in redo panel to be consistent with similar
operators
2015-04-22 17:20:10 +02:00
d354eeab74 Placeholder image strips feedback session changes no.2:
Change paths operator can also have the same placeholder logic now
2015-04-22 14:11:51 +02:00
e7c2d244c3 Placeholder image strips feedback session changes no.1:
Autodetect range of strips.
2015-04-22 14:11:51 +02:00
62d10cd833 Placeholders for sequencer take one.
Placeholder images, means that the image sequence reserves a range for
images, displaying black while we wait for them to finish rendering.

This is meant as a feature to not break the layout of gooseberry
sequence edits while we wait for those frames to arrive.
2015-04-22 14:11:51 +02:00
Julian Eisel
dc36e1fe39 Fix T44476: Hiding Grease Pencil from Outliner RMB doesn't update 3D
View
2015-04-22 14:02:48 +02:00
Julian Eisel
18aaae101a Fix T44477: Overlapping tooltips in Outliner
Tooltips for buttons in the Outliner could overlap the Outliner's RMB
menu in some cases (and there's no way to get rid of the tooltip again).
This disables the button's tooltip before creating the menu (as we do it
for the normal RMB menu)
2015-04-22 13:41:43 +02:00
1044dfd965 Fix and simplify vertical positioning and calculation of metadata
display more.
2015-04-22 13:19:58 +02:00
a069b8d5d8 Rename stamp panel to metadata panel.
Rationale - this panel also enables metadata that get written on files.

Also moved draw_stamp property in the panel - to make it clearer it only
controls the drawing, not individual metadata.
2015-04-22 12:35:59 +02:00
818a0cdc76 Fix stamp missing after multiview merge.
Was not using acquired render result correctly, most likely a copy paste
error.
2015-04-22 12:03:06 +02:00
97587dc5d6 Stamp cannot be written to file.
Make sure stamp data is avaliable before writing stamp to image - this
still does not fix stamp, looks like issue is availability of the images
themselves for the view, investigating next.
2015-04-22 11:50:57 +02:00
414990b0f1 Tracking: Some more code de-duplication 2015-04-22 12:46:29 +05:00
18a47b67fd Tracking: Code cleanup, de-duplicate some code in tracking context finish 2015-04-22 12:34:01 +05:00
e6ceecdf97 Cleanup: pep8, spelling 2015-04-22 16:26:54 +10:00
4da050674e Fix T44470: File Selection sometimes surpresses last Character.
Tweak hack of `file_draw_string()` (there may be better solution, but not worth
spending time on this, the whole filebrowser drawing code is to be rewritten anyway).
2015-04-22 08:15:05 +02:00
e1a53b6d52 Fix T44475: Merge option of Mirror Modifier behavior reversed.
Glitch in rB57d9badc.
2015-04-22 07:54:14 +02:00
a8adeeb6fb Logic Editor: Buttons for moving game properties up/down
D1163 by @panzergame, with minor edits by me (@Severin)
2015-04-21 23:33:45 +02:00
b35743d39f Tracking: Add missing plane track remapping when joining two point tracks 2015-04-22 02:10:50 +05:00
260f75a2ca Tracking: Cleanup, move some plane tracks code to utility functions 2015-04-22 02:10:50 +05:00
Dalai Felinto
9425a8ff38 BGE: scene.pre_draw_setup[] callback
This callback allows the user to change the camera data right before the
rendering calculations.

scene.pre_draw[] is not enough here, because if you want to change the
camera matrices (projection/modelview) the culling test is done before
that (after pre_draw_setup[] though).

Reviewers: moguri, campbellbarton

Differential Revision: https://developer.blender.org/D1251

Python sample code using this. The sample scene would need a default
camera (not used for rendering), a dummy camera ('Camera.VR'), and two
cameras ('Camera.Left', 'Camera.Right') that will be used for the actual
rendering.

```
import bge

def callback():
    scene = bge.logic.getCurrentScene()
    objects = scene.objects

    vr_camera = objects.get('Camera.VR')

    if bge.render.getStereoEye() ==  bge.render.LEFT_EYE:
        camera = objects.get('Camera.Left')
    else:
        camera = objects.get('Camera.Right')

    vr_camera.worldOrientation = camera.worldOrientation
    vr_camera.worldPosition =  camera.worldPosition

def init():
    scene = bge.logic.getCurrentScene()
    main_camera = scene.active_camera
    main_camera.useViewport = True

   scene.pre_draw_setup.append(callback)

    objects = scene.objects
    vr_camera = objects.get('Camera.VR')
    vr_camera.useViewport = True
    vr_camera.setViewport(
            0,
            0,
            bge.render.getWindowWidth(),
            bge.render.getWindowHeight() )
```
2015-04-21 17:41:23 -03:00
f2956d5fc7 Tracking: Fix over-allocation in plane track's point tracks pointers when removing point track 2015-04-22 01:36:15 +05:00
Julian Eisel
6885d316b1 Fix T44474: Rotation manipulator not hidden completely with all axes
locked

Really doesn't look like a bug on a first glance but the line of code
that was there previously seemed to be there to prevent the manipulator
from drawing in this case.
2015-04-21 21:55:19 +02:00
bf69453ae7 BLI_string: add BLI_snprintf_rlen
use when the length of the destination string is needed.
2015-04-22 05:37:22 +10:00
e40e2ab423 Large redesign of the whole thing.
Memory allocated in more specific functions.
GFSystem is now more about the gradient field and the seeds, not the mesh or resulting lines.
gfsys is now a 2-element array
Move unused functions in MOD_quadremesh.c file to the top for easy collapsing of #if 0 block
Cleanup of unused ringv_map from InputMesh.
Move some function calls from QuadRemeshModifier_do to initSystem
2015-04-21 21:35:12 +02:00
c9f9e29538 Math Lib: handling bits handling into own file 2015-04-22 04:44:24 +10:00
b47892e9f5 Minor edits to metadata commit
No need to calculate height of each line, just use height of font.
2015-04-22 04:43:13 +10:00
e1ce83f762 Initialize and use the theme for metadata text 2015-04-21 19:01:09 +02:00
aa6e6e0cb4 Change input for nextPoint function - it doesn't need GradientFlowSystem, just InputMesh. 2015-04-21 18:46:24 +02:00
03478aa131 Change names from GFEdge to QREdge. 2015-04-21 18:42:35 +02:00
58c511fb01 Stamp refactoring:
Write those on render result during rendering, so we can cleanly write a
render result image after rendering.
2015-04-21 18:37:06 +02:00
3091ea49fe Metadata:
* Theme support for metadata display
* Increase text DPI with scaling.
2015-04-21 18:37:06 +02:00
50bfc4bfa0 Metadata display support - patch by Julian and me.
Basically, blender adds a few metadata fields to images when
we render an image. Those metadata can now be viewed in the
image editor.

Also, made sure metadata are available when we write imbufs
to disc with "Save As". There may be more cases here that need
fixing, but this means that loading an image with metadata
will now properly preserve them in blender.
2015-04-21 18:37:06 +02:00
8b1c5e1239 Change names from QREdgeLink(-List) to QRDiskLink and QRDiskCycle. 2015-04-21 18:36:02 +02:00
48b67c8594 Be sure to clean the vert flag when adding. 2015-04-21 18:17:48 +02:00
19c58e4cdd Small optimization of insertOnGFEdge.
We don't need to calculate len_v3 (costly sqrt), but we can just use dot with in_e->dir,
which is unit length and should be parallel to vec is the same result, and even gives the sign for free.
2015-04-21 18:17:21 +02:00
Julian Eisel
f9972fa53e VSE: Allow GPencil drawing without having a strip loaded
Previously the GPencil strokes were just not drawn (even though they
were generated) until a strip was loaded.
2015-04-21 17:44:11 +02:00
84d117b3ad Minor edit to edit-mesh selection bias
only choose verts over edges (not faces)
2015-04-22 00:43:31 +10:00
3a3f80673c Cleanup: minor corrections 2015-04-22 00:16:26 +10:00
Julian Eisel
de687b6fa0 Fix T44465: Crash using VSE OGL render + Grease Pencil
Likely caused by rBd5f1b9c22233
2015-04-21 16:04:14 +02:00
e3a6440e7a BMesh: mesh-data picking, general improvements
Generalize logic for vert/edge/face selection:
- index cycling.
- selection bias with mixed modes.

Details:
- Edges now support index cycling (as verts/faces did already)
- Cycling over near elements is now only enabled when the mouse position remains the same.
- No longer do 2 selection passes to perform index cycling.

Fixes:
- Edges behind the view could be selected (surprising nobody reported!)
- Selection bias now only changes the element that gets picked without interning the return distance
  (was buggy with mixed modes).
2015-04-21 21:25:43 +10:00
907d4d310f Backdrop strictly shows image result only - it could get influenced by
scopes setting of space if one changed the space type back and forth.

Thanks to Sergey for reporting.
2015-04-21 12:13:02 +02:00
e0ae23b4d6 Allow editing of active strip proxy settings again in addition to the
set operator
2015-04-21 12:00:10 +02:00
797edf2218 Cleanup of insertLink. 2015-04-21 11:15:10 +02:00
e746c89abc Add faster method of calculating angle between two normalize vectors.
For now we'll just use acos(dot(a,b)) as it's faster, and accuracy is acceptable.
2015-04-21 10:08:36 +02:00
038e597ab3 Code cleanup. 2015-04-21 09:33:36 +02:00
9adaa6a06b Memory crash fix 2015-04-21 09:33:09 +02:00
b82d571c85 Cleanup: style 2015-04-21 15:53:32 +10:00
f36e91ad0a Correct crash in last commit (spacebar search) 2015-04-21 15:18:34 +10:00
Julian Eisel
56a93e9cb1 Add eyedropper for selecting object & obdata
In addition to the unlink icon to clear a value,
When cleared, show an eyedropper to select objects or object-data
(was already available via the EKey).
2015-04-21 14:25:03 +10:00
912397756a Fix T44432: Zoom to mouse fails /w FCurve editor 2015-04-21 13:10:32 +10:00
62e149881a Fixes for backbuf selection logic
- Fix ED_view3d_backbuf_sample_rect, r_dist was set completely wrong.
- Avoid duplicate calculations picking the nearest edge.
- Bias against picking selected edges is now optional.
- Remove unused callback reading the backbuf.
- Remove unused strict option picking vertices.
2015-04-21 04:50:39 +10:00
2e0842a4f5 Move ringe to output mesh. add vonvs for storing verts which are on input verts. 2015-04-20 20:30:59 +02:00
067ce7400a Cleanup, remove mergeVertsOnEdges. 2015-04-20 20:30:04 +02:00
ccc26a5484 Add GFPoint structure for holding info on a point before adding it to output verts. 2015-04-20 20:28:54 +02:00
fa6abd728e Fix deleteDegenerateVerts function: make vertmap only after deleting links. 2015-04-20 20:23:36 +02:00
aa880bb815 Cleanup: use ED_view3d_backbuf_* prefix 2015-04-21 03:19:27 +10:00
d57a93a7cb Fix T44383: Select face fails in some positions
When mixing vert/edge/face with select-visible,
face selection could fail when not close enough to the center.

This also fixes a bug where the bias for verts over edges would
prefer faces over edges too, making edges harder to pick.

Mixing edge with other selection modes works more predictably now.
2015-04-21 03:10:32 +10:00
0626d27bf6 Editmesh select nearest fixes
- distance from edge check wasn't clamping 0-1
- vertex bias wasn't taking pixelsize into account.
- index & pass counter were floats

Also some improvements

- use BMesh lookup tables when available.
- use structs to avoid issues getting out of sync.
2015-04-21 01:50:21 +10:00
60e8e20132 Cleanup: use macro for common view3d zbuf check 2015-04-21 01:50:20 +10:00
57d9badc21 Cleanup: use bool /w flag checks 2015-04-21 01:50:20 +10:00
6298632bfa Guardedalloc: Don't use aligned blocks to calculate memory sloppyness
Aligned memory is allocated with memalign() and malloc_usable_size() can't be
used to measure this block.
2015-04-20 19:23:25 +05:00
42e427905c CMake: Move performance tests under the cmake option
This way running full sweep of regression tests does not require
waiting for the performance test to finish.
2015-04-20 18:30:26 +05:00
4d5446cea7 Usual UI messages fixes... 2015-04-20 14:46:09 +02:00
828abaf11c Cycles: Split BVH nodes storage into inner and leaf nodes
This way we can get rid of inefficient memory usage caused by BVH boundbox
part being unused by leaf nodes but still being allocated for them. Doing
such split allows to save 6 of float4 values for QBVH per leaf node and 3
of float4 values for regular BVH per leaf node.

This translates into following memory save using 01.01.01.G rendered
without hair:

                   Device memory size   Device memory peak   Global memory peak
Before the patch:  4957                 5051                 7668
With the patch:    4467                 4562                 7332

The measurements are done against current master. Still need to run speed tests
and it's hard to predict if it's faster or not: on the one hand leaf nodes are
now much more coherent in cache, on the other hand they're not so much coherent
with regular nodes anymore.

Reviewers: brecht, juicyfruit

Subscribers: venomgfx, eyecandy

Differential Revision: https://developer.blender.org/D1236
2015-04-20 17:29:51 +05:00
cd44449578 Cycles: Synchronize images after building mesh BVH
This way memory overhead caused by the BVH building is not so visible and peak
memory usage will be reduced.

Implementing this idea is not so straightforward actually, because we need to
synchronize images used for true displacement before meshes. Detecting whether
image is used for true displacement is not so striaghtforward, so for now all
all displacement types will synchronize images used for them.

Such change brings memory usage from 4.1G to 4.0G with the 01_01_01_D scene
from gooseberry. With 01_01_01_G scene it's 7.6G vs. 6.8G (before and after
the patch).

Reviewers: campbellbarton, juicyfruit, brecht

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1217
2015-04-20 17:29:51 +05:00
b07c630676 I18n: Add Vietnamese language. 2015-04-20 14:27:20 +02:00
6bc26540c2 Fix T44452: Inconsistent gpencil color in prefs 2015-04-20 21:20:39 +10:00
fa761dfe6d Fix T44419: extruding when using lasso deselect 2015-04-20 21:10:52 +10:00
437f69ab45 Allow Python overrides for materials. 2015-04-20 20:20:33 +10:00
9b4c8a2507 Fix T44458 strip modifier mask not copied correctly when doing scene
copy.

What happens is that the strip is copied, but it still refers to the old
scene. Here we need to fix this by referring to the copy of the strip
and also do it after copying to make it order independent.
2015-04-20 11:51:43 +02:00
0aa2eed0c2 Compilation error fix for MSVC: It does not support expressions in array
declarations
2015-04-20 14:07:26 +05:00
bf6bde232d Fix: BGE crashes when RunPythonCallBackList() is called with maxargcount != minargcount 2015-04-20 13:53:54 +08:00
dbb2b29bea Action Stashing: Newly stashed strips now get "sync length" option enabled by default 2015-04-20 17:27:59 +12:00
a0e1b6573a Action Editor "Browse" Fix: Stash active action if nothing else uses it
Following the initial action management commits for 2.74, blurrymind pointed out a
problematic workflow involving the "Browse Action" dropdown in the Action Editor
which would lead to actions being accidentally lost. Namely, it turns out that
game animators frequently flip between different actions from the Browse menu while
working.

While the new up/down operators and/or other NLA based tools are better suited to this
without the problems of actions getting lost, some additional precautions were needed
for the Browse menu as well. So now, if the active action will have no users as a result
of the switch (i.e. it was a new action, and the user is checking on a previous action
via the Browse menu), this action will now get stashed. This workflow is not perfect though,
as there is the problem of the stashed action strips not reflecting the actions they reference.
2015-04-20 17:27:58 +12:00
689241b6e5 Fix for potential null-pointer-dereference if the new action is NULL 2015-04-20 17:27:57 +12:00
e4fbc8fc8d Fix: Changing actions in the Action Editor using the Browse dropdown should happen in tweakmode
When a NLA strip is being tweaked, it should not be possible to use the Action Editor to change
the action that it uses. Instead of changing the action in tweakmode, it now exits tweakmode
first before doing so.
2015-04-20 17:27:56 +12:00
5f6b958e96 Fix: "show_points" setting for Grease Pencil drawing didn't work
As reported by zeffi, the "show_points" option was not working in master.
It probably broke recently, after some changes meant that the point sizes
weren't geting set prior to drawing these points anymore. Since this was
originally added as a debugging tool (though it is now somewhat redundant
due to the stroke editing functionality, which uses/exposes the same points),
this option wasn't really that important. I have decided to add back a toggle
for this to the UI though, since it can be used for some interesting effects...
2015-04-20 17:27:55 +12:00
79319b3fba Sculpt: remove workaround T25371
It's no longer needed,
and made calc_area_normal different to the normal from calc_area_normal_and_center.
2015-04-20 13:36:51 +10:00
436004b6b1 Sculpt: clay-strips was missing accumulate button
Correct & de-duplicate check for accumulate.
2015-04-20 13:23:47 +10:00
07a7d77ec1 Fix: solved BGE compiler error on Linux/gcc 2015-04-20 10:58:25 +08:00
5db143efbb Fix T44449, sm_52 kernel missing in CMake builds. 2015-04-19 22:04:23 +02:00
62f79856e9 BGE : Standardization of callbacks execution.
A new function (RunPythonCallBackList) to call all python functions
contained in a python list was developed.

This function has:
  - first argument is the python list of callbacks
  - second argument is a python list of arguments
  - third argument is the minimum quantity of arguments
  - forth argument is the maximum quantity of arguments

It improves flexibility and supports *args.

Reviewers: moguri, dfelinto, campbellbarton, sybren

Reviewed By: campbellbarton, sybren

Subscribers: sybren

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1102
2015-04-19 20:33:08 +02:00
6f0f1dc3be Cleanup: warnings 2015-04-19 22:03:42 +10:00
e5048dd4ca Dyntopo: non-topology tool origdata support
Brushes that don't change topology didn't have access to original data.
2015-04-19 19:56:46 +10:00
ac73fe5fe0 Cleanup: use meaningful names re: (fc, an, sn) 2015-04-19 18:38:58 +10:00
fb6a0d24e1 Dyntopo: support for original normal access
Rename calc_flatten_center to calc_area_center,
since theres no 'flatten' spesific logic there.

Also refactor calc_area_center, calc_area_normal, calc_area_normal_and_center
so they're next to eachother - they're almost the same,
having them scattered about isn't helpful.
2015-04-19 18:24:21 +10:00
fe39ebea12 Cleanup: move project code into util function 2015-04-19 17:52:35 +10:00
57b020528b Cleanup: calculating sculpt center & normal
also avoid sqrt calculating dyntopo center (only checks for flipping)
2015-04-19 17:03:51 +10:00
eb4fb4f4fe disable verify from last commit (too slow) 2015-04-19 16:06:40 +10:00
d09a9a9597 Dyntopo: USE_EDGEQUEUE_TAG broke even subdiv
While adding edges to the queue multiple times is redundant,
walking over them is still needed.
2015-04-19 16:03:12 +10:00
550c3c2c1e Dyntopo: avoid over-counting /w neighbor average 2015-04-19 14:46:32 +10:00
2448c21cb3 Sculpt: avoid CD lookup /w mask smooth 2015-04-19 14:46:32 +10:00
9ac618a90e Sculpt: smooth brush, exclude self from average
Was including the vertices own location when accumulating.
2015-04-19 14:46:32 +10:00
3d55859924 BGE: Support for collision group/mask from the api + activated on EndObject.
A Python API for the collision group / mask has been added:
```
KX_GameObject.collisionGroup
KX_GameObject.collisionMask
```
The maximum number of collision groups and masked has been increased from eight to sixteen.
This means that the max value of collisionGroup/Mask is (2 ** 16) - 1

EndObject will now activate objects that were sleeping and colliding with the removed object.
This means that, unlike now, if a rigid body starts sleeping on top of another object, when the latter is removed the rigid body will activate and fall, rather than float midair as before.

Collision groups that do not intersect used to collide on the first frame. Now this has been fixed so that they collide appropriately.

Thanks to agoose77 for his help.

Reviewers: scorpion81, hg1, agoose77, sergof

Reviewed By: agoose77, sergof

Subscribers: sergof, moguri

Projects: #game_physics, #game_engine

Differential Revision: https://developer.blender.org/D1243
2015-04-19 01:04:22 +02:00
a2f9a0cfd9 BGE: Fix T43536 logic.getCurrentScene() returning wrong scene in
pre_draw and post_draw calls

A simple insert of KX_SetActiveScene(scene) before pre_draw and
post_draw calls solves the issue.

Reviewers: dfelinto, sybren, brita_, campbellbarton, moguri, lordloki

Reviewed By: moguri, lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1129
2015-04-18 21:37:59 +02:00
252b0cf5d2 Cleanup: API naming use BKE_undo_ prefix 2015-04-18 18:25:07 +02:00
38bea4e86c Cleanup: use BLO_memfile prefix 2015-04-18 18:11:01 +02:00
2c67c04226 Cleanup of MOD_quadremesh_geom.h, rename some things. 2015-04-18 17:11:34 +02:00
ce6fd8815c Cleanup, remapping of not dissolved verts. 2015-04-18 17:06:10 +02:00
986c45e8ae Optimizations to line intersection function and QREdgeList link adding, cleanup. 2015-04-18 16:22:15 +02:00
230712e6cb Autosave:
Flush edits only when saving global undo. This will stop freeing of PBVH
in sculpt mode, which introduces some pretty severe freezes, especially
in dyntopo. For global undo we flush the contents of the global undo
buffer which does not include localized edits of sculpt/edit mode, so
those data will not get saved anyway.
2015-04-18 15:50:29 +02:00
80b23d16b8 New verts-on-edge merging system. 2015-04-18 15:40:46 +02:00
4f2657bf47 BGE: New Draw debug shadow box for sun lamp
New Check option "Show Shadow Box" in shadow panel of sun lamp to get
feedback about which objects project shadows.

Minor tweaks by Campbell Barton and Jorge Bernal

Reviewers: moguri, sybren, kupoman, dfelinto, lordloki, campbellbarton

Reviewed By: lordloki, campbellbarton

Subscribers: sergey, lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1149
2015-04-18 12:30:02 +02:00
a620f8c356 Temp fix for isect_line_line_v3 not getting intersection when lines are perpendicular. 2015-04-18 08:07:52 +02:00
af8620de28 Cleanup: reordering of procedures. 2015-04-17 22:12:55 +02:00
dbabdc1724 Add mergeVertsOnEdges procedure. 2015-04-17 22:06:33 +02:00
3a4a2a9427 Fix T44390: Clay brush weirdness part-2
Use the normal of the plane instead of the vertex normal,
since projecting using the vertex normal frequently causes artifacts.
2015-04-18 05:08:14 +10:00
05b6de545a Fix T44390: Clay brush weirdness part-1
Clay brush had a feedback loop with dyntopo,
getting the plane from the cursor center didn't support original data.
2015-04-18 05:08:03 +10:00
b0c2fdd927 Cleanup: simplify sculpt normal accumulation 2015-04-18 03:09:16 +10:00
28b9a0276f Cleanup: simplify sculpt plane accumulation 2015-04-18 02:54:49 +10:00
e0aeafdf0a BGE : Fix light layer check
The layers in Blender are using a bit field for the 20 layers. The light layer value was limited to 20, so the highest usable light layer was five.
The patch modify the range and add layer out of range error messages.

Reviewers: sybren, hg1, moguri

Reviewed By: hg1, moguri

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1238
2015-04-17 18:12:51 +02:00
Dalai Felinto
394c5318c6 Bake-API: reduce memory footprint when baking more than one object (Fix T41092)
Combine all the highpoly pixel arrays into a single array with a lookup
object_id for each of the highpoly objects.

Note: This changes the Bake API, external engines should refer to the
bake_api.c for the latest API.

Many thanks for Sergey Sharybin for the complete review, changes
suggestion and feedback. (you rock!)

Reviewers: sergey

Subscribers: pildanovak, marcclintdion, monio, metalliandy, brecht

Maniphest Tasks: T41092

Differential Revision: https://developer.blender.org/D772
2015-04-17 12:25:37 -03:00
45e929dc12 Cleanup: redundant casts 2015-04-18 00:16:05 +10:00
fa0f936a64 Fix BPlayer (c) 2015-04-17 16:03:14 +02:00
3a015bb76b Depsgraph: Report total time spent on scene update
Previously was only per-thread timing.
2015-04-17 18:57:13 +05:00
15d3d8560d Cleanup: remove unused face normals
also use const
2015-04-17 23:50:23 +10:00
Dalai Felinto
80b4b43727 Code cleanup (for previous commit) 2015-04-17 10:41:31 -03:00
Dalai Felinto
cd729e9a4e Image Editor: Fix passes increase/decrease buttons
This was half-broken even in 2.74 (if you were using compositor), multiview did us the favour of breaking this for all cases (you are welcome).
It is all working now.
2015-04-17 10:38:17 -03:00
Dalai Felinto
479b669693 Fix T44336: Unable to select cycles-specific passes in UV/image editor
This approach gets rid of iuser->pass for good.

Also, I'm commenting out the pass increase/decrease. This was broken
since multiview. I will fix it later (before 2.75), but I didn't want to
get this patch mangled with that fix.

Thanks Sergey Sharybin for the review and feedbacks.

Reviewers: sergey

Differential Revision: https://developer.blender.org/D1232
2015-04-17 09:48:31 -03:00
81362c2f0c Add RNA accesible line density attribute 2015-04-17 14:05:49 +02:00
02fba106fa Dyntopo: save 4 bytes per BMLogVert 2015-04-17 18:07:08 +10:00
e05f719b8b Dyntopo: avoid redundant lookup on original data 2015-04-17 17:34:14 +10:00
50522cba92 Fix T44411: poll() function of MESH_OT_knife_project was not strict enough.
We need a 3DView region here, not only the 3DView...
2015-04-17 08:09:16 +02:00
09f2aa9382 Fix T44412: Crash when trying to paint on a GPencil frame when the frames are out of order 2015-04-17 13:32:57 +12:00
582fa5e36e Fix for Grease Pencil and negative frames
While investigating T44412, I noticed some weirdness going on when trying to
draw on frame 0 (i.e. strokes were getting added to frame 1 instead). Clearly,
this seemed like an off-by-one error related to clamping to prevent negative
frames which was also excluding frame 0.

This commit reverts the fixes made for T36831 in:
rBf18f2fbb33d90ecc91e6f3d063cb9f97f217e808

After thinking this over, I think these checks against drawing on negative
frames aren't needed. Even if the current userpref setting doesn't allow
navigating to negative frames, this may not be true for other users that
may work on the same file (in a team environment). Also, negative frame
values can get set via the dopesheet.
2015-04-17 13:02:45 +12:00
4cd37541b0 BGE: Fix for T44374 Crash when collision sensor deactivated
Don't allocate memory for sensor logic brick if it is deactivated
2015-04-17 02:12:57 +02:00
afc2f415ab Cleanup: use const for sculpt code 2015-04-17 03:11:26 +10:00
bbae0664a3 Added Support for Custom Vertex Normals to Collada exporter 2015-04-16 19:02:26 +02:00
a7cae2987d OpenGL does not like line thickness less than 1.0.
Check here is not completely correct either, we should check against
GL_ALIASED_LINE_WIDTH_RANGE and GL_SMOOTH_LINE_WIDTH_RANGE
2015-04-16 18:35:07 +02:00
6589d07c8f Action Editor: Preemptive fix for null-pointer dereference
A few weeks ago, I got a random crash while testing som edge cases
(IIRC, it was trying to assign an action with no active object),
which I haven't been able to reproduce since then. This commit though
adds some extra sanity checks here, as a user may try to assign an
action to an animdata block which did not have an action already.
2015-04-17 01:11:56 +12:00
0b691563ea Fix T44408: "Rest Length" property in the Stretch To constraint was getting clipped when using Metric Units
Increased the upper bound for the "Rest Length" property to cope with metric
units, especially when large (i.e. > 2 m) distances are involved. It may be
necessary to increase this again in the future, if even larger distances get
used (though it then starts getting a bit difficulty to justify such setups).
2015-04-17 01:11:55 +12:00
6603a10331 Cleanup: remove redundant initializers 2015-04-16 22:26:20 +10:00
69b33b6ed3 Draw smoke domain in transparent pass. Should composite smoke domains
correctly in scene - with known limitations of blending between
transparent objects.
2015-04-16 13:02:09 +02:00
eced87b2d6 Fix T44406: the Hebrew font causes trouble.
Looks like the droidsans hebrew font we used back in the days had some kerning bug or so...
Updated with latest version from Debian Testing repo, works nice now.
2015-04-16 12:37:03 +02:00
5b3d47f9c5 Cleanup of some unused code. 2015-04-16 11:15:49 +02:00
9cdb90e52f Remove medge array from gfsys, now all gfedges allocated from memarena. 2015-04-16 11:14:16 +02:00
0200636051 Add makeNormals function. 2015-04-16 11:02:03 +02:00
59db8d74b9 RNA: avoid past tense in property names 2015-04-16 16:41:12 +10:00
c5a126ee70 Docs: BLI_rand non-obvious behavior 2015-04-16 16:14:30 +10:00
8c98b1649d BGE: Fix for T42341 Sensor.frequency is badly named
"Frequency" parameter is renamed to "Skip" in the LogicBricks sensors as it represents skipped frames between pulses.

Naming something (frequency) the exact opposite of what it represents (period) was the worst choice.

Also, a new BGE python attribute 'skippedTicks' was introduced. 'frequency' attribute is maintained but deprecated.

Internally, freq variable is used yet at DNA_Sensor to maintain compability and to avoid do_versions.

Thanks to Sybren for the investigation.

{F162440}

Reviewers: campbellbarton, sybren, moguri, hg1

Reviewed By: sybren, hg1

Differential Revision: https://developer.blender.org/D1229
2015-04-16 06:39:33 +02:00
b466a82fa5 Partial fix for T44404: freestyle crashes blender.
Logical predicates AndUP1D and OrUP1D were instantiated even with an empty
list of unary 1D predicates, causing an exception in the constructors of
the logical predicate classes.

This is a regression made in b408d8af31.
2015-04-16 13:35:24 +09:00
b88421aa62 Dyntopo: avoid redundant loop collapsing edges 2015-04-16 12:24:59 +10:00
f57b904807 Dyntopo: blend vertex normals when collapsing 2015-04-16 11:59:48 +10:00
f919cd8f46 Move adding edges/polys/loops to output mesh to separate functions. 2015-04-15 23:29:04 +02:00
952aaaa573 Merge branch 'master' into soc-2014-remesh 2015-04-15 22:18:05 +02:00
de961c35ca Repair mesh caching and deleteDegenerateVerts function. 2015-04-15 22:13:13 +02:00
6675fd6b52 dyntopo: don't allocate tessfaces while sculpting
Tessellation data isn't used for drawing or sculpting.

This frees up some memory ~approx 10% in own tests.
Also slight spee-up since it avoids calculating it in the first place.
2015-04-16 04:32:16 +10:00
a91b650329 New method of obtaining mesh connectivity. 2015-04-15 20:26:26 +02:00
7f4b6a345e Fix crash loading file without scene in bg mode 2015-04-16 01:45:30 +10:00
99299da4b5 Cleanup: warnings, ws 2015-04-16 01:12:22 +10:00
34c1319d06 Cleanup: use const for event->tablet_data 2015-04-16 01:07:54 +10:00
f660085e2f Increase max brush size from 200 to 500 2015-04-16 00:59:43 +10:00
7730391d74 BGE: subclass with more than 1 argument, D1237
In the BGE you can't create a subclass with more than 1 argument like : "player = Player(owner, 10)"
I have modified the py_base_new to check only the first argument of args tuple.
Now we can do :

    class Player(types.KX_GameObject):
        def __init__(self, gameobj, life):
            print("create new player :", self, ", life :", life)

    player = Player(own, 50)
2015-04-15 22:02:16 +10:00
b9ea6fbb30 BMesh: dyntopo used lopsided normals
Normals from subdivided edges were only taken from the edges first vertex.

Interpolate between the two to give more even results.
2015-04-15 20:56:59 +10:00
240c5704e4 BMesh: Missed normal from example /w skip-cd flag
We may still want to use the normal as a reference but skip customdata.
2015-04-15 20:56:11 +10:00
255fb79ff3 Fix T44395: String untranslated in open file window. 2015-04-15 11:11:22 +02:00
730684f976 BMesh: avoid ghash lookups splitting the pbvh
This isn't a bottleneck but may as well avoid the extra ghash overhead.
2015-04-15 16:14:27 +10:00
9a711f98a7 typo in last commit 2015-04-15 15:34:06 +10:00
356ceded27 Sculpt: change behavior of crease brush
Pinch would give a flat result on either side of the stroke,
because points were dragged towards a single point.

Now pinch is projected on the sculpt plane, which gives a tighter crease.
The reverse is true too - blob brush which shares the code is also more curved.
2015-04-15 15:27:27 +10:00
b216f7abd6 RNA: use lock_ prefix for booleans 2015-04-15 14:51:17 +10:00
d8b5d11019 Big cleanup of MOD_quadremesh_geom(.c/.h) files. Disable modifier in edit mode for now. 2015-04-14 18:37:04 +02:00
Julian Eisel
9b9978656d Fix T44389: Tooltips swapped in Logic Editor 2015-04-14 17:24:55 +02:00
Dalai Felinto
2d33057c75 Multiview: compositor openexr multiview images fully working
This is from my original missing-bits/TODO list.
Basically multiview openexr was only working when multiview was on.
2015-04-14 12:19:11 -03:00
Dalai Felinto
66e2fc39ce Fix T44343 Compositor image node cannot properly load multilayer EXRs 2015-04-14 11:21:01 -03:00
f1355d0b45 Second round of hair random rotation limited to 180 degrees
This time roll back to originally discussed in the code review page approach
with simply bumping UI range for the property.

It's still not totally free from forward compatibility breaking (which is
already broken comparing to previous release) but at least it'll keep files
working inbetween of git blender versions in cases random factor was not
set above 2.0.

Differential Revision: https://developer.blender.org/D1214
2015-04-14 19:04:12 +05:00
f1e1ec2d8d Action Editor: Make the warning on unlinking actions a bit less intrusive
venomgfx was complaining that having it do the popup everytime was too intrusive,
so demoting it to just showing the warning in the header.
2015-04-15 01:19:38 +12:00
eb9a0944e0 Add InputMesh and OutputMesh structures for clarity. Cleanup. 2015-04-14 13:36:17 +02:00
04daaee0fd Fix T44385 SSAO inverted with new Intel drivers.
Intel has decided to fix this for newer devices and drivers only, so we
can't really avoid keeping a list of buggy drivers here.
2015-04-14 12:31:23 +02:00
ed40d5eaa7 Add flag that prevents editing of markers. Can be located in marker
menu.

When active, all editing operators for markers will not fire up.
2015-04-14 12:12:17 +02:00
68eeeea57e Dyntopo queue added the same edges multiple times
Use tagging to avoid re-evaluating the same edges while sculpting.

While gives only minor speedup,
it allows for changes to the queue without additional redundant checks.
2015-04-14 18:56:49 +10:00
7daa921359 BMesh: avoid customdata copy for new dyntopo verts 2015-04-14 18:41:01 +10:00
d36429b930 initialize members in-order 2015-04-14 18:41:01 +10:00
825b015e92 Fix T44348: Blender crashes when selecting bone from inactive scene in outliner
Pose is not guaranteed to be existing in object, so can't be used for selection
flag clear. Use bones themselves for that.
2015-04-14 13:25:25 +05:00
8486ee39bd PBVH: use realloc/recalloc 2015-04-14 17:58:07 +10:00
34d4ad326c Animation Editors: Name filter now updates as you type, making it a true "live search" 2015-04-14 18:50:15 +12:00
1e488802dc NLA: The "filter by name" functionality now works with NLA strips too 2015-04-14 18:39:09 +12:00
bb1bc7ecda NLA: Store track that the strip being tweaked comes from
There should be no functional changes visible from this change, but this commit
should make it easier to code tools which need to check on tweeakmode status,
by making it easier to figure out which NLA Track contains the strip which
owned the action being edited. (The strip is already saved, so this commit just
adds the track alongside it).

For now there is no version patch for this. The worst that happens is that an
extra refresh is needed in the NLA editor to get these to show up.
2015-04-14 18:39:07 +12:00
c95f38b92a Fix for another NLA drawing bug uncovered by the previous commit
With multiple strips in tweakmode, only the one tagged as being "active"
would get drawn in the correct colours, while all the others would just
get drawn as a selected strip instead.
2015-04-14 18:39:05 +12:00
5361339ba0 Temporary fix for NLA strips not getting drawn in tweakmode with multiple strips selected
When entering tweakmode on multiple strips (from different AnimData blocks)
simultaneously, only the track containing the last selected strip would be
shown. All the other tracks with strips being tweaked would not appear at
all.
2015-04-14 18:39:03 +12:00
097801e701 NLA: Shift-Tab toggles tweakmode AND makes that track solo
To help make it more convenient to edit stashed actions, Shift-Tab
(i.e. holding down the Shift key, which "tabbing" into tweakmode as
usual to edit the action referenced by the active NLA strip) now flags
the NLA Track that the strip occupies as being "solo" too.

This allows you to use the NLA to select a stashed action, then Shift-Tab
to start editing it without any other actions in the NLA stack interfering.
Like the "Next/Previous Layer" tools in the Action Editor, this is designed
to help with checking on stashed actions.
2015-04-14 18:39:02 +12:00
d841b75c5f BMesh: avoid redundant face-exists check (dyntopo) 2015-04-14 15:27:27 +10:00
6fb0563aee BMesh: optimize BM_face_exists
Avoid flagging/clearing flags,
just walk over the face until a mismatch is found.
2015-04-14 15:27:08 +10:00
c448196bb4 Cleanup: warnings 2015-04-14 10:34:32 +10:00
af2f4724d5 Cleanup: don't use single sets for comparisons 2015-04-14 10:34:32 +10:00
Dalai Felinto
2bceb3ae18 Fix for *harmless* T44342 Error when saving multilayer EXR
This was introduced with multiview, and it was an oversight on my end.
There is no error, we simply was never returning True
2015-04-13 19:56:56 -03:00
61a891deea Initial stuff for making polys. 2015-04-14 00:43:46 +02:00
50b67632ea Add meshing step.
For now, only generates edges (not polys), but basic functionality is there.
2015-04-14 00:03:43 +02:00
54c18d4849 Fix T44362 no easy way to repeatedly duplicate keyframes in action
editors.

Reporter used a hacky work-around by placing cursor at end of keyframe
range and doing ctrl-C ctrl-V repeatedly. This was working on 2.73 but
not anymore since the old selection is not kept.

Much better is to have duplication operator be repeatable. This commit
takes care of that.
2015-04-13 23:58:50 +02:00
27ded012d6 cleanup: style
to match my earlier commit in temp_viewport_fx_merge branch
https://developer.blender.org/rBc3f3b958dc0b

plus more

no functional changes
2015-04-13 16:56:43 -04:00
057c7c6fab Cleanup: do not use _reportf() when not doing any string formating!
Also usual minor i18n messages stuff...
2015-04-13 21:00:45 +02:00
Julian Eisel
86fe894f86 Moar precision for Color Stop position slider in Color Ramps
Normal dragging now uses a precision of 0.01 instead of 0.1, shift+dragging now uses 0.001. (0.1 steps can still be done using ctrl)

Requested by @venomgfx
2015-04-13 20:31:40 +02:00
f0c8b2a092 New generateMesh procedure. Cleanup of unused local vars. 2015-04-13 19:49:42 +02:00
d814ed7757 Cleanup of MOD_quadremesh_geom.h file. 2015-04-13 19:41:28 +02:00
9a2ea15cdb New addSegmentToLine procedure. 2015-04-13 19:25:30 +02:00
aed97c9efb Fix bug with autonormalization and transform (after own range commit).
Transforming the center after transforming a handle would continuously
flush an extra offset to the handles.

Also use normalization range of -1.0 to 1.0 instead of -0.5 to 0.5 (not
really important, just for better comparisons)
2015-04-13 18:37:15 +02:00
cae23bab6b Fix for crash with non-camera as a camera 2015-04-14 01:00:07 +10:00
f27e0b7c5e After user feedback:
* Allow ctrl click to do negative stroke in line strokes
* Use alt for angle constraints.
2015-04-13 16:31:06 +02:00
4ce437fff0 Revert "Fix hair random rotation limited to 180 degrees"
This reverts commit 176ed5bfe2.
2015-04-13 19:16:54 +05:00
198ca57ae4 Graph editor:
Normalization feature now uses the full range of the data instead of
just one semiaxis for the maximum size.
2015-04-13 15:57:57 +02:00
29d903933c Change GFLine implementation.
GFLine now manages directions, and it's interface is cleaner.
2015-04-13 15:55:03 +02:00
8ad37b0d22 Fix T44359: mesh_normals_loop_custom_set() would not behave correctly with zero-normals.
Zero-normals here are used as a shortcut to say 'use auto-computed values'.
So we have to do so in pre-process steps!
2015-04-13 15:44:09 +02:00
17a9b05b9d Fix T44350: View3D layer out of sync /w scene 2015-04-13 23:10:43 +10:00
41350a91b5 Workaround T44351: Scopes make editmesh lag
Scopes are very heavy to calculate and editmesh uv's can cause the image view to redraw.

Best just disable scopes in this case.
2015-04-13 22:44:08 +10:00
364b6b29ff New operator for action and graph editor that centers around current
scene frame, bound to numberpad zero.
2015-04-13 14:30:24 +02:00
d1f9fcaabc Cleanup: style 2015-04-13 22:08:51 +10:00
d2da8aa27a BMesh: resolve skinny face artifacts /w dyntopo
Dyntopo can currently create skinny faces,
especially when the faces are much larger then the resolution.

To get the old behavior, set debug value to 1234
2015-04-13 21:25:39 +10:00
a50955ee0f Minor edits of python class documentation (regarding ID tagging) 2015-04-13 13:22:55 +02:00
8c616e86b5 Calculate auto normalization maximum from keyframes within range if
preview is on
2015-04-13 12:44:06 +02:00
fdc653e8ce Nodes: Remove hardcoded BLENDER_MAX_THREADS number of threads
Use actual available number of threads now, which will make it easier
to increase max number of threads, without having some sloppy memory
usage and without doing some redundant checks on thread data which was
never used.
2015-04-13 15:40:44 +05:00
efe90384b7 Be a bit more specific in the message. 2015-04-13 12:28:12 +02:00
8a97d46296 Windows:
Only print backtrace on debug builds, since on release builds there is
only some useless output from a python library and fftw.
2015-04-13 12:21:32 +02:00
97ae0f22cd Depsgraph debug: Remove hardcoded array of BLENDER_MAX_THREADS elements
Allocate statistics array dynamically, so increasing max number of threads does
not increase sloppyness of the memory usage.

For the further cleanups: we can try alloca-ing this array, but it's also not
really safe because we can have quite huge number of threads in the future.
Plus statistics will allocate memory for each individual entry, so using alloca
is not going to give anything beneficial here.
2015-04-13 14:41:02 +05:00
890e533c76 Fix adding to paint-curves from the first point
- add_index now works when selecting the first point.
- sliding now selects the correct handle.
2015-04-13 19:30:43 +10:00
Mai Lavelle
176ed5bfe2 Fix hair random rotation limited to 180 degrees
The issue was caused by phase being limited from 0 to 1, which gave only
0..M_PI distribution which is not good enough for good randomness.

Now the phase is being randomized across full 0..2*M_PI range.
2015-04-13 14:17:00 +05:00
6fbf05f326 Make python gotchas more clear (regarding handling of stale data) 2015-04-13 11:00:22 +02:00
4fb33d82e2 Fix T44361: array modifier "fit curve" mode not working properly
'tot_length / step_length' gives the number of 'segments', not the number of
copies - we have to add 1 here.
2015-04-13 10:51:04 +02:00
f684dfc432 Fix T44364: Remove shape key crashes Blender 2015-04-13 15:54:37 +10:00
dd0cba0076 error in last commit 2015-04-13 15:46:27 +10:00
919de1e4c9 BMesh: diagram for dyntopo edge subdiv 2015-04-13 15:43:25 +10:00
9b359c1592 Py API: default arg for location_3d_to_region_2d
This function could return None for points behind the view,
note this in the doc-string and add an optional fallback argument.
2015-04-13 14:35:16 +10:00
e688ba0304 GHash: use unsigned int for ghash_size 2015-04-13 13:45:48 +10:00
55b7a8c027 ndof: fix Linux device detect regression 2015-04-12 19:58:17 -04:00
31a6d79b10 #if 0 not needed code 2015-04-13 00:30:39 +02:00
214751107c Delete GFMesh and related stuff. Cleanup. 2015-04-12 23:01:31 +02:00
e4f5992544 Adapt sampling distance function routines. 2015-04-12 14:29:08 +02:00
c950b8f289 making add>lamp its own menu so it can be extended by addons 2015-04-12 11:38:18 +01:00
a69dc9f122 Use defines for algorithm parameters. 2015-04-12 11:33:05 +02:00
542a0c41d2 Dyntopo: redundant length check subdividing edges 2015-04-12 19:14:28 +10:00
690b90f1e2 BMesh: minor optimization counting adjacent data
add BM_***_count_is_over(), _count_is_equal()

Useful if we only want to know if the count is a smaller value.
2015-04-12 17:38:14 +10:00
6d2c3a2456 BMesh: avoid ghash realloc's making log entry 2015-04-12 17:38:14 +10:00
Julian Eisel
f50fed6a6d Reset view after ctrl-clicking a Panel
Using ctrl+LMB to collapse all panels except of the clicked one resulted
in an empty area if done from a view that is scrolled down to some
degree. Resetting the view makes this much better, although it still
doesn't work that well if the area is really small, but I don't think
it's worth over-complicating things here.

"Feature-Request" by @maxon ;)
2015-04-12 08:07:34 +02:00
17b4f57bf0 Missed this last commit (dyntopo hashing) 2015-04-12 11:12:57 +10:00
87b6d3c796 BGE: Add keyword arguments to createConstraint API
Added keyword arguments to createConstraint.
Changed initial values for the pivod XYZ  form 1 to 0.0.
Changed initial values for the axis Z form 1 to 0.0.
Delete the parsing for 4 parameters, because parsing only the X pivot is not necessary, also it was not working correctly (int instead of  float).

Reviewers: brita_, sybren, lordloki, campbellbarton, moguri

Reviewed By: lordloki, campbellbarton

Subscribers: campbellbarton

Differential Revision: https://developer.blender.org/D705
2015-04-11 16:17:07 +02:00
b329016b29 BGE: FIX T43537: ImageMirror does not work in BlenderPlayer with quad buffer
In quad-buffer stereo mode, the GE render pass ends with the right eye on the right buffer, but we need to draw on the left buffer to capture the render.

Reviewed By: agoose77, HG1
2015-04-11 16:08:15 +02:00
a6421e1291 BMesh: intersect was using ptr hash for int keys 2015-04-11 23:41:10 +10:00
ccf44c400c BMesh: simplify hashing for dyntopo
Was using pointer hashing when the keys are in fact uint's.
Since they're well distributed from the rangetree,
no need to do bit-shifting tricks. just use int as hash.
Gives ~8% speedup in own tests.
2015-04-11 23:36:37 +10:00
7447a0173c Remove splash link to support gooseberry
Was included only for initial campaign.
2015-04-11 19:41:31 +10:00
45c3d08a7e Cleanup. Repair of QR_SHOWQUERIES flag. Repair of addPointToLine. 2015-04-11 04:21:30 +02:00
25139d067c Improve clarity of nextPoint function's result 2015-04-11 00:50:02 +02:00
b49cfb9794 New uniform sampling routines.
Now lines can be checked at given intervals instead of intersection points
2015-04-10 23:25:49 +02:00
465a5d29c0 BGE : Fix T43800: getScreenVect()/getScreenPosition()/modelview_matrix returns incorrect results
The getScreenVect(), getScreenPosition() and modelview_matrixmethod returns an incorrect results if called after the camera has been translated on the same frame.
The model view matrix will be update only once per frame with Cam->SetModelviewMatrix in KX_KetsjiEngine::RenderFrame.
Using GetWorldToCamera as model view matrix to get an actual view matrix even if the camera is moved.

Reviewers: sergey, dfelinto, brita_, sybren, hg1, campbellbarton

Reviewed By: hg1, campbellbarton

Projects: #game_engine

Differential Revision: https://developer.blender.org/D1170
2015-04-10 20:20:52 +02:00
35812e65f4 Cycles: Fix compilation error on windows after recent logging changes 2015-04-10 22:35:10 +05:00
d850fd8244 Disable strict flags for msvc 2015-04-11 00:43:15 +10:00
Dalai Felinto
02a5cf75a2 Fix for debug-only crash when setting "Any" keymap input type
Another one of those assert crashes when passing values != than 1 and 0
(in this case the value is -1)

Notes from reviewer:
--------------------
These should really be enums. since valid values are KM_ANY,
KM_MOD_FIRST, KM_MOD_SECOND.

But can see at some point this was changed from an enum so... I guess
this is the only way.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1227
2015-04-10 11:10:10 -03:00
f75bbe27e2 Thumbnails: Add translations to font preview.
Not much to say, this is pretty straightforward.
We just have to add current locale to thumbnails 'signature', so that
previews get re-generated when we change locale...

Tested with Japanese and French.

Btw, I do not really understand why using BLF in ImBuf is badlevel... :/
2015-04-10 15:34:31 +02:00
8a99dc2324 BLF translation: fix BLF_lang_get(), add UI-agnostic BLF_translate/_do helpers.
BLF_lang_get() shall return 'default' Blender locale (en_US) when translations
are completely disabled!

Also, add BLF_translate() and BLF_translate_do() to allow translating some strings
outside of label/tip context, but still only when i18n global flag is enabled.
2015-04-10 15:34:31 +02:00
a36c43fc8c Thumbnails: some reorganization, decouple actual path of file to preview from 'ref' one.
(Partial) backport from asset-experiments branch.

Reorganization: previously we could recompute name/path of thumb file two or three times,
now added lower-level internal functions that take those as parameters, so in most case
they are computed only once. Very minor optimization, but simple too.

Also, path of file to preview is now decoupled from path used to generate its URI
(and hence thumbnail path). In asset-experiments branch this is needed because
we also handle datablock previews in/as thumbnails (file_path is .blend path,
URI is .blend path + datablock 'path').

Here this will be needed for same kind of reason - once translated, font thumbnails
need to be re-generated when we change current language...
2015-04-10 15:34:31 +02:00
ec710775cf Use off_t for filesize (was int)
Resolves finding >2gig files.

Also enable strict flags.
2015-04-10 22:06:28 +10:00
b0906bcc5e Cleanup: remove win32 workaround 2015-04-10 22:06:28 +10:00
aac0df956f Cycles: Cleanup, make more clear what camera utility functions are private/public 2015-04-10 16:25:35 +05:00
085fa2e3d7 Fix T44329: Second part: prevent 'cachebuffer' and 'fullOSA' in preview renders. 2015-04-10 13:17:08 +02:00
711a5c79d8 Don't use vertex colors in textured mesh display during texpaint.
Wasn't that irritating?
2015-04-10 13:05:32 +02:00
e073562f80 Cycles: Make transform from viewplane a generic utility function 2015-04-10 15:53:14 +05:00
237c53fbf1 Only selected keys will get cleaned by the action and graph clean
operators
2015-04-10 12:45:13 +02:00
2f5dd83759 Cycles: Add some statistics logging
Covers number of entities in the scene (objects, meshes etc), also reports
sizes of textures being allocated.
2015-04-10 15:37:49 +05:00
1e71270f77 Fix T44329: Blender Crash when rendering in 3DView.
This commit fixes two different issues actually:
* When view name is unknown/irrelevant, you should pass a NULL str pointer to
  `RE_RenderLayerGetPass()`, not an empty string!
* `render_result_rescale()` would unconditionnaly free re->result (at the end),
  even if it did not replaced it at all, leading to freed memory access later.

This is only a partial fix though, "CacheBuffer" (i.e. saving tiles in EXR files)
shall not be used in 3DView rendering, and yet it is here...
2015-04-10 12:32:19 +02:00
253d15ea16 Move clean operator from action/ipo editors to the delete menu, now that
O key is bound to proportional editing.
2015-04-10 11:56:18 +02:00
11a48b7227 Python API docs, don't hard-code sphinx themes
also set the theme to classic (as it was for 2.73)
2015-04-10 15:49:07 +10:00
40334b4920 missed last commit 2015-04-10 13:44:26 +10:00
31d354dfa3 rename _ipo -> _fcurve 2015-04-10 13:41:57 +10:00
f2452bc9ab Test: blacklist loading addons /w known problems
The test now runs without warnings
2015-04-10 12:08:23 +10:00
Dalai Felinto
52f511269b Multiview: remove option to preview the selected stereo 3d mode and error when quadbuffer not supported
This was causing glitches when switching from/to fullscreen modes (e.g.,
side by side to anaglyph).

As for the quadbuffer errors this is part of a more complete solution to
be committed later.
2015-04-09 20:44:03 -03:00
Dalai Felinto
33028d17a0 Multiview: fix crashes with pageflip mode - by Cédric Paille (cedricp) 2015-04-09 15:22:53 -03:00
866532360c Fix T31546 fragment program gets created every frame
That was really crappy indeed. Now we have a separate API
for low level OpenGL programs, plus a nice interface for GPU, also
removes some GL calls from main code as a plus :)

The source for the programs is also moved to nice external .glsl files
(not sure which extension convention GPU assemply uses)
2015-04-09 20:20:50 +02:00
7ea4163e1e Cycles: Fix BVH counter on mesh updates 2015-04-09 22:23:59 +05:00
851ea206d0 Separate proportional editing options for graph and action editor. 2015-04-09 18:30:14 +02:00
cca4405437 Cycles: Fix wrong render result in certain configuration of render layer's surface/hair
There were some synchronization missing in cases when only one of those settings
was disabled.

Also added a render test for such configurations now.
2015-04-09 21:22:48 +05:00
ae5f2c2025 Fix regression after multiview, basically we appended the wrong frames
to movie file.

We have to resort to use crappy workarounds with preview arguments again
since preview range is only for OpenGL preview.
2015-04-09 18:02:43 +02:00
b30a2fe3f4 Fix T44322: Crash when trying to render spotlight halos.
Trying to access rl's from full samples in non-full-OSA context (with uninitialized
sample index even :P ).

Caused by rBd5f1b9c2, probably a copy/paste typo or so.
2015-04-09 16:32:45 +02:00
4cadbb03a8 Seriously... Fix building! 2015-04-09 16:17:51 +02:00
5197aa04c6 Fix part of T44320 selecting islands can fail.
Issue here is simple and has been fixed in other places such as
texpainting: Basically if face has different winding, do not calculate
it as adjucent to the other face, even if UV is identical.

This allows us to stack islands of symmetrical closed meshes on top of
one another and still be able to select the two identical island halfs
(provided the normals are correct of course).
2015-04-09 16:12:43 +02:00
d687428122 Error in own last commit 2015-04-09 21:23:21 +10:00
8a1c444c93 Disable proportional editing when duplicating keyframes 2015-04-09 12:49:06 +02:00
9749b2cb81 Fix partial image update during rendering
Was broken since 5d212fb.
2015-04-09 15:33:44 +05:00
d75bfdfafc Fix T44308 painting in 2D editor offset by one pixel.
Not sure why this was so in the first place but changing it seems OK.
2015-04-09 12:18:51 +02:00
a1b702aa38 Add seed's vertex only after checking if the line will exist. Change allocation block sizing. 2015-04-09 11:56:46 +02:00
8732c1a8b7 WM: allow 'save as' to path set by operator
Invoke assumed the filepath was never set.
Scripts couldn't invoke save-as at a custom location.
2015-04-09 19:49:05 +10:00
cc6e0b7394 UI: Extend preset menu
- allow for preset menu to change operator defaults.
- allow preset menu to select own kinds of file extensions.
2015-04-09 19:10:00 +10:00
bdad2c0595 Fix uninitialized var use reading view prefix 2015-04-09 17:30:26 +10:00
55ee436618 Fix missing NULL checks 2015-04-09 17:23:51 +10:00
089fc24c76 Fix for passing -1 to close() 2015-04-09 17:21:17 +10:00
5467260ce9 Cleanup: redundant NULL checks 2015-04-09 17:20:02 +10:00
0b59865115 Fix missing NULL check 2015-04-09 17:09:10 +10:00
1b72ad0c3d GHOST: don't instantiate assert arg
When debugging is disabled, function calls in an assert should never run.
2015-04-09 13:55:46 +10:00
12661de087 Remove invalid assert 2015-04-09 13:00:58 +10:00
1b7db84343 Cleanup of old code, new code in working state 2015-04-08 22:40:52 +02:00
aa24704749 Fix T44235: UNC Path Fails in open.
Here again, stat on '\\MYSERVER\foo\..' does not work...

Anyway, we can handle this in a much much simpler way using
BLI_access and BLI_parent_dir...
2015-04-08 21:59:05 +02:00
114d1b23d2 Fix T44113: Some System Folders do not contain go back arrow.
On windows empty dirs are completely empty - no par or current entries
are listed either, in those cases artificially add those.

Furthermore, stat on UNC paths do not support current/parent 'shortcuts'
(i.e. things like '\\SERVER\foo\bar\..' do not work), so we have to hack
around that mess...

This should ensure us we always do have valid parrent entry...
2015-04-08 21:59:05 +02:00
Dalai Felinto
5d212fb812 Fix T44310: Other render slots cleared after each render 2015-04-08 16:17:56 -03:00
0a304337e1 Freestyle: Fix for AndBP1D and OrBP1D not working due to typos.
Problem report by Folkert de Vries (flokkievids) through personal
communications.  Thanks!
2015-04-09 00:29:07 +09:00
c523e82e31 Particles: Fix for missing particles in render if they're disabled for viewport
The issue was introduced in rB4b685e1 and it appears some crazy area still
accesses particles for render after deleting it's render data, which broke
viewport/render behavior.

This commit restores previous G.is_rendering logic and adds corresponding
checks to cache construction, so counting is all consistent.

Goes to the TODO list to either replace G.is_rendering with eval_ctx or to
make it so psys->renderdata always exists during render sync.
2015-04-08 20:17:44 +05:00
2d05466700 Fix T44213: Bevel object from different scene won't update generated bezier curve geometry
The issue was caused by bevel object being automatically added to the scene graph
by dag_get_node() and had no incoming relations, even form the scene. This confused
scene update flush logic.

Now there'll be a scene relation added to such nodes, so they're always reachable
from the root node.
2015-04-08 20:06:42 +05:00
62f863b78a Fix memory leak in bump GLSL node 2015-04-08 16:48:15 +02:00
7fcb0bf71e Attempt GLSL compile fix in opensuse linux basically, we passed a vec3
as a float.
2015-04-08 16:30:45 +02:00
bf11e362c5 Fix T44046: Cycles speed regression in 2.74 (CPU only)
Issue was caused by MSVC not being able to optimize some code out in the same
way as GCC/Clang does, so now that parts of code are explicitly unfolded in
order to help compilers out.

This makes speed loss much less drastic on my laptop. That's probably as good
as we can do with MSVC without investing infinite amount of time looking trying
to workaround the optimizer.
2015-04-08 18:47:25 +05:00
2c91f9dc11 Transform: use relative motion for vertex slide
Vertex slide was using absolute mouse position unlike all other kinds of transform.

also remove need for allocated 2d projections.
2015-04-08 23:01:38 +10:00
01b1eb445c Math Lib: add project_plane_v3_v3v3
Useful for projecting one vector onto another (as a plane).

This is a rather common operation,
doing inline isn't always obvious whats happening.
2015-04-08 23:01:37 +10:00
d249db9755 Action editor proportional editing:
Fix crash when extending instead of translating
2015-04-08 14:36:25 +02:00
3b440dbf66 FileBrowser previews: Get rid of ugly, stupid and confusing 'FILE_TYPE_ICON_MOVIE' hack.
Was only handling failures in video thumbnails, was confusing (giving two different types
for video files, *sigh*), and... useless, since thumbnail code already handles smartly
failures in preview generation!
2015-04-08 14:31:49 +02:00
c5c60099c5 Proportional editing in action editor: display circle in center of
region.

It's -really- hard getting the center of selection here in the y axis, I
feel this is the best compromise.
2015-04-08 14:31:11 +02:00
40984f6c86 Fix annoying warning in GHOST when ASSERT_ABORT is off 2015-04-08 13:00:46 +02:00
235f1feaf4 Fix opengl render preview in image editor broken
During multiview, invalidation of the display imbuf of the preview image
was eaten by code eating elves.
2015-04-08 12:49:54 +02:00
7621ff7e55 Cycles: Code cleanup, indentation. Was wrong in the multiview commit 2015-04-08 15:35:01 +05:00
bb19c7c3f7 Forgot this last commit. 2015-04-08 12:02:23 +02:00
d6d4d5e094 Fix multiview issue: play animation crashes
We need to avoid passing a NULL string here, and also we need to pass
the correct suffix we used to pass view string directly which is
probably not what we want.
2015-04-08 11:53:14 +02:00
a18e5d6a67 warning: unused 2015-04-08 16:26:58 +10:00
ab2a8832dd Use IS_EQF for floats 2015-04-08 16:20:53 +10:00
Dalai Felinto
60ecc6b3b3 Multiview: Expose current drawn eye to API (viewport only) 2015-04-08 03:12:45 -03:00
45e2366148 Cleanup: remove unused defines 2015-04-08 15:09:20 +10:00
Dalai Felinto
796b17b843 Multiview: Fullscreen modes (sidebyside/topbottom) were not working
* WM_window_is_fullscreen() is not the correct test.
* Also, we no longer change window to fullscreen automatically.
2015-04-08 02:02:59 -03:00
f5648f6db9 BGE : Fix T36285 Wrong viewport scale.
Fix of T36285, I just invalidate projection matrix when a camera switch
to viewport mode, because we need to rewrite the projection matrix in
RenderFrame.
It worked with old blender version because when you use viewport render
one camera is added in the camera list and initialize its projection
matrix for the first time. But when we used several cameras + viewport
for splitscreen we had issues.

Reviewers: dfelinto, hg1, ben2610, lordloki, moguri

Reviewed By: moguri

Projects: #game_rendering, #game_engine

Differential Revision: https://developer.blender.org/D1202
2015-04-08 06:56:17 +02:00
441f68e2b0 Partial fix for T44219
Prevent crashes from out of bounds array access if an invalid rotation mode
is passed to the euler rotation blenlib calculations.
2015-04-08 14:34:07 +12:00
1492db09d1 Partial fixes for issues raised in T44219
* The breakdowner tool will no longer operate directly on properties
  of type "enum", as this doesn't make sense most of the time. This
  is still not much use though when custom properties (ints) are used
  to drive some underlying enum property though (as in blenrig)
* The breakdowner no longer tries to perform any blending if the
  start and end values are the same, to avoid float precision issues.
2015-04-08 14:34:06 +12:00
808ea6271a Cleanup: confusing if statements & alignment 2015-04-08 12:24:52 +10:00
ccfb9a96c3 CMake: resolve linking error on Linux
Since multiview, matrixGlyph failed to link
2015-04-08 11:50:57 +10:00
8c539b0ab5 Font preview for file browser
D1002 by @plasmasolutions, with own refactoring.

Note, needed to do a bad-level call here (IMB -> BLF)
Also can't use the BLF API directly because its not thread-safe.
So keep the function isolated (blf_thumbs.c).
2015-04-08 10:38:19 +10:00
c56c493cf4 BLF: use regular unsigned int's
So GL isnt needed to include BLF types.
2015-04-08 10:30:18 +10:00
a2ea4ce70d Cleanup: IMB/thumb naming 2015-04-08 09:55:02 +10:00
a57b898d17 BLF: Fix clamping drawing into byte buffer 2015-04-08 09:55:01 +10:00
Julian Eisel
7e52d810f3 Muliview: Minor UI-tweaks
* Don't grey multiview options in file browser and in Node Editor Properties out if multi-view is disabled, hide them completely (I think greying out single buttons is fine, but in case of entire blocks we should just hide to save space)
* Move multiview settings in Node Editor Properties above alpha settings to prevent the alpha buttons from appearing above multiview settings if multiview is enabled and Stereo 3D format is chosen (making them appear below is much nicer)
2015-04-08 00:41:37 +02:00
796c3c7748 Fix T44290: Clear users & fake-user conflict
The purpose of clearing users in this case is not to save the data,
so keeping fake-user doesn't make sense.
2015-04-08 06:50:38 +10:00
c89637be30 BGE: use tuple for returning display size 2015-04-08 06:28:05 +10:00
09a746b857 Cycles: Cleanup, typos 2015-04-08 01:15:38 +05:00
Dalai Felinto
cc9c049ff7 Multiview: compositor - avoid trashing image viewer views/buffers when multiview is off
I found this while investigating why the backdrop shows 'blank' while I
update a node influence factor. This problem still persist, but maybe it
was there before multiview. In release it is not noticeable, but in my
debug build is quite evident.
2015-04-07 16:56:31 -03:00
Dalai Felinto
4c2306d21a Multiview: compositor was not updating when multiview was off 2015-04-07 16:38:21 -03:00
c1e5d966c6 Proportional editing support for the action editor.
There are a few things here which are not so nice:

* Position of proportional edit circle is not centered on data
(difficult to predict positions here since those are completely custom,
 will probably be positioned at center of area later instead)

* Result is flushed to curve handles only at the end of the transform,
so if people have the graph editor open they will see handles lagging behind.
2015-04-07 20:49:47 +02:00
Dalai Felinto
662c2cd910 Multiview: update Set Stereo 3D menu when the selected stereo mode changes 2015-04-07 15:43:06 -03:00
858f54f16e Cycles: Cleanup, indentation 2015-04-07 22:41:08 +05:00
e36b0cb8f3 BGE: New API method getDisplayDimensions
This patch adds a new API function to get the actual display dimensions in pixels.

Reviewers: dfelinto, sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Differential Revision: https://developer.blender.org/D648
2015-04-07 18:32:25 +02:00
f9f3c29a3a Fix crash when changing proxy storage type for editing (was own
stupidity casting from Scene to Editing in RNA)

Move versioning for proxy storage to multiview version check (not really
correct but it was orphaned before and it doesn't hurt either).
2015-04-07 16:08:46 +02:00
Julian Eisel
cc78664d50 Revert Sticky Keys (and everything related to that)
Our current keymap doesn't give us enough room to make such changes in
the event system. To fix small issues caused by this, we would need to do
drastic changes in Blender's keymaps and internal handling. It was worth
a try, but it didn't work.

I can write down a more descriptive statement in a few days, but for now
I need a break of this stuff.
2015-04-07 14:13:20 +02:00
d60ff6c112 Fix for own last commit
resolved bug but wasn't correct
2015-04-07 20:27:08 +10:00
34818a44b2 Make image strips also follow the project directory storage options. 2015-04-07 12:15:18 +02:00
20a780e3e8 Fix T44258: Can't select similar regions 2015-04-07 19:56:24 +10:00
4b685e1b90 Fix T44268: Particles: too many virtual parents + non-100 display% = crash
Issue was caused by mismatched logic in counting child/parent particles in
job initialization and actual job execution. Confusion here came from mixed
usage of psys->renderdata and G.is_rendering.

We need to get rid of G.is_rendering and use eval_ctx if it's really needed,
but we also might just use psys->renderdata check since it's expected psys
to have this structure anyway.
2015-04-07 13:52:42 +05:00
98f4106694 Metaball tessellation optimization (Octree to BVH)
Speedup is non-linear, 2x-10x faster is quite normal.
Patch T43678.

- Switched from an Octree to BVH.
- Finding first points of surface no longer "wastes" density function evaluation: every result is cached.
- Use MemArena instead of using own memory management.
- Correct calculation of metaelem bounding box.
- Remove mball_count(): mballs are now counted "on the go".
2015-04-07 13:19:50 +10:00
2cd0a07e34 Initial changes to the remesher. 2015-04-07 05:02:54 +02:00
9510137d12 Cleanup: brace placement /w structs 2015-04-07 11:25:42 +10:00
e2eeb46a1b Cleanup: rename treehash -> outliner_treehash
This is an API specifically for the outliner,
not some generic hierarchical hash structure.
2015-04-07 11:01:47 +10:00
5217d2bc0e Use BKE_edgehash_ensure_p where possible 2015-04-07 10:53:58 +10:00
808de65d91 EdgeHash: ensure function, avoids multiple lookups 2015-04-07 10:53:20 +10:00
1b9f1519bc Cleanup 2015-04-07 08:46:48 +10:00
Julian Eisel
3dcdacffca This commit doesn't deserve a title
Today just wasn't my day...
2015-04-06 23:23:13 +02:00
d3388f0c7a Fix compilation error in Win Debug. 2015-04-06 23:17:18 +02:00
Julian Eisel
bcc9a23548 Various Sticky fixes (tm)
* Revert 776bfa64a5 and c3dad7953a (some X11 systems are doing
stupid things forcing me to do an extra check that completely breaks the
click type handling on other systems using the slightly changed
implementation from those commits - see T44278)
* Fix sample lines in Compositor+VSE

(And yes, this time I tested on both of my systems to make sure
everything is fine)
2015-04-06 23:10:21 +02:00
33a9247334 UI i18n cleanup...
And some general style cleanup as well (line length...).
2015-04-06 22:06:06 +02:00
e2354e64d2 Cycles: Cleanup, spaces around assignment operator
Did some bad spacing in recent commits, better to get rid of those so
they does not confuse those who're working on sources.
2015-04-07 00:25:54 +05:00
c1d8ddacaf Cycles: Avoid doing paranoid checks in filepath of builtin images
Originally we thought it's needed in order to distinguish builtin file from
filename which starts with '@', but the filepath is actually full path there
and it's unlikely to have file system where '@' is a proper root character.

Surprisingly this does not give visible speed differences, but it's still
nice to get rid of redundant check.
2015-04-07 00:11:47 +05:00
7c19239bf9 Cycles: Support bultin 3d textures with OSL backend 2015-04-06 23:29:29 +05:00
2aa79679dc OSX: add also license for iomp5 using cmake and fix all textfiles wrong destination 2015-04-06 19:55:51 +02:00
28e9058e7a OSX: add a license file for libiomp5 ( intel omp ) when compiled with 2015-04-06 19:12:23 +02:00
593b4d84c4 BGE: followup of renaming parameter "other" to "reference"
See commit 3e5332bb95
2015-04-06 18:23:56 +02:00
3e5332bb95 BGE: fixed nomenclature of KX_Scene::addObject and KX_Scene::AddReplicaObject
KX_Scene::addObject: Changed the parameter "other" to "reference", as "other" doesn't mean anything.
KX_Scene::AddReplicaObject: Changed the parameter "parentobject" to "referenceobject", as the parameter did NOT contain a parent object in any way.

Now both functions use the same kind of name for the same thing.

Thanks to panzergame / Porteries Tristan.
2015-04-06 17:11:36 +02:00
d0aae79505 Cycles: More instant feedback on progressive rendering for first sample
Main purpose of this change is to make material preview appearing more
instant after the shader tweaks.
2015-04-06 19:28:25 +05:00
b5f58c1ad9 Cycles: Experiment with making previews more interactive
There were two major problems with the interactivity of material previews:

- Beckmann tables were re-generated on every material tweak.
  This is because preview scene is not set to be persistent, so re-triggering
  the render leads to the full scene re-sync.

- Images could take rather noticeable time to load with OIIO from the disk
  on every tweak.

This patch addressed this two issues in the following way:

- Beckmann tables are now static on CPU memory.

  They're couple of hundred kilobytes only, so wouldn't expect this to be
  an issue. And they're needed for almost every render anyway.

  This actually also makes blackbody table to be static, but it's even smaller
  than beckmann table.

  Not totally happy with this approach, but others seems to complicate things
  quite a bit with all this render engine life time and so..

- For preview rendering all images are considered to be built-in. This means
  instead of OIIO which re-loads images on every re-render they're coming
  from ImBuf cache which is fully manageable from blender side and unused
  images gets freed later.

  This would make it impossible to have mipmapping with OSL for now, but we'll
  be working on that later anyway and don't think mipmaps are really so crucial
  for the material preview.

  This seems to be a better alternative to making preview scene persistent,
  because of much optimal memory control from blender side.

Reviewers: brecht, juicyfruit, campbellbarton, dingto

Subscribers: eyecandy, venomgfx

Differential Revision: https://developer.blender.org/D1132
2015-04-06 19:22:17 +05:00
Dalai Felinto
36f352a4e4 Fix doversion check - patch by Sergey Sharybin 2015-04-06 11:11:36 -03:00
Dalai Felinto
d5f1b9c222 Multi-View and Stereo 3D
Official Documentation:
http://www.blender.org/manual/render/workflows/multiview.html

Implemented Features
====================
Builtin Stereo Camera
* Convergence Mode
* Interocular Distance
* Convergence Distance
* Pivot Mode

Viewport
* Cameras
* Plane
* Volume

Compositor
* View Switch Node
* Image Node Multi-View OpenEXR support

Sequencer
* Image/Movie Strips 'Use Multiview'

UV/Image Editor
* Option to see Multi-View images in Stereo-3D or its individual images
* Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images

I/O
* Save/Open Multi-View (OpenEXR, Stereo3D, individual views) images

Scene Render Views
* Ability to have an arbitrary number of views in the scene

Missing Bits
============
First rule of Multi-View bug report: If something is not working as it should *when Views is off* this is a severe bug, do mention this in the report.

Second rule is, if something works *when Views is off* but doesn't (or crashes) when *Views is on*, this is a important bug. Do mention this in the report.

Everything else is likely small todos, and may wait until we are sure none of the above is happening.

Apart from that there are those known issues:
* Compositor Image Node poorly working for Multi-View OpenEXR
(this was working prefectly before the 'Use Multi-View' functionality)
* Selecting camera from Multi-View when looking from camera is problematic
* Animation Playback (ctrl+F11) doesn't support stereo formats
* Wrong filepath when trying to play back animated scene
* Viewport Rendering doesn't support Multi-View
* Overscan Rendering
* Fullscreen display modes need to warn the user
* Object copy should be aware of views suffix

Acknowledgments
===============
* Francesco Siddi for the help with the original feature specs and design
* Brecht Van Lommel for the original review of the code and design early on
* Blender Foundation for the Development Fund to support the project wrap up

Final patch reviewers:
* Antony Riakiotakis (psy-fi)
* Campbell Barton (ideasman42)
* Julian Eisel (Severin)
* Sergey Sharybin (nazgul)
* Thomas Dinged (dingto)

Code contributors of the original branch in github:
* Alexey Akishin
* Gabriel Caraballo
2015-04-06 10:40:12 -03:00
74df307ca4 Cycles: Free unused image buffers when rendering with locked interface
It is still possible to free a bit more memory by detecting buildin images
which are not used by shaders, but that's not going to improve memory usage
that much to bother about this now.

Such change brings peak memory usage from 4.1GB to 3.4GB when rendering
01_01_01_D layout scene from the Gooseberry project. Mainly because of
freeing memory used by rather huge environment map in the viewport.

Reviewers: campbellbarton, juicyfruit

Subscribers: eyecandy

Differential Revision: https://developer.blender.org/D1215
2015-04-06 17:47:08 +05:00
Julian Eisel
bb2300de94 Fix T44282: Image sampling line disappears after a while
Now even to master
2015-04-06 14:12:05 +02:00
Julian Eisel
883663a0ad Fix T44278: Tab, Z-Key and Spacebar not working
Seems like a fix that is needed for some X11 systems causes this bug on
others :| Not sure if the systems that needed this fix are now still
fine (since I did a slight change to the click type check procedure),
but I need to check that on my system in the institute in a bit.
2015-04-06 13:13:35 +02:00
26e50295ce Use BKE_ghash_ensure_p where possible 2015-04-06 20:41:37 +10:00
dd129125b6 GHash: ensure function, avoids multiple lookups 2015-04-06 20:33:02 +10:00
3639a70eae Fix T44222: Crash using pointiness attribute for volume shaders
This attribute is not really supported for volumes, so it get's converted to
constant 0 at shader compile time.

TODO: We should consider doing the same for tangent attribute in order to save
some annoying checks at tracing time.
2015-04-06 14:11:28 +05:00
a9bb8d8a73 Cycles: de-duplicate fast/approximate erf function calculation
Our own implementation is in fact the same performance as in fast_math from
OpenShadingLanguage, but implementation from fast_math is using explicit madd
function, which increases chance of compiler deciding to use intrinsics.
2015-04-06 12:49:44 +05:00
9f8ffd478e Only show image slot-name in render view 2015-04-06 17:06:37 +10:00
dd3aa1b372 Cleanup: replace confusing 'if' statements 2015-04-06 16:40:26 +10:00
8cc475c40b Fix T43696: Baking tearing normals
Patch D1207 by @chrisr
2015-04-06 15:56:33 +10:00
986972701e Fix T44249: Cursor depth offset 2015-04-06 15:00:07 +10:00
434087981a Fix minor glitch getting depth from mouse cursor 2015-04-06 15:00:07 +10:00
46b42dba14 Fix: Stroke Edit Mode warning for GPencil draws correctly with Region Overlap enabled 2015-04-06 13:21:18 +12:00
5574f4c59d Fix: It was difficult to select control points for NLA Control FCurves in the Graph Editor 2015-04-06 12:19:20 +12:00
7157f3dbce GHash: no reason to use GSetEntry in ghash API 2015-04-06 09:08:10 +10:00
Julian Eisel
c3dad7953a Stickies: Remove redundant fixes
Those fixes aren't needed anymore due to
776bfa64a5
2015-04-05 20:04:37 +02:00
Julian Eisel
776bfa64a5 Stickies: Don't send extra event on KM_CLICK
Just add KM_CLICK to the already sent KM_RELEASE, don't send a new one
for this.

This might help us to get rid of quite some glitches and workarounds \o/
(why didn't this come earlier to my mind? :S)
2015-04-05 19:32:57 +02:00
Julian Eisel
af23e8d44a Fix T44275: CTRL+LMB to extrude to mouse position conflicts with snapped
extruding

More practical description of the bug: extruding with ctrl to use
snapping and confirming the action added another extrusion to the mouse
position.
This was caused from the second event that is now sent if a key release
happens within the click timeout. It triggers the "Extrude to Cursor"
operator since it is called by CTRL+LMB wich is exactly the event that
is sent in this case.

I'm not totally happy with this workaround since it changes the Confirm/
Abort event for all transformation actions to key release which *might*
result in more conflicts (fingers crossed this isn't the case). If this
happens we might need to write some special transformation handling for
extrusion.

This is an example of the difficulties we get from loading too much
functions on the same keys - we need to be careful with that!
2015-04-05 18:52:36 +02:00
ab2d05d958 Fix T44269: Typo in volume_attribute_float:geom_volume.h
Was rather harmless typo since we either pass both dx,dy or pass both NULL.
2015-04-05 19:07:45 +05:00
b06962fcfe Cycles: Avoid using lookup table for Beckmann slopes on GPU
This patch is based on some work done in D788 and re-formulation from Beckmann
implementation in OpenShadingLanguage.

Skipping texture lookup helps a lot on GPUs where it's more expensive to access
texture memory than to do some extra calculation in threads.

CPU code still uses lookup-table based approach since this seems to be still
faster (at least on computers i've got access to).

This change gives about 2% speedup on BMW scene with GTX560TI.
2015-04-05 19:07:45 +05:00
252b36ce77 Cycles: Remove unused Beckmann slope sampling code
It did not preserve stratification too well and lookup-table approach was
working much better. There are now also some more interesting forumlation
from Wenzel and OpenShadingLanguage which should work better than old code.
2015-04-05 19:07:44 +05:00
Julian Eisel
92755da471 Fix T44251 (2nd try): Changing views using numpad broken 2015-04-05 15:41:20 +02:00
29e968a315 BGE: Fix T36703: Character motion actuator local movement not working correct.
The character motion actuator local movement does not taking account of the object rotation.
It is necessary to rotate the motion vector before adding the local movement.

Reviewers: sybren, lordloki, moguri

Reviewed By: lordloki, moguri

Maniphest Tasks: T42709

Differential Revision: https://developer.blender.org/D1206
2015-04-05 10:13:04 +02:00
1a117ad40c Fix T44263: Invalid parameters to fill_vn_fl in deform.c.
Own fault, thanks a bunch to LazyDodo for finding that - and odd
GCC did not warn about it...
2015-04-05 09:50:16 +02:00
a1c2b1a8a8 Fix T44265: Win32 error checking GL version 2015-04-05 09:57:10 +10:00
59bfc5c76e Fix T44270: Similar face region crash /w wire edge 2015-04-05 09:44:30 +10:00
00f732f268 Fix T44266: win32 delete's malloc'd memory 2015-04-05 06:54:34 +10:00
2f42be6995 Cleanup: remove MSVC2008 workaround 2015-04-05 06:54:34 +10:00
26979d45b1 Cleanup: use float math funcs 2015-04-05 06:54:34 +10:00
cedd7cde44 WM: prefer define over zero wmEvent.val 2015-04-05 06:54:34 +10:00
8eac4085be Fix T44264 copy paste error, checking same condition twice. 2015-04-04 22:39:25 +02:00
Julian Eisel
1604a26fe6 Fix T44251: Changing views using numpad broken
For KM_ANY I've filtered out every event that has a click type, although
that was only needed for the additional event sent on KM_HOLD. A bit weird
that this only happened on a few machines though.
2015-04-04 19:17:39 +02:00
Julian Eisel
59df941ea5 Fix T44259: Secondary strokes get terminated early when drawing in Continuous Drawing mode 2015-04-04 14:27:05 +02:00
f5949efb53 Missed in recent cleanup 2015-04-04 18:58:49 +11:00
e84b0e4c35 Ghost: update tests for recent changes 2015-04-04 17:21:18 +11:00
eca22d076c Cleanup: move filelist out of storage
Depends on imbuf, problematic for tests
2015-04-04 17:21:18 +11:00
e5392069cc Cleanup: Typo fix in HSV code. 2015-04-04 07:50:09 +02:00
12cede5ca3 Cleanup: use BKE_ocean_* prefix 2015-04-04 15:19:24 +11:00
7acd69958b Cleanup: use BKE_sculptsession_* prefix 2015-04-04 15:19:21 +11:00
1c96a84320 Cleanup: use BKE_animdata_* prefix 2015-04-04 15:13:56 +11:00
89a3e4deff Cleanup: redundant normalize in expmap_to_quat 2015-04-04 14:45:54 +11:00
519e20f984 Cleanup 2015-04-04 10:48:17 +11:00
92c7632835 Add missing break statements 2015-04-04 10:48:05 +11:00
4a4aaabfa9 CMake: treat inline C files as headers 2015-04-04 10:37:38 +11:00
f9b6709a17 Add missing declarations 2015-04-04 10:37:38 +11:00
53f4aa7817 WIP: Added dedicated operator for unlinking actions from the Action Editor (NLA buttons support to come)
After looking into this more carefully, I've found that we do in fact need a dedicate
operator to add some custom logic when trying to unlink an action from the editor/datablocks.

Specifically, this new operator does the following:
1) When in Tweak Mode, it shouldn't be possible to unlink the active action,
   or else, everything turns to custard.
2) If the Action doesn't have any other users, the user should at least get
   a warning that it is going to get lost.
3) We need a convenient way to exit Tweak Mode from the Action Editor
4) If none of the above apply, we can just unlink normally

This commit implements this for the Action Editor, with stubs for the NLA Editor too.
Those will be fixed next.
2015-04-04 11:37:06 +13:00
34c4133daf Tweaks to descriptions for Action Layer Up/Down 2015-04-04 11:37:05 +13:00
Julian Eisel
a3fdc6b755 Update keyconfigs for stickies
Change are needed to avoid conflicts due to rB53a3850a8a05249942a0c4
2015-04-03 16:44:42 +02:00
Julian Eisel
53a3850a8a Sticky Keys backend
Design task: T42339
Differential Revision: D840
Initial implementation proposal: T41867

Short description:
With this we can distinguish between holding and tabbing a key. Useful
is this if we want to assign to operators to a single shortcut. If two
operators are assigned to one shortcut, we call this a sticky key.

More info is accessible through the design task and the diff.

A few people that were involved with this:
* Sean Olson for stressing me with this burden ;) - It is his enthusiasm
that pushed me forward to get this done
* Campbell and Antony for the code and design review
* Ton for the design review
* All the other people that gave feedback on the patch and helped to
make this possible

A big "Thank You" for you all!
2015-04-03 16:21:22 +02:00
b444887054 Fix T44243: File browser behavior is inconsistent between append and open.
Only basic fix, the whole 'dir' field handling needs rework to correctly support
lib stuff (will be done as part of asset-experiment rewriting work)...

All this code is doing way too much filesystem inspection by itself, instead of
reusing flielist.c work - this is stupid, and will completely break with future
asset engines!
2015-04-03 16:20:18 +02:00
3f30ebf64a Fix related to T44243: do not systematically do live-update when tab-completing textedit buttons.
We now have a specific flag for that, use it! Note that for all 'search menu' buttons,
there is already a similar behavior, so there is no need to force apply butt in this case
anyway, which means in practice this change only has effect in the single place
it is needed currently - file browser dir/file fields.

In this case (dir field), applying button even on partial matches leads code
to ask to create a new dir, which breaks completely the expected behavior of
completion. And we do not need immediate apply at all here.

Note this is the only 'autocomplete' button not using search menu, so this change
does not affect anything else in UI.
2015-04-03 16:20:18 +02:00
03f2e5d4a6 Fix: Drawing glitch when renaming animation channels
When renaming animation channels, the old names are no longer drawn behind the
text boxes anymore. This used to cause problems if the names were long, or
if text boxes were set to have transparent backgrounds.

Thanks to kopias for reporting on IRC.
2015-04-04 01:40:01 +13:00
6ef7e0a194 Bugfix: Stashed actions now get added to the bottom of the NLA Stack if there weren't any stashed actions already 2015-04-04 01:40:00 +13:00
b30836dad7 Fix: Action/NLA Tweakmode Checks
Made all action management operators use the AnimData-local flag instead of the scene
global one. Technically, this is more accurate and results in less blocking
situations (i.e. another object may be in tweakmode, but because of that, the active
object's action couldn't be stashed).

The main impetus for this though was that the Action Up/Down feature doesn't clear
the global flag, since it is not in a position to do so (since it can't load up
everything to clear it).

TODO:
I'll need to review how this global flag works and/or potentially ditch it (or
perhaps add some better ways to ensure that it stays valid), since while thinking
this over, I've noticed a few problems here. But, for the meantime, this commit
at least makes things more usable here in the short term.
2015-04-04 01:39:59 +13:00
5681b4fc83 Action Editor: Move up/down buttons to be before the datablock selector
It turned out that the constantly changing width of the datablock selector
made it a pain to use these to quickly toggle between different actions,
as the buttons would keep jumping around, thus leading to errors when
quickly toggling between actions. This way doesn't look quite as great,
but should be more usable.
2015-04-04 01:39:58 +13:00
943b830bf6 Action Layer Up/Down: Fixes for NLA Solo / NLA Muting
Now marking NLA Tracks as Solo'd and muting the NLA stack are linked together
when using the Action Layer Up/Down tools. That is, when switching from a NLA strip
to the active action, if the track was solo'd, then the NLA stack will get muted;
and when switching from the active action to a NLA track, if the stack was muted,
the track will get solo'd. This linkage means that we ensure that when moving up
and down the stack, we can continue to check the actions in isolation without things
messing up when you switch to and from the active action.

Also fixed a bug where this wasn't getting applied when going in the other direction.

TODO:
- When we get the rest/reference track support, we're going to need to insert
  some calls to flush the restpose values so that values from the previously
  used action do not pollute the pose for the new action (if not all the
  same controls get keyed across both). For now, it's best to only do this
  switching from the first frame.
2015-04-04 01:39:56 +13:00
961dac55cf Code Cleanup: Deduplicate logic to switch between NLA Strips/Actions 2015-04-04 01:39:55 +13:00
f350e9f3fc Code Cleanup: Split out duplicate code for finding an available NLA strip above/below 2015-04-04 01:39:54 +13:00
bcf1abbc83 Action Editor: Go to Next/Previous Animation Layer
With this feature, it is now possible to quickly switch between different actions
stacked/stashed on top of each other in the NLA Stack without having to go to the
NLA Editor and doing a tab-select-tab dance, thus saving quite a few clicks. It
was specifically designed with Game Animation / Action Library workflows in mind,
but also helps layered animation workflows.

Usage:
Simply click on the up/down arrow buttons (between the action datablock selector
and the pushdown/stash buttons) to go to the action in the NLA Track above/below
the NLA Strip being whose action is being tweaked in the Action Editor.

Notes:
- These still work when you're not editing the action used by a NLA Strip.
If you're just animating a new action normally, it is possible to use the "down arrow"
to temporarily jump down to the previous action without losing the new action you're
working on, and then use the "up arrow" to get back to it once you're done checking
the other action(s).

- If there are multiple actions/strips on the same layer/track, then only the one
closest to the current frame will be used.
2015-04-04 01:39:53 +13:00
13a63234d6 Fix T44237: translation does not work for input sockets in 'Active node properties' panel. 2015-04-03 12:38:59 +02:00
99d8e08ed9 Fix T44237: translation does not work in spacebar search.
Added translation there, also fixed a stupid bug which was leading most internal
operators to have 'dual' i18n_context (default NULL one and default 'Operator' one).
2015-04-03 12:26:29 +02:00
89530f1486 Fix T44240: Lamp Halo invisible in rendering.
Halo is not possible when using 'deep' buffer shadow - reflect that in UI.
When not using buffered shadows, switch lamp bufftype to 'regular' on render, as already
done with 'halfway' method.
2015-04-03 11:17:58 +02:00
43101289a6 Fix T44183 particles in linked group offset from object
A nice bug combining all the broken features of blender:
Particles, duplis and multiple scene dependencies.

Fortunately this was solvable: Basically, we need to
make sure derivedmesh for dupli instance is generated before
obmat is overriden. This also makes sense, since no instance
has "true" obmat apart from original. Lazy initialization of
derivedmesh just does not work here (or it -does- work but first
use should be before instance drawing).

Fingers crossed nothing else breaks after this...
2015-04-02 17:13:45 +02:00
018dc3aeda Action Editor: Experimental tweak to ordering of buttons
This commit is an experiment exploring the relationship between the action
management buttons (i.e. action selector + pushdown/stash, and soon a few others)
and the filtering stuff (i.e. summary, only selected, etc.)

The old ordering meant that the filtering stuff was consistently in the same
place beside the mode selector, meaning that the order was "common stuff, then
editor specific stuff", this was not that great on smaller windows, where there
important stuff was often out of view.

This new order places greater emphasis on the parts which are likely to be more
important. It also allows us to have a better hierarchy/flow; this is especially
because we'll soon introduce a way to specify which datablock "level" the
action comes from, so going from "level -> action -> filters within action" will
make more sense.
2015-04-03 02:17:45 +13:00
5d4beee8c6 Code Cleanup: Split Action management operator stuff into action_data.c 2015-04-03 02:17:44 +13:00
64fed6841a Cleanup: followup to rBf87d7c605dcfb - use __func__ instead of literal func name in string.
Since we are already using BKE_reportf... This way, no more issue if/when we copy/paste
or rename that!
2015-04-02 14:51:37 +02:00
Dalai Felinto
f87d7c605d Fix error messages for RE_layer_load_from_file() and RE_layer_load_from_file() 2015-04-02 09:08:25 -03:00
77ff544d93 Fix issue reported by copias on irc, shift duplicate and snap crashes in
sequencer.

Missing snap callback case. Quick patch is to use the sequencer specific
operator instead of generic translate. We really need to support proper
snap/snap options at some point though.
2015-04-02 13:47:53 +02:00
ff45930cc5 Cleanup: Make strict flags happy
We might also just remove those arguments perhaps?
2015-04-02 16:01:23 +05:00
fd2ea3a909 Cycles: Make guarded allocator happy about strict C++ flags 2015-04-02 15:51:43 +05:00
f30b60d139 Fix: Crash when using "On Selected Markers" mode for Propogate Pose with no markers present
The function to get a list of markers was not clearing the list before it exited
early, and with no way to tell that the method failed, callers could make the
mistake of trusting that the list was now valid (i.e. either full of marker
frames or empty, vs being invalid)
2015-04-02 23:48:25 +13:00
838c3503a7 Expose the Pose Propagate tool a bit more in the UI
From the various forum threads and the fact that a new addon has cropped up,
it appears that it is not that well known that this tool exists, and that it
can be used solve a very common problem that animators face. Namely:
  When you've gone through blocking out your key poses and then realise
  that you need to adjust parts of the rig which don't change much, this
  tool solves the problem of needing to go through doing grunt-work to
  fix all the other keyframes which now need to change as well.

So, this tool is now available in the following two places (in addition to
the existing Pose -> Propagate menu):
* Toolbar - The "Propagate" button will use the default mode (or the last
            used mode for each subsequent invocation).
            The arrow-button beside this will allow choosing between the different
            modes. (NOTE: The UI team may have different thoughts on this, but,
            let's give this a try for a while first, to see if this sort of thing works)
* Alt-P   - In Pose Mode, this will now bring up a menu allowing you to choose
            which mode is used. Since this sort of thing is something that does
            get run several times in a row when you need it, having this hotkey
            will make it a bit more convenient.
2015-04-02 23:48:24 +13:00
97f6bff45a Propagate Pose: Added 'Selected Keyframes' mode
This commit adds a new mode for the Propagate Pose tool. With this new option,
the Propagate Pose will copy the current pose over to all selected keyframes
after the current frame.

For reference, some of the other/existing options are: to copy it to each subsequent
keyframe with the same value (WHILE_HELD - the default), to the next keyframe,
or to the last keyframe.
2015-04-02 23:48:23 +13:00
f5adbcc3a2 GPencil: Draw status indicator in top-right corner when in Stroke Edit Mode
When in Stroke Edit Mode, an indicator/warning message is now shown in the top-right
corner to make it easier to notice that operations will apply to Grease Pencil
strokes instead.
2015-04-02 23:48:22 +13:00
2cac2e7213 GPencil: H/Shift-H/Alt-H now work to Hide and Reveal Layers in Strokes Edit Mode
* H       = Hide active layer
* Shift-H = Hide non-active layers
* Alt-H   = Show all layers
2015-04-02 23:48:21 +13:00
146be8e258 Fix proportional editing always turned on in graph editor. 2015-04-02 12:34:35 +02:00
2fc69d11c8 Add custom properties to sequence strips 2015-04-02 21:07:23 +11:00
ac2530be8c Cleanup own todo: RE_pipeline is not a bad include from BKE, it's already used in few places 2015-04-02 14:39:58 +05:00
77667ad80f Cleanup 2015-04-02 16:12:33 +11:00
efc7c355b2 Code Cleanup: Pruning back the unusued includes now 2015-04-02 16:33:09 +13:00
26fa13e6f8 Code Cleanup: Reshuffling some of the GPencil code
* Moved the context handling stuff into gpencil_utils.c

* Moved the datablock and layer operators out into their own file too. Again,
  these weren't related to the other stuff that much

* Split the GPencil to Curves operator out into its own file (gpencil_convert.c).
  This was quite a massive blob of code (48kb) that was not that related to the
  other operators still in that file (gpencil_edit.c)
2015-04-02 16:29:33 +13:00
b6d878fa96 Fix for incorrect description 2015-04-02 12:12:35 +13:00
Julian Eisel
4b847595ee Fix T44217: Crash when starting .blend without "Load UI" enabled
Caused by changes in 31e26bb83b. This makes it fall back to the old
method if we can't find a screen.

Patch is actually by @LazyDodo with minor edits by me.
2015-04-02 00:24:58 +02:00
fcbf92eb10 Merge branch 'master' into soc-2014-remesh
Conflicts:
	source/blender/editors/object/object_ops.c
	source/blender/makesdna/DNA_modifier_types.h
	source/blender/makesrna/intern/rna_modifier.c
	source/blender/modifiers/MOD_modifiertypes.h
	source/blender/modifiers/intern/MOD_util.c
2015-04-02 00:17:43 +02:00
f1494edf78 Cycles: Make SSS intersection closer to regular triangle intersection 2015-04-01 21:20:04 +05:00
394b947a50 Cycles: Remove unused direction from triangle intersection functions
This argument was unused and got nicely optimized out. But once it
starts to be using registers are getting stressed really crazy,
causing slow down of render.
2015-04-01 21:08:12 +05:00
8e6e7010bc Proportional editing for graph editor did not work outside edit mode 2015-04-01 11:24:58 +02:00
af399884e1 Fix T44113: Ashikhmin-Shirley distribution of glossy shader at 0 roughness causes artifacts when background uses MIS
Was a division by zero error, solved in the same way as beckmann/ggx
deals with small roughness values.
2015-04-01 14:21:21 +05:00
71af08e1c9 Fix T44212: Crash on Group Rename.
Nice offset-by-one index error. ;)
2015-04-01 09:48:48 +02:00
f7dbce9914 Real fix for T44127: Python does not guarantee to free all objects on exit...
All kudos to Campbell for the head-up and patch!
2015-04-01 09:34:01 +02:00
6461fbd9ce Fix glitch scaling bone radius
connected parents radius could get out of sync with child.
2015-04-01 17:07:04 +11:00
879f5c832b Match corrective-smooth UI to smooth modifier 2015-04-01 09:29:56 +11:00
c59ca9e477 silence MSVC warning
‘*/‘ found outside of comment
2015-03-31 14:58:41 -04:00
d9c566a2d8 Corrections to submodules: we need to use latest tag available from master branch 2015-03-31 22:10:26 +05:00
f3b45eb76f Fix T43987 ambient occlusion wrong for Intel cards on windows (tested on
HD3000 and HD4000 cards so far).

Similar issue to Radeon 3xxx series but Intels need the opposite factors
for dfdy.
2015-03-31 17:37:17 +02:00
7ee340c0b4 Fix writing freed memory, exiting full view 2015-04-01 02:01:02 +11:00
79918e0577 Cycles: Avoid float/int conversion in few places 2015-03-31 19:52:14 +05:00
7da4c2637d Cycles: Fix typo in distance heuristic for shadow rays
It's not that bad because this typo could only caused not really
efficient BVH traversal, causing higher render times. Not as if
it was causing render artifacts.
2015-03-31 19:52:14 +05:00
66a028a576 Proportional editing for IPO editor - version ready for feedback by artists.
This works by using the distance in the x axis only (usually artists want to influence nearby
keyframes based on timing, not value). Tweaking handles is the same as tweaking
the central handle. It's a bit ambiguous if proportional editing is really meaningful
for handles but will leave that for artists to decide.
2015-03-31 16:45:30 +02:00
41f9cdc955 Point master's submodules to v2.74 tag as well 2015-03-31 18:57:17 +05:00
b98c7bcf3a Fix T44077 material update fails in textured mode when VBOs are off.
The issue has been here since we changed drawing code for meshes to use
vertex arrays instead of immediate mode when VBO was off. Basically we
should now always invalidate the GPU objects regardless of the VBO
setting in the preferences.

The bug has been there since 2.73 at least, but what made it apparent
now is that new version resets preferences and as an extension the VBO
flag.

Should be included in final 2.74 release
2015-03-31 11:42:39 +02:00
4153ff3610 Fix T44201: Crash Deleting Hierarchy in Outliner
Typical error using '->next' member of a freed linked list item. A bit trickier
even here, since we have some recursion...

Trivial fix for nasty crasher, safe for 2.74 imho?
2015-03-31 08:36:48 +02:00
c16a8983ef Corrective Smooth Modifier (aka delta-mush)
This modifier can be used to correct bad deformations,

Original patch D1183 by @sazerac, with own modifications
2015-03-31 10:20:11 +11:00
660173ed72 BGE: Fix: VehicleWrapper compiler warning.
The return type of raise_exc_wheel() is bool, but the method return -1. The compiler will change the return type type to an int. This can cause some problems on 64bit systems.

Reviewers: lordloki, sybren

Reviewed By: lordloki, sybren

Differential Revision: https://developer.blender.org/D1204
2015-03-30 22:47:46 +02:00
dd0604c606 Fix T44193: Hair intersection with duplis causes flickering
It was an issue with what bounds to use for BVH node during construction.

Also corrected case when there are all 4 primitive types in the range and
also there're objects in the same range.
2015-03-31 00:24:43 +05:00
9b4172cc6c Fix T43266, when we have a blendfile name use only that without the pid
for autosave. Will save Windows users from polluting their tmp folders
too much.
2015-03-30 19:21:38 +02:00
050f28f03f Remove wrong back jump detection on looping 2015-03-30 18:27:28 +02:00
bacdfc70e2 Fix T41191: Custom Loop Normals Viewport shading not updating when set from py script
Missing update tagging...

Safe for 2.74.
2015-03-30 15:04:42 +02:00
c6ce8200dd Attempt to fix T44056, dof high quality shader error in ATI cards.
ATI driver does not like declaration of gl_FragColor and glFragData in
the same source file (even though only one of the two is ever
referenced), just use one of the two.
2015-03-30 14:45:14 +02:00
79a68617b3 Pass bool arg to RNA_property_boolean_set 2015-03-30 23:31:42 +11:00
590efaacb8 Potential fix for T43987, ambient occlusion different between offscreen
and on screen rendering.

Aaaaah, the beauty of driver implementations of OpenGL!

Turns out the problem here is that drivers calculate df/dy differently
in some cases (probably because OpenGL counts y reverse to how the
window system does, so drivers can get confused).

Fixed this for the ATI case based on info we have so far, there's also
the Intel case which will be handled separately (missing info on Intel's
renderer string etc).

Unfortunately we can't really fix this for the general case so we'll
have to haldle cases as they come in our tracker and by adding silly
string comparisons in our GPU initialization module <sigh>.
2015-03-30 14:14:52 +02:00
4aeb34dc82 Cleanup: use const for typeinfo 2015-03-30 22:15:06 +11:00
98cbde91d2 Fix compilation of game engine in ubuntu 2015-03-30 13:06:54 +02:00
bfe63bbfc4 Grey out high quality depth of field when it's not supported by GPU 2015-03-30 12:49:05 +02:00
01e0062b4c missed last commit 2015-03-30 21:25:28 +11:00
268524c025 Cleanup: use const for typeinfo 2015-03-30 21:18:49 +11:00
b663f1f1cf Cycles: Correction to previous commit: non-msvc compilers also should use nullptr 2015-03-30 15:17:09 +05:00
131912dc73 Cycles: Fix compilation error with MSVC after recent C++11 changes 2015-03-30 15:06:45 +05:00
09397ac2c1 Fix for invalid buffer access on zero-face meshes 2015-03-30 20:50:23 +11:00
afbc45ed93 Cycles: Attempt to fix osl+scons compilation
Defines (and other cflags) are not inherited by scons to the subdirectories,
need to take care of them in all nested SConscripts.
2015-03-30 14:00:03 +05:00
1b327aa219 Fix T44186: Bezier Bevel facto mapping broken when 'start' was set to 'Resolution' and 'end' was not.
Trivial, we need totla_length in that case too.

Safe to be backported to 2.74.
2015-03-30 10:24:26 +02:00
59740a6c98 SCons: cudakernels now depends on some configuration tests 2015-03-30 13:11:08 +05:00
23c0e46a00 Buildbot: Use Clang with OpenMP support for 64bit OSX builds
This should make such areas as simulations and sculpting nicely threaded.

32bit will be tried to be supported later.
2015-03-30 13:05:14 +05:00
786763ca4c remove zero translations
within draw_emtpy_*
These are no-ops.

Also const-ified some variables there.
2015-03-30 02:53:39 -04:00
e47a96463d cleanup: remove unused code & vars 2015-03-30 01:25:34 -04:00
8d1dc22bec cleanup: typos in comments, style
no functional changes
2015-03-30 00:51:00 -04:00
dea0e3833f Remove use_invert_vertex_group use_ prefix
To match other modifiers.
2015-03-30 10:46:53 +11:00
ab9d903b99 Cleanup: single quotes for enums 2015-03-30 10:46:53 +11:00
3204aff6d0 Fix compilation of cycles network server when logging is enabled 2015-03-29 22:22:53 +02:00
f01456aaa4 Optionally use c++11 stuff instead of boost in cycles where possible. We do and continue to depend on boost though
Reviewers: dingto, sergey

Reviewed By: sergey

Subscribers: #cycles

Differential Revision: https://developer.blender.org/D1185
2015-03-29 22:12:40 +02:00
70d9c01325 Fix T44162: Outliner: modifier's icons toggle update issue
Use same notifier for button callback as the one used in matching outliner operator...
2015-03-29 13:14:59 +02:00
47c1112e6e Make internal functions of point density independent from Render 2015-03-29 02:34:44 +05:00
94b0193196 Make point density sampling functions a bit easier for re-use
Still not ideal but getting closer. Main annoying thing so far is
dependency of Render structure for now. It is used to switch particles
to render mode and could probably also be eliminated.
2015-03-29 02:14:06 +05:00
b25c208d5b Code cleanup: whitespace, line wrapping 2015-03-28 23:50:36 +05:00
2c5ba41413 Code cleanup: Get rid of set but unused matrix 2015-03-28 23:40:56 +05:00
44a4b90b4f Fix collada compile after BKE cleanup 2015-03-28 18:17:54 +01:00
b1d758ae6b Cleanup: redundant struct declarations 2015-03-29 03:56:39 +11:00
8a183aa26b Cleanup: use BKE_texture_ prefix 2015-03-29 03:16:55 +11:00
8c1c2b40a2 Use union for EditBone's
Avoids complicated casts accessing as int
2015-03-29 01:30:44 +11:00
fcc086a92b Cleanup: unused args 2015-03-29 01:26:09 +11:00
7a1e7295a5 NLA Strip Keyframes: Nullified the risk that NLA mapping can get applied to NLA Curves 2015-03-29 03:03:05 +13:00
b253be1a19 Nla Strip Keyframes: Active FCurve Keyframes panel displays names properly now (and doesn't disable the FCurves) 2015-03-29 02:45:24 +13:00
0c5d0422b4 NLA Strip Keyframes: Insert keyframe tools in Anim Editors work now
* Insert Keyframe tool for Dopesheet/Graph Editors needed to be modified to
  not try to resolve the paths for NLA Control Curves
* For now, the poll callback to get the "Active FCurve" also works when given
  a NLA control curve. They're really the same in most cases, and this should
  be fine until one of the channels does something funky.
2015-03-29 02:20:57 +13:00
0ffd7f721e Nla Strip Keyframes: Sliders in channel list insert keyframes now 2015-03-29 01:39:59 +13:00
34209b59b8 Nla Strip Curves: This works with anim channel rearranging tools now 2015-03-29 01:39:58 +13:00
182e84da88 Nla Strip Curves: Getting more stuff working
* Clicking anywhere on the expander collapses it (like for the gpencil one)
* Deleting these curves works now (but has the side effect of turning off
  the animated influence/time options too, as it is assumed that when those
  are enabled there is a corresponding fcurve)
2015-03-29 01:39:57 +13:00
67f983ac53 Nla Strip Controls: Added special FCurve type (in the animfiltering code)
Using the standard "FCurve" animchannel type didn't work that well for
the control FCurves on NLA Strips, as the paths would not resolve correctly,
and the indentation was wrong. Also, there would likely be issues down the
track with applying NLA mapping. Hence, it's easier to just create a separate
type for this case, and adapt the rest of the code to also consider these (todo).
2015-03-29 01:39:56 +13:00
8f4c5ff0ec Nla Strip Controls: Added dedicated "Expander" channel to Action/Graph Editors
The "Nla Strip Controls" channel is used to house the per-strip
FCurves for controlling the strip_time and influence properties.
It sits above the active action's first group, at the same level
in the hierarchy as other groups.

TODO: It looks like a dedicated FCurve channel is needed for these
control FCurves, so that we won't accidentally apply NLA mapping
or have these FCurves disabled by the path lookups failing.
2015-03-29 01:39:55 +13:00
6dac874d68 Fix for various small issues which may cause crashes 2015-03-29 01:39:54 +13:00
da0d0b2f20 Compile fix
New parameter added by these fixes did not exist when this call got added
2015-03-29 01:39:53 +13:00
90e9a22eaa Fix for earlier commit - Turning off "animated" influence/time didn't work
Reshuffled order that in which NLA Strip's F-Curves vs its automatic settings are
evaluated so that the automatic settings can always override the custom settings,
since it's not that easy to get things working correctly the other way around.
2015-03-29 01:39:53 +13:00
fc0a576c30 Keyframes on NLA-Strip F-Curves are detected by RNA buttons too 2015-03-29 01:39:52 +13:00
59b2316e82 Code Cleanup / Preemptive Bug Fixing: "action" parameter may get set when it shouldn't be
Logically, it makes sense that this parameter only gets used to describe the action
that the F-Curve actually belongs to (if it belongs to one). Otherwise, it should not
be set at all.
2015-03-29 01:39:51 +13:00
2b4ff142ab Fix T36385: Animated Strip-Time doesnt update
This commit implements proper evaluation + keyframing support for animating influence
and time on NLA Strips (among other properties) by resolving a few long standing issues
which prevented the original design for this from working.

The original design for animating these properties (and/or some of the other settings
on NLA Strips) is that NLA Strips actually have some of their own F-Curves that are
used for animating settings which will affect how they are evaluated. As seen in this
bug report, the alternative of having these animated as part of the stack (which the
strips work above/outside/on-top of) means that glitches can occur.

Although one of the original considerations for why this wasn't implemented earlier
was that introducing keyframes there isn't so clean cut, and causes UI design issues
for how we expose these via the animation editors for editing (NOTE: support for that
is still to come). Another concern is that this sets a precedent for how FModifiers
might get evaluated.
2015-03-29 01:39:50 +13:00
1a5c5ac742 Fix T44068: "Layered" option for auto keyframing doesn't "Insert Available Only" is enabled
The "Layered" option for auto keyframing will create a new NLA strip if playback
reaches the end of the frame range and jumps back again. The idea is that instead
of overwriting the keyframes you've already made, it will make a new animation
layer. However, this does not work with the "Insert Available Only" option
(which can either be set in the User Prefs, or in the active keyingset), as that
option needs some existing FCurves to tell what it can insert keyframes into.

The "fix" here is to simply not show the offending button in situations where it
cannot be used!
2015-03-28 23:48:10 +13:00
b7afbaf8cc Bugfix: Fix for crash when trying to create new action in Shape Key DopeSheet mode
When the active object had no shapekey data, trying to create a new action from the
Shape Keys mode of the DopeSheet would crash. The segfault here was a silly regression
caused by my earlier Action Stashing work.

However, the old (pre-Action Stashing) code here also wasn't that great either.
While it didn't crash, it would still silently create a new action, even if that
could not get assigned/used anywhere. To prevent both of these problems from
happening again, I've added additional null checks, as well as beefing up the poll
callback here to forbid keyframing
2015-03-28 23:23:23 +13:00
469ba8a30a Tracking: Code cleanup, missing break statements 2015-03-28 00:46:59 +05:00
5498629906 Freestyle: Code cleanup, silence warning in release mode 2015-03-28 00:34:16 +05:00
e1bcc2d779 Cycles: Code cleanyp, sky model
For as long as code stays in official folders it should follow
our code style.
2015-03-28 00:28:37 +05:00
5ff132182d Cycles: Code cleanup, spaces around keywords
This inconsistency drove me totally crazy, it's really confusing
when it's inconsistent especially when you work on both Cycles and
Blender sides.

Shouldn;t cause merge PITA, it's whitespace changes only, Git should
be able to merge it nicely.
2015-03-28 00:15:15 +05:00
6f43e1dfef Cleanup: win32 mixed declare/statements in main()
Make it a more clear where declarations end
(ifdef's all over made it a bit confusing).
2015-03-28 04:12:12 +11:00
59b578e320 Cleanup: use const char for stats arg 2015-03-28 04:12:12 +11:00
3d305b5a37 Cycles: Code cleanup, make strict flags happy about disabled OSL 2015-03-27 19:10:36 +05:00
d18e8ad1f3 Cleanup: view3d headers 2015-03-28 01:05:50 +11:00
267904dd3c Cleanup: gpencil headers 2015-03-28 01:05:50 +11:00
7cbb659400 Use squared dist /w comparisons (mask, edge-slide) 2015-03-28 01:05:49 +11:00
7b7eac9211 Add profiling prints for audio synch to detect how continuous our frame
progression is
2015-03-27 15:00:13 +01:00
74e8e14cce Makesrna: Fix function prototypes for struct used RNA_def_struct_sdna_from
Previously makesrna would have generated code expecting DNA structure from
RNA_def_struct_sdna_from() to be passed to it. This was wrong because actual
PointerRNA points to a "parent" structure, making it impossible to add
functions to certain RNA structures.

It so far never needed and we didn't notice this issue, but it's needed for
some ongoing development now.
2015-03-27 18:44:11 +05:00
1c2f1ff725 Compositor: Cleanup, remove unused need_sync parameter 2015-03-27 18:23:32 +05:00
d84cc6a18f Compositor: Followup to previous stats commit
No need to mark tree for localization, it was never done and
it all just worked. We can save some CPU ticks by skipping doing
this.
2015-03-27 18:23:32 +05:00
da170d9dc3 Compositor: Fix heap overflow when copying previews 2015-03-27 18:23:32 +05:00
8af5390968 Fix T44149: Compositing : Node Groups do not work correctly
Input constants are to be connected before removing proxies,
otherwise node groups might give totally different result.

This is a regression and to be put into final release.
2015-03-27 18:23:32 +05:00
3366b30bf1 Compositor: Code cleanup, debug mode is now fine with strict flags 2015-03-27 18:23:32 +05:00
6cd82dbf57 CMake: Enable strict flags for C++ 2015-03-27 18:23:31 +05:00
061e73a270 Physics: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
052ebd6564 C++ RNA API: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
4393b60579 ImBuf: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
13358d049e Freestyle: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
2ada3512a2 Compositor: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
585dd26120 Cycles: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
232c2d382e Dualcon: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
3f4219a694 OpenColorIO: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
90f645855a GHost: Code cleanup, prepare for strict C++ flags 2015-03-27 18:23:31 +05:00
38c4645f0a rename BGE attr from D1091 (match methods) 2015-03-27 22:23:19 +11:00
34c92848a7 Use preview option to detect frame range for filename when using ctrl
F11.
2015-03-27 11:39:09 +01:00
e7afba4b29 Compositor: Cleanup, don't pollute namepace with all symbols from std 2015-03-27 14:41:20 +05:00
408a2a8420 Compositor: Improve reports to the interface about what's going on
The functionality was got lost when new compositor system was landed
and it wasn't always clear what's causing the hicucps. Now it's nicely
reported to the stats line.
2015-03-27 14:38:02 +05:00
a12b2ec66d BGE: New isDynamicSuspended python attribute
This is a new KX_GameObject attribute that it increments the
possibilities of optimization during the game

Additionally the unused m_bSuspendDynamics variable is removed.

Reviewers: moguri, agoose77, lordloki

Reviewed By: agoose77, lordloki

Subscribers: agoose77, lordloki

Differential Revision: https://developer.blender.org/D1091
2015-03-27 06:11:23 +01:00
Severin
c8f95cbb60 Only enable IME for supported translation contexts
For me, weird characters are drawn if IME is enabled but translation
is not set to a supported language.
Could become an utility function if needed later.
2015-03-26 22:16:00 +01:00
Severin
065e5896c4 IME: Minor API cleanup 2015-03-26 21:24:01 +01:00
Severin
6e72f06069 Fix duplicated IME input
AFAIK a few IMEs were affected by this so I guess we can now add a
few more IMEs to the "officially supported" list.

Patch by @randon (thanks again!), minor edits by me.
2015-03-26 21:16:43 +01:00
d26c18c05e Project directory proxies:
Use BL_proxy if directory is blank to avoid filling the whole folder
with files.
2015-03-26 18:25:25 +01:00
4c7876c740 New option proxy placement, project directory.
There are two per-editor settings now, the Per-Strip setting (default)
and the Project setting.

The per strip setting basically uses the previous, per-strip options for
storing the proxies.
The project setting though will use a specified directory for -all-
proxies, or the blend file directory if no directory is given.
2015-03-26 17:54:16 +01:00
d084967627 Revert "Change Enables proxy operator to Copy proxy operator."
This reverts commit ec03ab021f.

Changing this since it looks like Mattieu does not really like the change.
Will be adding another way to tweak the directories
2015-03-26 15:44:51 +01:00
c0ef4e9b78 Fix T44122, rendering OpenGL preview movie with audio has wrong audio
range and extra frames.

Issue here is that the movie backend would unconditionally use the start
frame of the scene instead of the preview frame. Solved by passing an
explicit "preview" argument.

Strictly speaking, the preview argument is part of the renderdata
struct, that is also passed to the code, but when rendering the final
result we want to unconditionally render the full range regardless of
the preview setting of the render structure.

However, OpenGL rendering does use the preview range so we need to
account for that when making those exports.

This is also a nice chance to correct the filenames, which still used
the full range.
2015-03-26 14:50:18 +01:00
f80064f2d2 Fix compiling after sound changes 2015-03-26 13:19:33 +01:00
59132e6481 Fix building with audaspace disabled after 828c85a 2015-03-26 16:33:20 +05:00
dc3b869c9a Missed those last commit 2015-03-26 11:39:08 +01:00
828c85a1bf sound module: Append functions with BKE (makes it easier to make them
out from local functions)
2015-03-26 11:35:41 +01:00
d97b97460c Fix T44138: Crash in DataTransfer modifier when selecting a source with no loops.
Simply check and early return in case we have no source or destination items
(verts/edges/loops/polys) available...

Also, fix an assert in `BKE_mesh_calc_normals_poly()`, when called with no poly.
2015-03-26 09:20:37 +01:00
b87eaef1f7 Fix T44137: bpy.path.is_subdir fails
`bpy.path.is_subdir("/abc/def/ghi","/abc/de")` incorrectly returned True
2015-03-26 16:32:16 +11:00
770b109deb Fix: AUD_OpenALDevice::getPosition returns negative values
Reported by Antony Riakiotakis. The problem was the seeking code.
2015-03-26 14:45:21 +13:00
Julian Eisel
92f305a490 A more forward thinking version of previous commit
Basically same as 581afa9da3, but I guess we can assume that scopes added in future
to the image preview may also want to use the viewrect from the original ibuf.
2015-03-25 22:15:56 +01:00
Julian Eisel
581afa9da3 Fix T44121: VSE Preview scaling issue when using proxies and Show Overexposed 2015-03-25 21:52:54 +01:00
4dc141f933 Yet another fix for crashing particles. 2015-03-25 20:09:02 +01:00
5e2cc06518 minor cleanup: alignment 2015-03-25 14:29:08 -04:00
d4ac58d049 Fix T43694, by Krzysztof Rećko (chrisr), reviewed in D1177.
Added some guards to prevent clumping to non existing particles. Also, adjusted threaded child path evaluation, so each child is evaluated once - previously virtual parents were done twice.
2015-03-25 18:34:52 +01:00
9fc1a29de3 Fix 2 typos ( shakin' hands ) 2015-03-25 16:56:51 +01:00
4fd2f678ea Fix T44133 SSAO in OpenGL rendering from orthographic camera did not
work

Safe to include in final release
2015-03-25 15:05:36 +01:00
1a866d55ac Fix crash with computers not supporting high quality depth of field. 2015-03-25 14:43:28 +01:00
1c329af74c Fix T44026: ID prop delete leaves names in _RNA_UI 2015-03-26 00:12:28 +11:00
0ef9f61410 Attempt to fix an error in compilation of geometry shaders in Intel 4000
cards (see T44072)
2015-03-25 13:05:52 +01:00
7bc8ddc6e2 use BKE_mball_tessellate.h include
also remove unused includes
2015-03-25 22:40:09 +11:00
3d20bf75cb BKE_mball: split tessellation into its own file
this has a lot of its own local structs, functions,
better to keep isolated from general metaball selection/library logic.
2015-03-25 22:40:09 +11:00
ec03ab021f Change Enables proxy operator to Copy proxy operator.
Allows to change and copy settings much easier, also allows things like
directory settings etc to be copied over.
2015-03-25 12:36:43 +01:00
8463e6cb41 Fix for crash when using particle emission with clump/roughness curves
in a smoke sim.

This interaction between sims is totally stupid and must be recoded
entirely in some utopian future.
2015-03-25 12:29:22 +01:00
a180c8e2ed Allow multiple strips to use the same directory when custom proxy
directory is used.

This is done by appending the name of the file as extra folder. Existing
projects may need to regenerate their proxies but it should be possible
now to have all proxies nicely in the same custom folder.

Next commits will include operators to copy directory settings between
selected strips, making the process faster.
2015-03-25 12:05:34 +01:00
22dfb50622 Fix T44128: Ray visibility only enables diffuse if glossy is also enabled
Issue was caused by accident in c8a9a56 which not only disabled glossy
reflection if Glossy visibility is disabled, but also Diffuse reflection.

Quite safe and should go to final release branch.
2015-03-25 14:53:20 +05:00
3cee9d6939 Simplify recent commit 2015-03-25 20:29:38 +11:00
b38b5846ba Fix T44124: Crash deleting brush 2015-03-25 20:16:27 +11:00
3eb33b804d Fix T44118: Rotated background image disappears
Image clipping didn't take rotation into account.
2015-03-25 19:49:14 +11:00
8d0b104f43 Fix T44064: Reroute two-node loop crash
Issue was caused by cycles in shader graph confusing it's
simplification stage. Now we're ignoring links which are
marked as invalid from blender side so we don't run into
such cycles and keep graph code simple.
2015-03-25 13:46:59 +05:00
917b8754f9 Tracking: Fix one frame memory leak when tracking last frame 2015-03-25 13:20:37 +05:00
87cff57207 Fix T44123: Cycles SSS renders black in recent builds
Issue was introduced in 01ee21f where i didn't notice *_setup()
function only doing partial initialization, and some of parameters
are expected to be initialized by callee function.

This was hitting only some setups, so tests with benchmark scenes
didn't unleash issues. Now it should all be fine.

This is to go to the 2.74 branch and we actually might re-AHOY.
2015-03-25 02:33:49 +05:00
41ed59e0eb Minor UI message fix. 2015-03-24 21:36:26 +01:00
Julian Eisel
2ba82d5729 Cleanup: Remove unwanted debug printf from 7293f6d486
Sergey said this kindof cleanup is good for commit ratio... noted! ;)
2015-03-24 15:54:02 +01:00
Julian Eisel
f98b84072e Remove redundant shortcuts from keyconfigs
These have been deleted recently (cd54f07a3c, fbd4dfb2c, 3f68a0aea)
2015-03-24 15:52:14 +01:00
fa09e152af Code cleanup: r_ prefix vs. _r suffix 2015-03-24 19:20:51 +05:00
Julian Eisel
b714b23443 Fix T44092: Maya preset doesn't allow attaching Nodes to Frames via D&D 2015-03-24 14:15:03 +01:00
7293f6d486 Cleanup - move proxy storage options to the proxy itself - also will
enable more storage options, since seq->flag is running out of space
2015-03-24 12:24:54 +01:00
765fd7044b Updating python API documentation for function bge.render.makeScreenshot 2015-03-24 10:17:55 +00:00
4685092fd8 Fix T44102: Mirrored objects render black with Blender Internal and Autosmooth.
Normals are not vertices, we cannot apply matrix's scale to them...
2015-03-24 11:03:05 +01:00
0f0e080a26 Fix T44110: Plane track doesn't work when built with scons
For some reason recent change in avoiding non-aligned eigen vectors
was behaving differently for cmake and scons. Made it a bit different
now by storing scalars. This is more robust approach anyway, because
it's not really guaranteed Mat.col() gives a pointer inside data,
depending on column-major vs. row-major storage.

This is to be backported to 2.74 branch.
2015-03-24 14:05:49 +05:00
cf365275c2 Fix T44089: All addons do not use same default for orientations.
Transformed 'OrientationHelper' class into 'orientation_helper_factory' function,
which returns an OrientationHelper customized class with specified default axes.
2015-03-24 09:57:11 +01:00
3030e2d1cb CMake: tweak recent py module changes
support installing portable builds to CMAKE_INSTALL_PREFIX
2015-03-24 19:09:51 +11:00
4560570f8a Fix for building blender as a Python module
Installation didn't work on debian distro's
now install into PYTHON_SITE_PACKAGES (which is detected and can be configured).
2015-03-24 17:06:12 +11:00
3bb7e14618 UI: remove UI_BTYPE_SEARCH_MENU_UNLINK
Internal change only,
use UI_BTYPE_SEARCH_MENU with an unlink flag instead.

They are really the same button type, one just happens to have the option to unlink.
2015-03-24 15:09:58 +11:00
a93f346ff4 Cleanup: unused function 2015-03-24 15:09:58 +11:00
22e222563a Blender world value viewport update
This patch will update the 3D viewport if a word value has changed.

This patch does not depends on an other patch, but should applied after https://developer.blender.org/D151 otherwise the the word value viewport update is be slow.

Reviewers: brecht

Reviewed By: brecht

Subscribers: thelasthope, darkxiv

Differential Revision: https://developer.blender.org/D159
2015-03-24 00:31:31 +01:00
ee57968461 BGE: Remove old world bge.render API
This patch can be used to remove the old world bge.render API if the new world API D157 is used.

If  the new world API is applied we can remove the old API because the old has newer worked.
The patch keep the two old working methods for backward compatibility.

Reviewers: campbellbarton, moguri

Reviewed By: campbellbarton, moguri

Subscribers: brecht

Differential Revision: https://developer.blender.org/D158
2015-03-24 00:27:45 +01:00
fd22a92939 BGE: Add new world API KX_WorldInfo (KX_Scene)
This Patch will add a the world API (mist, background, ambient)  to KX_WorldInfo.
The new API uses now attributes.

Reviewers: campbellbarton, moguri

Reviewed By: moguri

Subscribers: klauser, brecht

Differential Revision: https://developer.blender.org/D157
2015-03-24 00:23:40 +01:00
6c9502a6c1 BGE: Remove BlenderWorldInfo
This patch will remove the BlenderWorldInfo and move the source into KX_WorldInfo.

Reviewers: brecht, moguri

Reviewed By: brecht, moguri

Differential Revision: https://developer.blender.org/D156
2015-03-24 00:19:15 +01:00
ce40fb9ab2 BGE: World color management fix
This patch will fix the color management for the mist and global ambient color.
It will remove the old "Color Management" switch in the BGE "Render > Shading" panel and will use the "Display Device" setting in the "Scene > Color Management" panel instead.

Reviewers: moguri, brecht

Reviewed By: brecht

Differential Revision: https://developer.blender.org/D154
2015-03-23 23:56:46 +01:00
931c3e6544 BGE: Code clean up for world (mist, background, ambient)
Code clean up for BGE world mist, background and global ambient color.
Move mist render update to BlenderWolrdInfo

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D152
2015-03-23 22:49:38 +01:00
c73693d4a5 BGE: Fix T43592: World GLSL
This patch will fix the world GLSL (mist, background, ambient) update for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D151
2015-03-23 22:32:49 +01:00
da5fb82a63 CMake: readme.html version trick broke packages 2015-03-24 07:49:17 +11:00
0737f59f62 tweaks to packman build
remove --asroot arg to makepkg
2015-03-24 07:49:17 +11:00
e7ae96ad41 BGE: Fix T27322: World F-Curve
This patch fixes the world (mist, background, ambient) F-Curve for  for the BGE.

Reviewers: moguri, brecht

Reviewed By: moguri, brecht

Differential Revision: https://developer.blender.org/D150
2015-03-23 21:43:42 +01:00
d07c666a0e BGE: Add setMistType and setMistIntensity API.
This patch adds the missing setMistType() and setMistIntensity() to the API

Reviewers: campbellbarton, brecht, moguri

Reviewed By: campbellbarton, brecht, moguri

Subscribers: campbellbarton, dingto

Differential Revision: https://developer.blender.org/D149
2015-03-23 21:40:11 +01:00
2affbb437b BGE: Multitexture world (mist, ambient) fix
This patch fix the existing word API for mist and global ambient lighting.
Add deprecated message to disableMist()
Add setUseMist(enable).

Reviewers: dfelinto, campbellbarton, moguri

Reviewed By: moguri

Subscribers: solarlune, jta, brecht

Projects: #bf_blender:_next

Differential Revision: https://developer.blender.org/D148
2015-03-23 21:36:08 +01:00
38321faa8d cleanup: use spaces for alignment
while studying GPU lib
2015-03-23 15:40:44 -04:00
722ddaaccd Remove 'lorem ipsum' operator
its a very specific function, and not hard to paste body text from elsewhere.
We can make an addon if its important to some users.
2015-03-24 06:17:30 +11:00
6af89c9913 compile fix 2015-03-23 15:04:11 -04:00
1bee77b77a Disable high quality depth of field for GPUs that don't support it,
system will fall back to low quality depth of field.

Also add check in case some of the errors are caused by crappy
framebuffer object support.
2015-03-23 19:24:01 +01:00
ddf58004c4 BGE: LoD Hysteresis clean up
Move scene hysteresis value to KX_Scene where it should be (instead of
KX_GameObject)
2015-03-23 19:03:56 +01:00
f65e3c7f1b Fix T44076, SSAO in solid mode will disable antialiasing in wireframe
mode.

Yes it will, because those modes stay active. So on user side, expose
depth of field option always (I don't see why not), but disable SSAO in
wireframe/bounding box mode. It is a known limitation that compositing
does not support antialiasing yet, but better give users some more
control.

This could be included in final release but it's not that serious
either.
2015-03-23 18:54:56 +01:00
1b71279adc Versioning code to correct socket naming after
340b76b42c

Reported by formerly Old_Demon on blenderartists.

Apparently this caused old files to lose their links to material sockets
(noob own mistake from inexperience with node system).

This should either be included in release with version checking being
set to version 2.73 and subversion 10, without tweaking the
BKE_blender.h file

OR

340b76b42c should be reverted for this
release.

Thanks to Lukas for checking this out.
2015-03-23 18:37:50 +01:00
b13770215c Use linear filtering for final pass of high quality depth of field, no
need to get nearest point anymore.
2015-03-23 17:07:21 +01:00
f5c33a2d48 Shader errors:
Count line from beginning of the whole shader source instead of each
string sepatately since it helps with finding out the error line in most
tested platforms
2015-03-23 15:20:12 +01:00
e8b6d86f95 Fix T44093: Color picker SV+H order wrong.
Based on HSV ordering, SV+H had S<>V swapped.
2015-03-24 00:18:57 +11:00
befaf86a99 Allow bg-image rotation for camera views 2015-03-24 00:03:51 +11:00
b8a6cd0140 Cleanup: comments, style 2015-03-23 22:52:33 +11:00
c48ebb44ae Tidy up the user interface for depth of field based on feedback by
NudelZ on irc, thanks!
2015-03-23 12:48:19 +01:00
fd2b4a74c8 Use same rgb -> greyscale for BLI_math as imbuf 2015-03-23 22:26:00 +11:00
3c21885ec4 Change coefficients to 4 digit precision only.
Need to match convention and sum up to 1.0 (previous set had a minor
10^(-10) overflow) Thanks to Campbell for taking notice.
2015-03-23 12:18:42 +01:00
0884c174b3 Make sure matcap icons are within range.
Basically out of range could happen when opening files made in 2.72 when
the new icons for texture painting were added. Apparently some more
caution is needed here.
2015-03-23 12:00:34 +01:00
c451dba550 Mitigate T44035: Proportional editing lag
Calculating connected data can be slow,
it still lags with heavy meshes but perform some optimizations (nearly twice as fast)
2015-03-23 20:03:14 +11:00
ed7e593a4b Fix T43926: Volume scatter: intersecting objects GPU rendering artifacts
Fix T44007: Cycles Volumetrics: block artifacts with overlapping volumes

The issue was caused by uninitialized parameters of some closures, which
lead to unpredictable behavior of shader_merge_closures().
2015-03-23 12:48:33 +05:00
572489ec89 Fix wrong sizeof() in new ghash hashing helpers code.
Spotted by Coverity.
2015-03-22 21:14:39 +01:00
059d5bc809 OSX: fix 1 leak ( found and fixed by marcclintdion ) and 1 possible leak in dragndrop, backport to 2.74 2015-03-22 19:29:42 +01:00
e7d051043d BGE: New hysteresis offset to improve LOD level transitions
This change introduces a new hysteresis parameter that it will be added
or subtracted to/from the LOD distance to avoid popping when a LOD
object moves close to the LOD transition continuously.

Then, we have the following:

- a new LOD Hysteresis setting per scene (default 10%) which is located
in Scene context --> Level of Detail panel. This scene parameter also
will active/deactive the scene hysteresis.
- and a new LOD Hysteresis setting per object (default 10%) which is
located in Object context --> Levels of Detail panel. The LOD hysteresis
setting per object (if active) will overwrite the hysteresis setting per
scene value.

For the new blends: the hysteresis setting per scene would be active by
default and the per object would be inactive by default.
For the old blends: both hysteresis settings (per scene and per object)
would be inactive by default. A quick way to take advantage of this
feature for old blends would be to activate the hysteresis parameter in
the scene context -> Level of Detail panel

Reviewers: campbellbarton, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: nonamejuju, lordodin

Differential Revision: https://developer.blender.org/D957
2015-03-22 18:19:49 +01:00
0b4a71b072 BGE: Add physics constraints replication
This patch will add a physics constraints replication for group instances
(dupli group).
It also fix crashing when when a group instance is made from a linked
group instance and both are on the active layer.

Initial patch T31443 from moerdn (Martin Sell).

Reviewers: lordloki, sergof, moguri, sybren

Reviewed By: moguri, sybren

Differential Revision: https://developer.blender.org/D658
2015-03-22 17:56:26 +01:00
2744ce77de Revert part of D1074 related to acceleration taked into account.
It has been reverted because it was affecting obstacle avoidance
(T44041).

This fix should be backported to 2.74
2015-03-21 17:54:49 +01:00
e183199022 Cleanup: instantiate arg once in context macro 2015-03-22 03:35:13 +11:00
9ff3d8eafa Cleanup: minor edits to project generators 2015-03-22 03:35:13 +11:00
8e9c9fde42 OSX/GHOST: need one more release in error case 2015-03-21 17:15:38 +01:00
d21018b334 Fix T44065: fixed vehicle constraint
Commit ffee7f1a58 broke vehicle constraints; this fixes that.
2015-03-21 14:42:57 +01:00
d28bfb5022 Cleanup: constify view3d/camera 2015-03-21 22:44:13 +11:00
6e50bdd870 Cleanup: constify scene/modifiers 2015-03-21 22:44:00 +11:00
0025d90b98 Cleanup: use tabs 2015-03-21 16:40:43 +11:00
e0611ca832 View3D: fix view-selected zoom logic
- Correct logic converting radius to view distance.
- Wasn't taking view-zoom into account converting lens to angle.
- Support framing the selection in the camera bounds (for camera locked views).

Add ED_view3d_radius_to_dist to handles these details.
2015-03-21 15:33:10 +11:00
e88cfc28b2 View3D: use defines for default zoom-levels 2015-03-21 15:24:36 +11:00
997c0c837b Fix indentation in last commit, tab slipped in 2015-03-20 20:26:51 +01:00
ed61017391 Really fix scons with new glsl shaders 2015-03-20 20:24:30 +01:00
d5abff589e Fix scons build 2015-03-20 19:47:06 +01:00
0582aa6f13 Partly fix T44025, pixelFormat retain was left, for 2.74 backport 2015-03-20 17:57:35 +01:00
919a665497 Cycles: Avoid memcpy of intersecting memory
Could happen when assignment happens to self during sorting.
2015-03-20 21:14:50 +05:00
8ff4c53e63 Correction to previous commit, initialization of needs_free got lost by accident 2015-03-20 21:09:52 +05:00
f91850d564 Disable IME for headless builds 2015-03-21 03:02:09 +11:00
b9dc4f851b Fix link error with GLEW 2015-03-20 16:35:41 +01:00
94a3924eab Correct recent commit 2015-03-21 02:25:28 +11:00
63ab5b0883 Fix for building win32 headless 2015-03-21 02:17:27 +11:00
d12ab9a9a8 Remove unused armature code
ED_armature_deselect_all now simply de-selects
2015-03-21 02:17:27 +11:00
62b31a6e99 Avoid per-draw allocation when drawing currently rendering tiles 2015-03-20 19:56:09 +05:00
339e43e1e8 Only create vertex buffers if supported and clean them up properly. 2015-03-20 15:43:34 +01:00
07b2508305 Fix high quality depth of field on the Mac.
Quite a few things wrong here:

* Mac did not support EXT_draw_instanced, only ARB_draw_instanced
* Draw instanced did not work unless data came from vertex buffer, which
is second time we see weird things with vertex arrays in mac
* There were a few stupid mistakes by me as well, such as binding to
uniform locations for the wrong shaders (it's a wonder it ever worked
:p)
2015-03-20 15:26:13 +01:00
3d6642db83 Fix race condition and bad memory access highlighting render tiles
Is was possible that interface will be refreshed at thesame time
as render engine will start freeing render parts.

Not sure if we can get away without RW mutex here, seems we need
one way of synchronization or another..
2015-03-20 17:51:05 +05:00
c0be69f7fd Fix/Improve FKey bone creation
- new bone is now made active
- previous selection cleared
- bone direction places the tip on the active bone (if available)
2015-03-20 23:48:27 +11:00
6786ef6783 Fix T43986: VSE Mask Modifier don't move with video-Clip.
Now mask animation is offset to start of strip, instead of staying at frame 1!

Warning: this may break existing files, in case some would be using (hacking around!)
current bad behavior...
2015-03-20 12:39:25 +01:00
03d945095a Cmake: Some more tweaks to building from branch without upstream 2015-03-20 14:07:56 +05:00
6f51df5384 SCons: Attempt to deal with branches without upstream configured 2015-03-20 14:03:54 +05:00
6de12b1b43 CMake: Suppress unconfigured branch upstream error in the output 2015-03-20 13:59:05 +05:00
1cd4070e35 Fix T43786: Cycles bake disregards Auto Smooth (vertex per-face normals)
Added an utility function which performs vertex split based on the loop
normal so now backing API matches to what's happening in Cycles and BI
in terms of autosplit.

Reviewers: dfelinto, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1174
2015-03-20 12:47:19 +05:00
56edaf7867 Fix stupid strict flags in math_color_inline.c
It was unleashed with recent ghash commit and issue seems to
be the same as fixed in 69065b5b.
2015-03-20 12:25:14 +05:00
35ea7efbca Add missing update adding a shape-key
Noticeable when pin is enabled.
2015-03-20 15:50:56 +11:00
cf29010bd4 Cleanup: warnings bit-shift int overflow 2015-03-20 15:41:36 +11:00
f51a3aedc9 Cleanup remove unused variable 2015-03-19 21:11:33 +01:00
fd559ed94f Missed this last commit. 2015-03-19 21:10:41 +01:00
05e3c261a4 Fix T43989: Sequencer - Ctrl snapping a sequencer strip does not work if you specify the x axis.
New 'strip' snapping was simply not computed in case of constrained transform, hence init
'0' value was used as frame offset in this case.

This commit reorganizes a bit that snapping, to keep it more 'confined' into `snapSequenceBounds()`
dedicated function. It still needs a minor hack (setting snapping mode to something else than
defualt `SCE_SNAP_MODE_INCREMENT`, to avoid this snapping to be called by contraint code).

Thanks to Antony for review and enhancements.

This fix should be backported to 2.74.
2015-03-19 20:53:34 +01:00
ea12b87afd Fix cycles dof settings 2015-03-19 20:49:18 +01:00
81472aff2b Remove deleted list for palette colors
was used because of UI memory access only.
2015-03-20 06:08:38 +11:00
eee538f0d2 UI: minor re-organization of dof options 2015-03-20 06:08:22 +11:00
bd1e5eeab7 Blender will now use trilinear filtering by default 2015-03-19 20:05:31 +01:00
2941b4ad9b BLI GHash: add some basic gtests.
We could likely add much more, but those already covers basic behavior and should be able
to catch most errors when editing this code.

Also added some performances tests as well (timing ghash insert/lookup under heavy loads,
for different kinds of keys).
2015-03-19 19:50:51 +01:00
cfdd27381c GHash - code reorganization, performance enhancements, add a few missing utils to API.
This patch is the root of the GHash rework, all other diff will be based on it:

Reduce average load from 3.0 to 0.75
----------------------------------

This is the big performance booster part, e.g. makes tracing a dyntopo stroke between 25% and 30% faster.

Not much to say about it, aside that it obviously increase memory footprint (about 25% - 30% too).

Add optional shrinking
----------------------------------

I.e. ghashes/gsets can now shrink their buckets array when you remove enough entries. This remains optional and OFF by default.

Add code to use masking instead of modulo
----------------------------------

Buckets indices are obtained from hashes by “reducing” the hash value into the valid bucket range. This can be done either by bit-masking, or using modulo operation.
The former is quicker, but requires real hashes, while the later is slower (average 10% impact on ghash operations) but can also be used as a 'fake' hashing on raw values, like e.g. indices.

In Blender currently not all ghash usages actually hash their keys, so we stick to modulo for now (masking is ifdef’ed out), we may however investigate the benefits of switching to masking with systematic very basic hashing later…

Add various missing API helpers
----------------------------------

I.e. a way to deep-copy a ghash/gset, and a way to (re-)reserve entries (i.e. manually grow or shrink the ghash after its creation).

Various code refactoring
----------------------------------

* Get rid of the 'hack' regarding ghash size when used as gset (it’s simpler and safer to have two structs defined here, and cast pointers as needed).
* Various re-shuffle and factorization in low-level internal code.
* Some work on hashing helpers, introducing some murmur2a-based hashing too.

Thanks a bunch to Campbell for the extensive review work. :)

Reviewers: sergey, campbellbarton

Subscribers: psy-fi, lukastoenne

Projects: #bf_blender

Maniphest Tasks: T43766

Differential Revision: https://developer.blender.org/D1178
2015-03-19 17:37:54 +01:00
881e05fc54 Armature select-hierarchy now uses connected bones
Traverse down connected child bones (when available)

Also remove redundant bone loops.
2015-03-20 01:40:45 +11:00
3e9947c4d4 Depth of field high quality:
A new checkbox "High quality" is provided in camera settings to enable
this. This creates a depth of field that is much closer to the rendered
result and even supports aperture blades in the effect, but it's more
expensive too. There are optimizations to do here since the technique is
very fill rate heavy.

People, be careful, this -can- lock up your screen if depth of field
blurring is too extreme.

Technical details:

This uses geometry shaders + instancing and is an adaptation of
techniques gathered from

http://bartwronski.com/2014/04/07/bokeh-depth-of-field-going-insane-

 http://advances.realtimerendering.com/s2011/SousaSchulzKazyan%20-
%20in%20Real-Time%20Rendering%20Course).ppt

TODOs:

* Support dithering to minimize banding.
* Optimize fill rate in geometry shader.
2015-03-19 15:18:14 +01:00
93048873f1 Fix compilation error of blenderplayer after recent constraint commit 2015-03-19 19:10:40 +05:00
7c65b75d01 Correct recent armature symmetrize
Duplicating part of a chain could have invalid 'connected' flag.
2015-03-20 00:42:17 +11:00
15b37a4a4d Speedup for constraints update from python script
General idea is to avoid actual calculation from property update()
callback and tag things for update later instead.

That said, pose constraint flags are now tagged for update and
handled as a part of object update. In the new depsgraph it'll
be a nice dedicated operation node.

Also avoid updating disabled flags for all the modifiers. This
part of the path is not totally optimal since it'll still need
to iterate over bones in order to get pchan, but to optimize it
further would be nice to find a way to avoid pchan requirement
all together.

Reviewers: campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1191
2015-03-19 18:28:49 +05:00
c69b5e0276 Fix T44040: Blender crashes when nodes are muted
It was actually an old issue with wrong conversion happening for muted
nodes, which wasn't visible before memory optimization commit.

This is to be backported to the final release.
2015-03-19 16:04:49 +05:00
52d72a37cd Cleanup 2015-03-19 20:34:02 +11:00
ad95cb72bc Transform: Shift for precision PET adjustment
Patch T36753 by @hjaarnio
2015-03-19 20:11:33 +11:00
156921114e Armature Symmetrize tool
D1147 by @julien, with fixes/improvements

Duplicate bones where needed, otherwise use existing.
Keeps parent relations intact, can operate on parts of an armature.
2015-03-19 19:26:48 +11:00
c6ee43d384 Cleanup: style (armature duplicate) 2015-03-19 18:13:47 +11:00
8b6e777736 Fix out-of-bounds read BKE_deform_flip_side_name 2015-03-19 18:13:47 +11:00
4b88541d59 CMake: unbundle eigen3
Optionally use systems eigen3 library.

T41989 by @hasufell with edits
2015-03-19 15:41:41 +11:00
2df4444def CMake: exclude Colamd when OpenNL's disabled 2015-03-19 14:48:52 +11:00
2a2bf3c1ab Freestyle: pass Main struct to new/copy 2015-03-19 14:34:14 +11:00
9b54c88e0f Cleanup: spelling grey -> gray 2015-03-19 14:14:48 +11:00
4f602ff943 Revert part of recent color-management commit
This adds back rgb_to_grayscale,
not all color is managed or depends on the current loaded blend file's CM options.

Noted in comments that this is only to be used outside the CM pipeline.
2015-03-19 14:12:51 +11:00
255b07681a Color managed luminance for shader ramp-in-energy 2015-03-19 12:59:36 +11:00
ce11e1c878 Cleanup: better not pass function call to FTOCHAR
also use rgb_uchar_to_float
2015-03-19 12:42:34 +11:00
c31aae0487 Use fabsf for floats 2015-03-19 06:13:50 +11:00
1dd1d286c6 Select nth option to skip steps
Patch T43752 @codemanx, added matching curve option.
2015-03-19 04:40:43 +11:00
64451f0928 Fix for crash adding mask modifier 2015-03-19 01:10:44 +11:00
9231d35caa Simplify math in mix_linear glsl function. Thanks to valentin for
pointing out on irc.
2015-03-18 14:09:03 +01:00
72419eebc2 Fix T44029 textures disappear in viewport if GPU mipmap generation is
off.

GPUs need a full tree of mipmaps up to dimension 1xn to work. This will
make it so for all imbufs but cost is negligible and it's unlikely that
something could break due to that.
2015-03-18 13:48:49 +01:00
3e5cd52783 Fix bad memory access freeing viewport which uses movie clip 2015-03-18 17:17:04 +05:00
aff4aa173a Support UV island selection in UV synch and face select mode.
Enough said, people wanted this for ages, enjoy!
2015-03-18 12:41:03 +01:00
ff1ed872d9 Fix crash using "Copy to selected" on ID-props 2015-03-18 18:53:32 +11:00
2919519714 RNA: palette colors api
Methods so Python can manage colors.
palette.colors.new()/remove()/clear()/active
2015-03-18 16:10:43 +11:00
a975a3ca63 RNA: move palette into its own file 2015-03-18 15:57:53 +11:00
db710e6c0d Fix crash using removed data as function arguments 2015-03-18 15:52:36 +11:00
d0fcbab152 Fix RNA active spline assignment 2015-03-18 15:15:52 +11:00
63897304a9 Fix T44028: Vertex Colors Baking error
Was wrong color management flag used for some bakers.
Actually goes back to 7997e38.
2015-03-18 00:10:58 +05:00
2ab4489f17 Fix T44027: Normal Edit Mod : Radial from object normals affected by target object scale.
The way we were getting diff to apply to vcos from target object was just bad!

Also, fixed another related issue - negated scale would be clamped to nearly zero,
now only consider absolute version of size (we do not care about its sign here anyway).

This should be backported to 2.74 (with previous commit too).
2015-03-17 19:57:16 +01:00
6ceb84c217 BLI math vec: add 'abs' functions to get absolute values of a vector.
Unseful when handling e.g. scale, sometimes.
2015-03-17 19:57:16 +01:00
948bc66a00 Cycles: Improve readability of dumped graphs 2015-03-17 21:15:17 +05:00
a43d00d51e Cycles: Fix displacement code creating cyclic dependencies in graph
Bump result was passed to set_normal node and then set_node was connected
to all unconnected Normal inputs, including the one from original Bump
node, causing cycles.
2015-03-17 19:39:09 +05:00
dd38dce7f0 Part 2 of D1082 by Troy Sobotka, remove our functions that do luma
calculations and use the OCIO one instead.
2015-03-17 15:20:33 +01:00
42aac45d7f Part 1 of D1082 by Troy Sobotka, add API in OCIO for luminance
calculation.
2015-03-17 14:15:05 +01:00
bf8ea6b60e Kick particle systems to force redistribution, needed for reliably
applying recent jitter fix.
2015-03-17 11:04:44 +01:00
07f53d6454 Fix T44020: Crash exporting fluid sim to fbx
The issue is coming from wrong fluid modifier copy callback,
which might have left some pointers shared across original
and target fluid modifiers.
2015-03-17 12:59:44 +05:00
1724513fc6 Fix T44021: Crash switching Rendering Engines while viewport rendering + animating
Make sure preview render job is cancelled before freeing the render engine
associated to the viewport.
2015-03-17 12:02:10 +05:00
f138666f68 cleanup: Mac #include
Don’t need all of Cocoa, or any of Carbon here.
2015-03-17 01:18:52 -04:00
c0fa864e24 Cleanup: bool & const
Using bool when we're asking yes/no questions such as whether some GPU
feature is supported.

Consolidated these simple functions into gpu_extensions.c and grouped
them in the header.

Const-ified some args where the functions don't modify the pointed-to
data.
2015-03-16 22:57:56 -04:00
b0bbd34ac2 I18n: update for new akward algo names in UI messages... 2015-03-16 20:55:01 +01:00
ef70d644d6 reverting unintentionally changed value of enum OBJ_TEXT 2015-03-16 18:58:58 +01:00
9ed5a1073e fix D1130 renamed the enum OBJ_FONT to OBJ_TEXT to avoid naming conflicts in Windows 2015-03-16 18:46:40 +01:00
77bc623bc4 Get rid og gluBuild2DMipmaps on game engine. 2015-03-16 16:18:37 +01:00
664c611fc8 Get rid of gluBuild2DMipmaps on rna API.
Code here is a bit weird/simpler than GPU_draw, but we can reuse the API
here, albeit with a few restrictions (no high resolution, custom
filtering mode - which will probably get lost next time blender reloads
textures)
2015-03-16 16:07:21 +01:00
6d03e94491 Get rid of gluBuild2DMipmaps on gpu_draw.c (use our own imbuf scaling
functions instead)
2015-03-16 15:45:34 +01:00
86c828d9fd Make sure disabling attribute arrays also resets the counter so we don't
do it twice.
2015-03-16 12:14:23 +01:00
2fa593a6f7 Fix T43853: Audio animation bug (fcurves)
For a detailed bug explanation see the comments in the report.
2015-03-16 23:02:04 +13:00
19ce78fb3b Code cleanup: Comment 2015-03-16 14:52:54 +05:00
9542cf041a Fix an incorrect assert in lnor code.
There is one case where we do can have only two edges for two loops...
2015-03-16 10:38:45 +01:00
30527e3e55 Fix T43178: BGE has hard-coded 60 Hz as frame rate
Two areas of the BGE use a hard-coded 60 Hz as frame rate. However, this 60 Hz is just a default setting, and can be changed in the Blender interface.
This setting is now used instead of the hard-coded 60 Hz.

CcdPhysicsEnvironment::SetFixedTimeStep() is actually never called, as we don't even support a true fixed-timestep simulation.
2015-03-16 10:12:37 +01:00
6aaedc7cfd Refer to Task 43975: Deleting a Shapekey can break the relative pointers
This patch would reassign the relative of all keyblocks to the relative
of the deleted keyblock. And it fixes the misalignement of the index values
after the keyblock is deleted.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1176
2015-03-16 10:03:23 +01:00
60df4d10ff Fix T43999: MIS for environment broken after multi-threading commit
Typo in task start row calculation.
2015-03-16 13:31:27 +05:00
ce009c8019 PyConsole: double-click to select word
patch T43641 by @v-disp with own edits
2015-03-16 16:03:32 +11:00
4c58cb8bd9 Correct assert 2015-03-16 13:39:27 +11:00
f03e004c23 Fix T43997: Paste fcurve keeps handle selection 2015-03-16 13:08:26 +11:00
927306d60a Cleanup 2015-03-16 11:46:20 +11:00
13dc766148 PyAPI: bpy.ops enum error was cut short 2015-03-16 10:16:16 +11:00
06cc89d744 Fix T43976: Edit-mode crash /w (scene/screen.scene) mismatch 2015-03-16 09:57:15 +11:00
d49eeabae7 Cleanup: warnings 2015-03-16 09:37:00 +11:00
15374d31d5 Update themes for 2.74 2015-03-16 09:29:26 +11:00
2140cb60cb Fix T39184: Multisegment bevel profiles should curve in-plane sometimes.
When the multisegment profile joins two unbeveled edges, all in the same
plane, users desire that rather than the current behavior of linear
interpolation between those edges, the profile should curve.
This changes behavior to do that.  The old behavior can be obtained
by setting the profile parameter to 0.25, if desired.
2015-03-15 18:24:36 -04:00
Julian Eisel
3e6cfcca86 Nodes: Shortcuts for Snap and Snap Element Menu
Added Shift + Tab for Snap and Ctrl + Shift + Tab for Snap Element Menu (consistent to
3D View)

NOTE: Exit Group is now Ctrl + Tab instead of Shift + Tab
2015-03-15 22:35:26 +01:00
Julian Eisel
62070ae6e1 Fix T44003: Flatty Light: GPencil vertices and timeline keyframes black
I noticed our version code and subversion got out of sync in the past, maybe
that's what the issue was here.
Deleting the entries from the .xml makes it fall back to the default values.
2015-03-15 22:13:05 +01:00
225027ce5d BGE - new read-only attribute in KX_GameObject python api (LOD level)
Added a new "current_lod_level" property to the python api of
KX_GameObject. The property returns the current lod level of the game
object. The purpose of the property is activate logic routines only when
an object is at a certain lod-distance from the camera, avoiding to
separately recomputing the same distance in the logic script. Usage in
python script might look like:

owner = bge.logic.getCurrentController().owner
lod_level = owner.currentLodLevel
if lod_level == 0: ...do something
else: ... object might be too distant

Reviewers: dfelinto, kupoman, moguri

Reviewed By: kupoman, moguri

Subscribers: lordloki

Projects: #game_engine

Differential Revision: https://developer.blender.org/D978
2015-03-15 17:26:49 +01:00
dd3ade250d BGE: Fix for T43994 Steering actuator bug with Navmesh
Now the facing option is taken into account as before

This is a regression and to be ported to the final release branch.
2015-03-15 11:38:04 +01:00
176ecd9c9c BGE : Fix for T43724 and T41599 addObject() with KX_FontObject and
overlay scene

GetGameObjectType is overwritten in KX_FontObject to differentiate a
font object into AddNodeReplicaObject function. Now, in this function,
we add fonts in the appropriate list.

Reviewers: campbellbarton, moguri, dfelinto, lordloki

Reviewed By: lordloki

Subscribers: lordloki

Projects: #game_logic, #game_engine

Differential Revision: https://developer.blender.org/D1130
2015-03-15 10:50:59 +01:00
3824e0f124 Cleanup: style 2015-03-14 12:10:09 +11:00
6e17420548 BGE: Fix for T43788 Light casts shadow when use_shadow unchecked
Makes use_shadow usage consistent across supported lamp types (Spot and
Sun)

Differential D1148

Reviewers: Moguri, Brecht
2015-03-13 23:47:15 +01:00
fc3de690ac RNA: avoid inefficient array printing 2015-03-13 23:52:47 +11:00
a1a7317f6b Add argument to DM_to_mesh() function to take ownership over the DM
The idea is pretty simple: instead of making temporary copy of all the
related custom data layers just pass the ownership from the DM to the
mesh.

This is really handy in cases when you've got DM which you need to
convert to Mesh datablock and wouldn't need that DM after conversion
anyway.

Foe example, render database conversion, exporters and even Modifier
Apply will benefit from this option.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1127
2015-03-13 17:46:55 +05:00
2ef2f085fb Add an option to mesh.calc_tessface() to get rid of polygons and loops
The purpose of this change is to add extra possibility to render engines and
export scripts to reduce peak memory footprint during their operation.

This new argument should be used with care since it'll leave mesh in not really
compatible with blender format, but it's ok to be used on temp meshes.

Unfortunately, it's hard to get scene where it'll show huge benefit because
in my tests with cycles peak memory is reached in MEM_printmemlist_stats().

However, in the file with sintel dragon it gives around 1gig of memory benefit
after removing the polys which would allow other heavy to compute stuff such as
hair (or even pointiness calculation) to not be a peak memory usage.

In any case, this change is nice to have IMO, and only means more parts of
scene export code should be optimized memory-wise.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1125
2015-03-13 17:39:21 +05:00
0e18a56432 Cycles: Free caches used by the synchronized objects
Issue this commit is addressed to is that particle system and particle modifier
will contain caches once derived mesh was requested and this cached data will
never be freed.

This could easily lead to unwanted memory peaks during synchronization stage
of rendering.

The idea is to have RNA function in object which would free caches which can't
be freed otherwise. This function is not intended to deal with derived final
since it might be used by other objects (for example by object with boolean
modifier).

This cache freeing is only happening in the background rendering and locked
interface rendering.

From quick tests with victor file this change reduces peak memory usage by
command line rendering by around 6% (1780MB vs. 1883MB). For rendering from
the interface it's about 12% (1763MB vs. 1998MB).

Reviewers: campbellbarton, lukastoenne

Differential Revision: https://developer.blender.org/D1121
2015-03-13 17:38:03 +05:00
79393cb7a2 Fix T43959 jittering in 2D texture painting.
This is still not perfect,
but should work smoother now. Previously there was visible wobbling
while painting.

This can be included in final release.
2015-03-13 13:10:38 +01:00
a0a6cb129e Fix unstable particle jittered distribution.
This was never working for threaded distribution.
2015-03-13 13:07:23 +01:00
63ea8dd156 Initial compilation support with C++11 featureset enabled
This commit makes some preliminary fixes and tweaks aimed to make blender
compilable with C++11 feature set. This includes:

- Build system attribute to enable C++11 featureset.

  It's for sure default OFF, but easy to enable to have a play around with
  it and make sure all the stuff is compilable before we go C++11 for real.

- Changes in Compositor to use non-named cl_int structure fields.

  This is because __STRICT_ANSI__ is defined by default by GCC and OpenCL
  does not use named fields in this case.

- Changes to TYPE_CHECK() related on lack of typeof() in C++11

  This uses decltype() instead with some trickery to make sure returned type
  is not a reference.

- Changes for auto_ptr in Freestyle

  This actually conditionally switches between auto_ptr and unique_ptr since
  auto_ptr is deprecated in C++11. Seems to be not strictly needed but still
  nice to be ready for such an update anyway/

This all based on changes form depsgraph_refactor branch apart from the weird
changes which were made in order to support MinGW compilation. Those parts of
change would need to be carefully reviewed again after official move to gcc49
in MinGW.

Tested on Linux with GCC-4.7 and Clang-3.5, other platforms are not tested and
likely needs some more tweaks.

Reviewers: campbellbarton, juicyfruit, mont29, lukastoenne, psy-fi, kjym3

Differential Revision: https://developer.blender.org/D1089
2015-03-13 16:47:40 +05:00
278871db5b error in last commit 2015-03-13 22:46:15 +11:00
bb825d02f8 CMake: unbundle LZO library
Patch T41989 by @hasufell
2015-03-13 22:36:01 +11:00
61eab743f1 Cycles: Optimization for CMJ in CUDA kernels
Two things:
- Use intrinsics for clz/ctz (ctz is implemented via ffs()).
- Use faster sqrt() function which precision is enough for
  integer values.
2015-03-13 12:38:14 +05:00
aa4cb95a5c Pass proper bmain to the updateDepgraph() of modifiers
This is mainly to make physics modifiers being able to work
with it. For other cases this main is not needed.
2015-03-13 12:03:23 +05:00
1cac8c23b5 Fix T43803: Crash playing smoke animation, when linked as group instance
The issue was caused by missing relations between smoke domain and flow/source
objects. This happened because smoke's modifier only iterated base objects and
ignored cases when flow/source could be linked to scene via dupli-group and
does not have real base.

The same seems to be still needed for fluid and dynamic paint modifiers,
will do it as a separate commit.

Reviewers: campbellbarton

Differential Revision: https://developer.blender.org/D1172
2015-03-13 12:03:23 +05:00
73ad76970e BGE: Fix for T43980 MouseLook (actuator) triggers MouseMovement (sensor)
on other objects permanently

only trigger mouse event when it is necessary, this way we avoid
conflicts with other mouse sensors.
2015-03-13 00:50:25 +01:00
3db0e1ef6a Cycles: Simplify volume light connect code. 2015-03-13 00:09:13 +01:00
0ed914a194 Cleanup: Use differential helper class. 2015-03-12 23:35:01 +01:00
90f36d4ec8 BGE: Fix for T43793 Increment frame_start/end value to 255 frames
Currently, for animated textures we were allowing 16x16 tiles but we can reproduce 128 frames only.

Reviewers: moguri, sergey, campbellbarton

Reviewed By: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1164
2015-03-12 22:07:35 +01:00
e160da30ea View3D: Quad-view opposite axis switching
Pressing Numpad9 now orbits to the opposite side in any viewport,
with the advantage that it can switch locked-quadview axis to their opposite side.
2015-03-13 04:48:23 +11:00
f8de442a35 Cleanup: remove unused viewnumpad code 2015-03-13 03:40:58 +11:00
a8f6d51ebc D1171: Use GHash for BHead idname lookups
This patch avoids looping over bhead's linked list when looking up values by name.

Used during appaned and library loading.
Gives noticeable overall speedup loading files that used libraries. (nearly 2x on some Mango files)
2015-03-13 01:55:49 +11:00
f2d4f6b086 Cleanup: use realloc for entry-array-resizing 2015-03-13 01:55:48 +11:00
1ce256cb8f Cleanup: refactor header lookups into functions 2015-03-13 00:41:21 +11:00
b007fa41c6 Cleanup: use POINTER_OFFSET macro 2015-03-13 00:41:21 +11:00
03c77fbb99 Readme: tweaks to make it less hassle to edit
also remove "this is the Nth release" text, not so helpful and easy to forget to update.
2015-03-13 00:34:27 +11:00
dce16d57dc Revert "Fix T43865: Cycles: Watertight rendering produces artifacts on a huge plane"
The fix was really flacky, in terms during speed benchmarks i had
abort() in the fallback block to be sure it never runs in production
scenes, but that affected on the optimization as well. Without this
abort there's quite bad slowdown of 5-7% on the renders even tho
the Pleucker fallback was never run.

This is all weird and for now reverting the change which affects on
all the production scenes and will look into alternative fixes for
the original issue with precision loss on huge planes.

This reverts commit 9489205c5c.
2015-03-12 18:24:53 +05:00
c4b3b60aad Fix T43974: Alpha output of movie clip node crashes blender
Issue was caused by a bug in the memory optimization commit,
should be backported to the final release branch.
2015-03-12 18:24:53 +05:00
13d443496c Partial fix for T43967: Background is wrong in 2.74
Was missing do-versions code after rotation order change in Cycles.

This is a regression and to be ported to the final release branch.
2015-03-12 18:24:53 +05:00
cef379242b Cleanup: style 2015-03-13 00:07:26 +11:00
92d77b250e makesrna: move extern prototypes into own header
Patch T36049 by @jeske
2015-03-13 00:05:11 +11:00
ae45496812 OpenEXR 2.2 add support for Dreamworks DWAA / DWAB compression
This patch makes it possible for the user to select all supported compression types in OpenEXR 2.2

Discussion points:
 - B44 is only defined for half's it compresses to a fixed representation of 44% of the halfs. We do currently not reflect in the UI that in the case of float32's it will be equal to compression = NONE
 - ZIPS is single scanline zip and is supposed to be useful in cases where importing in Nuke happens.
 - The new Dreamworks formats, are the worth exposing etc etc

Reviewers: campbellbarton, sergey

Reviewed By: sergey

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1050
2015-03-12 14:02:33 +01:00
2814039ee3 Remove version from readme, (replace on install) 2015-03-12 23:52:48 +11:00
4b3641ec99 Fix loading of indexed .bmp files
D1173 by @rdb

Support for 1,2,4 bit images
2015-03-12 23:52:09 +11:00
064fa4baae Cycles / Decoupled Ray Marching: Skip consecutive empty steps.
This merges consecutive empty steps in the decoupled record function,
which can lead to fewer iterations in the scatter functions.

Only helps slightly though (1%), but doesn't hurt to have this.

Differential Revision: https://developer.blender.org/D873
2015-03-12 13:50:12 +01:00
cdb47b9dfc Cycles: Make Background MIS building threaded
Use multiple threads for building the MIS table, if the
resolution is higher than 512.
Also replace division by cdf_total, with a inverse multiplication by
cdf_total_inv. This gives further speedup.

On my Macbook (8 CPU threads) this improves the time to build the table:
Resolution 4096: From 0.16s to 0.03s
Resolution 8096: From 0.61s to 0.11s

This especially helps to reduce the scene update time, when tweaking world
shader while viewport rendering is running.

Patch by Sergey and myself.

Differential Revision: https://developer.blender.org/D1159
2015-03-12 13:50:11 +01:00
583466fccf Blender 2.75 release cycle start: BCon1 2015-03-12 13:50:11 +01:00
26a2b7b38f Py/RNA: add bpy.data.palettes 2015-03-12 23:49:15 +11:00
42c7200248 CustomData: don't calloc when duplicating layers 2015-03-12 23:49:15 +11:00
56f794fce6 Cleanup: de-duplicate view3d clipping 2015-03-12 23:49:15 +11:00
17d96ca2aa GuardedAlloc: safer MEM_SAFE_FREE
only instantiate the argument once,
so MEM_SAFE_FREE(array[i++]), won't cause incorrect behavior.
2015-03-12 23:49:15 +11:00
57646cb2ce Py Tests: manual URL validator
Support for URL checker to use locally generated manual.
2015-03-12 23:49:15 +11:00
4aa51096a7 Point submodules to RC1 tags 2015-03-11 20:49:46 +05:00
b40b6431c8 2.74 splash
by Manu Järvinen
2015-03-12 02:38:57 +11:00
124a226eaa 2.74 release: update HTML
Also remove unneeded metadata
2015-03-12 02:38:56 +11:00
639a3dd53b 2.74 version bump 2015-03-12 02:30:55 +11:00
99ed95bba2 Fix really stupid issue reported by Campbell, code retry to render
without VBOs would return prematurely and leak.
2015-03-11 12:19:16 +01:00
72f86ad046 Fix typo in RNA definition of "shape_key_add"
Reviewers: sergey

Reviewed By: sergey

Differential Revision: https://developer.blender.org/D1167
2015-03-11 16:17:13 +05:00
527302bc0b Fix 8bit BMP palette reading
part of D1173 by @rdb, load BGR -> RGB
2015-03-11 21:26:29 +11:00
cf385caf92 Fix flip node making unsigned int out-of-range 2015-03-11 15:39:58 +11:00
62faffc800 Cleanup: style 2015-03-11 13:15:52 +11:00
6b610500b9 Cleanup: indentation 2015-03-11 13:14:24 +11:00
0d053158ec Fix T43342 bad rendering of normal maps on NVIDIAs on the MacOS
This is not limited to normal maps, it's just that normal maps cause a
mix of interleaved vertex arrays + non interleaved vertex arrays + GLSL,
which could confuse the GL. Possible explanation is that it may be
clobbering the vertex index of the shader somehow but this is difficult
to know without extensive tests and the Mac is needed by Francesco in
the morning :).

Do brute force solution instead, just force legacy drawing on Macs when
VBOs is off. On the plus side VBOs work fine, so we should be fine when
we update.
2015-03-10 23:08:43 +01:00
26d7b6c517 Fix T43831: Image Editor: Render info not displayed
Issue was caused by b62c2a9 and root of it goes to the fact that text
info is stored in the "main" scene, not the currently rendering one.

This is a bit annoying but making it so text and result are coming
from the same scene is a bit dangerous to do now. Will re-visit this
change after the release and see if it might be done in a more clear
fashion.
2015-03-11 00:04:59 +05:00
56c0a3faef Fix T43953, make opengl render work like before, basically, if we render
transparent, it will render sky/transparent, regardless of the "show
world setting".
2015-03-10 16:47:50 +01:00
edc8a4c484 Fix memory leak when using two bump maps on the same material 2015-03-10 15:27:24 +01:00
51a60cbaf8 Fix T43887: Quick Fur duplicate particle system on edit
Forbid add quick fur operator from adding fur to objects in edit mode.

Fur is not visible for them anyway and because of local undo stack used
in edit mode tweaking values of this operator does not lead to proper
operator redo.
2015-03-10 17:02:29 +05:00
9d72c9e7e5 Tests: Print counter with operator test 2015-03-10 22:00:24 +11:00
8a551394e5 Fix crash in mesh data transfer 2015-03-10 19:46:24 +11:00
95a1cc20dc Fix crash extruding an empty curve 2015-03-10 18:22:08 +11:00
81b50bcf5f Fix crash enabling dyntopo in background mode 2015-03-10 18:21:26 +11:00
f1a0c2a4f0 Fix T43941: Grease pencil eraser outline vanishes 2015-03-10 18:17:02 +11:00
afa8a0ac19 Fix for yet another assert fail of particle dmcache index.
This is totally broken, just making sure Blender does not crash and devs
can investigate other issues that are actually fixable.
2015-03-09 18:45:27 +01:00
e2471ea96a Attempt to fix T43919, avoid using GPU_framebuffer_slots_bind just in
case a system does not support drawing to many framebuffers.
2015-03-09 18:27:27 +01:00
219937fc5d Fix T43674: Smoke collision does not detect obstacles reliably.
The smoke obstacle detection was using a maximum distance for BVH
checks to find mesh elements that define boundary cells in the grid.
This BVH test was using an arbitrary value of 0.6 cell units. It should
be `sqrt(3)*0.5` to account for the maximum possible distance of mesh
elements inside a cell. Otherwise some cells that should form the
boundary are not detected as such (no closest mesh element found inside
the radius), so you get gaps in the smoke obstacle.
2015-03-09 15:23:52 +01:00
Julian Eisel
b14e2876a7 Fix T43937: Changing Texture Brush doesn't update toolbar 2015-03-09 14:48:56 +01:00
b21e0cccfa Fix T43872: Adding a constraint to a bone of a proxy armature resets all bones' transformations.
Temp hack for until new depsgraph is here. Thanks the Joshua and Sergey for their help.
2015-03-09 13:02:30 +01:00
fd94d2d80f T37832: OpenCL compositing bug in defocus node
The issue seems to be caused by the integer overflow. It's actually
still needed to investigate why exactly buffer contained such a huge
value, but the patch is still legit and seems to be solving the issue
just nicely.
2015-03-09 16:56:37 +05:00
a1549bc47a Image Space: enable zoom/cursor warping 2015-03-09 21:01:43 +11:00
40ef25d000 Fix T43891: Skin modifier inverts some faces 2015-03-09 20:26:09 +11:00
9ffc66b1c0 Math Lib: add mid_v3_v3v3v3v3 2015-03-09 20:26:09 +11:00
d4c1e98dd4 Fix T43484: Motion blur fails in certain circumstances
The issue was caused by mismatch in how aligned triangles storage was
filled in during BVH construction and how it was used during rendering.

Basically, i  was leaving uninitialized storage for triangles when
there was deformation motion blur detected for the mesh. Was likely
some sort of optimization, but in fact it's still possible that regular
triangles would be needed for rendering.

So now we're storing aligned storage for all triangle primitives and
only skipping motion triangles (the deformation motion blur flag from
mesh is now ignored).
2015-03-09 14:15:35 +05:00
b13b900d50 Cycles: Improve logging in object motion detection
Reporting mesh name is not really useful, since it's name does not
any relation with the original object/mesh names.
2015-03-09 13:25:27 +05:00
2ae0f1e70b Fix T43908: Mask render bug, one pixel black line
This was a regression caused by attempts to fix T42844 and there were
some red-herrings which lead me to the wrong way to fix it. It's some
deeper issue than just interpolation offset, it's mainly how the node
resolution is being mapped to each other.

It could be actually a part of canvas awareness project..
2015-03-09 12:48:42 +05:00
36df8cc1e5 Fix T43421: bisect_edges returns insufficient data 2015-03-09 18:33:24 +11:00
09e072a245 Fix T43858: Collision Bounds Display Bug
Was using draw-type when drawing BGE collision bounds.
2015-03-09 17:24:14 +11:00
29e5de3728 Fix BGE: calling ReleaseInstance on NULL joystick 2015-03-09 16:36:35 +11:00
c44f489d24 Fix for clamping large UV coords in UV-panel
Would clamp value ranges in UI when outside hard coded range.
2015-03-09 15:49:45 +11:00
60f7f93c16 Freestyle: Fix for a few line style properties left not copied. 2015-03-09 12:53:16 +09:00
Folkert de Vries
7d38d85340 Freestyle: Fix for references of deprecated texture stroke shaders.
Removed all references of deprecated texture shader.  Also deleted
several lines of dead code.

Since texture_shader.py no longer does what it was supposed to do,
the file itself was removed.

Patch reviewed by Tamito Kajiyama (kjym3).
2015-03-09 12:53:13 +09:00
a0fa3de267 Fix T43624: Freestyle uses wrong colour on second Line Set with textured lines in Cycles.
This is a regression introduced by rBd8b00a3bf5c1 (Freestyle: memory
consumption optimization in stroke rendering).

The issue was caused by uninitialized MPoly::mat_nr values.  Before the
stroke rendering optimization, individual Freestyle strokes were
represented by distinct mesh objects, and thus MPoly::mat_nr was left
unset (i.e., was always zero).  Now that the stroke rendering optimization
has been done and mesh objects may represent multiple strokes of different
materials, MPoly::mat_nr had to be properly set to the material index that
refers to the material of the poly face.
2015-03-09 12:53:11 +09:00
ec18021867 Fix T43337: Group object disappear after append
Relying on user-count of 1 wasn't reliable because of custom-bones.
2015-03-09 14:33:27 +11:00
Severin
573783259d IME: Disable IME for number buttons 2015-03-09 02:27:11 +01:00
Severin
7d5d971dea Fix T43920: Crash when clicking into different area during IME composition
Fix by @randon
2015-03-09 02:27:11 +01:00
a7855f81d4 Fix T43332: Adding polygon int layer failed 2015-03-09 12:23:58 +11:00
fee0e6e211 BMesh Py API: calc_edge_angle functions
Make consistent with calc_edge_angle,
take an optional fallback arg for non-manifold edges
otherwise raise an exception.
2015-03-09 00:47:53 +11:00
b4fccce1f6 BGE: Fix for regressions T43883 and T43456 (and T43876 likely). SDL joystick related
Only to create and destroy joystick devices for connected joysticks

Reviewers: campbellbarton, sybren, moguri

Reviewed By: sybren

Maniphest Tasks: T43883, T43876

Differential Revision: https://developer.blender.org/D1161
2015-03-07 21:27:30 +01:00
c32ded3654 Cycles: add better specializations for SSE shuffle function and few more wrappers. 2015-03-07 17:25:21 +00:00
c8fb488b08 Fix T41066: An actual fix for curve intersection on FMA-enabled CPUs 2015-03-07 16:20:34 +00:00
b7a759502f InstallDeps: Fix stupid typo which broke OIIO building (and nobody reported it :| ). 2015-03-07 14:42:03 +01:00
8dbbb60e8a Fix T43910: Unpack fails when stored filename is broken (empty, or no file part...).
Now we have an helper that will generate local/global paths and ensure they are valid.

Note: We currently have no way to 'generate' a valid extension in these cases, so just
using raw (file-safe) ID name.
2015-03-07 14:41:43 +01:00
cf1227d4ad Fix edit-lattice leaving incorrect point-size 2015-03-07 03:53:08 +11:00
1c3b2c58af Fix issue reported on irc by Sebastian, crash when undoing and changing
screen.

Apparently the screen on the given file did not have a scene attached.

Not sure how this is possible exactly, but for now just guard against it
at load time by assigning default scene in that case.
2015-03-06 14:22:00 +01:00
e95732bced Fix broken "force setting multisamples only once", introduced in b5b359b48f 2015-03-06 13:07:02 +01:00
9794facab3 Fix metaball->mesh removing all metas in the scene
Assumed the entire scene used the one motherball.
2015-03-06 22:46:45 +11:00
6405aa4e9c Fix access freed memory when doing constraints ID counter on main free
Basically just made constraints free function aware of possible do_id_users
argument, same as we've got for objects, object data and so on.
2015-03-06 15:22:25 +05:00
3f572fe7d2 Fix T43905: Crash happens when press Create Plane Track
It was only happening on 32bit platforms because of alignment
differences when allocating class.

Now got rid of copy of eigen matricies stored by value in the
residual block which solves aligment issues and should also
give some unmeasurable speedup.
2015-03-06 14:58:16 +05:00
f682129d62 PyAPI: clarify fallback docstring 2015-03-06 19:02:57 +11:00
8638142c3b Fix T43904: calc_vert_angle returns wrong value
This was mis-named, rename to `calc_edge_angle`
and allow a fallback value in the case when the vert doesn't have 2-edges.
2015-03-06 18:55:36 +11:00
7df60becb9 BMesh: Add extended BM_vert_calc_edge_angle that takes a fallback value 2015-03-06 18:45:00 +11:00
d17e6c10df Cleanup: quiet minilzo warnings 2015-03-06 17:47:23 +11:00
2f21dbf38b Cleanup: unused warnings 2015-03-06 17:30:05 +11:00
a9b7d5e4e8 Cleanup: unused macro warning 2015-03-06 14:17:21 +11:00
b1f4301deb Fix typo in "Add" and "Subtract" mode of Vector Math node.
Differential Revision: https://developer.blender.org/D1003
2015-03-06 02:34:03 +01:00
Julian Eisel
d6a6950547 Correction to previous commit
Calling ensure_lookup_table for each face is stupid! :/
(Noted by Sergey - thx)
2015-03-05 20:36:58 +01:00
Julian Eisel
61aede4305 Fix T43900: "Operator Mesh Add" template fails
Another script that was missing the lookup_table call.
2015-03-05 20:26:41 +01:00
37d7b2d3b6 Revert "COLLADA - support for shadeless material (SHADER_CONSTANT)"
This reverts commit 04b0a9f4b8.
2015-03-05 19:44:23 +01:00
e2d4a93a00 Fix T43880 really stupid mistake from fixing stick mode selection 2015-03-05 19:14:38 +01:00
6f3629607b Make limits of sequencer scaling a bit more sane 2015-03-05 19:05:39 +01:00
7c38ba0a9e Audio library, early exit when animation is found 2015-03-05 18:50:44 +01:00
a7d292394e Fix T43898, correct all uv layers in bevel, not only the active one 2015-03-05 18:50:44 +01:00
04b0a9f4b8 COLLADA - support for shadeless material (SHADER_CONSTANT)
This patch make it possible to export and import shadeless material.

Reviewers: sergey, sauraedron

Subscribers: sergey

Projects: #collada

Differential Revision: https://developer.blender.org/D1094
2015-03-05 18:44:04 +01:00
23af8984bb Compositor: Add sanity check around pass element size and compositor data type
Only happening in the debug builds, avoids issues like recent AO one from happening.
2015-03-05 20:24:41 +05:00
6e1ea04ada Fix T43894: Wrong alpha with bilateral blur node
The issue was caused by AO operation reporting it's a color operation
(which means it's expected to output RGBA) but internally it's RGB
only in the render engine, which caused some memory to be uninitialized.
2015-03-05 20:21:55 +05:00
73d0749a59 Compositor: Fix compilation error with COM_DEBUG enabled 2015-03-05 20:12:28 +05:00
9489205c5c Fix T43865: Cycles: Watertight rendering produces artifacts on a huge plane
The issue was caused by numerical instability whrn having ray origin close to a huge
triangle, which could have aused bad ray distance check.

Watertight Woop intersection isn't really addressing such cases, it's dealing with
small triangles far away from the ray origin instead, so it's a bit tricky yo make
it working reliably.

While we're quite close to the release it's safer to do check in Pleaucker coordinates
if ray close to a huge triangle. Likely this additional check combined with some other
tweaks to the code doesn't cause measurable slowdown in the scenes tested here.

After the release we can play a bit more with this code in order to make it more
stable without Pleucker fallback.
2015-03-05 18:55:30 +05:00
eb16b04b9d CMake: Need to find pugixml.hpp instead of pugixml.h
That's how file is actually called in the upstream.
2015-03-05 17:23:23 +05:00
6883a9bad9 Recent changes broke SDL/GHOST 2015-03-05 21:01:48 +11:00
37771e8fff Cleanup: unused var 2015-03-05 17:58:22 +11:00
61215999b5 Update install_deps for recent CMake change 2015-03-05 17:45:21 +11:00
da0176614b Fix T43672: Cycles preview stalls when out of view 2015-03-05 15:42:01 +11:00
1e817cceb0 CMake: rename LLVM_DIRECTORY -> LLVM_ROOT_DIR
Matching convention with all other libs
2015-03-05 15:42:01 +11:00
acfc0d4a18 CMake: was defaulting to an old LLVM version
Made finding LLVM fail.

only use LLVM_VERSION if set, else set to installed version
2015-03-05 15:42:01 +11:00
30d6589069 CMake: mark lib/debug options advanced 2015-03-05 15:42:01 +11:00
90e1b83696 Fix T43890: Crash, Alt-D over operator redo button 2015-03-05 09:10:16 +11:00
ffee7f1a58 BGE: Fix crash when a constraint misses its reference object
Blender allows you to create a constraint without specifying its reference
object, even when the constraint requires such a reference. The BGE would
crash on this. This change simply ignores such a constraint.
2015-03-04 14:15:41 +01:00
6efcd9e8fe Math Lib: redundant axis flip decomposing a plane
Also add a faster, non-normalized version of the function.

(Neither are used currently used).
2015-03-04 20:11:49 +11:00
b1e48ab4e4 Fix T43879: Autokey ignore pref /w viewlock-camera 2015-03-04 17:15:11 +11:00
cf2876b77a Fix for snap to cursor /w parents (object/pose)
Also don't use pose-bone transform unless the user is in pose-mode.
2015-03-04 15:13:10 +11:00
d48c3666da Snap: ignore unselected items, /w snap from active 2015-03-04 15:13:10 +11:00
27fe640104 Own error in recent commit (Snap active) 2015-03-04 13:28:45 +11:00
c755d8fbb5 RNA: rename mesh validate argument
cleanup_cddata -> clean_customdata
2015-03-04 12:58:14 +11:00
85c38e7389 Fixed wrong label and hint text in Collada exporter 2015-03-03 23:42:33 +01:00
7f25da6509 fix T43094 Added check for out of bounds in vertex color array 2015-03-03 23:42:32 +01:00
d544bc5cd5 Cycles: Fix embarrassing type remained after getting rid of utility SWAP() 2015-03-04 00:16:21 +05:00
ed5df50192 Cycles: Fix/workaround for toggling world MIS causing CUDA to fail
Seems it's just another issue with the compiler, worked around by explicitly
telling not to inline some function.

In theory we can unify this with CPU, but we're quite close to the release
so better be safe than sorry.
2015-03-03 18:48:37 +05:00
19656233dd Style cleanup 2015-03-03 13:43:47 +01:00
d58a15c0a6 Windows: Add stacktrace support when unhandled exception occurs.
We need to register the exception handler slightly differently here, as
well as adding DbgHelp as a library, but according to docs it should be
supported in recent Windows editions (Win XP included even).

We can try it first and revert if there are issues.
2015-03-03 13:39:15 +01:00
b42a3d2485 Another stability commit for legacy users - don't crash when toggling
dyntopo just notify user that their system doesn't support it.
2015-03-03 11:34:23 +01:00
f2bc3dd678 Grrr, missed those ones in previous commit! 2015-03-03 10:44:14 +01:00
82cafcfdb7 UI messages fixes... 2015-03-03 10:40:52 +01:00
23330473e3 Cleanup: remove unused collada conversion 2015-03-03 15:40:34 +11:00
26a251202b Fix mesh-validate for polys using successive verts 2015-03-03 15:32:35 +11:00
34003dd034 Fix T43151: Collada meshes crash Blender
We have multiple reports of collada files crashing, run all meshes through validate.
2015-03-03 15:30:45 +11:00
6d5ab8fdb7 Cleanup: collada had own defined Global (why?)
Wasn't needed and made linking fail here
2015-03-03 15:07:19 +11:00
6856ea0642 Bugfix T43866: 'Purge all' button in the outliner
The cleanups in 08a2101 forgot to modify the UI code which was using these values.
2015-03-03 12:52:18 +13:00
e2c24a18e3 Knife: fix glitch dragging mouse outside the face
Had a small gap between the last-vertex & new-cut
2015-03-03 09:29:44 +11:00
Julian Eisel
c271a9fa8b Fix T43864: Saving from top area in fullscreen changes wrong area into File Browser
We now always use the actual fullscreen area.
2015-03-02 22:38:59 +01:00
d2b6c6fd9b Fix T43862: Knife fails with concave ngon 2015-03-03 00:26:20 +11:00
8c6073db11 BMesh: BM_loop/edge_point_side_of_loop_test
change behavior to use a negative number when outside,
and return the signed, squared distance.
2015-03-03 00:26:13 +11:00
e38dc33f80 Fix dist_signed_squared_to_corner_v3v3v3 with concave corners 2015-03-03 00:20:53 +11:00
cea3892813 Revert "Reshuffle applying of solver results a bit to ensure it works exactly"
This reverts commit 4c723eb80e.
2015-03-02 12:18:57 +01:00
bc20a745be Fix T43859: Texture baking crashes blender
The issue was caused by particles using billboard distribution, which
requires either object to be specified or camera in the scene to be
existing.

This commit prevents backing from crash, but bake result might not be
totally expected because of the thing mentioned above.
2015-03-02 16:08:23 +05:00
4c723eb80e Reshuffle applying of solver results a bit to ensure it works exactly
as complicated as before cloth solver changes.

Still doesn't solve the collapsing cloth cube issue mentioned in T43406,
probably the bending springs work somewhat differently now.
2015-03-02 11:47:42 +01:00
1adfa36f88 Fix missing newline in the button cycle error print 2015-03-02 14:26:52 +05:00
520646b421 cleanup: whitespace 2015-03-02 16:51:01 +11:00
3281c3f3ce error in last commit 2015-03-02 16:51:01 +11:00
6373078321 Fix T43848: Wrong direction recalculating normals
Face islands furthest faces could face towards the center point when connected to sharp edges.

Now check the furthest edge of the furthest face, to test for face winding.
2015-03-02 15:51:07 +11:00
9d85e32ee3 BMesh: calc normals, use area weighted center
Prevents many small faces skewing center calculation.
2015-03-02 13:04:46 +11:00
56935e23c4 cleanup: float/double promotion, redundant casts 2015-03-02 11:05:34 +11:00
2058505da4 Bugfix T43851: Creating a new action after stashing crashes blender 2015-03-02 05:05:04 +13:00
f076eb482b Use the old double-step collision method only for cloth.
This method does not work for hair anyway. Even though hair collision
needs work at this point, it's still better than nothing.
2015-03-01 15:37:55 +01:00
dfefd36837 Fix T43406: Bring back cloth collisions.
This was disabled during the course of hair dynamics work. The cloth
collision solution is based on a secondary velocity-only solver step.

While this approach is usable in general, the collision response
calculation still does not work well for hair meshes. Better contact
point generation is needed here (Bullet) and preferably an improved
solver for unilateral constraints.
2015-03-01 12:33:30 +01:00
9f6f151536 I18n: Do not skip Polish anymore, translation work has started on it. 2015-02-28 21:51:17 +01:00
4ad31d5bab NLA Drawing Tweaks
* Strips in muted tracks are also drawn with dotted borders now to make it clearer
  that they are not contributing.

TODO:
* Perhaps dotted should be used for protected, and opacity for muted instead?
2015-03-01 02:34:54 +13:00
46ad5b6f67 Tweaks for NLA and newly added Action Stash Tracks
* Do not make Action Stash Tracks or their strips active/selected
* Lock the track to prevent accidental editing/adding of other strips

* Prevent strips from being added into locked tracks by the pushdown operator.
  This is mainly to prevent pushdown actions from getting into the stash tracks.
2015-03-01 02:34:53 +13:00
ea84b0e4ac Action Editor: "New Action" operator now stashes old actions, and is used by default again
This commit modifies the "New Action" operator to always stash the old action
before it creates a new one. As a result, the old active action will now have
a proper user of sorts after the new one is created, preventing previously
created actions from being lost.

Now that the New operator does this, it can be used for the Action Editor header AND
NLA Editor (Animation Data Panel -> Active Action) again. The "stash and create"
operator is somewhat redundant at this point as a result.
2015-03-01 02:34:52 +13:00
741a66e472 Action Editor WIP: Adding new actions in Action Editor now uses the "stash and create new" operator
In constrast to the old "new" operator, this operator will stash the existing action
in the stack to prevent it from being lost. This situation isn't totally ideal yet,
since the NLA Editor still calls the old method.
2015-03-01 02:34:51 +13:00
13a0dce51c Action Stashing: Don't allow an action to get stashed more than once 2015-03-01 02:34:50 +13:00
b16fbabd61 Reshuffle code 2015-03-01 02:34:49 +13:00
7c611e2204 Code Cleanup: Deduplicate logic for getting AnimData block associated with Action Editor modes 2015-03-01 02:34:48 +13:00
2b51eab69d Code cleanup: Split off the creation and setting logic for new actions into different functions
This is also just as prep for the next step
2015-03-01 02:34:47 +13:00
9c82a0478f UI Tweak: Display labels for Push Down and Stash
I'm still not sure which version is better, but I suspect that with the labels,
this might help users figure this out more than if they were just unlabelled
icon buttons...
2015-03-01 02:34:46 +13:00
8d2fc99618 Code Cleanup: Separate out the logic for stashing actions into a separate function 2015-03-01 02:34:46 +13:00
ac30378e3e Action Editor: Stash Action Operator
This operator (the snowflake icon, beside the pushdown button on the Action Editor
header) adds the currently active action to the NLA stack in a muted track, then
creates + loads a new action ready to be populated with new keyframes.
Since the NLA is being used to hang on to all the actions here, no actions are
getting lost.

Usage Notes (there will be some additional tweaks to make this nicer):
* To preview different actions that have been "stashed", simply click the "Solo"
  toggle for the track containing the action in question. Playing back the NLA will
  now show the stashed track
* To edit a previously stashed action - simply enter tweakmode on it in the NLA
  while the "Solo" toggle is enabled.

Todo:
* Add some more operators here to polish up the Action <-> NLA bridge to make the
  layered and stash workflows smoother. Examples include some tools to easily
  switch between the different actions layers in the stack, as well as making it
  easier to get out of tweakmode (and sync up the action lengths)

* Review and cleanup the behaviour of the "new" operator here to avoid the old
  problems that users were running into

* After the next release - Implement the full Action Libraries functionality, with
  ways to bridge the stashed strips over to a full-blown library.
2015-03-01 02:34:44 +13:00
7af4690295 NLA: Auto-Blends option is no longer enabled on all newly added strips
This may be put back again later, but currently, this is a bit too trigger-happy
to have it on. It tends to mess up results more than it helps.
2015-03-01 02:34:43 +13:00
b44201d8b9 Fix for NLA Solo/Mute behaviour
The Solo and Mute functionality for the NLA system should really be mutually
exclusive features. They both affect whether a given track applies or not.
The only difference is that the Solo option mutes all the others, while the Mute
only does this on a per track basis.

Before this fix, muting a strip and then making it solo meant that the solo'd
track would not play at all, which isn't really what we want.
2015-03-01 02:34:43 +13:00
bb7ce9173a Fix for previous commit: Pop up a warning in cases where the operator will refuse to do anything 2015-03-01 02:34:42 +13:00
b28a24091f Action Editor: Added "Push Down" operator to send the current action on to the NLA Stack
This commit exposes the "Push Down" button/functionality found in the NLA Editor
to the Action Editor, so that actions can be added NLA Stack from here too. The
main point of this for now is to make the whole layered-animation workflow nicer
more efficient, but not requiring the second editor be visible in common cases.
It also conveniently sets things up for the next few changes (already hinted at
here)...
2015-03-01 02:34:41 +13:00
cec1691a91 Code Cleanup: Clarify some comments regarding usercount management
(Note for the uninitiated looking at the diffs: this is very much *not* what
 you're probably thinking right now, if you're looking at the line in
 act_new_exec())
2015-03-01 02:34:40 +13:00
8bb3e2a3ea gameengine physics: moving collision filtering inside the collision panel and relabeling some parts 2015-02-28 09:09:55 +00:00
b00fecc85d UI: place camera DOF buttons to be more compact 2015-02-28 17:26:05 +11:00
08a2101eb6 Outliner: rename "Orphaned Datablocks" menu item
Makes the drop-down push searchbox out of the view (which is already quite cramped)
change to "Orphan Data".
2015-02-28 16:24:54 +11:00
38c30c41d7 BGE: Fix ShowDeprecationWarning macro.
Reviewers: lordloki, brita_, sybren, moguri

Reviewed By: moguri

Differential Revision: https://developer.blender.org/D1144
2015-02-27 23:10:43 +01:00
fff8a519b8 Py Enum props definition: 'default' parameter cleanup/fix.
* There was no real default value for this parameter (neither "" nor None would work the same as
  not specifying that parameter). Now, 'None' is considered as default value, and you get
  exact same behavior with this value and if not specifying it. This is important at least for
  consistency, and potentially too in some esoteric cases (like generated code or so).
* Add a warning about the fact that 'default' parameter shall not be psecified when items
  are given a callback function.
2015-02-27 23:02:13 +01:00
12f60e7825 Fix T43834: Text object looses one char after another by entering/leaving edit mode.
Own mistake in refactoring of `BLI_strncpy_wchar_as_utf8()`, if given size was exactly
the one needed, we'd lost last char (off-by-one error).

Many thanks to plasmasolutions (Thomas Beck) who found the issue and did
all the investigation work here!
2015-02-27 21:31:54 +01:00
15957a9e4d Get rid of gluScaleImage in our game engine as well. 2015-02-27 14:47:39 +01:00
55e7d726c4 Make some adjustments to the units for viewport camera dof.
This is still not so correct, to make it work we really have to do a
blurring pass based on the real coc (currently we are just blending 3
levels of blur)
2015-02-27 14:11:26 +01:00
d7a877b69c Fix WPaint inactive when painting on a vgroup and the only other vgroup is locked.
`enforce_locks()` would reset weights of non-locked modified vgroups if it could not
find any other non-modified non-locked vgroup to 'distribute' weights into.
Sounds rather stupid, yet I hope I did not break something else, this code
is rather convoluted to say the least.

Side-reported by zeauro (ronan ducluzeau) in T43814, thanks!
2015-02-27 11:46:55 +01:00
a7e80a9470 Fix T43814: Skinning : set parent with automatic weights doesn't take into account locked vertex groups.
Simply skip a bone's vgroup when it already exists and is locked.
2015-02-27 11:46:55 +01:00
af032873a2 error in last commit 2015-02-27 20:58:32 +11:00
9ab28727ac Fix T43605: Spot Cone+Curve creates odd shadow
Curves could leave glFrontFace in an unknown state.
2015-02-27 20:54:57 +11:00
9683c2b129 Fix T42833: Kink on nurbs curve
Threshold for normalizing was too big.
2015-02-27 20:16:51 +11:00
0b67c21077 Fix T43807: invalid mesh from 2-sided cyclic curve 2015-02-27 17:43:10 +11:00
7293291a40 cleanup: typos 2015-02-27 15:57:59 +11:00
cfd176bcb1 MEM_SAFE_FREE caused issues /w const & GCC5 2015-02-27 15:26:22 +11:00
5520b8df4b cleanup: double promotion 2015-02-27 14:52:58 +11:00
2a5e92c989 cleanup: use GHOST_PRINT instead of stdio
Mostly from my own NDoF stuff.
2015-02-26 21:21:11 -05:00
6cb692f48e cleanup: ghost Win32 event processing functions
Removed window arg from key conversion functions.

Removed processModifierKeys declaration since that function was
apparently never implemented.

Using Win32-specific classes instead of their generic superclass -- this
helps in a few cases like WinTab.
2015-02-26 19:53:55 -05:00
a6ebc9a813 Compile fixes for mingw64
* m_hDC was always included after m_hWnd in all the constructors and other functions,
  but the order was reversed in the struct, meaning that they would not get initialised
  correctly

* Got rid of the gotos for the error handling case in initializeDrawingContext()
  This was causing "jump to label ... crosses initialisation" errors for the calls
  to get GL version string info (i.e. const char *vendor = ...;  etc.)  I wasn't sure
  if those glGetString calls needed the rest of the context to be defined first, so
  I decided to leave them where they are now, and got rid of the gotos (which were
  making this particular piece of code a bit confusing) instead.


TODO:
There are still a bunch of warnings about around 660, which I haven't managed to solve
(but at least they won't prevent Blender from compiling)

  narrowing conversion of '(stereoVisual ? 1063 : 1061)' from 'int' to
  'DWORD {aka long unsigned int}' inside { } is ill-formed in C++11 [-Wnarrowing]
2015-02-27 13:14:09 +13:00
7aa91f5fbc cleanup: ghost Win32 IME
Took out lots of redundant function calls (getters). Also wrapped more
code in WITH_INPUT_IME guards.
2015-02-26 18:40:34 -05:00
87dc01e690 Fix T43806: Knife project crashes
Need to re-create the bmbvh after executing the cut.
2015-02-27 09:53:23 +11:00
90cc2643e9 cleanup: spelling & typos
Comments only, no functional change.
2015-02-26 14:12:24 -05:00
eaabe9d6c6 BGE: Fix for CreateConstraint API
This patch fix two bugs related to CreateConstraint().
1. Disable linked collision only working with 6DoF constraints.
2. If all pivot axis rotations setted to zero the linked object disappears.

{F101374}

Reviewers: moguri, sybren, brita_, lordloki

Reviewed By: lordloki

Subscribers: p9ablo

Differential Revision: https://developer.blender.org/D704
2015-02-26 20:08:22 +01:00
0aa258117d Fix T43303 impossible to select a joint in stick bone edit mode.
Things here are simple, selected bone joint could have same priority as
unselected bone, so bone would always win. Gave joints a little more
priority than bones, usually user will be more precise just to select
the joint anyway.
2015-02-26 15:44:06 +01:00
84f314c875 Remove redundant glInitNames calls (shouod be handled in selection code
now.)
2015-02-26 15:20:30 +01:00
46fe39ff31 Fix T43479 animated textures lost after going to a frame before animated
frame start.

Issue here is that if we failed to get an image from the cache, we would
try to load from file. This would fail when the queried frame was less
than the animated sequence start frame, and invalidate the OK state of
the image.

Solution is that when loading from cache succeeds, we also reset the OK
state of the image for animated textures.

The fix might be relevant elsewhere too, but kept it isolated just in
case.
2015-02-26 15:10:19 +01:00
13c275ce84 Fix T42506 sequencer not limiting zoom.
Fix by Campbell thanks!
2015-02-26 14:27:33 +01:00
60679a171d Revert "Cleanup: Simplify camera sample motion blur code."
This reverts commit 8197f0bb64.
2015-02-26 13:27:02 +01:00
f159ed7746 Workaround T43491: Python readline causes crash
loading 'readline' module could crash blender if 'libedit' was already linked (via LLVM).

Workaround the problem for now since we don't even need readline,
a _real_ fix likely involves changing how LLVM or Python are built.
2015-02-26 22:54:18 +11:00
d9fa9bffd5 Grmll, sorry for the noise, fix stupi cpoypaste typo in previous commit. 2015-02-26 11:46:05 +01:00
ac26a61385 Attempt to fix BGE build on windows.
Caused by rBb5b359b48f7f35a79b3eec, better to try a full build before pushing that type of commit. :/
2015-02-26 11:42:22 +01:00
98e3694c39 Fix T43817: issue with non-utf8 encodings in Windows paths, again...
We need to use 'W' widechar variants of win funcs and convert wchar to utf8-encoded bytes
in those cases, sigh...

Note: theoritical fix only, need org reporter to test it...
2015-02-26 11:27:58 +01:00
88facb8876 Fix potential buffer overflow in BLI_strncpy_wchar_as_utf8(). 2015-02-26 11:27:58 +01:00
8197f0bb64 Cleanup: Simplify camera sample motion blur code. 2015-02-26 10:30:01 +01:00
31f6e621b8 Fix T43643: Solidify crashes with 'only-rim'
When verts were shared by 2+ face-islands, the number of allocated edges was wrong.

Cleanup the logic for new verts/edges.
2015-02-26 18:48:22 +11:00
d282728f1d mesh_validate: don't add invalid edges into the hash 2015-02-26 17:49:21 +11:00
7708012b9d Change samples variable for SSAO - now it is actual samples, not squared
- spiral scheme is much more intuitive here. Also use float number for
spirals to avoid having samples on the same radial direction when sample
number is divisible by spiral number.
2015-02-25 23:30:50 +01:00
22ab4e6e13 Use spiral mapping for SSAO - it reduces banding a lot, especially in
higher sample counts. Probably a blurring pass might be a good addition
here as well.
2015-02-25 23:10:01 +01:00
442664e02c SSAO: sampling coordinates go out of screen, reject the sample
Previous behaviour would get occlusion at borders which could create
over occlusion at edges of the screen.
2015-02-25 22:05:03 +01:00
6a65bc91e2 Minor message fixes - thanks to S.J.Bennett for the heads up 2015-02-25 14:41:54 +01:00
df258c9054 Fix silly mistake with flags which would make stereo buffers unsupported 2015-02-25 14:15:07 +01:00
5d01db8035 Make the message even more clear in case someone does not know what GPU
is

(we are talking about people who won't have installed a driver -
anything is possible)
2015-02-25 14:09:40 +01:00
b5b359b48f Warning messagebox for windows when an unsupported implementation of
OpenGL is detected:

Hoping to decrease the frequency of by far one of the most frequent bug
reports by windows users.

There is some reorganization of the GHOST API to allow easy addition of
further OpenGL options in the future. The change is not propagated too
deep to keep the size of the patch managable. We might reorganize things
here later.

For OpenGL we do two checks here:
One is a combination of GDI generic renderer or vendor microsoft
corporation and OpenGL version 1.1. This means the system does not
use GPU acceleration at all. We warn user to install a graphics
driver and of cases where this might happen (remote connection, using
blender through virtual machine)

The other one just checks if OpenGL version is less than 1.4 (we can
easily change that in the future of course) and warns that it is
deprecated.

Both cases will still let blender startup correctly but users should now
have a clear idea of the system being unsupported.

A user preference flag is provided to turn the warning off.

Now stop posting those bug reports without installing a driver first -
please?
2015-02-25 13:51:53 +01:00
1da5e8df6f error in last commit 2015-02-25 18:19:39 +11:00
83caabebd2 CMake: error making get_blender_version a function
Incorrect use of PARENT_SCOPE meant the vars would be used uninitialized elsewhere.
2015-02-25 18:15:54 +11:00
37556d9a9a Fix T43798: Individual origins disabled object PET 2015-02-25 13:41:02 +11:00
565df1559f T43771: Fix
There is a difference between the socket order of the BokehBlur node and
the BokehBlur operation. Socket[2] and Socket[3] have switched their
order.
2015-02-24 20:28:12 +01:00
6ddd2549ed Fix T43535 - weight paint issues
Two issues in this report:

* Shift-F key conflict between painting and selecting mirrored bone
(moved select mirrored to ctrl-shift-F)
* It was possible to display texture overlay in weight painting, even
though the mode does not support textures yet.
2015-02-24 20:12:49 +01:00
cc388ccca4 Add Inset Faces to the mesh edit mode toolbar.
Inset has been missing from the toolbar for a long time, even though it's a fundamental mesh tool. It now lives, happily, alongside Extrude.
2015-02-24 12:19:24 -06:00
2dd37614bc Cleanup leftover code from previous commit 2015-02-24 17:28:43 +01:00
50e9868abe Fix T43785 crash with border select.
Naming here is slightly misleading. We have:

* Number of elements (objects) that can be picked
* Buffer size
* Number of integers in buffer.

Interestingly enough, bufsize in OpenGL (as far as I could find in
examples on the web) and in most of the code refers to the latter and
actual buffer size is only used whenever we do allocations on the heap.
Added an extra defines here to make things a bit clearer:

* MAXPICKELEMS refers to the number of objects that can be picked
* MAXPICKBUF   refers to the number of integers in the selection buffer

Also made all buffers use MAXPICKBUF where some used MAXPICKBUF * 4.
That means that some parts of blender will use less space for selection
now. MAXPICKBUF is set to 10000 for 2500 object selection, which can be
changed at any time, but I think 10000 integers on the stack touches the
borders of uglyland anyway.
2015-02-24 17:19:07 +01:00
340b76b42c Patch D843 by Alexander Romanov, fixes to the naming of the material
node so it's more similar to the names in the material properties
2015-02-24 16:15:46 +01:00
831a111353 Fix T43792: Connect faces fails with ngons
Complex ngons that intersected the path multiple times would fail to connect.

Now find closest intersections in both directions.
2015-02-25 00:08:39 +11:00
6c96113d5f Modifier: no need to calloc (immediately filled) 2015-02-25 00:08:38 +11:00
07c61e9389 Fix T43743 R key not working after recent rake/random source
refactoring.

Use a new menu instead of old enum key.
2015-02-24 11:56:26 +01:00
77faefb453 Fix T43634: Selecting 'Drop Color' from spacebar menu causes instant close
This is an internal operator, should not be invoked manually.
2015-02-24 14:38:49 +05:00
625101da99 RNA: correct enum flag callback
Was returning NULL, auto-completing:

    bpy.types.Material.bl_rna.properties["type"].

Would crash, accessing 'default_flag', thanks to @lukastoenne for investigating.
2015-02-24 19:45:56 +11:00
a585cbd2af Fix T43783: Cycles clipping doesn't match viewport when camera is inside volume
Ray length adjustment got lost in some refactor commit back to 2.71 days.
2015-02-24 13:07:52 +05:00
4c75f77669 Fix T43784: Compositing scale node border error
This was still the known issue with pixel center, original commit didn't cover all the
cases by the looks of it.

Should be all fine now, but much more intense testing is welcome.
2015-02-24 12:42:31 +05:00
1f527c6033 Fix BKE_mesh_validate_arrays, ignored do_fixes 2015-02-24 13:10:15 +11:00
cdd14ea96d Cleanup: use bit-shift for bmesh_elem_check 2015-02-24 13:10:15 +11:00
Dalai Felinto
abd630de62 Disable Bake Jitter code (recently added)
The following commits were supposed to add anti-alias and help with OSL
baking:

7b16fda379
1b92dfa961

However they introduced other issues (artifacts mostly), see T43550 .
Leaving the code ifdef'ed for now.
2015-02-23 17:50:44 -03:00
4f86f62f32 RNA: use 0/1 for pose layer operator 2015-02-24 07:43:04 +11:00
225f68c324 Fix interpolation functions ignoring number of components when doing early output 2015-02-24 00:36:33 +05:00
2081fd1d7d Gooseberry request:
Show World will now influence if world is rendered in opengl rendering.

This is a little undefined according to blender history, since sky used
to always be drawn when offscreen rendering, as if "Only Render" was
ticked. Since if we don't draw sky in that case there's no valid color
really (and using theme colors is not so nice) we just draw transparent
background.
2015-02-23 18:49:29 +01:00
67fcf5256d Move allocation of imbuf from array to allocimbuf.
Skip allocation of temporary imbuf
2015-02-23 17:19:31 +01:00
97422ea64f Cleanup: Simplify brick texture code a bit. 2015-02-23 16:49:50 +01:00
Dalai Felinto
249f2b9ccf RNA: use 1/0 for move layers operator
internal api Consistency.

For the records, I suspect there are still a few cases of this. I found
this by chance (moving an object to a different layer), and I ran into
the previous one (fixed by Campbell) as well (by adding a cube).

Anyways, since it only happens when building with crash on asserts is
not a big issue. But by the time we change RNA to use bool instead of
int it would be nice to do a call for test to prevent those breaks.
2015-02-23 12:34:15 -03:00
9626f4fdf5 GPU module: get rid of gluscaleimage - game engine also uses that but
commit to remove from there will be done separately due to issues with
linking.
2015-02-23 16:33:18 +01:00
1940cf5a0b After discussion on irc change new function to only allocate from a
buffer only. scaling can be done separately
2015-02-23 16:30:37 +01:00
041f706506 IMB library: Add function that scales an array of byte or float pixels.
Function just wraps the array in an imbuf and does regular imbuf
scaling.
2015-02-23 15:51:30 +01:00
eacc3debb7 Fix compilation error after recent GPU debug changes 2015-02-23 18:09:28 +05:00
ced19783fd Fix mismatch (missing 'const' to mactch funcs declarations).
Was breaking windows compile, reported by bdancer over IRC, thanks.

Also, quite some annoying 'unused vars' warnings (debug-only vars).
2015-02-23 13:57:02 +01:00
fed61d50c7 Debug GPU functionality from soc-viewport_fx by Jason Wilkins
patch number D706 with changes:

- WITH_GPU_DEBUG just creates a debug context (and enables the debug messaging
system functions) but leaves the checks we had intact. Old patch
added the debug functionality only if we had the flag on to save some
performance.

Rationale here is that we might not want to recompile blender just to get
the extra information, and having users start blender with a -d flag to
get the extra information is also useful for bug reports. Those checks already
existed and most expensive ones are hidden behind a debug mode check
so performance should not be that bad.

- Did some cleanup of existing functionality:
When things go wrong blender side, just print the error,
don't check for GL errors first.

- Did not port changes needed for GLES to regular glew.h

- Got rid of duplicate or very similar new functionality.

Generally, code is more moving things around/cleanup and should work exactly
as before apart from the debug context, so it's safe to add even now.

It also provides a nice substitute function for glu error descriptions
2015-02-23 13:35:57 +01:00
34479d8b63 Snap to Active: missing armature/pose/mball/curve
de-duplicate active center calc between transform & snap-to-selected.
2015-02-23 23:05:54 +11:00
17b8479101 Fix T43774: Snap to Cursor ignores active pivot 2015-02-23 22:26:19 +11:00
ec36e3ae80 Fix T43776: Rigging : Clear User transform is not working when mesh is in weight paint mode.
Use same trick as for regular 'clear transform' operators to get a valid armature
in weight paint mode (where active object is weight-painted one).
2015-02-23 12:23:13 +01:00
8ee2b01b04 Fix T43740: 'Back to Previous' failed on reload
Would restore with the file-selector where the 'info' header should be.
2015-02-23 21:33:14 +11:00
b497eae0a8 Screen: remove redundant NULL check in ED_area_prevspace 2015-02-23 21:06:55 +11:00
86cfbeec6a Partial fix for T43740
ED_area_data_swap would put the screen in an invalid state and crash.
(SpaceLink.spacetype didn't match ScrArea.type)

However behavior is still odd in the instance of the report.
2015-02-23 20:02:54 +11:00
96c452bdf6 Fix T43769: Envmap Texture copy looses image 2015-02-23 18:22:09 +11:00
7c03ef295b CustomData: const correctness 2015-02-23 16:17:16 +11:00
0c4fb47edd BLI_utildefines: correct comment 2015-02-23 16:17:16 +11:00
64b328f22b Edge/Vert Slide: avoid redundant loop angle calls
No need to calculate loop angle for each layer
2015-02-23 15:44:28 +11:00
bc876f9ea4 Error in last commit
Accidentally left in malloc/free
2015-02-23 15:40:43 +11:00
5a372dbd89 Fix error in recent vert/edge-slide commits
`CustomData_bmesh_interp_n` was expecting the 'dest' arg not to have its offset applied.

This was a bit confusing since the source args have it applied,
and in some cases we only have the destination with the offset.
2015-02-23 13:57:06 +11:00
50c977b54d CustomData: replace calloc -> malloc
stack array is uninitialized, relying on calloc here would just hide bugs.
2015-02-23 13:57:06 +11:00
d580c90469 CustomData: const correctness for interp() 2015-02-23 13:54:33 +11:00
c26fa67bcd BLI_utildefines: add pointer offset macro
Handy since it keeps the type of the original.
2015-02-23 13:50:12 +11:00
765b842f95 Subsurf: missing NULL checks on free 2015-02-23 08:34:20 +11:00
Julian Eisel
0f1ffd4792 Fix T43768: Pointcache end frame ignores preview range
Fix for T43768

This way it works consistent with cloth, softbodys, etc.

Reviewers: lukastoenne

Differential Revision: https://developer.blender.org/D1134
2015-02-22 17:14:19 +01:00
63b0a7feb2 Cycles: Make it survive if preview_cycles.blend uses persistent data
Currently should be no functional changes, but nice thing to have fixed
for some further experiments.
2015-02-21 19:18:20 +05:00
6d9c99422b Fix T43748: MouseLook actuator raises an Assert error
An assertion seems to be inverted by mistake, as MT_assert(!m_mouse); is followed
by using m_mouse->XXXX.
2015-02-21 14:39:04 +01:00
813dcb9feb GPencil: Another fix for the "big square dots" problem
Strokes containing only a single point are now drawn so that they respect the
pressure values too. Previously, they were getting drawn at a fixed size based
on the thickness of strokes. Thanks to @kekeljevic for posting a screenshot which
made the problem here easy to identify!

(On a side note: Perhaps it's a combination of the drivers I'm using, or the
multisampling goodness at work, but after applying this change, the dots are
now appearing as round circles as originally intended, and can also be scaled
up quite a bit too. And that's for 3D points which couldn't be affected like
this earlier! I'm not sure what's going on here, but whatever it is, I like it ;)
2015-02-22 02:09:52 +13:00
6ec05eb3e6 Code cleanup: Use bools instead of int 2015-02-21 17:50:05 +05:00
578cc2143d Cycles: Add note about autodiff in OSL wireframe shader 2015-02-21 17:31:41 +05:00
888d810185 Cycles: Use lower progressive update timeout for preview rendering
This ways previews are refreshing with the same ratio as job was expecting
this to happen, giving more instant feedback on the changes.
2015-02-21 17:30:29 +05:00
a97bc1bedf Fix T43755: Wireframe attribute doesn't work with displace
This attribute missed derivatives calculation.

Not totally sure what's the proper approach for algebraic derivative
calculation, so calculating them by definition. This isn't fastest
way to do it in this case and could be replaced with some smarter magic
in the wireframe calculation loop.

At least currently implemented approach is better than nothing.
2015-02-21 17:30:29 +05:00
3445ff0f93 scene conversion: style cleanup 2015-02-21 12:16:21 +00:00
4c0adb95dc gamengine: removing useless comment 2015-02-21 12:16:21 +00:00
9bfdcc4d32 gameengine: removing addInitFromFrame hack 2015-02-21 12:16:20 +00:00
5785df431b gameengine: dataconversion import and whitespace cleanup 2015-02-21 12:16:20 +00:00
f15bb2b793 doxygen: updating blender version and link to tracker 2015-02-21 12:16:20 +00:00
7501bdc52e python bge.types module - Updating documentation to close T40778 2015-02-21 12:16:20 +00:00
8db9b07cb3 Fix T33762 - texture fonts were not using the material color (gameengine) 2015-02-21 12:16:20 +00:00
f1a65a9fab makeScreenshot - adding frame number to the filename 2015-02-21 12:16:20 +00:00
cf4646b95f commiting patch to fix T30173 2015-02-21 12:16:19 +00:00
c391a67830 gameengine: KX_Scene comment cleanup 2015-02-21 12:16:19 +00:00
cfec320f1e BGE cleanup: removing unused async logic bricks
This code was never run and is an outdated copy from the code above.
If someday this is needed again, it is better to start clean.
2015-02-21 12:16:19 +00:00
e0187ec0c3 Documentation update: references to OpenGL tutorials in the python bgl module 2015-02-21 12:16:19 +00:00
7bd4c78a1a Cleanup: Put all Bump dx/dy code in the beginning here, same as with other nodes. 2015-02-21 12:55:19 +01:00
913e109f14 Correction for RNA getter of use_save_buffers 2015-02-21 12:47:29 +05:00
09893ec7fc Cycles: Workaround for NVidia OpenCL compilation
It was complaining about explicit __constant to __private memory conversion,
which is now worked around using implicit conversion.

It's not a real fix i'm afraid and i'm still failing to build OpenCL kernel
with latest Linux drivers, but maybe it'll let someone else to investigate
what causes compiler to run out of memory?
2015-02-21 12:35:06 +05:00
87572091fb BGE: Fix T43215: Rigidbody constraints deletion.
Deleting an object was deleting all rigidbody constraints in the scene.
Bug was introduced with D701.

Reviewers: agoose77, sergof, moguri, lordloki, sybren

Reviewed By: lordloki, sybren

Subscribers: sybren, hbar, blueprintrandom, sergof, agoose77

Differential Revision: https://developer.blender.org/D1007
2015-02-20 23:37:32 +01:00
1b92dfa961 Fix T43550: Bug in Cycles Bake Texture
Issue was caused by the changes in 7b16fda which changed the initial
state for rng. This commit makes it so the same initial hash is used
(which solves the regression without distorting AA-looking image.

It also makes it so OpenCL compiler is happy about this code (before
this change it'll complain about trying to cast private variable to
global one).
2015-02-21 01:56:48 +05:00
f7a2a36b31 RNA: use 1/0 for object layers
internal api Consistency.
2015-02-21 02:10:08 +11:00
8e955449a8 Yet another commit to get rid of missing faces in fill brushes.
We are now guarding against some divisions by small values.
There are still issues here but they are not on boundary faces
anymore so they must be related to some other issue such as
the triangle intersection test.
2015-02-20 15:11:24 +01:00
d12eba61a5 Sequencer: allow scene volume above 1 2015-02-21 00:08:56 +11:00
de4dcda545 Fix T43651: New pointiness attribute doesn't work with displacement
Simple fix: just make pointiness aware of bump offset.
2015-02-20 17:20:24 +05:00
51b0ae8a85 Fix T43739: bad documentation for bmesh py intersect_face_point()
Previous text could make think this func was checking whether a point was
inside and on the face, while it actually checks whether the projection
of that point onto the face is inside its boundary...
2015-02-20 10:54:26 +01:00
185e301229 RNA: correct bool callbacks 2015-02-20 19:54:51 +11:00
d0978103ae Revert "Cast result of rna_RenderSettings_use_game_engine_get to {0, 1}"
There are more flags that trigger this assertion, so I want to discuss
an appropriate way to fix it before changing them all.

This reverts commit b1191e5caf.
2015-02-20 08:41:31 +01:00
b1191e5caf Cast result of rna_RenderSettings_use_game_engine_get to {0, 1}
rna_RenderSettings_use_game_engine_get() in rna_scene.c would return 0 or 2,
whereas the assertion in rna_access.c:1843 indicates that boolean values
should only be 0 or 1.
2015-02-20 08:36:50 +01:00
f9a5dab529 RNA: calloc -> malloc when fixbuf is uninitialized 2015-02-20 17:18:41 +11:00
919e38cfc8 Fix for unlikely NULL pointer dereference
Potential crash reading freestyle modifiers from future blend-files
2015-02-20 17:18:41 +11:00
1ec83f41c1 Fix possible (unlikely) memory leak 2015-02-20 17:09:40 +11:00
83220ab7fb Cycles: Use size_t for aligned allocator
Seems it got changes by accident to int during guarded allocation work,
causing bad memory allocations.
2015-02-19 22:19:29 +05:00
2ddfd3a123 Skip flip check in cases where it's not needed. 2015-02-19 16:58:35 +01:00
f56fd1c47a Remove flipping for colinear case/ In such cases it is doubtful whether
face orientation is really meaningful
2015-02-19 16:51:51 +01:00
b1d02f3d57 Projective painting: Only dither if factor is more than zero 2015-02-19 16:48:51 +01:00
efb20dacc6 Fix T43735 painting on perpendicular to the screen polygons is
problematic (still!)

It seems due to floating point precision issues we have to account for
even more cases.

Added colinear check for one more triangle edge-vertex and assumed that
if no collision test is found then triangle is completely inside box.

Such cases are mostly from float precision not catching triangle just
outside bucket. Now tests are much better for simple tests (paint/flood
fill cube from ortho view, paint sphere), however there are still some
rare cases of stray pixels.
2015-02-19 16:48:17 +01:00
7f406a53c7 Cycles: Cleanup for indentation in device_cpu.cpp
Perhaps became broken after rather recent change about which entry point
to kernel to use.
2015-02-19 19:05:04 +05:00
3bc9ac19f5 Cycles: Free memory used by intermediate BVH vectors earlier
Ideally we should get rid of those temporary vectors anyway, but
it's not so trivial because of the alignment. For untl then we'll
just have a bit worse solution. This part of code is not the root
of the issue of memory spikes for now anyway.

But since we're getting rid of temporary memory earlier actual spike
is a bit smaller as now. For example in franck_sheep file it's now
5489.69MB vs. previously 5599.90MB.
2015-02-19 18:58:21 +05:00
0f652501c7 Cycles: Reduce memory used by background light update
Simple change: just get rid of intermediate data a bit earlier, before
final pixels array is being allocated. This gives around 30% of memory
save during light update (this is about 60meg in the frank sheep file
i'm using here).

This isn't really visible by artists a lot, because actual spike happens
on BVH construction. But it doesn't mean we shouldn't be accurate with
memory usage in other areas.
2015-02-19 18:18:04 +05:00
27d1446d24 Cleanup: Restructure curve settings code a bit.
This is a bit more logical, as it better represents the 3 primitive types we have.
2015-02-19 12:37:56 +01:00
ebdc1cde3f Fix 2d paint issue with textured brushes: Multiply brush color with
texture in the right space
2015-02-19 12:37:47 +01:00
528514c393 bge physics: disallowing compound collisions for soft bodies
Closes D610, T40427, T30630

Cherrypicked from local squash
Conflicts:
	release/scripts/startup/bl_ui/properties_game.py
2015-02-19 11:20:18 +00:00
b7033e3d4e BGE physics: adding links to bullet documentation 2015-02-19 11:20:18 +00:00
d2c2b10aeb gameengine physics: removing triangle mesh collision option for character controllers 2015-02-19 11:20:17 +00:00
938fa934c8 gameengine physics: removing compound option for character controllers
Cherrypicking c31d921 onto 117edbb
Conflicts:
	release/scripts/startup/bl_ui/properties_game.py
2015-02-19 11:20:17 +00:00
0049c22ad9 Animation ghosting: when tweaking start-end values don't clamp user
input, instead make sure the end-start values are sane instead
2015-02-19 12:10:44 +01:00
9fc2c37328 Guardedalloc: Reset peak memory should set peak to currently allocated memory
Otherwise statistics could be really funny looking.
2015-02-19 13:14:06 +05:00
3e534833e3 Cycles: Make sphere and tube image mapping friendly with OpenCL
OpenCL doesn't let you to get address of vector components, which
is kinda annoying. On the other hand, maybe now compiler will have
more chances to optimize something out.
2015-02-19 12:52:48 +05:00
5004b58262 Cycles: Make util_math_fast.h compatible with OpenCL 2015-02-19 12:29:06 +05:00
5721863805 RNA: pass only 0/1 to RNA_property_boolean_set 2015-02-19 12:33:14 +11:00
eee79641c3 RNA: poll functions restricting object types
D1100,D1105,D1106 by @lichtwerk
2015-02-19 11:59:24 +11:00
a74bd1bec7 Generate correct Cycles node setup for quick smoke "fire" preset.
Patch by Gottfried Hofmann.
Differential Revision: https://developer.blender.org/D1103
2015-02-19 00:18:27 +01:00
5ed2cc8070 Fix T43652: X11 "_NET_WM_PID" not set by Ghost
D1107 by @kevindietrich
2015-02-19 09:54:11 +11:00
f0527d9631 Ghost/X11 cleanup (reduce variable scope) 2015-02-19 09:54:11 +11:00
5d0696052a BGE: Fix T41502 Path following jumping
New Lock Z velocity parameter was added. This parameter avoid the micro-jumping.
By default it is actived except when you load an old file that it is deactived to keep former behaviour.

Additionally it was solved another issue related with the acceleration: That is the acceleration value was not taked into account and we had always the maximum linear velocity from the beginning of movement. Now the acceleration is taken into account until we reach the maximum velocity.
When you load an old file, the acceleration value is set to the maximum range (1000.f). This way we simulate a maximum velocity constant from the beginning of movement (former behaviour).

{F142195}

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: sergey

Differential Revision: https://developer.blender.org/D1074
2015-02-18 23:24:02 +01:00
bd5154bb2c Fix Cycles OpenCL error with scons, util_math_fast.h was missing.ø 2015-02-18 22:44:17 +01:00
f1a9dbb0d7 Fix minor mistake - only increase size of compositing when stencil -is-
set.
2015-02-18 22:16:20 +01:00
b5a14c381c Report total unfreed memory size on exit
Previously only number of unfreed blocks would have been printed,
which might not be totally enough during investigation process.
2015-02-19 02:08:09 +05:00
6c5f63b476 Guardedalloc: Add extra logging and checks in MEM_freeN()
We don't like when NULL is send to MEM_freeN(), but there was some
differences between lockfree and guarded allocators:

- Lockfree would have silently crash, in both release and debug modes
- Guarded allocator would have printed error message, abort in debug
  but keep working in release build.

This commit makes lockfree allocator behavior to match guarded one.
2015-02-19 01:58:49 +05:00
0f2adc0817 Cycles: Make aligned allocation to respect WITH_BLENDER_GUARDEDALLOC
Title pretty says it all actually. Can only briefly mention that we're
indeed entering that state when after applying some WIP patches having
much fuller statistics about memory usage would help giving exact memory
benefit.
2015-02-19 01:50:46 +05:00
ee9ac4e4fc CMake: remove expression in endif(...) 2015-02-19 07:45:59 +11:00
54994740bd CMake: indent & missing header 2015-02-19 07:15:55 +11:00
483fa4c387 CMake: picky style edit
'cmake_consistency_check.py' relies on this formattng.
2015-02-19 07:15:00 +11:00
bbc7dc169d RNA: assert when non 0/1 values used as bool
Prepare for using 'bool' type.
2015-02-19 07:08:10 +11:00
86e04c4ca9 RNA: assert on over-sized array index access 2015-02-19 07:01:49 +11:00
9d464a7538 RNA: use __func__ for alloc-id's 2015-02-19 06:57:45 +11:00
4ed8b70870 BGE: Fix T42437: Physics/Compound bug
Null check to verify that parent has a character controller. Otherwise (i.e empty) it will crash.

Reviewers: moguri, campbellbarton

Reviewed By: campbellbarton

Differential Revision: https://developer.blender.org/D1115
2015-02-18 19:59:21 +01:00
9bd2a7c0a8 BGE: Fix T41570: Blender crash when physics createConstraint
Move physicsid type to unsigned long long to avoid crashes on Windows 8.1 64bits.
Other systems also modified to put them inline with this solution.

Reviewers: dfelinto, brita_, moguri, juicyfruit, campbellbarton

Reviewed By: juicyfruit, campbellbarton

Subscribers: juicyfruit

Differential Revision: https://developer.blender.org/D1122
2015-02-18 19:52:54 +01:00
839a6b22d6 Fix T43716 regression in mask modifier - edges could access out of
bounds indices of vertices.

Issue here is that if we copy edge customdata the MEdge data that were
previously written get overwritten, solution is to write indices and
flags last (probably writing flags is superfluous here).
2015-02-18 17:59:16 +01:00
c9fa37fbcd Cycles: Initialize "headless" flags on engine initialization
This flag is global for all the sessions and never changes. so it doesn't
really make sense to pass it around to all sessions and synchronization
routines.

Switched to a static member of BlenderSession now, but it's probably more
logical to introduce some sort of BlenderGlobals. Doesn't currently worth
a hassle for a single boolean flag tho.
2015-02-18 21:52:51 +05:00
6f3500db05 Cleanup: Remove unused SD_PHASE_HAS_EVAL flag.
We only have a non-singular volume closure and therefore no need to distinguish it.
2015-02-18 16:33:31 +01:00
a2366a3a2e Cleanup for Cycles hair shader ifdefs.
sc->T and sc->data2 were behind __HAIR__ ifdef, now they are not anymore, so we can always assign the correct value.
2015-02-18 15:57:39 +01:00
bf0a001e61 Cleanup: Remove support for Boost filesystem 2.
This is deprecated since Boost 1.48.
2015-02-18 13:49:49 +01:00
55fd389a70 New filebrowser bookmarks: Some minor fix/optimization from latest coverity report. 2015-02-18 13:18:04 +01:00
2967253ae4 Fix Windows build.
Mighty M$VC never heard of 'strcasecmp' family of functions, it prefers its
own names, as usual...
2015-02-18 12:22:58 +01:00
6920735cff Include SDL information in system info text.
Adds bpy.app.sdl to expose SDL version information.

When SDL is not available on a Linux system, certain Blender features
are silently disabled (like joystick support in the BGE). This change
is the first step towards making it more obvious why something isn't
working.

SDL information is exposed to Python via bpy.app.sdl, in the same way
as OCIO and OIIO information is exposed.

Generated system-info.txt contains SDL loading method (linked or
dynamically loaded by Blender) and SDL version number.

Reviewed by: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1112
2015-02-18 12:08:20 +01:00
7f7413bce2 Cleanup: Use bools in BVHParams class. 2015-02-18 12:05:59 +01:00
6fe23b60dd Use clamp to border for brushes or textures can "leak" after rotating
texture coordinates of brushes (in rake mode).
2015-02-18 11:59:55 +01:00
fda119866d GPencil: RMB menu tools in Outliner works for GP Layers now
It would be even better if these used their own dedicated menu which could include
the protect values too, but this one at least works now
2015-02-18 14:49:42 +13:00
c7c711bb72 GPencil Fix: Added checks to ensure that copy/paste doesn't paste incompatible strokes
There was a problem with the copy/paste functionality, where it would be possible to
paste 3d strokes into 2D editors, or 2D strokes into the 3D view. The problem with
that though is that these will not show up, and because there's no feedback at the
time, users may end up doing this pasting several times.
2015-02-18 14:49:41 +13:00
bd92168643 Cycles / BVH: Remove unused temp copy of prim_object.
This will save some memory during BVH Build.
2015-02-18 01:14:59 +01:00
5eecfbd980 Quiet uninitialized mem use for blank cursor
harmless but may as well initialize.
2015-02-18 10:44:28 +11:00
1fa98b374f Fix free'd memory use removing constraint 2015-02-18 10:44:17 +11:00
b337cc1c21 Do not allocate an XRay buffer if compositing is dnot one for offscreen
rendering.
2015-02-17 23:38:28 +01:00
d74189a78a cleanup & missing break 2015-02-18 09:08:24 +11:00
ef11be0e77 Cycles: Avoid over-allocation in decouple ray marching
It could have happened with really long rays and small steps.

Step size will be adjusted to the clamped number of steps in order
to preserve render result compatibility as much as possible.

We should probably reformulate this a bit, so it will give the
same looking results without step tweaks. But this new behavior
should already be much better that it was before.
2015-02-18 02:26:24 +05:00
a9dbaf3755 Ensure BLI_stat() return value is checked.
also add function attrs on BLI_fileops to ensure they're used correctly.
2015-02-18 07:27:27 +11:00
e089b0e911 Amend to previous own Fix T43684: only use hack on WIN32, and use case-insensitive comparison.
Thanks to Campbell for the headup.
2015-02-17 21:10:08 +01:00
5115e86246 Fix T38808: Re-opening an image makes absolute 2015-02-18 06:39:28 +11:00
9d879c43f3 Fix T43708: Wrong manipulator in individual origin
Manipulator and actual behavior were out-of-sync with a single edge selected.
2015-02-18 06:08:59 +11:00
6133d14028 BMesh: calc_manipulator_stats can only check verts
Code assumed selection wasn't correctly flushed, which we ensure now.
2015-02-18 05:41:13 +11:00
07ba8b96e5 Tweak to new UIList bookmarks & co: extend up to ten entries before using scrollbars.
But again, what we really need to fix is UI saving for that temp area...
2015-02-17 19:27:14 +01:00
7e73b6aa25 Cleanup: Add comment about light_p being modified in one case. 2015-02-17 19:24:37 +01:00
1aa93dd9fd Cycles: Cleanup after recent changes 2015-02-17 23:21:53 +05:00
21a2b73a1e Fix T43684 (again!): Mighty Windows thinks it’s perfectly sensible to block everyone during 5 seconds for a mere stat() call on "A:\" path...
For now, just always consider those floppy entries ("A:\" and "B:\") as valid... sigh.
2015-02-17 19:13:22 +01:00
e6f40b4ceb Some tweaks to last commit, this is better. 2015-02-17 19:03:50 +01:00
f3e831f02d Cycles: Fix for hair transmission BSDF not returning proper label 2015-02-17 22:40:00 +05:00
6f820664c4 Cleanup: Deduplicate area light sampling code. 2015-02-17 18:39:37 +01:00
f05f99f9d4 Fix crash when rendering to offscreen OpenGL, fix scons build 2015-02-17 18:35:56 +01:00
ff7220349d Compositing works with X-Ray.
Basically, before drawing X-Rays, we now bind a second depth buffer.
After drawing XRays, we do an extra resolve pass where we overwrite the
non-XRay depth buffer in pixels where the depth is not maximum (which
means background pixel, since depth is cleared before drawing X-Ray
objects).

This ensures both scene and X-Rays keep their depth values and are ready
for compositing. Well, the odd effect due to depth discontinuities can be
expected, and X-Rays are a bit more expensive (extra buffer + resolve pass)
but at least X-Rays won't invalidate depth values anymore. Whee!
2015-02-17 18:11:22 +01:00
a0d7db503d Cycles: Small tweaks for Henyey Greenstein closure code.
* Avoid duplicative fabs(g) check in sample code.
* Avoid dot product in eval code.

Helps like ~1% when Scatter Anisotropy is 0.
2015-02-17 17:48:18 +01:00
ea2fc5b9d6 Fix for particle path drawing with black tips.
The last path segment can be shortended due to randomized path length.
In that case the last segment's color vector was not defined.
2015-02-17 15:22:02 +01:00
9b845359a6 Quick fix/hack for too small 'operator' panel in filebrowser
Real issue is that temp area used to draw modal filebrowser is never saved,
so non of UI 'edits' (like UIList resize, regions resize, panels reorder, etc.)
are ever saved. Should be addressed, but no time for that currently.
2015-02-17 15:18:02 +01:00
18e849b05d GPencil: On the fly switching between Drawing and Erasing when using "Continuous Drawing"
It is now possible to switch between drawing and erasing strokes when in
the modal "Continous Drawing" sessions. This makes the drawing experience
just a little more fluid, saving some unncessary steps to get out of
the editing mode to activate the intended tool.

TODO: Is there interest for tablet support for this too?
2015-02-18 03:16:33 +13:00
bf878d3c3d Cycles: Remove empty closure blur code and the corresponding entries in the switch.
Most compilers will probably optimize that out, but I still don't see a reason to keep it.
2015-02-17 13:44:25 +01:00
4660c00ac5 Cycles: Make blender session aware of rendering from command line
This way we can do some more aggressive policy about releasing temporary
data during synchronization.
2015-02-17 16:25:16 +05:00
7307f3b485 Fix T43706: Creating a directory in the file browser (by typing it in the file path) crashes Blender
Issue was caused by 2e9105c, free() does nothing if pointer is NULL, but guarded
allocator expects you to not free NULL.
2015-02-17 15:55:18 +05:00
2c1b0536c9 Fix T43697, grid drawing over wires and grease pencil. Props to Julian
for figuring out a simple solution to that :)
2015-02-17 11:37:20 +01:00
cdc1dab073 Fix T43685: New pointiness attribute error with auto-smooth enabled
Simple fix: all vertex attributes should be filled in before split.
2015-02-17 13:49:11 +05:00
587d8771e0 Cycles: Minor code cleanup in recent attributes changes 2015-02-17 13:46:25 +05:00
86a2e9d0e4 etch-a-ton: off by one error
was writing past the buffer when inserting strokes
2015-02-17 17:12:19 +11:00
28f31bdfd8 etch-a-ton: fix crash selecting strokes 2015-02-17 16:49:30 +11:00
a8487fc7fe etch-a-ton: fix uninitialized memory use 2015-02-17 16:48:53 +11:00
Julian Eisel
0294327615 Hide 3D Cursor in Paint Modes (with exceptions)
= Hide 3D Cursor in Paint Modes (with exceptions)

In paint modes, the 3D Cursor mostly is rather useless so it's more annoying than useful. This patch aims to hide the cursor in cases it's not used.

Included exceptions (cases where cursor is drawn in paint modes):
* Active object is in weight paint mode and a selected bone in pose mode can be found
* Clone brush (only if //Clone from paint slot// is disabled)

There might be more exceptions where the cursor should be shown in paint modes, but those are all I could find for now. Feel free to hint me for more.

Note: After D1110 was rejected, Campbell and me discussed this a bit more on IRC and agreed that this behaviour might be a good solution.

Reviewers: psy-fi, campbellbarton

Reviewed By: psy-fi, campbellbarton

Projects: #user_interface

Differential Revision: https://developer.blender.org/D1113
2015-02-17 03:26:03 +01:00
4bb331dfd5 RNA API: reuse property lookups 2015-02-17 13:13:59 +11:00
Julian Eisel
691cb61835 Fix for another missing update from GPencil in Outliner 2015-02-17 02:12:23 +01:00
Julian Eisel
89412028ce Fix T43669: Grease Pencil visibility toggle not working in Outliner 2015-02-17 02:12:23 +01:00
070f516b52 Fix FileSel globbing including dirs & ".." 2015-02-17 12:01:47 +11:00
8cb4011220 Revert "Fix file size not drawn using Link/Append"
This reverts commit 4ca4f04c75.

Was running an fs-stat on redraw, on every file! (every mouse motion!).
Could become very slow on network-fs

also caused crash (T43631)
2015-02-17 11:36:41 +11:00
9f008d17fe assert when BLI_exists is called with NULL path 2015-02-17 11:36:35 +11:00
00133ba8f0 Subsurf: Use guarded allocator for non-arena CCG
Our new guarded allocator implementation has much smaller memory
block size overhead and doesn't have any locks now. So in order
to make fuller track of what's happening in blender and avoid
confusion why certain circumstances reports much less memory than
others we'll now switch to guarded allocator.

This was actually one of the biggest reasons of the confusion in
the recent memory usage investigation. There's still some overhead
is happening due to non-freeing nature of arena allocator but the
things are not nearly as bad as they looked before: memory overhead
is measured in tens of megabytes, not hundreds as it looked before.

Plus with some smarter allocation policy we can almost eliminate this
overhead.
2015-02-17 03:42:16 +05:00
1e00e87e3a FileSpace selection didn't call op.check sometimes
(de)select all & globbing didnt run operators check callback.

D867 by @igel with edits
2015-02-17 08:54:25 +11:00
fa9311c9a4 Cleanup: Update comments and make it more clear what volume interpolation is for. 2015-02-16 22:11:41 +01:00
652b2b656a Fix bake action visual-keying option
Disabling did nothing
2015-02-17 07:19:48 +11:00
00a3c9afc8 UI messages fixes and cleanup. 2015-02-16 20:38:07 +01:00
0dfdca6d13 Fix T43684: File Browser is unusable on Windows Machines (do not BLI_is_dir() in draw loop!)
Did not had any issue on linux, but looks like on some windows can slow things as Hell.
Or maybe just the presence of some network FS?

Anyway, not a good idea, so now fsmenu entries' valid status is stored and only evaluated
on startup (reading of bookmarks & co) and when opening file browser (refresh, like
for system bookmarks).
2015-02-16 15:58:57 +01:00
fd4f0ed39e Cleanup: Remove unused code from hair BSDF. 2015-02-16 15:23:01 +01:00
bbe1b54818 Fix T43689, viewport compositing does not respect alpha settings for
background.

For SSAO supporting this is no problem, for DOF we would ideally do
blurred alpha, but alpha channel in blurred buffers is occupied by coc
field, so use original color alpha instead. It's not entirely correct
but it's better than nothing.
2015-02-16 14:42:36 +01:00
6e08aa0a9e Tracking: Expose Filter Tracks operators to the Cleanup panel
Not totally happy with this, but it's better than nothing for until
we've got real outlier detection. Also made it more cleat how exactly
filtering happens, so users don't expect something the operator is not
intended to do.
2015-02-16 17:16:14 +05:00
7c3d5a3337 Cycles: Use some more bools in microfacet code. 2015-02-16 12:32:42 +01:00
e7d2e5ffbc Extended RNA support for mesh customdata property layers.
Support for user-defined customdata layers (named int, float, string
layers) was limited to polygon customdata. This is not accessible in
cycles because only tessfaces are used there. Furthermore the polygon
attributes were simply described as MeshFloatProperty, MeshIntProperty,
MeshStringProperty, omitting the distinction by element type.

The patch only adds vertex attributes so far. However, the code now
explicitly defines polygon and vertex attributes, so adding edges, loops
and tessfaces is much easier should the need arise.

Problem is that the RNA definition, which is already much more
complicated than the basic DNA/BKE definition of custom properties, now
becomes extremely bloated and cumbersome. A simpler solution would be
preferable but may not be possible within the constraints of RNA.
2015-02-16 12:26:25 +01:00
9daac198f5 Cycles: Correction for C++11 compilation error after recent vector changes 2015-02-16 15:38:13 +05:00
9a10b208ba Ensure CMake finds SDL 2.0
CMake 2.8 doesn't search /usr/include/SDL2, which is the include directory
for SDL 2.x on Ubuntu Linux (and possibly others). This results in SDL 1.2
headers being found when WITH_SDL_DYNLOAD=OFF, and our shipped SDL 2.0
headers when WITH_SDL_DYNLOAD=ON. This patch ensures that in both
cases the correct SDL headers are used.

Reviewers: sergey, campbellbarton

Projects: #bf_blender

Differential Revision: https://developer.blender.org/D1112
2015-02-16 09:27:50 +01:00
58652301de Vert/Edge Slide: better UV interpolation
Ignore faces which the sliding vert is outside of.
2015-02-16 18:49:18 +11:00
421d0f3bde Math Lib: add dist_signed_squared_to_corner_v3v3v3
Can be used to check if a point is inside the 2-planes defined by a face-corner.
2015-02-16 18:47:15 +11:00
81be1c7a21 Correct crash /w vertex slide with no faces
Error in recent commit
2015-02-16 13:41:46 +11:00
7975c0d35a cleanup: split VSE view-size into own function 2015-02-16 13:19:22 +11:00
5c747e7196 Fix T43681: VSE draw glitch with no-display
Missed clearning the backdrop
2015-02-16 13:05:59 +11:00
b1dbda143d BMesh: Connect path, use select order
Could connect a pair of verts previously,
now connect all vertices along the path, running a second time closes the loop.

Can also be used for without faces to connect edges between selected points.
2015-02-16 09:44:30 +11:00
e2573aea9b Compilation error fix for strict compiler flags 2015-02-15 23:12:54 +05:00
478d67e858 Cycles: Hopefully compilation error fix for OSX 2015-02-15 23:11:33 +05:00
a98fc4f8f9 Fix T43671: Playing with Mix Factor of Data Transfer Modifier Is Overwritting Data of Base Mesh
The issue was actually affecting all data types that are not regular CDLayer ones, since by default
DerivedMesh references mesh data (verts, edges, etc. - modifying custom normals often implies
modifying edges' sarpness too).
Modfying edge/face sharpness etc. could directly affect the mesh in this case, **bad**!

So we detect whether we are copying data types that may affect non-CDlayers data, and whether
verts array of org dm is same as mesh one - in which case we copy the DM. This avoids
useless copying in most cases.

Note Edit Normals was quite obviously suffering the same issue.
2015-02-15 19:00:06 +01:00
1c64543aef Cleanup of SpaceFile, from asset-experiments branch mostly.
Helps keeping diff with branch relevant and clean...
2015-02-15 16:35:42 +01:00
f1ee11fcca Fix for previous commit, sorry for the noise. 2015-02-15 15:55:13 +01:00
2e9105cc96 Cleanup: BLI_listdir (direntry): get rid of usage of raw malloc/free here.
No reason at all not to use MEM_xxx as everywhere else, especially confusing
when members of direntry **are** MEM_-allocated (relname, etc.)!
2015-02-15 15:07:48 +01:00
35567d563d Possible todo notes for more polished UI? 2015-02-16 01:21:48 +13:00
263518ec49 Outliner: "Purge All" function for Outliner in "Orphaned Datablocks" mode
Many users have been requesting a way to remove unused datablocks from the file/session
"without closing and reopening" Blender (or at least that's the impression I'm getting).

This commit adds a new operator (exposed as the "Purge All" button in the header of
the "Orphaned Datablocks" mode in the Outliner, which seems to be the logical
place for this) for doing so. It does so by wrapping up the save and "revert"
(i.e. reload the saved file from disk, without needing to quit Blender) operators
along with a confirmation prompt for good measure.

Caveats:
* Ultimately, we still cannot really cleanly delete any datablocks from the current
  session outright without reloading the file/data at some point. Thus, we do need
  to reload the file again before it can be used.
* This does mean that this operation is irreversible. Notably, Undo history is lost
  is doing this operation. Hence the warnings...   (Then again, undo/redo actually
  reloads the entire scene DB from memory, so it's not anything uncommon ;)

Other Notes:
* The addition of this operator brings this mode more into line with being a kind of
  "Trashcan" place, with this new operator being the manual "Empty Trash" button.
  If the "Orphaned Datablocks" name is too obscure, maybe we could rename this
  mode to "Trash" or something similar?
2015-02-16 01:21:47 +13:00
0688f6e012 Code Cleanup: Reshuffle libraries and orphaned datablocks views to a more appropriate place in the file 2015-02-16 01:21:46 +13:00
d0609d09e4 Outliner: Do not show RMB menu for "ID Base" entries 2015-02-16 01:21:45 +13:00
16689a1db0 Outliner: Use restriction columns in "Orphaned Datablocks" view to manage usercounts
When in "Orphaned Datablocks" mode, the restriction columns are used to display
usercount indicators and toggles to manage whether datablocks get saved or not.

* The first column shows an icon to indicate whether that datablock is going to get
  saved. A tick indicates the datablock will be saved, while a cross indicates the
  opposite. Clicking on this changes whether the datablock will get saved.

* The second column shows the usercount.

* The third column shows whether the datablock has a fake user.


Notes:
* The second and third columns are pretty much redundant (functionally speaking).
  While it is possible to also toggle fake users by clicking in the third column,
  its role here is more as information for power users (and hopefully to allow others
  to connect the relationship between the saved/not saved status and fake users)

* I'm not sure whether the use of the X here for the "not saved" state stands out enough
  to draw user's attention to items which are "in the danger zone".
2015-02-16 01:21:44 +13:00
030b0aab43 Outliner: Added new mode for displaying "orphaned" datablocks
Orphaned datablocks are those which have either:
* 0 users
* A "fake" user only

In the case of the former, they will be quietly discarded from the file on the next
save + reload. Hence, it is helpful to have a view where you can confirm which ones
fall into this category and might be worth saving.

We also include datablocks with a fake user only so that datablocks given a user
above can have that easily turned off again (in case the user makes a mistake).
Another benefit of showing these is that it become easier to remove fake users from
datablocks you no longer want retained without having to hunt for them.
2015-02-16 01:21:43 +13:00
Julian Eisel
0ff56ca2aa Revert/Remove "Auto View" Feature
Turned out that I misinterpreted the feature request, plus there are some
minor issues with the commit that would need to be corrected.
After all, I decided to just remove it again as it seems to not be really
useful for the users.
2015-02-15 04:29:11 +01:00
c439d14a9a missed this second last commit 2015-02-15 14:11:05 +11:00
fa2f7c69ac mathutils: Implement __hash__() functions
- all mathutils types
- only works on frozen data (so vectors can be used in sets/dict keys)
- uses same method as CPython, (matches hashing a tuple)

D1104 by @juicyfruit with own modifications
2015-02-15 14:02:08 +11:00
a9d979c8ef mathutils: add freeze() method, is_frozen attr
This allows you to make any mathutils object immutable.
2015-02-15 14:01:59 +11:00
ce85aef0d9 mathutils: remove redundant read callback 2015-02-15 13:46:47 +11:00
4feb77cf03 mathutils: avoid extra alloc for Vector.lerp 2015-02-15 13:46:47 +11:00
24f9ed0b34 Fix crash setting Euler.order to a non-string 2015-02-15 13:46:47 +11:00
bf157ce927 Fix T42919 & T42218: BGE: Python-driven armature animation got buggy
Due to changes in the way animation updates were handled,
BL_ArmatureObjects were no longer registering to KX_Scene as animated.

Moguri says: It might have been relying on the deformer update which
moved rom being called on every object in the render step. Now
armature deformers are only updated if they need to be.

Fix T42919 & Fix T42218
2015-02-15 02:00:56 +01:00
a83b2d3fd9 Cycles: Fix wrong attribute count calculation in prevous commit
The workaround for generated texture coordinates is to be done before
calculating number of elements for attribute, otherwise counter wouldn't
include those attributes.
2015-02-15 02:55:18 +05:00
1862fbf203 Cycles: Optimize memory usage when creating mesh attributes
The idea behind the change is to pre-allocate attribute arrays in advance,
which avoids re-allocation of arrays later for each of meshes being handled.

This reduces peak memory used by Cycles database from 1.3G to 0.9G for
victor.blend from Gooseberry.

It doesn't mean every file will benefit from this change since peak memory
usage is happening in the different places of the rendering code.

Also, unfortunately, attributes export might not cause the peak of render
preparation stage. That said, it's actually object_to_mesh() which causes
the memory to peak in the same test file. So we really need to optimize that
part first in order to get visible results for artists. But in any case it's
now quite easy to track hotspots in Cycles itself which is good.
2015-02-15 02:01:48 +05:00
18937f6fb5 Cycles: Add ifdef switch to use blender's guardedalloc for vector allocation
It's actually a bad level call, but it's inside ifdef block and disabled by
default and only intended to be used for development purposes.

Main idea of this change is to combine statistics coming from Cycles and
Blender during scene synchronization step, to see if further changes are
actually reducing memory footprint.
2015-02-15 02:01:48 +05:00
d0cc1180b0 Cycles: Add utility method to vector which totally frees memory used the vector
The method is called vector::free_memory(). Use with care since it'll invalidate
all the pointers to vector memory, all iterators and so on.

Currently unused, but might become handy when clearing unused data.
2015-02-15 02:01:48 +05:00
aad96506c1 Cycles: Report system memory usage and peak after scene device update
This only happens when built with WITH_CYCLES_DEBUG flag, memory statistics
is coming from guarded STL allocator.
2015-02-15 02:01:48 +05:00
a445e49186 Cycles: Implement guarded allocator for STL classes
The commit implements a guarded allocator which can be used by STL classes
such as vectors, maps and so on. This allocator will keep track of current
and peak memory usage which then can be queried.

New code for allocator is only active when building Cycles with debug flag
(WITH_CYCLES_DEBUG) and doesn't distort regular builds too much.

Additionally now we're using own subclass of std::vector which allows us
to implement shrink_to_fit() method which would ensure capacity of the
vector is as big as it should be (without this making vector smaller will
still use all previous memory allocated).
2015-02-15 02:01:48 +05:00
01067fe51c Cycles: Replace own aligned allocator with system one
This replaces our own implementation of aligned malloc with system calls,
which depends on which operation system you're on.

This is probably really minor noticeable change, but in the same time it
might reduce amount of wasted memory.
2015-02-15 02:01:48 +05:00
Julian Eisel
24976dd29d Outliner: Toggle restrict buttons only for selectable child objects
D404 by @rupp with minor edits by me.
2015-02-14 21:54:31 +01:00
354cf76803 Cleanup: Comment block for sse helpers. 2015-02-14 20:57:21 +01:00
d979f39cf1 Cycles: Small improvement for volume render (decoupled)
Simplify branching here a bit, helps ~3% in volume_light_sampling.blend (Branched MIS scene).
2015-02-14 20:44:30 +01:00
2fad3132a3 Cycles: Fix compilation error of Cycles standalone with Libmv disabled 2015-02-14 21:33:14 +05:00
db297e7ea3 Revert "Fix T43471, based on patch submitted by @sean_loh."
This reverts commit b2b54b0902.

The patch breaks particle distribution even in simple cases, not worth
doing this for keeping a hackish loophole open.
2015-02-14 16:40:57 +01:00
cfa1fd1c1f object drawing: only use halo-draw in object mode 2015-02-14 22:29:45 +11:00
dd6edac803 Bring copy/free operations into line with changes in previous commit 2015-02-15 00:06:19 +13:00
ec2ede4302 Bugfix: Referencing actions from Action Actuator was not setting a user
This reverts the change made in 8872cba7e9
which was contributing to actions being lost in some cases [1], even when
they were assigned to those actuaters, which needed them to be able to
function. Now there's one less case where users are needed but were missing :)

Note that this still doesn't solve the core issue where nothing is responsible
for associating actions created for a particular datablock (and not currently
being used in its active action slot, or in the NLA stack) with that datablock.
That issue is the cause of most action disappearances as well as for other problems
(such as renaming bones being unable to fix unreferenced/unused actions) where there
are diifferences between users' mental models and the data model. Proper fixes are
coming soon (restoring fake users here isn't a proper fix, as it only masks the
fundamental mismatch/problem here).


[1] http://blenderartists.org/forum/showthread.php?357021-BGE-loses-actions
2015-02-15 00:06:18 +13:00
dde0765de2 CMake: Enable JeMalloc by default
It's really handy to have blender linked against jemalloc because of
much better memory fragmentation handling by that library.

To be noted: if jemalloc library is not found it'll be disabled with
message about that, no compilation error should happen.
2015-02-14 15:13:48 +05:00
a439c8026a CMake: Add search path for jemalloc which corresponds to own and studio setup 2015-02-14 12:29:48 +05:00
7a977df6d4 Refactor array_utils out of BLI_array
BLI_array.h is for resizing array macros, where as array_utils can operate on any arrays.
2015-02-14 08:00:41 +11:00
2af905391d cleanup: doxy comments 2015-02-14 08:00:41 +11:00
2c1143aa2f Comments: use doxy sections for nodes header 2015-02-14 08:00:41 +11:00
3ec9b8e0c2 Purge temporary files on abort
This way both BLI_assert() and abort() called directly shouldn't
leave any files in the temp folder.

Previously it was really possible to have gadzillions of files
left over because of assert failures and debug aborts during the
development process.
2015-02-14 01:30:36 +05:00
ab77466105 Fix T43585 XRay + transparency broken
We need to turn off restore depth mask in transparency.
2015-02-13 14:38:38 +01:00
Julian Eisel
ef2f31028e Revert "Fix T43646: VSE preview allows displaying channels down to -5"
This reverts commit e652f781a3.

@schlaile, mentioned in T43646 that this was an intended feature. Checked git
history and it's seems like he's right.
2015-02-13 13:57:48 +01:00
90a9415c9a No need to use "SSAO" for SSAO color 2015-02-13 12:15:57 +01:00
c01a2aa4bb Alleviate grid creating shadows in Ambient Occlusion effect.
Draw the grid last with depth masking disabled. That should have no ill
effects otherwise as far as I can tell except from some exceptional
cases (axis lines over grid) but this is hardly annoying.

Generally to properly solve such issues we need to have a better render
pipeline with wire objects/materials being drawn after compositing. This
is not impossible but for now doing it the simple way.
2015-02-13 11:56:41 +01:00
Julian Eisel
e652f781a3 Fix T43646: VSE preview allows displaying channels down to -5
Maybe just another typo (tm). (Checked with @psy-fi)
2015-02-13 11:53:29 +01:00
261cd7f6bf Fix T43649: Geometry node breaks GLSL shading
The issue was caused by the recently added attribute, which is to be
added to the shader function even tho it's not supported.
2015-02-13 15:24:35 +05:00
e63594a6e5 Fix again tablets with linux!
Yes, for me tablets (both wacom and no-name) were again broken - curse X11!
So now, we want ButtonPress, Button1Motion does not work anymore...

Anyway, this patch makes things much cleaner, storing each event type
in its own variable!

Patch by cedricp (Cédric PAILLE) from T43367, thanks a bunch!
2015-02-13 10:57:26 +01:00
46151a6a69 Fix issue with some files having non-unique modifier names
Originally the files are coming from ancient early-2.4x epoch, but in
theory such setups might have been re-saved multiple times already with
more recent blender versions.

So the verisoning code is applied on all the files, including very
recent ones.

Bumped subversion, because this check si not really cheap.
2015-02-13 13:51:10 +05:00
67fa545ed0 Make modifier_unique_name return whether modifier was renamed or not 2015-02-13 13:46:51 +05:00
270bbc89ec Fix Cycles compilation on x86, without SSE. 2015-02-13 09:29:16 +01:00
34e9f6b956 Fix (revert) mistake in rB1ae2098a6e04359b, causing broken UI (see e.g. Scene buttons).
Reported by  sebastian_k through IRC, thanks!
2015-02-13 09:10:53 +01:00
616eb6818f cleanup 2015-02-13 16:17:00 +11:00
1ae2098a6e cleanup: ui, use bools 2015-02-13 11:43:28 +11:00
4132ca1ac2 UI: show check-boxes pie-menu bool/enums 2015-02-13 11:33:11 +11:00
29e19cecd8 BMesh: avoid ugly macro for loop interpolation
Compiler optimizes to practically the same output
2015-02-13 11:06:16 +11:00
1af042d9ed BGE: Fix for T42285 & T38935 crashes. They are Rayhit related.
We make sure that good values are passed to GetPolygon() and we check that the visual mesh doesn't have a wrong displacement when it passes over a object which has a mesh triangle as compound bound.

Reviewers: dfelinto, sergof, agoose77, moguri

Reviewed By: moguri

Subscribers: agoose77

Differential Revision: https://developer.blender.org/D979
2015-02-13 00:12:21 +01:00
2b847d1e65 BGE: Remove translation and rotation constrains subpanel from dynamics type
The translation and rotation locks subpanel was not used by dynamic physics type to avoid inestability in the application of forces and/or torques. Therefore it is better to remove it from UI (for dynamics) to avoid misunderstandings.

Reviewers: moguri, dfelinto, campbellbarton

Reviewed By: campbellbarton

Subscribers: panzergame

Differential Revision: https://developer.blender.org/D1090
2015-02-13 00:05:16 +01:00
9e217ccb2e BGE Fix T39026: No collisions detected with parented rigid body object
Fix for T39026. Preliminary investigation by blenderscripter on D446.
Also it solves bug T41285 (Parenting object leave collission box).

Refactor commit b90de0331d introduced a
regression bug.

Reviewers: sergof, campbellbarton, moguri

Reviewed By: moguri

Subscribers: blueprintrandom, blenderscripter

Differential Revision: https://developer.blender.org/D1064
2015-02-12 23:56:50 +01:00
eda2d563bc Cleanup horrible artifact of Greek to English translation. 2015-02-12 22:05:47 +01:00
8de421bbf1 Use the RNA for overriding the name instead. 2015-02-12 19:59:34 +01:00
d0a91eb1b4 More naming refinement GPU fstop -> Viewport f-stop 2015-02-12 19:50:19 +01:00
090623c6b6 Revert "Add missing trailing '}' in GLSL files"
This reverts commit ebd4a6e0dd.

Trailing '}' is added in C, also we add some extra code as needed.
2015-02-12 19:39:10 +01:00
f20fa24ba1 Add DOF fstop property for cycles, also don't grey it out when object is
set as focused
2015-02-12 19:35:43 +01:00
ebd4a6e0dd Add missing trailing '}' in GLSL files 2015-02-13 05:12:15 +11:00
5e613198e5 Viewport compositing - first code
This commit introduces a few ready made effects for the 3D viewport
and OpenGL rendering.

Included effects are Depth of Field, accessible from camera view
and screen space ambient occlusion. Those effects can be turned on and
tweaked from the shading panel in the 3D viewport.

Off screen rendering will use the settings of the current camera.

WIP documentation can be found here:

http://wiki.blender.org/index.php/User:Psy-Fi/Framebuffer_Post-processing
2015-02-12 18:54:41 +01:00
d40ac45610 Fix (unreported) load_file() func from creator.c not setting G.save_over correctly.
This was rather annoying, since if you were script-editing a .blend file in background
mode, opened through this commandline option system,  and wanted to save over,
a mere `bpy.ops.wm.save_mainfile()` *would not* overwrite expected file,
but instead write/replace the dummy `untitled.blend` one!
2015-02-12 17:30:19 +01:00
d70c7c06e7 Removed the cloth preroll feature.
This feature has been totally broken for a long time. It was added
originally because negative frames were not supported.

Giving simulations (cloth and others) time to settle before animation
starts needs to be solved in a much better and more generic way.
2015-02-12 16:30:07 +01:00
912b4659ec Tracker operators: filter & copy track settings
D1069 by @sebastian_k
2015-02-13 02:22:39 +11:00
719fd5a1ce GPencil: Alt-S can now be used to adjust the pressure values (i.e. thickness) of strokes 2015-02-13 02:48:50 +13:00
d92d8c3768 GPencil: Some tweaks to make GPencil UI more compact when there are 0 or 1 layer(s) only
As brought up in T43595, the Grease Pencil layers list could sometimes end up
taking up too much space when there are no layers. Another issue raised there
was that the up/down buttons are redundant when there is only a single layer.
This commit makes some changes to get these a bit more compact for the case where
you have an empty GPencil datablock left over from previous work.
2015-02-13 02:48:49 +13:00
4f3f9cb280 GPencil: LKEY can now be used for Select Linked too now 2015-02-13 02:48:49 +13:00
5c02afb698 Bugfix: Old NLA Strips from 2.4x got converted with no names (since they didn't use to have any) 2015-02-13 02:48:48 +13:00
7221fbe9dd cleanup 2015-02-12 23:51:02 +11:00
e408e632a1 Addons: print short message if an addons missing
Was printing full traceback, harmless but verbose.
2015-02-12 23:44:37 +11:00
b05df25f1c First test with applymodifier.
The modifier has a lot of bugs.
2014-08-26 21:15:42 -05:00
5aac8ee281 Clean code.
Completed all methods to compute flow lines.
2014-08-25 09:21:59 -05:00
baca2b3f15 Methods to find flow lines that are near. 2014-08-21 21:28:55 -05:00
9368c81882 New files to organize the code
Several structures for produce new mesh.
Several methods to compute the seeds, and accelerate the queries of nears flow lines.
2014-08-15 21:53:35 -05:00
0a77b92f27 method to compute sampling distance functions 2014-08-08 20:38:38 -05:00
6012a9f902 Add two buttons on modifier, first button to compute flow. second button to remeshing. 2014-08-01 20:38:12 -05:00
ce1a6c1ca6 Exhaustive method for calculating the path of the flow line.
More comparisons on the scale to avoid vector field calculation is performed.
Method to compute a random point, P, uniformly from within triangle ABC, method given by Robert Osada, Thomas Funkhouser, Bernard Chazelle, and David Dobkin. 2002. Shape distributions. ACM Trans. Graph. 21, 4 (October 2002), 807-832. DOI=10.1145/571647.571648 http://doi.acm.org/10.1145/571647.571648
2014-07-30 20:38:06 -05:00
b987a43d2f Method to store a map of edges around vertex.
Method to project a gradient field vector on a plane defined by face for define the direction of flow line over this face.
Method to intersect a face with line projected from seed point on gradient direction.
2014-07-25 20:35:22 -05:00
a2ca8fe246 Warnings fixed, about non used variables. 2014-07-18 21:03:13 -05:00
f8b49614c1 Method for choose face that serve to build a line gradient flow
Method to project vector field on certain face and intersect this with adjacent edges.
Fixed problem about computation of gradient field vector, i misinterpreted the matrix representation.
2014-07-18 21:00:49 -05:00
b20cf5c2b4 I add a structure to manage the flow lines.
The main structure is modified to save a set of flow lines.
It created a method to calculate a flow line, given the index of a vertex that will serve as the seed of the line.
2014-07-11 20:57:49 -05:00
4c92ad2cfa One more fix to make this compile on Linux.
Needed to change min -> min_ff, max -> max_ff.
2014-07-08 12:39:37 -04:00
b2e887f2ef Patch to fix some compilations problems. 2014-07-08 10:25:33 -05:00
426a1c5737 Structures were added to store the two gradient fields.
It ended the method to calculate the two gradients fields.
The results are now shown with only two colors, so that the scalar field is represented by bands.
2014-06-26 19:37:25 -05:00
9b789f3cff Method to compute the gradient field. 2014-06-20 19:25:51 -05:00
77b604afa2 Initial structures to compute the gradient field. 2014-06-20 18:53:00 -05:00
23d10799c7 Minor bug fixes and several correction. 2014-06-19 15:25:18 -05:00
3e97ae43a0 Code optimization.
The system create a new vertex group, to put the results.
2014-06-13 16:24:12 -05:00
308b016251 Initial version, to create a Scalar Field U.
The tool is implement as a Modifier.
The features points are define with vertex groups.
2014-06-06 14:02:24 -05:00
6c55911cdc Merge remote-tracking branch 'origin/master' into soc-2014-remesh 2014-06-04 11:10:23 -05:00
81e4f77bb0 Initial configuration, to add the quadrilateral remeshing tool as a modifier remeshing 2014-06-03 20:15:23 -05:00
39799f88f7 Initial configuration, to add the quadrilateral remeshing tool as a modifier remeshing 2014-06-03 20:11:10 -05:00
1827 changed files with 89232 additions and 31383 deletions

View File

@@ -197,10 +197,10 @@ option(WITH_PYTHON "Enable Embedded Python API (only disable for develop
option(WITH_PYTHON_SECURITY "Disables execution of scripts within blend files by default" ON)
mark_as_advanced(WITH_PYTHON) # dont want people disabling this unless they really know what they are doing.
mark_as_advanced(WITH_PYTHON_SECURITY) # some distributions see this as a security issue, rather than have them patch it, make a build option.
set(WITH_PYTHON_SECURITY ON CACHE BOOL "ON" FORCE) # temp force on.
option(WITH_PYTHON_SAFETY "Enable internal API error checking to track invalid data to prevent crash on access (at the expense of some effeciency, only enable for development)." OFF)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development)" OFF)
mark_as_advanced(WITH_PYTHON_SAFETY)
option(WITH_PYTHON_MODULE "Enable building as a python module which runs without a user interface, like running regular blender in background mode (experimental, only enable for development), installs to PYTHON_SITE_PACKAGES (or CMAKE_INSTALL_PREFIX if WITH_INSTALL_PORTABLE is enabled)." OFF)
if(APPLE)
option(WITH_PYTHON_FRAMEWORK "Enable building using the Python available in the framework (OSX only)" OFF)
endif()
@@ -260,6 +260,10 @@ endif()
# (unix defaults to System OpenJPEG On)
option(WITH_SYSTEM_OPENJPEG "Use the operating systems OpenJPEG library" OFF)
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_EIGEN3 "Use the systems Eigen3 library" OFF)
endif()
# Modifiers
option(WITH_MOD_FLUID "Enable Elbeem Modifier (Fluid Simulation)" ON)
@@ -269,6 +273,7 @@ option(WITH_MOD_REMESH "Enable Remesh Modifier" ON)
# option(WITH_MOD_CLOTH_ELTOPO "Enable Experimental cloth solver" OFF) # this is now only available in a branch
# mark_as_advanced(WITH_MOD_CLOTH_ELTOPO)
option(WITH_MOD_OCEANSIM "Enable Ocean Modifier" OFF)
option(WITH_MOD_QUADREMESH "Enable Quad Remesh Modifier" ON)
# Image format support
option(WITH_OPENIMAGEIO "Enable OpenImageIO Support (http://www.openimageio.org)" ON)
@@ -308,6 +313,9 @@ endif()
# Compression
option(WITH_LZO "Enable fast LZO compression (used for pointcache)" ON)
option(WITH_LZMA "Enable best LZMA compression, (used for pointcache)" ON)
if(UNIX AND NOT APPLE)
option(WITH_SYSTEM_LZO "Use the system LZO library" OFF)
endif()
# Camera/motion tracking
option(WITH_LIBMV "Enable libmv structure from motion library" ON)
@@ -351,7 +359,7 @@ option(WITH_CYCLES_STANDALONE "Build cycles standalone application" OFF)
option(WITH_CYCLES_STANDALONE_GUI "Build cycles standalone with GUI" OFF)
option(WITH_CYCLES_OSL "Build Cycles with OSL support" ${_init_CYCLES_OSL})
option(WITH_CYCLES_CUDA_BINARIES "Build cycles CUDA binaries" OFF)
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 CACHE STRING "CUDA architectures to build binaries for")
set(CYCLES_CUDA_BINARIES_ARCH sm_20 sm_21 sm_30 sm_35 sm_50 sm_52 CACHE STRING "CUDA architectures to build binaries for")
mark_as_advanced(CYCLES_CUDA_BINARIES_ARCH)
unset(PLATFORM_DEFAULT)
option(WITH_CYCLES_LOGGING "Build cycles with logging support" ON)
@@ -369,7 +377,7 @@ endif()
mark_as_advanced(LLVM_STATIC)
# disable for now, but plan to support on all platforms eventually
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" OFF)
option(WITH_MEM_JEMALLOC "Enable malloc replacement (http://www.canonware.com/jemalloc)" ON)
mark_as_advanced(WITH_MEM_JEMALLOC)
# currently only used for BLI_mempool
@@ -387,6 +395,7 @@ option(WITH_BOOST "Enable features depending on boost" ON)
# Unit testsing
option(WITH_GTESTS "Enable GTest unit testing" OFF)
option(WITH_TESTS_PERFORMANCE "Enable performance tests" OFF)
# Documentation
@@ -403,6 +412,7 @@ option(WITH_GL_EGL "Use the EGL OpenGL system library instead of th
option(WITH_GL_PROFILE_COMPAT "Support using the OpenGL 'compatibility' profile. (deprecated)" ON )
option(WITH_GL_PROFILE_CORE "Support using the OpenGL 3.2+ 'core' profile." OFF)
option(WITH_GL_PROFILE_ES20 "Support using OpenGL ES 2.0. (thru either EGL or the AGL/WGL/XGL 'es20' profile)" OFF)
option(WITH_GPU_DEBUG "Create a debug OpenGL context (allows inserting custom messages and getting notifications for bad GL use)" OFF)
mark_as_advanced(
WITH_GLEW_MX
@@ -411,6 +421,7 @@ mark_as_advanced(
WITH_GL_PROFILE_COMPAT
WITH_GL_PROFILE_CORE
WITH_GL_PROFILE_ES20
WITH_GPU_DEBUG
)
if(WITH_GL_PROFILE_COMPAT)
@@ -434,6 +445,13 @@ if(MSVC)
set(CPACK_INSTALL_PREFIX ${CMAKE_GENERIC_PROGRAM_FILES}/${})
endif()
# Experimental support of C++11
option(WITH_CPP11 "Build with C++11 standard enabled, for development use only!" OFF)
mark_as_advanced(WITH_CPP11)
# Dependency graph
option(WITH_LEGACY_DEPSGRAPH "Build Blender with legacy dependency graph" ON)
# avoid using again
option_defaults_clear()
@@ -660,6 +678,7 @@ if(WITH_GHOST_SDL OR WITH_HEADLESS)
set(WITH_X11_XINPUT OFF)
set(WITH_X11_XF86VMODE OFF)
set(WITH_GHOST_XDND OFF)
set(WITH_INPUT_IME OFF)
endif()
if(WITH_CPU_SSE)
@@ -794,6 +813,21 @@ if(UNIX AND NOT APPLE)
find_package_wrapper(ZLIB REQUIRED)
find_package_wrapper(Freetype REQUIRED)
if(WITH_LZO AND WITH_SYSTEM_LZO)
find_package_wrapper(LZO)
if(NOT LZO_FOUND)
message(FATAL_ERROR "Failed finding system LZO version!")
endif()
endif()
if(WITH_SYSTEM_EIGEN3)
find_package_wrapper(Eigen3)
if(NOT EIGEN3_FOUND)
message(FATAL_ERROR "Failed finding system Eigen3 version!")
endif()
endif()
# else values are set below for all platforms
if(WITH_PYTHON)
# No way to set py34. remove for now.
# find_package(PythonLibs)
@@ -838,17 +872,21 @@ if(UNIX AND NOT APPLE)
if(WITH_SDL)
if(WITH_SDL_DYNLOAD)
set(SDLMAIN_LIBRARY)
set(SDL_INCLUDE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/extern/sdlew/include/SDL2")
set(SDL_LIBRARY)
set(SDL_LIBRARY_TEMP)
else()
find_package_wrapper(SDL)
find_package_wrapper(SDL2)
if(SDL2_FOUND)
# Use same names for both versions of SDL until we move to 2.x.
set(SDL_INCLUDE_DIR "${SDL2_INCLUDE_DIR}")
set(SDL_LIBRARY "${SDL2_LIBRARY}")
set(SDL_FOUND "${SDL2_FOUND}")
else()
find_package_wrapper(SDL)
endif()
mark_as_advanced(
SDLMAIN_LIBRARY
SDL_INCLUDE_DIR
SDL_LIBRARY
SDL_LIBRARY_TEMP
)
# unset(SDLMAIN_LIBRARY CACHE)
if(NOT SDL_FOUND)
@@ -1024,75 +1062,18 @@ if(UNIX AND NOT APPLE)
endif()
endif()
# XXX Maybe most of this section should go into an llvm module?
if(WITH_LLVM)
# Set llvm version if not specified
if(NOT LLVM_VERSION)
set(LLVM_VERSION "3.0")
endif()
find_package_wrapper(LLVM)
if(LLVM_DIRECTORY)
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_DIRECTORY}/bin NO_CMAKE_PATH)
endif()
else()
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config)
endif()
if(NOT LLVM_FOUND)
set(WITH_LLVM OFF)
message(STATUS "LLVM not found")
endif()
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
endif()
if(NOT DEFINED LLVM_DIRECTORY)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_DIRECTORY
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_DIRECTORY ${LLVM_DIRECTORY} CACHE PATH "Path to the LLVM installation")
endif()
if(NOT DEFINED LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
endif()
else()
message(FATAL_ERROR "LLVM not found.")
endif()
endif()
if(WITH_LLVM OR WITH_SDL_DYNLOAD)
# Fix for conflict with Mesa llvmpipe
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script=${CMAKE_SOURCE_DIR}/source/creator/blender.map")
set(PLATFORM_LINKFLAGS "${PLATFORM_LINKFLAGS} -Wl,--version-script='${CMAKE_SOURCE_DIR}/source/creator/blender.map'")
endif()
# OpenSuse needs lutil, ArchLinux not, for now keep, can avoid by using --as-needed
@@ -1121,6 +1102,25 @@ if(UNIX AND NOT APPLE)
# GNU Compiler
if(CMAKE_COMPILER_IS_GNUCC)
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "5.0")
# GCC5 uses gnu11, until we update, force c89
# though some c11 features can still be used.
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu89")
endif()
# use ld.gold linker if available, could make optional
execute_process(
COMMAND ${CMAKE_C_COMPILER} -fuse-ld=gold -Wl,--version
ERROR_QUIET OUTPUT_VARIABLE LD_VERSION)
if ("${LD_VERSION}" MATCHES "GNU gold")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fuse-ld=gold")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fuse-ld=gold")
else ()
message(INFO "GNU gold linker isn't available, using the default system linker.")
endif ()
unset(LD_VERSION)
# CLang is the same as GCC for now.
elseif(CMAKE_C_COMPILER_ID MATCHES "Clang")
set(PLATFORM_CFLAGS "-pipe -fPIC -funsigned-char -fno-strict-aliasing")
@@ -1162,7 +1162,7 @@ elseif(WIN32)
set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} /SAFESEH:NO")
set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} /SAFESEH:NO")
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi)
list(APPEND PLATFORM_LINKLIBS ws2_32 vfw32 winmm kernel32 user32 gdi32 comdlg32 advapi32 shfolder shell32 ole32 oleaut32 uuid psapi Dbghelp)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS imm32)
@@ -1251,8 +1251,8 @@ elseif(WIN32)
find_package(png)
if(NOT PNG_FOUND)
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
message(WARNING "Using HARDCODED libpng locations")
set(PNG_PNG_INCLUDE_DIR ${LIBDIR}/png/include)
set(PNG_LIBRARIES libpng)
set(PNG "${LIBDIR}/png")
set(PNG_INCLUDE_DIRS "${PNG}/include")
@@ -1339,19 +1339,19 @@ elseif(WIN32)
set(OPENEXR_VERSION "2.1")
find_package(OPENEXR REQUIRED)
if(NOT OPENEXR_FOUND)
message(WARNING "Using HARDCODED OpenEXR locations")
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
${OPENEXR_LIBPATH}/Iex-2_2.lib
${OPENEXR_LIBPATH}/Half.lib
${OPENEXR_LIBPATH}/IlmImf-2_2.lib
${OPENEXR_LIBPATH}/Imath-2_2.lib
${OPENEXR_LIBPATH}/IlmThread-2_2.lib
)
endif(NOT OPENEXR_FOUND)
message(WARNING "Using HARDCODED OpenEXR locations")
set(OPENEXR ${LIBDIR}/openexr)
set(OPENEXR_INCLUDE_DIR ${OPENEXR}/include)
set(OPENEXR_INCLUDE_DIRS ${OPENEXR}/include/OpenEXR)
set(OPENEXR_LIBPATH ${OPENEXR}/lib)
set(OPENEXR_LIBRARIES
${OPENEXR_LIBPATH}/Iex-2_2.lib
${OPENEXR_LIBPATH}/Half.lib
${OPENEXR_LIBPATH}/IlmImf-2_2.lib
${OPENEXR_LIBPATH}/Imath-2_2.lib
${OPENEXR_LIBPATH}/IlmThread-2_2.lib
)
endif()
endif()
if(WITH_IMAGE_TIFF)
@@ -1391,10 +1391,10 @@ elseif(WIN32)
if(WITH_BOOST)
if(WITH_CYCLES_OSL)
set(boost_extra_libs wave)
endif(WITH_CYCLES_OSL)
endif()
if(WITH_INTERNATIONAL)
list(APPEND boost_extra_libs locale)
endif(WITH_INTERNATIONAL)
endif()
set(Boost_USE_STATIC_RUNTIME ON) # prefix lib
set(Boost_USE_MULTITHREADED ON) # suffix -mt
set(Boost_USE_STATIC_LIBS ON) # suffix -s
@@ -1452,16 +1452,16 @@ elseif(WIN32)
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_DIRECTORY}/lib/*.lib)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
file(GLOB LLVM_LIBRARY_OPTIMIZED ${LLVM_ROOT_DIR}/lib/*.lib)
if(EXISTS ${LLVM_DIRECTORY}/debug/lib)
if(EXISTS ${LLVM_ROOT_DIR}/debug/lib)
foreach(LLVM_OPTIMIZED_LIB ${LLVM_LIBRARY_OPTIMIZED})
get_filename_component(LIBNAME ${LLVM_OPTIMIZED_LIB} ABSOLUTE)
list(APPEND LLVM_LIBS optimized ${LIBNAME})
endforeach(LLVM_OPTIMIZED_LIB)
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_DIRECTORY}/debug/lib/*.lib)
file(GLOB LLVM_LIBRARY_DEBUG ${LLVM_ROOT_DIR}/debug/lib/*.lib)
foreach(LLVM_DEBUG_LIB ${LLVM_LIBRARY_DEBUG})
get_filename_component(LIBNAME ${LLVM_DEBUG_LIB} ABSOLUTE)
@@ -1521,7 +1521,7 @@ elseif(WIN32)
if(WITH_MINGW64)
message(STATUS "Compiling for 64 bit with MinGW-w64.")
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
if (GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
if(GCC_VERSION VERSION_GREATER 4.9 OR GCC_VERSION VERSION_EQUAL 4.9)
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64_gcc49)
else()
set(LIBDIR ${CMAKE_SOURCE_DIR}/../lib/mingw64)
@@ -1535,7 +1535,7 @@ elseif(WIN32)
endif()
endif()
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi)
list(APPEND PLATFORM_LINKLIBS -lshell32 -lshfolder -lgdi32 -lmsvcrt -lwinmm -lmingw32 -lm -lws2_32 -lz -lstdc++ -lole32 -luuid -lwsock32 -lpsapi -ldbghelp)
if(WITH_INPUT_IME)
list(APPEND PLATFORM_LINKLIBS -limm32)
@@ -1698,8 +1698,8 @@ elseif(WIN32)
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_LIBPATH ${LLVM_DIRECTORY}/lib)
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_LIBPATH ${LLVM_ROOT_DIR}/lib)
# Explicitly set llvm lib order.
#---- WARNING ON GCC ORDER OF LIBS IS IMPORTANT, DO NOT CHANGE! ---------
set(LLVM_LIBRARY LLVMSelectionDAG LLVMCodeGen LLVMScalarOpts LLVMAnalysis LLVMArchive
@@ -1845,14 +1845,14 @@ elseif(APPLE)
if(NOT WITH_PYTHON_MODULE AND NOT WITH_PYTHON_FRAMEWORK)
# normally cached but not since we include them with blender
set(PYTHON_INCLUDE_DIR "${LIBDIR}/python/include/python${PYTHON_VERSION}m")
# set(PYTHON_BINARY "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
# set(PYTHON_EXECUTABLE "${LIBDIR}/python/bin/python${PYTHON_VERSION}") # not used yet
set(PYTHON_LIBRARY python${PYTHON_VERSION}m)
set(PYTHON_LIBPATH "${LIBDIR}/python/lib/python${PYTHON_VERSION}")
# set(PYTHON_LINKFLAGS "-u _PyMac_Error") # won't build with this enabled
else()
# module must be compiled against Python framework
set(PYTHON_INCLUDE_DIR "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/include/python${PYTHON_VERSION}m")
set(PYTHON_BINARY "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
set(PYTHON_EXECUTABLE "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/bin/python${PYTHON_VERSION}")
#set(PYTHON_LIBRARY python${PYTHON_VERSION})
set(PYTHON_LIBPATH "/Library/Frameworks/Python.framework/Versions/${PYTHON_VERSION}/lib/python${PYTHON_VERSION}/config-${PYTHON_VERSION}m")
#set(PYTHON_LINKFLAGS "-u _PyMac_Error -framework Python") # won't build with this enabled
@@ -2034,10 +2034,10 @@ elseif(APPLE)
endif()
if(WITH_LLVM)
set(LLVM_DIRECTORY ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_ROOT_DIR ${LIBDIR}/llvm CACHE PATH "Path to the LLVM installation")
set(LLVM_VERSION "3.4" CACHE STRING "Version of LLVM to use")
if(EXISTS "${LLVM_DIRECTORY}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_DIRECTORY}/bin/llvm-config")
if(EXISTS "${LLVM_ROOT_DIR}/bin/llvm-config")
set(LLVM_CONFIG "${LLVM_ROOT_DIR}/bin/llvm-config")
else()
set(LLVM_CONFIG llvm-config)
endif()
@@ -2045,7 +2045,7 @@ elseif(APPLE)
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_DIRECTORY
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
@@ -2054,7 +2054,7 @@ elseif(APPLE)
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
if(LLVM_LIBRARY AND LLVM_DIRECTORY AND LLVM_LIBPATH)
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
@@ -2225,6 +2225,9 @@ if(WITH_IMAGE_REDCODE)
set(REDCODE_INC ${REDCODE})
endif()
if(NOT WITH_SYSTEM_EIGEN3)
set(EIGEN3_INCLUDE_DIRS ${CMAKE_SOURCE_DIR}/extern/Eigen3)
endif()
#-----------------------------------------------------------------------------
# Configure OpenGL.
@@ -2346,6 +2349,10 @@ if(WITH_GL_EGL)
list(APPEND GL_DEFINITIONS -DWITH_EGL)
endif()
if(WITH_GPU_DEBUG)
list(APPEND GL_DEFINITIONS -DWITH_GPU_DEBUG)
endif()
#-----------------------------------------------------------------------------
# Configure OpenMP.
if(WITH_OPENMP)
@@ -2482,6 +2489,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_C_COMPILER_FLAG(C_WARNINGS C_WARN_FORMAT_SIGN -Wformat-signedness)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2509,6 +2517,16 @@ if(CMAKE_COMPILER_IS_GNUCC)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_MISSING_INCLUDE_DIRS -Wmissing-include-dirs)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_DIV_BY_ZERO -Wno-div-by-zero)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_TYPE_LIMITS -Wtype-limits)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_RETURN_TYPE -Werror=return-type)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_DECLARATION_AFTER_STATEMENT -Werror=declaration-after-statement)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_ERROR_IMPLICIT_FUNCTION_DECLARATION -Werror=implicit-function-declaration)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_CHAR_SUBSCRIPTS -Wno-char-subscripts)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_NO_UNKNOWN_PRAGMAS -Wno-unknown-pragmas)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_POINTER_ARITH -Wpointer-arith)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNUSED_PARAMETER -Wunused-parameter)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_WRITE_STRINGS -Wwrite-strings)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_UNDEF -Wundef)
ADD_CHECK_CXX_COMPILER_FLAG(CXX_WARNINGS CXX_WARN_FORMAT_SIGN -Wformat-signedness)
# gcc 4.2 gives annoying warnings on every file with this
if(NOT "${CMAKE_C_COMPILER_VERSION}" VERSION_LESS "4.3")
@@ -2642,6 +2660,16 @@ if(WITH_PYTHON)
endif()
endif()
if(WITH_CPP11)
if(CMAKE_COMPILER_IS_GNUCC OR CMAKE_C_COMPILER_ID MATCHES "Clang")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11")
elseif(MSVC12)
# Nothing special is needed, C++11 features are available by default.
else()
message(FATAL_ERROR "Compiler ${CMAKE_C_COMPILER_ID} is not supported for C++11 build yet")
endif()
endif()
# Include warnings first, so its possible to disable them with user defined flags
# eg: -Wno-uninitialized
set(CMAKE_C_FLAGS "${C_WARNINGS} ${CMAKE_C_FLAGS} ${PLATFORM_CFLAGS}")
@@ -2659,7 +2687,7 @@ mark_as_advanced(
mark_as_advanced(
LLVM_CONFIG
LLVM_DIRECTORY
LLVM_ROOT_DIR
LLVM_LIBRARY
LLVM_VERSION
)
@@ -2820,6 +2848,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_MOD_REMESH)
info_cfg_option(WITH_MOD_FLUID)
info_cfg_option(WITH_MOD_OCEANSIM)
info_cfg_option(WITH_MOD_QUADREMESH)
info_cfg_text("OpenGL:")
info_cfg_option(WITH_GLEW_ES)
@@ -2828,6 +2857,7 @@ if(FIRST_RUN)
info_cfg_option(WITH_GL_PROFILE_COMPAT)
info_cfg_option(WITH_GL_PROFILE_CORE)
info_cfg_option(WITH_GL_PROFILE_ES20)
info_cfg_option(WITH_GPU_DEBUG)
if(WIN32)
info_cfg_option(WITH_GL_ANGLE)
endif()

View File

@@ -65,7 +65,7 @@ ifneq "$(findstring cycles, $(MAKECMDGOALS))" ""
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/cycles_standalone.cmake"
endif
ifneq "$(findstring headless, $(MAKECMDGOALS))" ""
BUILD_DIR:=$(BUILD_DIR)_bpy
BUILD_DIR:=$(BUILD_DIR)_headless
BUILD_CMAKE_ARGS:=$(BUILD_CMAKE_ARGS) -C"$(BLENDER_DIR)/build_files/cmake/config/blender_headless.cmake"
endif
ifneq "$(findstring bpy, $(MAKECMDGOALS))" ""
@@ -171,7 +171,7 @@ help: FORCE
@echo ""
@echo "Package Targets"
@echo " * package_debian - build a debian package"
@echo " * package_pacman - build an arch linux pacmanpackage"
@echo " * package_pacman - build an arch linux pacman package"
@echo " * package_archive - build an archive package"
@echo ""
@echo "Testing Targets (not associated with building blender)"
@@ -218,7 +218,7 @@ package_debian: FORCE
cd build_files/package_spec ; DEB_BUILD_OPTIONS="parallel=$(NPROCS)" sh ./build_debian.sh
package_pacman: FORCE
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg --asroot
cd build_files/package_spec/pacman ; MAKEFLAGS="-j$(NPROCS)" makepkg
package_archive: FORCE
make -C "$(BUILD_DIR)" -s package_archive

View File

@@ -480,6 +480,13 @@ if env['WITH_BF_OPENMP'] == 1:
else:
env.Append(CCFLAGS=['-fopenmp'])
if env['WITH_BF_CPP11']:
if env['OURPLATFORM'] in ('win32-vc', 'win64-vc'):
# Nothing special is needed, C++11 features are available by default.
pass
else:
env['CXXFLAGS'].append('-std=c++11')
#check for additional debug libnames
if env.has_key('BF_DEBUG_LIBS'):
@@ -751,6 +758,9 @@ if B.targets != ['cudakernels']:
data_to_c_simple("release/datafiles/preview_cycles.blend")
# --- glsl ---
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_program_smoke_color_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_simple_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_material.glsl")
@@ -761,6 +771,15 @@ if B.targets != ['cudakernels']:
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vertex_world.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_vsm_store_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_ssao_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_frag.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_vert.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_dof_hq_geo.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_lib.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_depth_resolve.glsl")
data_to_c_simple("source/blender/gpu/shaders/gpu_shader_fx_vert.glsl")
data_to_c_simple("intern/opencolorio/gpu_shader_display_transform.glsl")
# --- blender ---
@@ -855,19 +874,21 @@ B.init_lib_dict()
##### END SETUP ##########
if B.targets != ['cudakernels']:
# Put all auto configuration run-time tests here
## Auto-configuration run-time tests
from FindSharedPtr import FindSharedPtr
from FindUnorderedMap import FindUnorderedMap
from FindSharedPtr import FindSharedPtr
from FindUnorderedMap import FindUnorderedMap
conf = Configure(env)
old_linkflags = conf.env['LINKFLAGS']
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
FindSharedPtr(conf)
FindUnorderedMap(conf)
conf.env['LINKFLAGS'] = old_linkflags
env = conf.Finish()
conf = Configure(env)
old_linkflags = conf.env['LINKFLAGS']
conf.env.Append(LINKFLAGS=env['PLATFORM_LINKFLAGS'])
# Put all tests here
FindSharedPtr(conf)
FindUnorderedMap(conf)
conf.env['LINKFLAGS'] = old_linkflags
env = conf.Finish()
# End of auto configuration
@@ -1007,6 +1028,7 @@ if env['OURPLATFORM']!='darwin':
source.remove('shaders')
source.remove('osl')
source=['intern/cycles/kernel/'+s for s in source]
source.append('intern/cycles/util/util_atomic.h')
source.append('intern/cycles/util/util_color.h')
source.append('intern/cycles/util/util_half.h')
source.append('intern/cycles/util/util_math.h')
@@ -1161,9 +1183,37 @@ if env['OURPLATFORM']=='linuxcross':
textlist = []
texttargetlist = []
for tp, tn, tf in os.walk('release/text'):
tf.remove("readme.html")
for f in tf:
textlist.append(tp+os.sep+f)
def readme_version_patch():
readme_src = "release/text/readme.html"
readme_dst = os.path.abspath(os.path.normpath(os.path.join(env['BF_BUILDDIR'], "readme.html")))
if not os.path.exists(readme_dst) or (os.path.getmtime(readme_dst) < os.path.getmtime(readme_src)):
f = open(readme_src, "r")
data = f.read()
f.close()
data = data.replace("BLENDER_VERSION", VERSION)
f = open(readme_dst, "w")
f.write(data)
f.close()
textlist.append(readme_dst)
readme_version_patch()
del readme_version_patch
'''Command(
"release/text/readme.html"
)
Command("file.out", "file.in", Copy(env['BF_INSTALLDIR'], "release/text/readme.html"))
'''
# Font licenses
textlist.append('release/datafiles/LICENSE-bfont.ttf.txt')
if env['WITH_BF_INTERNATIONAL']:

View File

@@ -491,7 +491,7 @@ OPENEXR_SOURCE_REPO=( "https://github.com/mont29/openexr.git" )
OPENEXR_SOURCE_REPO_UID="2787aa1cf652d244ed45ae124eb1553f6cff11ee"
ILMBASE_SOURCE=( "http://download.savannah.nongnu.org/releases/openexr/ilmbase-$ILMBASE_VERSION.tar.gz" )
OPENEXR_USE_REPO=false
OIIO_USE_REPO=false
OIIO_SOURCE=( "https://github.com/OpenImageIO/oiio/archive/Release-$OIIO_VERSION.tar.gz" )
OIIO_SOURCE_REPO=( "https://github.com/OpenImageIO/oiio.git" )
OIIO_SOURCE_REPO_UID="c9e67275a0b248ead96152f6d2221cc0c0f278a4"
@@ -510,7 +510,7 @@ OSL_SOURCE_REPO_UID="22ee5ea298fd215430dfbd160b5aefd507f06db0"
OSL_SOURCE_REPO_BRANCH="blender-fixes"
OPENCOLLADA_SOURCE=( "https://github.com/KhronosGroup/OpenCOLLADA.git" )
OPENCOLLADA_REPO_UID="18da7f4109a8eafaa290a33f5550501cc4c8bae8"
OPENCOLLADA_REPO_UID="3335ac164e68b2512a40914b14c74db260e6ff7d"
FFMPEG_SOURCE=( "http://ffmpeg.org/releases/ffmpeg-$FFMPEG_VERSION.tar.bz2" )
@@ -1374,7 +1374,7 @@ EOF
cmake_d="$cmake_d -D CMAKE_INSTALL_PREFIX=$_inst"
cmake_d="$cmake_d -D LLVM_ENABLE_FFI=ON"
cmake_d="$cmake_d -D LLVM_TARGETS_TO_BUILD=X86"
cmake_d="$cmake_d -D -DLLVM_ENABLE_TERMINFO=OFF"
cmake_d="$cmake_d -D LLVM_ENABLE_TERMINFO=OFF"
if [ -d $_FFI_INCLUDE_DIR ]; then
cmake_d="$cmake_d -D FFI_INCLUDE_DIR=$_FFI_INCLUDE_DIR"
@@ -1493,7 +1493,7 @@ compile_OSL() {
if [ ! -z $LLVM_VERSION_FOUND ]; then
cmake_d="$cmake_d -D LLVM_VERSION=$LLVM_VERSION_FOUND"
if [ -d $INST/llvm ]; then
cmake_d="$cmake_d -D LLVM_DIRECTORY=$INST/llvm"
cmake_d="$cmake_d -D LLVM_ROOT_DIR=$INST/llvm"
cmake_d="$cmake_d -D LLVM_STATIC=ON"
fi
fi
@@ -1537,7 +1537,7 @@ clean_OpenCOLLADA() {
compile_OpenCOLLADA() {
# To be changed each time we make edits that would modify the compiled results!
opencollada_magic=8
opencollada_magic=9
_init_opencollada
# Clean install if needed!
@@ -2997,7 +2997,7 @@ print_info() {
_buildargs="$_buildargs $_1"
fi
if [ -d $INST/llvm ]; then
_1="-D LLVM_DIRECTORY=$INST/llvm"
_1="-D LLVM_ROOT_DIR=$INST/llvm"
_2="-D LLVM_STATIC=ON"
PRINT " $_1"
PRINT " $_2"

View File

@@ -5,3 +5,5 @@ WITH_BF_CYCLES_CUDA_BINARIES = True
WITH_BF_CYCLES_OSL = False # OSL never worked on OSX 32bit !
WITH_BF_COLLADA = False # we drop 32bit, newest collada is only x86_64 !

View File

@@ -1,5 +1,6 @@
CC = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang"
CXX = "../lib/darwin-9.x.universal/clang-omp-3.5/bin/clang++"
MACOSX_ARCHITECTURE = 'x86_64' # valid archs: ppc, i386, ppc64, x86_64
WITH_BF_CYCLES_CUDA_BINARIES = True

View File

@@ -124,10 +124,12 @@ else:
directory = 'public_html/download'
try:
filename = os.path.join(directory, packagename)
zf = z.open(package)
f = file(os.path.join(directory, packagename), "wb")
f = file(filename, "wb")
shutil.copyfileobj(zf, f)
os.chmod(filename, 0644)
zf.close()
z.close()

View File

@@ -116,6 +116,8 @@ else:
if config.find('player') != -1:
scons_options.append('BF_BUILDDIR=%s_player' % (build_dir))
elif config.find('cuda') != -1:
scons_options.append('BF_BUILDDIR=%s_cuda' % (build_dir))
else:
scons_options.append('BF_BUILDDIR=%s' % (build_dir))
@@ -140,7 +142,7 @@ else:
retcode = subprocess.call(cur_scons_cmd + scons_options)
if retcode != 0:
print('Error building rules wuth config ' + config)
print('Error building rules with config ' + config)
sys.exit(retcode)
sys.exit(0)

View File

@@ -0,0 +1,56 @@
# - Find Eigen3 library
# Find the native Eigen3 includes and library
# This module defines
# EIGEN3_INCLUDE_DIRS, where to find spnav.h, Set when
# EIGEN3_INCLUDE_DIR is found.
# EIGEN3_ROOT_DIR, The base directory to search for Eigen3.
# This can also be an environment variable.
# EIGEN3_FOUND, If false, do not try to use Eigen3.
#
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If EIGEN3_ROOT_DIR was defined in the environment, use it.
IF(NOT EIGEN3_ROOT_DIR AND NOT $ENV{EIGEN3_ROOT_DIR} STREQUAL "")
SET(EIGEN3_ROOT_DIR $ENV{EIGEN3_ROOT_DIR})
ENDIF()
SET(_eigen3_SEARCH_DIRS
${EIGEN3_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(EIGEN3_INCLUDE_DIR
NAMES
# header has no '.h' suffix
Eigen/Eigen
HINTS
${_eigen3_SEARCH_DIRS}
PATH_SUFFIXES
include/eigen3
)
# handle the QUIETLY and REQUIRED arguments and set EIGEN3_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(Eigen3 DEFAULT_MSG
EIGEN3_INCLUDE_DIR)
IF(EIGEN3_FOUND)
SET(EIGEN3_INCLUDE_DIRS ${EIGEN3_INCLUDE_DIR})
ENDIF(EIGEN3_FOUND)
MARK_AS_ADVANCED(
EIGEN3_INCLUDE_DIR
)

View File

@@ -33,6 +33,7 @@ SET(_jemalloc_SEARCH_DIRS
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
/opt/lib/jemalloc
)
FIND_PATH(JEMALLOC_INCLUDE_DIR

View File

@@ -0,0 +1,94 @@
# - Find LLVM library
# Find the native LLVM includes and library
# This module defines
# LLVM_INCLUDE_DIRS, where to find LLVM.h, Set when LLVM_INCLUDE_DIR is found.
# LLVM_LIBRARIES, libraries to link against to use LLVM.
# LLVM_ROOT_DIR, The base directory to search for LLVM.
# This can also be an environment variable.
# LLVM_FOUND, If false, do not try to use LLVM.
#
# also defined, but not for general use are
# LLVM_LIBRARY, where to find the LLVM library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
if(LLVM_ROOT_DIR)
if(DEFINED LLVM_VERSION)
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION} HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config HINTS ${LLVM_ROOT_DIR}/bin NO_CMAKE_PATH)
endif()
else()
if(DEFINED LLVM_VERSION)
message(running llvm-config-${LLVM_VERSION})
find_program(LLVM_CONFIG llvm-config-${LLVM_VERSION})
endif()
if(NOT LLVM_CONFIG)
find_program(LLVM_CONFIG llvm-config)
endif()
endif()
if(NOT DEFINED LLVM_VERSION)
execute_process(COMMAND ${LLVM_CONFIG} --version
OUTPUT_VARIABLE LLVM_VERSION
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_VERSION ${LLVM_VERSION} CACHE STRING "Version of LLVM to use")
endif()
if(NOT LLVM_ROOT_DIR)
execute_process(COMMAND ${LLVM_CONFIG} --prefix
OUTPUT_VARIABLE LLVM_ROOT_DIR
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_ROOT_DIR ${LLVM_ROOT_DIR} CACHE PATH "Path to the LLVM installation")
endif()
if(NOT LLVM_LIBPATH)
execute_process(COMMAND ${LLVM_CONFIG} --libdir
OUTPUT_VARIABLE LLVM_LIBPATH
OUTPUT_STRIP_TRAILING_WHITESPACE)
set(LLVM_LIBPATH ${LLVM_LIBPATH} CACHE PATH "Path to the LLVM library path")
mark_as_advanced(LLVM_LIBPATH)
endif()
if(LLVM_STATIC)
find_library(LLVM_LIBRARY
NAMES LLVMAnalysis # first of a whole bunch of libs to get
PATHS ${LLVM_LIBPATH})
else()
find_library(LLVM_LIBRARY
NAMES LLVM-${LLVM_VERSION}
PATHS ${LLVM_LIBPATH})
endif()
if(LLVM_LIBRARY AND LLVM_ROOT_DIR AND LLVM_LIBPATH)
if(LLVM_STATIC)
# if static LLVM libraries were requested, use llvm-config to generate
# the list of what libraries we need, and substitute that in the right
# way for LLVM_LIBRARY.
execute_process(COMMAND ${LLVM_CONFIG} --libfiles
OUTPUT_VARIABLE LLVM_LIBRARY
OUTPUT_STRIP_TRAILING_WHITESPACE)
string(REPLACE " " ";" LLVM_LIBRARY "${LLVM_LIBRARY}")
endif()
endif()
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LLVM DEFAULT_MSG
LLVM_LIBRARY)
MARK_AS_ADVANCED(
LLVM_LIBRARY
)

View File

@@ -0,0 +1,68 @@
# - Find LZO library
# Find the native LZO includes and library
# This module defines
# LZO_INCLUDE_DIRS, where to find lzo1x.h, Set when
# LZO_INCLUDE_DIR is found.
# LZO_LIBRARIES, libraries to link against to use LZO.
# LZO_ROOT_DIR, The base directory to search for LZO.
# This can also be an environment variable.
# LZO_FOUND, If false, do not try to use LZO.
#
# also defined, but not for general use are
# LZO_LIBRARY, where to find the LZO library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If LZO_ROOT_DIR was defined in the environment, use it.
IF(NOT LZO_ROOT_DIR AND NOT $ENV{LZO_ROOT_DIR} STREQUAL "")
SET(LZO_ROOT_DIR $ENV{LZO_ROOT_DIR})
ENDIF()
SET(_lzo_SEARCH_DIRS
${LZO_ROOT_DIR}
/usr/local
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(LZO_INCLUDE_DIR lzo/lzo1x.h
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
include
)
FIND_LIBRARY(LZO_LIBRARY
NAMES
lzo2
HINTS
${_lzo_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set LZO_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(LZO DEFAULT_MSG
LZO_LIBRARY LZO_INCLUDE_DIR)
IF(LZO_FOUND)
SET(LZO_LIBRARIES ${LZO_LIBRARY})
SET(LZO_INCLUDE_DIRS ${LZO_INCLUDE_DIR})
ENDIF(LZO_FOUND)
MARK_AS_ADVANCED(
LZO_INCLUDE_DIR
LZO_LIBRARY
)

View File

@@ -71,6 +71,7 @@ ENDIF()
MARK_AS_ADVANCED(
OPENGLES_EGL_INCLUDE_DIR
OPENGLES_EGL_LIBRARY
OPENGLES_LIBRARY
OPENGLES_INCLUDE_DIR
)

View File

@@ -83,6 +83,7 @@ ENDIF()
MARK_AS_ADVANCED(
OPENIMAGEIO_INCLUDE_DIR
OPENIMAGEIO_LIBRARY
OPENIMAGEIO_IDIFF
)
UNSET(_openimageio_SEARCH_DIRS)

View File

@@ -40,7 +40,6 @@ FIND_PATH(PCRE_INCLUDE_DIR pcre.h
${_pcre_SEARCH_DIRS}
PATH_SUFFIXES
include
include
)
FIND_LIBRARY(PCRE_LIBRARY

View File

@@ -1,7 +1,7 @@
# - Find PugiXML library
# Find the native PugiXML includes and library
# This module defines
# PUGIXML_INCLUDE_DIRS, where to find pugixml.h, Set when
# PUGIXML_INCLUDE_DIRS, where to find pugixml.hpp, Set when
# PugiXML is found.
# PUGIXML_LIBRARIES, libraries to link against to use PugiiXML.
# PUGIXML_ROOT_DIR, The base directory to search for PugiXML.
@@ -38,7 +38,7 @@ SET(_pugixml_SEARCH_DIRS
FIND_PATH(PUGIXML_INCLUDE_DIR
NAMES
pugixml.h
pugixml.hpp
HINTS
${_pugixml_SEARCH_DIRS}
PATH_SUFFIXES

View File

@@ -14,6 +14,7 @@
# PYTHON_INCLUDE_CONFIG_DIRS
# PYTHON_LIBRARIES
# PYTHON_LIBPATH, Used for installation
# PYTHON_SITE_PACKAGES, Used for installation (as a Python module)
# PYTHON_LINKFLAGS
# PYTHON_ROOT_DIR, The base directory to search for Python.
# This can also be an environment variable.
@@ -65,6 +66,14 @@ IF(DEFINED PYTHON_LIBPATH)
SET(_IS_LIB_PATH_DEF ON)
ENDIF()
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
# only search for the dirs if we havn't already
IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_LIB_PATH_DEF))
@@ -74,14 +83,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
"dm;dmu;du;d" # debug
)
STRING(REPLACE "." "" _PYTHON_VERSION_NO_DOTS ${PYTHON_VERSION})
SET(_python_SEARCH_DIRS
${PYTHON_ROOT_DIR}
"$ENV{HOME}/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/py${_PYTHON_VERSION_NO_DOTS}"
"/opt/lib/python-${PYTHON_VERSION}"
)
FOREACH(_CURRENT_ABI_FLAGS ${_python_ABI_FLAGS})
#IF(CMAKE_BUILD_TYPE STREQUAL Debug)
@@ -146,6 +148,7 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
ENDIF()
IF(PYTHON_LIBRARY AND PYTHON_LIBPATH AND PYTHON_INCLUDE_DIR AND PYTHON_INCLUDE_CONFIG_DIR)
SET(_PYTHON_ABI_FLAGS "${_CURRENT_ABI_FLAGS}")
break()
ELSE()
# ensure we dont find values from 2 different ABI versions
@@ -168,7 +171,6 @@ IF((NOT _IS_INC_DEF) OR (NOT _IS_INC_CONF_DEF) OR (NOT _IS_LIB_DEF) OR (NOT _IS_
UNSET(_CURRENT_PATH)
UNSET(_python_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
ENDIF()
UNSET(_IS_INC_DEF)
@@ -187,17 +189,41 @@ IF(PYTHONLIBSUNIX_FOUND)
SET(PYTHON_INCLUDE_DIRS ${PYTHON_INCLUDE_DIR} ${PYTHON_INCLUDE_CONFIG_DIR})
SET(PYTHON_LIBRARIES ${PYTHON_LIBRARY})
FIND_FILE(PYTHON_SITE_PACKAGES
NAMES
# debian specific
dist-packages
site-packages
HINTS
${PYTHON_LIBPATH}/python${PYTHON_VERSION}
)
# we need this for installation
# XXX No more valid with debian-like py3.4 packages...
# GET_FILENAME_COMPONENT(PYTHON_LIBPATH ${PYTHON_LIBRARY} PATH)
# not used
# SET(PYTHON_BINARY ${PYTHON_EXECUTABLE} CACHE STRING "")
# not required for build, just used when bundling Python.
FIND_PROGRAM(
PYTHON_EXECUTABLE
NAMES
"python${PYTHON_VERSION}${_PYTHON_ABI_FLAGS}"
"python${PYTHON_VERSION}"
"python"
HINTS
${_python_SEARCH_DIRS}
PATH_SUFFIXES bin
)
ENDIF()
UNSET(_PYTHON_VERSION_NO_DOTS)
UNSET(_PYTHON_ABI_FLAGS)
UNSET(_python_SEARCH_DIRS)
MARK_AS_ADVANCED(
PYTHON_INCLUDE_DIR
PYTHON_INCLUDE_CONFIG_DIR
PYTHON_LIBRARY
PYTHON_LIBPATH
PYTHON_SITE_PACKAGES
PYTHON_EXECUTABLE
)

View File

@@ -0,0 +1,72 @@
# - Find SDL library
# Find the native SDL includes and library
# This module defines
# SDL2_INCLUDE_DIRS, where to find SDL.h, Set when SDL2_INCLUDE_DIR is found.
# SDL2_LIBRARIES, libraries to link against to use SDL.
# SDL2_ROOT_DIR, The base directory to search for SDL.
# This can also be an environment variable.
# SDL2_FOUND, If false, do not try to use SDL.
#
# also defined, but not for general use are
# SDL2_LIBRARY, where to find the SDL library.
#=============================================================================
# Copyright 2015 Blender Foundation.
#
# Distributed under the OSI-approved BSD License (the "License");
# see accompanying file Copyright.txt for details.
#
# This software is distributed WITHOUT ANY WARRANTY; without even the
# implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
# See the License for more information.
#=============================================================================
# If SDL2_ROOT_DIR was defined in the environment, use it.
IF(NOT SDL2_ROOT_DIR AND NOT $ENV{SDL2_ROOT_DIR} STREQUAL "")
SET(SDL2_ROOT_DIR $ENV{SDL2_ROOT_DIR})
ENDIF()
SET(_sdl2_SEARCH_DIRS
${SDL2_ROOT_DIR}
~/Library/Frameworks
/Library/Frameworks
/usr/local
/usr
/sw # Fink
/opt/local # DarwinPorts
/opt/csw # Blastwave
)
FIND_PATH(SDL2_INCLUDE_DIR
NAMES
SDL.h
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
include/SDL2 include
)
FIND_LIBRARY(SDL2_LIBRARY
NAMES
SDL2
HINTS
${_sdl2_SEARCH_DIRS}
PATH_SUFFIXES
lib64 lib
)
# handle the QUIETLY and REQUIRED arguments and set SDL2_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(SDL2 DEFAULT_MSG
SDL2_LIBRARY SDL2_INCLUDE_DIR)
IF(SDL2_FOUND)
SET(SDL2_LIBRARIES ${SDL2_LIBRARY})
SET(SDL2_INCLUDE_DIRS ${SDL2_INCLUDE_DIR})
ENDIF(SDL2_FOUND)
MARK_AS_ADVANCED(
SDL2_INCLUDE_DIR
SDL2_LIBRARY
)

View File

@@ -60,7 +60,8 @@ if(EXISTS ${SOURCE_DIR}/.git)
execute_process(COMMAND git log HEAD..@{u}
WORKING_DIRECTORY ${SOURCE_DIR}
OUTPUT_VARIABLE _git_below_check
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
if(NOT _git_below_check STREQUAL "")
# If there're commits between HEAD and upstream this means
# that we're reset-ed to older revision. Use it's hash then.

View File

@@ -28,7 +28,13 @@ if not sys.version.startswith("3"):
sys.version.partition(" ")[0])
sys.exit(1)
from cmake_consistency_check_config import IGNORE, UTF8_CHECK, SOURCE_DIR
from cmake_consistency_check_config import (
IGNORE,
UTF8_CHECK,
SOURCE_DIR,
BUILD_DIR,
)
import os
from os.path import join, dirname, normpath, splitext
@@ -134,6 +140,7 @@ def cmake_get_src(f):
if found:
cmake_base = dirname(f)
cmake_base_bin = os.path.join(BUILD_DIR, os.path.relpath(cmake_base, SOURCE_DIR))
while it is not None:
i += 1
@@ -154,6 +161,8 @@ def cmake_get_src(f):
# replace dirs
l = l.replace("${CMAKE_CURRENT_SOURCE_DIR}", cmake_base)
l = l.replace("${CMAKE_CURRENT_BINARY_DIR}", cmake_base_bin)
l = l.strip('"')
if not l:
pass
@@ -187,11 +196,16 @@ def cmake_get_src(f):
pass
elif new_file.endswith(".osl"): # open shading language
pass
elif new_file.endswith(".glsl"):
pass
else:
raise Exception("unknown file type - not c or h %s -> %s" % (f, new_file))
elif context_name == "INC":
if os.path.isdir(new_file):
if new_file.startswith(BUILD_DIR):
# assume generated path
pass
elif os.path.isdir(new_file):
new_path_rel = os.path.relpath(new_file, cmake_base)
if new_path_rel != l:
@@ -244,7 +258,7 @@ print("\nChecking for missing references:")
is_err = False
errs = []
for f in (global_h | global_c):
if f.endswith("dna.c"):
if f.startswith(BUILD_DIR):
continue
if not os.path.exists(f):
@@ -305,7 +319,7 @@ if UTF8_CHECK:
try:
for l in open(f, "r", encoding="utf8"):
i += 1
except:
except UnicodeDecodeError:
print("Non utf8: %s:%d" % (f, i))
if i > 1:
traceback.print_exc()

View File

@@ -74,3 +74,6 @@ IGNORE = (
UTF8_CHECK = True
SOURCE_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), "..", ".."))))
# doesn't have to exist, just use as reference
BUILD_DIR = os.path.normpath(os.path.abspath(os.path.normpath(os.path.join(SOURCE_DIR, "..", "build"))))

View File

@@ -29,18 +29,19 @@ Example linux usage
Windows not supported so far
"""
from project_info import (SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
# is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
import os

View File

@@ -22,26 +22,27 @@
# <pep8 compliant>
"""
r"""
Example Linux usage:
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
Example Win32 usage:
c:\Python32\python.exe c:\blender_dev\blender\build_files\cmake\cmake_qtcreator_project.py c:\blender_dev\cmake_build
example linux usage
python ~/blender-git/blender/build_files/cmake/cmake_qtcreator_project.py ~/blender-git/cmake
"""
from project_info import (SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
from project_info import (
SIMPLE_PROJECTFILE,
SOURCE_DIR,
# CMAKE_DIR,
PROJECT_DIR,
source_list,
is_project_file,
is_c_header,
is_py,
cmake_advanced_info,
cmake_compiler_defines,
project_name_get,
)
import os
import sys
@@ -63,18 +64,19 @@ def create_qtc_project_main():
if SIMPLE_PROJECTFILE:
# --- qtcreator specific, simple format
PROJECT_NAME = "Blender"
with open(os.path.join(PROJECT_DIR, "%s.files" % PROJECT_NAME), 'w') as f:
FILE_NAME = PROJECT_NAME.lower()
with open(os.path.join(PROJECT_DIR, "%s.files" % FILE_NAME), 'w') as f:
f.write("\n".join(files_rel))
with open(os.path.join(PROJECT_DIR, "%s.includes" % PROJECT_NAME), 'w') as f:
with open(os.path.join(PROJECT_DIR, "%s.includes" % FILE_NAME), 'w') as f:
f.write("\n".join(sorted(list(set(os.path.dirname(f)
for f in files_rel if is_c_header(f))))))
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % PROJECT_NAME)
qtc_prj = os.path.join(PROJECT_DIR, "%s.creator" % FILE_NAME)
with open(qtc_prj, 'w') as f:
f.write("[General]\n")
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % PROJECT_NAME)
qtc_cfg = os.path.join(PROJECT_DIR, "%s.config" % FILE_NAME)
if not os.path.exists(qtc_cfg):
with open(qtc_cfg, 'w') as f:
f.write("// ADD PREDEFINED MACROS HERE!\n")

View File

@@ -321,6 +321,9 @@ macro(setup_liblinks
endif()
endif()
if(WITH_LZO AND WITH_SYSTEM_LZO)
target_link_libraries(${target} ${LZO_LIBRARIES})
endif()
if(WITH_SYSTEM_GLEW)
target_link_libraries(${target} ${BLENDER_GLEW_LIBRARIES})
endif()
@@ -513,14 +516,15 @@ macro(SETUP_BLENDER_SORTED_LIBS)
bf_ikplugin
bf_modifiers
bf_bmesh
bf_gpu
bf_blenkernel
bf_physics
bf_nodes
bf_rna
bf_gpu
bf_blenloader
bf_imbuf
bf_blenlib
bf_depsgraph
bf_intern_ghost
bf_intern_string
bf_avi
@@ -539,7 +543,6 @@ macro(SETUP_BLENDER_SORTED_LIBS)
ge_phys_dummy
ge_phys_bullet
bf_intern_smoke
extern_minilzo
extern_lzma
extern_colamd
ge_logic_ketsji
@@ -593,6 +596,10 @@ macro(SETUP_BLENDER_SORTED_LIBS)
list(APPEND BLENDER_SORTED_LIBS extern_eltopo)
endif()
if(NOT WITH_SYSTEM_LZO)
list(APPEND BLENDER_SORTED_LIBS extern_minilzo)
endif()
if(NOT WITH_SYSTEM_GLEW)
list(APPEND BLENDER_SORTED_LIBS ${BLENDER_GLEW_LIBRARIES})
endif()
@@ -648,6 +655,10 @@ macro(SETUP_BLENDER_SORTED_LIBS)
if(WITH_BULLET AND NOT WITH_SYSTEM_BULLET)
list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
endif()
if(WITH_MOD_QUADREMESH)
list(APPEND BLENDER_SORTED_LIBS bf_intern_quadremesh)
endif()
foreach(SORTLIB ${BLENDER_SORTED_LIBS})
set(REMLIB ${SORTLIB})
@@ -925,6 +936,7 @@ macro(remove_strict_flags)
remove_cc_flag("-Wstrict-prototypes")
remove_cc_flag("-Wmissing-prototypes")
remove_cc_flag("-Wunused-parameter")
remove_cc_flag("-Wunused-macros")
remove_cc_flag("-Wwrite-strings")
remove_cc_flag("-Wredundant-decls")
remove_cc_flag("-Wundef")
@@ -954,6 +966,20 @@ macro(remove_strict_flags)
endmacro()
macro(remove_extra_strict_flags)
if(CMAKE_COMPILER_IS_GNUCC)
remove_cc_flag("-Wunused-parameter")
endif()
if(CMAKE_C_COMPILER_ID MATCHES "Clang")
remove_cc_flag("-Wunused-parameter")
endif()
if(MSVC)
# TODO
endif()
endmacro()
# note, we can only append flags on a single file so we need to negate the options.
# at the moment we cant shut up ffmpeg deprecations, so use this, but will
# probably add more removals here.
@@ -1015,6 +1041,15 @@ macro(ADD_CHECK_CXX_COMPILER_FLAG
endmacro()
function(get_blender_version)
# extracts header vars and defines them in the parent scope:
#
# - BLENDER_VERSION (major.minor)
# - BLENDER_VERSION_MAJOR
# - BLENDER_VERSION_MINOR
# - BLENDER_SUBVERSION (used for internal versioning mainly)
# - BLENDER_VERSION_CHAR (a, b, c, ...or empty string)
# - BLENDER_VERSION_CYCLE (alpha, beta, rc, release)
# So cmake depends on BKE_blender.h, beware of inf-loops!
CONFIGURE_FILE(${CMAKE_SOURCE_DIR}/source/blender/blenkernel/BKE_blender.h
${CMAKE_BINARY_DIR}/source/blender/blenkernel/BKE_blender.h.done)
@@ -1047,25 +1082,28 @@ function(get_blender_version)
message(FATAL_ERROR "Version parsing failed for BLENDER_VERSION_CYCLE")
endif()
math(EXPR BLENDER_VERSION_MAJOR "${_out_version} / 100")
math(EXPR BLENDER_VERSION_MINOR "${_out_version} % 100")
set(BLENDER_VERSION "${BLENDER_VERSION_MAJOR}.${BLENDER_VERSION_MINOR}" PARENT_SCOPE)
set(BLENDER_SUBVERSION ${_out_subversion} PARENT_SCOPE)
set(BLENDER_VERSION_CHAR ${_out_version_char} PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE ${_out_version_cycle} PARENT_SCOPE)
math(EXPR _out_version_major "${_out_version} / 100")
math(EXPR _out_version_minor "${_out_version} % 100")
# for packaging, alpha to numbers
string(COMPARE EQUAL "${BLENDER_VERSION_CHAR}" "" _out_version_char_empty)
string(COMPARE EQUAL "${_out_version_char}" "" _out_version_char_empty)
if(${_out_version_char_empty})
set(BLENDER_VERSION_CHAR_INDEX "0" PARENT_SCOPE)
set(_out_version_char_index "0")
else()
set(_char_ls a b c d e f g h i j k l m n o p q r s t u v w x y z)
list(FIND _char_ls ${BLENDER_VERSION_CHAR} _out_version_char_index)
math(EXPR BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index} + 1" PARENT_SCOPE)
list(FIND _char_ls ${_out_version_char} _out_version_char_index)
math(EXPR _out_version_char_index "${_out_version_char_index} + 1")
endif()
# message(STATUS "Version (Internal): ${BLENDER_VERSION}.${BLENDER_SUBVERSION}, Version (external): ${BLENDER_VERSION}${BLENDER_VERSION_CHAR}-${BLENDER_VERSION_CYCLE}")
# output vars
set(BLENDER_VERSION "${_out_version_major}.${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_VERSION_MAJOR "${_out_version_major}" PARENT_SCOPE)
set(BLENDER_VERSION_MINOR "${_out_version_minor}" PARENT_SCOPE)
set(BLENDER_SUBVERSION "${_out_subversion}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR "${_out_version_char}" PARENT_SCOPE)
set(BLENDER_VERSION_CHAR_INDEX "${_out_version_char_index}" PARENT_SCOPE)
set(BLENDER_VERSION_CYCLE "${_out_version_cycle}" PARENT_SCOPE)
endfunction()
@@ -1103,7 +1141,7 @@ endmacro()
macro(blender_project_hack_post)
# --------------
# MINGW HACK END
if (_reset_standard_libraries)
if(_reset_standard_libraries)
# Must come after projecINCt(...)
#
# MINGW workaround for -ladvapi32 being included which surprisingly causes

View File

@@ -27,7 +27,8 @@ if(EXISTS ${CMAKE_SOURCE_DIR}/.git/)
execute_process(COMMAND git rev-parse --short @{u}
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE MY_WC_HASH
OUTPUT_STRIP_TRAILING_WHITESPACE)
OUTPUT_STRIP_TRAILING_WHITESPACE
ERROR_QUIET)
endif()
endif()
set(BUILD_REV ${MY_WC_HASH})
@@ -111,3 +112,9 @@ elseif(UNIX)
"tar.bz2")
endif()
unset(MAJOR_VERSION)
unset(MINOR_VERSION)
unset(PATCH_VERSION)
unset(BUILD_REV)

View File

@@ -12,9 +12,9 @@ blender_version_char=$(sed -ne 's/.*BLENDER_VERSION_CHAR.*\([a-z]\)$/\1/p' $blen
# map the version a -> 1
# not to be confused with blender's internal subversions
if [ "$blender_version_char" ]; then
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
blender_version_full=${blender_version}.$(expr index abcdefghijklmnopqrstuvwxyz $blender_version_char)
else
blender_version_full=${blender_version}
blender_version_full=${blender_version}
fi
blender_ver_string=$blender_version+git$blender_version_full
@@ -60,7 +60,7 @@ package() {
cd $srcdir/build
make DESTDIR="$pkgdir" install
python -m compileall \
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
$pkgdir/usr/share/blender/$blender_version/scripts/addons
$pkgdir/usr/share/blender/$blender_version/scripts/startup \
$pkgdir/usr/share/blender/$blender_version/scripts/modules \
$pkgdir/usr/share/blender/$blender_version/scripts/addons
}

View File

@@ -230,7 +230,8 @@ WITH_BF_FREESTYLE = True
CC = 'gcc'
CXX = 'g++'
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing','-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CCFLAGS = ['-pipe','-fPIC','-funsigned-char','-fno-strict-aliasing', '-D_LARGEFILE_SOURCE', '-D_FILE_OFFSET_BITS=64','-D_LARGEFILE64_SOURCE']
CFLAGS = ['-std=gnu89']
CXXFLAGS = []
CPPFLAGS = []

View File

@@ -198,7 +198,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
CC_WARN = [ '-Wall' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi']
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-ldbghelp']
if WITH_BF_IME:
LLIBS.append('-limm32')

View File

@@ -237,7 +237,7 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
if WITH_BF_IME:
LLIBS.append('imm32')

View File

@@ -193,7 +193,7 @@ C_WARN = ['-Wno-char-subscripts', '-Wdeclaration-after-statement', '-Wstrict-pro
CC_WARN = [ '-Wall', '-Wno-char-subscripts' ]
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread']
LLIBS = ['-lshell32', '-lshfolder', '-lgdi32', '-lmsvcrt', '-lwinmm', '-lmingw32', '-lm', '-lws2_32', '-lz', '-lstdc++','-lole32','-luuid', '-lwsock32', '-lpsapi', '-lpthread', '-ldbghelp']
if WITH_BF_IME:
LLIBS.append('-limm32')

View File

@@ -244,7 +244,7 @@ C_WARN = []
CC_WARN = []
CXX_WARN = []
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi']
LLIBS = ['ws2_32', 'vfw32', 'winmm', 'kernel32', 'user32', 'gdi32', 'comdlg32', 'advapi32', 'shfolder', 'shell32', 'ole32', 'oleaut32', 'uuid', 'psapi', 'Dbghelp']
if WITH_BF_IME:
LLIBS.append('imm32')

View File

@@ -372,7 +372,7 @@ def propose_priorities():
def creator(env):
sources = ['creator.c']# + Blender.buildinfo(env, "dynamic") + Blender.resources
incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
incs = ['#/intern/guardedalloc', '#/source/blender/blenlib', '#/source/blender/blenkernel', '#/source/blender/depsgraph', '#/source/blender/editors/include', '#/source/blender/blenloader', '#/source/blender/imbuf', '#/source/blender/renderconverter', '#/source/blender/render/extern/include', '#/source/blender/windowmanager', '#/source/blender/makesdna', '#/source/blender/makesrna', '#/source/gameengine/BlenderRoutines', '#/extern/glew/include', '#/source/blender/gpu', env['BF_OPENGL_INC']]
defs = []
@@ -441,7 +441,7 @@ def buildinfo(lenv, build_type):
no_upstream = False
try :
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}']).strip()
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', '@{u}'], stderr=subprocess.STDOUT).strip()
except subprocess.CalledProcessError:
# assume branch has no upstream configured
build_hash = btools.get_command_output(['git', 'rev-parse', '--short', 'HEAD']).strip()
@@ -670,6 +670,8 @@ def WinPyBundle(target=None, source=None, env=None):
py_dir += '/release/site-packages'
# grr, we have to do one by one because the dir exists
for f in os.listdir(py_dir):
if f == '.svn':
continue
fn_src = os.path.join(py_dir, f)
fn_dst = os.path.join(py_target, f)
@@ -762,7 +764,7 @@ def AppIt(target=None, source=None, env=None):
commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/*.h %s/kernel/*.cl %s/kernel/*.cu %s/kernel/' % (croot, croot, croot, cinstalldir)
commands.getoutput(cmd)
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
cmd = 'cp -R %s/kernel/svm %s/kernel/closure %s/kernel/geom %s/util/util_color.h %s/util/util_half.h %s/util/util_math.h %s/util/util_math_fast.h %s/util/util_transform.h %s/util/util_types.h %s/kernel/' % (croot, croot, croot, croot, croot, croot, croot, croot, croot, cinstalldir)
commands.getoutput(cmd)
cmd = 'cp -R %s/../intern/cycles/kernel/*.cubin %s/lib/' % (builddir, cinstalldir)
commands.getoutput(cmd)
@@ -816,6 +818,8 @@ def AppIt(target=None, source=None, env=None):
instname = env['LCGDIR'][1:] # made libiomp5 part of blender libs
cmd = 'ditto --arch %s %s/openmp/lib/libiomp5.dylib %s/%s.app/Contents/Resources/lib/'%(osxarch, instname, installdir, binary) # copy libiomp5
commands.getoutput(cmd)
cmd = 'cp %s/openmp/LICENSE.txt %s/LICENSE-libiomp5.txt'%(instname, installdir) # copy libiomp5 license
commands.getoutput(cmd)
# extract copy system python, be sure to update other build systems
# when making changes to the files that are copied.
@@ -839,6 +843,7 @@ def UnixPyBundle(target=None, source=None, env=None):
py_src = env.subst( env['BF_PYTHON_LIBPATH'] + '/python'+env['BF_PYTHON_VERSION'] )
py_target = env.subst( dir + '/python/' + target_lib + '/python'+env['BF_PYTHON_VERSION'] )
py_target_bin = env.subst(dir + '/python/bin')
# This is a bit weak, but dont install if its been installed before, makes rebuilds quite slow.
if os.path.exists(py_target):
@@ -858,6 +863,11 @@ def UnixPyBundle(target=None, source=None, env=None):
except:
pass
# install the executable
run("rm -rf '%s'" % py_target_bin)
os.makedirs(py_target_bin)
run("cp '%s' '%s'" % (env.subst(env['BF_PYTHON_BINARY']), py_target_bin))
run("cp -R '%s' '%s'" % (py_src, os.path.dirname(py_target)))
run("rm -rf '%s/distutils'" % py_target)
run("rm -rf '%s/lib2to3'" % py_target)

View File

@@ -198,7 +198,8 @@ def validate_arguments(args, bc):
'C_WARN', 'CC_WARN', 'CXX_WARN',
'LLIBS', 'PLATFORM_LINKFLAGS', 'MACOSX_ARCHITECTURE', 'MACOSX_SDK', 'XCODE_CUR_VER', 'C_COMPILER_ID',
'BF_CYCLES_CUDA_BINARIES_ARCH', 'BF_PROGRAM_LINKFLAGS', 'MACOSX_DEPLOYMENT_TARGET',
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING'
'WITH_BF_CYCLES_DEBUG', 'WITH_BF_CYCLES_LOGGING',
'WITH_BF_CPP11', 'WITH_BF_LEGACY_DEPSGRAPH',
]
@@ -653,7 +654,11 @@ def read_opts(env, cfg, args):
('BF_LLVM_LIBPATH', 'LLVM library path', ''),
('BF_LLVM_LIB_STATIC', 'LLVM static library', ''),
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', '')
('BF_PROGRAM_LINKFLAGS', 'Link flags applied only to final binaries (blender and blenderplayer, not makesrna/makesdna)', ''),
(BoolVariable('WITH_BF_CPP11', '"Build with C++11 standard enabled, for development use only!', False)),
(BoolVariable('WITH_BF_LEGACY_DEPSGRAPH', 'Build Blender with legacy dependency graph', True)),
) # end of opts.AddOptions()
return localopts

File diff suppressed because it is too large Load Diff

View File

@@ -10,26 +10,14 @@
* \ingroup intern
*/
/** \defgroup boolop boolop
* \ingroup intern
*/
/** \defgroup ctr container
* \ingroup intern
*/
/** \defgroup decimation decimation
* \ingroup intern
*/
/** \defgroup elbeem elbeem
* \ingroup intern
*/
/** \defgroup bsp bsp
* \ingroup intern
*/
/** \defgroup iksolver iksolver
* \ingroup intern
*/

View File

@@ -7,7 +7,7 @@
* These pages document the source code of blender.
*
* \subsection implinks Important Links
* - <a href="http://projects.blender.org">projects.blender.org</a> with <a href="http://projects.blender.org/tracker/index.php?group_id=9&atid=498">bug tracker</a>
* - <a href="http://developer.blender.org">developer.blender.org</a> with bug tracker
* - <a href="http://wiki.blender.org/index.php/Dev:Contents">Development documents</a> on our wiki.
*
* \subsection blother Other

View File

@@ -93,36 +93,44 @@
/* ================================ */
/** \defgroup blender blender */
/** \defgroup blender Blender */
/** \defgroup blf blenfont
/** \defgroup blf BlenFont
* \ingroup blender
*/
/** \defgroup bke blenkernel
/** \defgroup bke BlenKernel
* \ingroup blender
*/
/** \defgroup bli blenlib
/** \defgroup bli BlenLib
* \ingroup blender
*/
/** \defgroup nodes nodes
/** \defgroup depsgraph Dependency Graph
* \ingroup blender
*/
/** \defgroup cmpnodes cmpnodes
/** \defgroup bph Physics
* \ingroup blender
*/
/** \defgroup nodes Nodes
* \ingroup blender
*/
/** \defgroup cmpnodes Nodes (Compositor)
* \ingroup nodes
*/
/** \defgroup shdnodes shdnodes
/** \defgroup shdnodes Nodes (Shader)
* \ingroup nodes
*/
/** \defgroup texnodes texnodes
/** \defgroup texnodes Nodes (Texture)
* \ingroup nodes
*/
/** \defgroup modifiers modifiers
/** \defgroup modifiers Object Modifiers
* \ingroup blender
*/
@@ -132,29 +140,29 @@
* \ingroup blender
*/
/** \defgroup ikplugin ikplugin
/** \defgroup ikplugin IK Plugin
* \ingroup blender
*/
/** \defgroup DNA sDNA
/** \defgroup DNA Struct DNA (File Format)
* \ingroup blender data
*/
/** \defgroup RNA RNA
/** \defgroup RNA RNA (Data API)
* \ingroup blender data
*/
/** \defgroup blenloader .blend read and write functions
/** \defgroup blenloader Blend file IO
* \ingroup blender data
* \todo check if \ref blo and \ref blenloader groups can be
* merged in docs.
*/
/** \defgroup quicktime quicktime
/** \defgroup quicktime QuickTime
* \ingroup blender
/** \defgroup gui GUI */
/** \defgroup wm windowmanager
/** \defgroup wm Window Manager
* \ingroup blender gui
*/
@@ -324,7 +332,7 @@
* \ingroup externformats
*/
/** \defgroup imbuf IMage Buffer
/** \defgroup imbuf Image Buffer (ImBuf)
* \ingroup blender
*/

View File

@@ -20,15 +20,15 @@ constraint_type = 2
physics_id_1 = object_1.getPhysicsId()
physics_id_2 = object_2.getPhysicsId()
# Use bottom right edge of Object1 for hinge position
# use bottom right edge of Object1 for hinge position
edge_position_x = 1.0
edge_position_y = 0.0
edge_position_z = -1.0
# use Object1 y axis for angle to point hinge
# rotate the pivot z axis about 90 degrees
edge_angle_x = 0.0
edge_angle_y = 1.0
edge_angle_z = 0.0
edge_angle_y = 0.0
edge_angle_z = 90.0
# create an edge constraint
constraints.createConstraint(physics_id_1, physics_id_2,

View File

@@ -1,16 +1,19 @@
"""
.. _operator-execution_context:
Execution Context
-----------------
When calling an operator you may want to pass the execution context.
This determines the context thats given to the operator to run in, and weather
invoke() is called or execute().
This determines the context that is given for the operator to run in, and whether
invoke() is called or only execute().
'EXEC_DEFAULT' is used by default but you may want the operator to take user
interaction with 'INVOKE_DEFAULT'.
'EXEC_DEFAULT' is used by default, running only the execute() method, but you may
want the operator to take user interaction with 'INVOKE_DEFAULT' which will also
call invoke() if existing.
The execution context is as a non keyword, string argument in:
The execution context is one of:
('INVOKE_DEFAULT', 'INVOKE_REGION_WIN', 'INVOKE_REGION_CHANNELS',
'INVOKE_REGION_PREVIEW', 'INVOKE_AREA', 'INVOKE_SCREEN', 'EXEC_DEFAULT',
'EXEC_REGION_WIN', 'EXEC_REGION_CHANNELS', 'EXEC_REGION_PREVIEW', 'EXEC_AREA',

View File

@@ -3,7 +3,7 @@ PropertyGroup Example
+++++++++++++++++++++
PropertyGroups can be used for collecting custom settings into one value
to avoid many indervidual settings mixed in together.
to avoid many individual settings mixed in together.
"""
import bpy

View File

@@ -6,7 +6,7 @@ Custom properties can be added to any subclass of an :class:`ID`,
:class:`Bone` and :class:`PoseBone`.
These properties can be animated, accessed by the user interface and python
like blenders existing properties.
like Blender's existing properties.
"""
import bpy

View File

@@ -1,12 +1,11 @@
"""
Extending Menus
+++++++++++++++
When creating menus for addons you can't reference menus in blenders default
When creating menus for addons you can't reference menus in Blender's default
scripts.
Instead, the addon can add menu items to existing menus.
Instead the addon can add menu items to existing menus.
The function menu_draw acts like Menu.draw
The function menu_draw acts like :class:`Menu.draw`.
"""
import bpy

View File

@@ -1,21 +1,20 @@
"""
Basic Menu Example
++++++++++++++++++
This script is a simple menu, menus differ from panels in that they must
Here is an example of a simple menu. Menus differ from panels in that they must
reference from a header, panel or another menu.
Notice the 'CATEGORY_MT_name' :class:`Menu.bl_idname`, this is a naming
Notice the 'CATEGORY_MT_name' in :class:`Menu.bl_idname`, this is a naming
convention for menus.
.. note::
Menu subclasses must be registered before referencing them from blender.
.. note::
Menu's have their :class:`Layout.operator_context` initialized as
'EXEC_REGION_WIN' rather then 'INVOKE_DEFAULT', so if the operator context
needs to initialize inputs from the :class:`Operator.invoke` function
then this needs to be explicitly set.
Menus have their :class:`Layout.operator_context` initialized as
'EXEC_REGION_WIN' rather than 'INVOKE_DEFAULT' (see :ref:`Execution Context <operator-execution_context>`).
If the operator context needs to initialize inputs from the
:class:`Operator.invoke` function, then this needs to be explicitly set.
"""
import bpy

View File

@@ -11,51 +11,54 @@ Physics Constraints (bge.constraints)
.. literalinclude:: ../examples/bge.constraints.py
:lines: 6-
.. function:: createConstraint(physicsid, physicsid2, constrainttype, [pivotX, pivotY, pivotZ, [axisX, axisY, axisZ, [flag]]]])
.. function:: createConstraint(physicsid_1, physicsid_2, constraint_type, pivot_X, pivot_y, pivot_z, axis_x, axis_y, axis_z, flag)
Creates a constraint.
:arg physicsid: the physics id of the first object in constraint
:type physicsid: int
Constraints types:
- :class:`POINTTOPOINT_CONSTRAINT`
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
- :class:`GENERIC_6DOF_CONSTRAINT`
:arg physicsid2: the physics id of the second object in constraint
:type physicsid2: int
:arg physicsid_1: the physics id of the first object in constraint.
:type physicsid_1: int
:arg constrainttype: the type of the constraint. The constraint types are:
- :class:`POINTTOPOINT_CONSTRAINT`
- :class:`LINEHINGE_CONSTRAINT`
- :class:`ANGULAR_CONSTRAINT`
- :class:`CONETWIST_CONSTRAINT`
- :class:`VEHICLE_CONSTRAINT`
- :class:`GENERIC_6DOF_CONSTRAINT`
:arg physicsid_2: the physics id of the second object in constraint.
:type physicsid_2: int
:arg constrainttype: the type of the constraint.
:type constrainttype: int
:arg pivotX: pivot X position
:type pivotX: float
:arg pivot_X: pivot X position (optional).
:type pivot_X: float
:arg pivotY: pivot Y position
:type pivotY: float
:arg pivot_Y: pivot Y position (optional).
:type pivot_Y: float
:arg pivotZ: pivot Z position
:type pivotZ: float
:arg pivot_Z: pivot Z position (optional).
:type pivot_Z: float
:arg axisX: X axis
:type axisX: float
:arg axis_X: X axis angle in degrees (optional).
:type axis_X: float
:arg axisY: Y axis
:type axisY: float
:arg axis_Y: Y axis angle in degrees (optional).
:type axis_Y: float
:arg axisZ: Z axis
:type axisZ: float
:arg axis_Z: Z axis angle in degrees (optional).
:type axis_Z: float
:arg flag: 128 to disable collision between linked bodies
:arg flag: 128 to disable collision between linked bodies (optional).
:type flag: int
:return: a constraint wrapper.
:rtype: :class:`bge.types.KX_ConstraintWrapper`
.. attribute:: error
Simbolic constant string that indicates error.
Symbolic constant string that indicates error.
.. function:: exportBulletFile(filename)

View File

@@ -66,7 +66,7 @@ Constants
.. data:: KX_BLENDER_GLSL_MATERIAL
Materials approximating blender materials with GLSL.
.. DATA:: VSYNC_OFF
Disables vsync
@@ -87,6 +87,7 @@ Constants
Right eye being used during stereoscopic rendering.
*********
Functions
*********
@@ -94,47 +95,55 @@ Functions
.. function:: getWindowWidth()
Gets the width of the window (in pixels)
:rtype: integer
.. function:: getWindowHeight()
Gets the height of the window (in pixels)
:rtype: integer
.. function:: setWindowSize(width, height)
Set the width and height of the window (in pixels). This also works for fullscreen applications.
:type width: integer
:type height: integer
.. function:: setFullScreen(enable)
Set whether or not the window should be fullscreen.
:type enable: bool
.. function:: getFullScreen()
Returns whether or not the window is fullscreen.
:rtype: bool
.. function:: getDisplayDimensions()
Get the actual display dimensions, in pixels, of the physical display (e.g., the monitor).
:type dimension: list [width,heigh]
.. function:: makeScreenshot(filename)
Writes a screenshot to the given filename.
If filename starts with // the image will be saved relative to the current directory.
If the filename contains # it will be replaced with the frame number.
The standalone player saves .png files. It does not support color space conversion
or gamma correction.
When run from Blender, makeScreenshot supports all Blender image file formats like PNG, TGA, Jpeg and OpenEXR.
Gamma, Colorspace conversion and Jpeg compression are taken from the Render settings panels.
Writes an image file with the current displayed frame.
The image is written to *'filename'*. The path may be absolute (eg. "/home/foo/image") or relative when started with
"//" (eg. "//image"). Note that absolute paths are not portable between platforms.
If the filename contains a "#", it will be replaced by an incremental index so that screenshots can be taken multiple
times without overwriting the previous ones (eg. "image-#").
Settings for the image are taken from the render settings (file format and respective settings, gamma and colospace
conversion, etc). The image resolution matches the framebuffer, meaning, the window size and aspect ratio.
When running from the standalone player, instead of the embedded player, only PNG files are supported. Additional
color conversions are also not supported.
:arg filename: path and name of the file to write
:type filename: string
@@ -146,65 +155,29 @@ Functions
.. function:: showMouse(visible)
Enables or disables the operating system mouse cursor.
:type visible: boolean
.. function:: setMousePosition(x, y)
Sets the mouse cursor position.
:type x: integer
:type y: integer
.. function:: setBackgroundColor(rgba)
Sets the window background color.
Sets the window background color. (Deprecated: use KX_WorldInfo.background_color)
:type rgba: list [r, g, b, a]
.. function:: setMistColor(rgb)
Sets the mist color.
:type rgb: list [r, g, b]
.. function:: setAmbientColor(rgb)
Sets the color of ambient light.
:type rgb: list [r, g, b]
.. function:: setMistStart(start)
Sets the mist start value. Objects further away than start will have mist applied to them.
:type start: float
.. function:: setMistEnd(end)
Sets the mist end value. Objects further away from this will be colored solid with
the color set by setMistColor().
:type end: float
.. function:: disableMist()
Disables mist.
.. note:: Set any of the mist properties to enable mist.
.. function:: setEyeSeparation(eyesep)
Sets the eye separation for stereo mode. Usually Focal Length/30 provides a confortable value.
:arg eyesep: The distance between the left and right eye.
:type eyesep: float
@@ -212,21 +185,21 @@ Functions
.. function:: getEyeSeparation()
Gets the current eye separation for stereo mode.
:rtype: float
.. function:: setFocalLength(focallength)
Sets the focal length for stereo mode. It uses the current camera focal length as initial value.
:arg focallength: The focal length.
:arg focallength: The focal length.
:type focallength: float
.. function:: getFocalLength()
Gets the current focal length for stereo mode.
:rtype: float
.. function:: getStereoEye()
@@ -241,7 +214,7 @@ Functions
.. function:: setMaterialMode(mode)
Set the material mode to use for OpenGL rendering.
:type mode: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. note:: Changes will only affect newly created scenes.
@@ -250,14 +223,14 @@ Functions
.. function:: getMaterialMode(mode)
Get the material mode to use for OpenGL rendering.
:rtype: KX_TEXFACE_MATERIAL, KX_BLENDER_MULTITEX_MATERIAL, KX_BLENDER_GLSL_MATERIAL
.. function:: setGLSLMaterialSetting(setting, enable)
Enables or disables a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:type enable: boolean
@@ -265,43 +238,43 @@ Functions
.. function:: getGLSLMaterialSetting(setting, enable)
Get the state of a GLSL material setting.
:type setting: string (lights, shaders, shadows, ramps, nodes, extra_textures)
:rtype: boolean
.. function:: setAnisotropicFiltering(level)
Set the anisotropic filtering level for textures.
:arg level: The new anisotropic filtering level to use
:type level: integer (must be one of 1, 2, 4, 8, 16)
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getAnisotropicFiltering()
Get the anisotropic filtering level used for textures.
:rtype: integer (one of 1, 2, 4, 8, 16)
.. function:: setMipmapping(value)
Change how to use mipmapping.
:type value: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. note:: Changing this value can cause all textures to be recreated, which can be slow.
.. function:: getMipmapping()
Get the current mipmapping setting.
:rtype: RAS_MIPMAP_NONE, RAS_MIPMAP_NEAREST, RAS_MIPMAP_LINEAR
.. function:: drawLine(fromVec,toVec,color)
Draw a line in the 3D scene.
:arg fromVec: the origin of the line
:type fromVec: list [x, y, z]
:arg toVec: the end of the line
@@ -313,7 +286,7 @@ Functions
.. function:: enableMotionBlur(factor)
Enable the motion blur effect.
:arg factor: the ammount of motion blur to display.
:type factor: float [0.0 - 1.0]

View File

@@ -23,15 +23,14 @@ base class --- :class:`PyObjectPlus`
:arg axis:
:type axis: integer
.. note::
For each axis:
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
.. note::
* Lowerlimit == Upperlimit -> axis is locked
* Lowerlimit > Upperlimit -> axis is free
* Lowerlimit < Upperlimit -> axis it limited in that range
For PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
PHY_LINEHINGE_CONSTRAINT = 2 or PHY_ANGULAR_CONSTRAINT = 3:
axis = 3 is a constraint limit, with low/high limit value
* 3: X axis angle
:arg value0 (min): Set the minimum limit of the axis
@@ -39,7 +38,8 @@ base class --- :class:`PyObjectPlus`
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
PHY_CONE_TWIST_CONSTRAINT = 3:
For PHY_CONE_TWIST_CONSTRAINT = 4:
axis = 3..5 are constraint limits, high limit values
* 3: X axis angle
* 4: Y axis angle
@@ -50,7 +50,8 @@ base class --- :class:`PyObjectPlus`
:arg value1 (max): Set the maximum limit of the axis
:type value1: float
PHY_GENERIC_6DOF_CONSTRAINT = 12:
For PHY_GENERIC_6DOF_CONSTRAINT = 12:
axis = 0..2 are constraint limits, with low/high limit value
* 0: X axis position
* 1: Y axis position
@@ -132,10 +133,10 @@ base class --- :class:`PyObjectPlus`
Returns the contraint type (read only)
:type: integer
- 1 = :class:`~bge.constraints.POINTTOPOINT_CONSTRAINT`
- 2 = :class:`~bge.constraints.LINEHINGE_CONSTRAINT`
- 3 = :class:`~bge.constraints.ANGULAR_CONSTRAINT`
- 4 = :class:`~bge.constraints.CONETWIST_CONSTRAINT`
- 11 = :class:`~bge.constraints.VEHICLE_CONSTRAINT`
- 12 = :class:`~bge.constraints.GENERIC_6DOF_CONSTRAINT`
* 1 = POINTTOPOINT_CONSTRAINT
* 2 = LINEHINGE_CONSTRAINT
* 3 = ANGULAR_CONSTRAINT (aka LINEHINGE_CONSTRAINT)
* 4 = CONETWIST_CONSTRAINT
* 11 = VEHICLE_CONSTRAINT
* 12 = GENERIC_6DOF_CONSTRAINT

View File

@@ -78,6 +78,14 @@ base class --- :class:`SCA_IObject`
The object must have a physics controller for the mass to be applied, otherwise the mass value will be returned as 0.0.
.. attribute:: isSuspendDynamics
The object's dynamic state (read-only).
:type: boolean
.. seealso:: :py:meth:`suspendDynamics` and :py:meth:`restoreDynamics` allow you to change the state.
.. attribute:: linearDamping
The object's linear damping, also known as translational damping. Can be set simultaneously with angular damping using the :py:meth:`setDamping` method.
@@ -145,16 +153,28 @@ base class --- :class:`SCA_IObject`
.. attribute:: groupMembers
Returns the list of group members if the object is a group object, otherwise None is returned.
Returns the list of group members if the object is a group object (dupli group instance), otherwise None is returned.
:type: :class:`CListValue` of :class:`KX_GameObject` or None
.. attribute:: groupObject
Returns the group object that the object belongs to or None if the object is not part of a group.
Returns the group object (dupli group instance) that the object belongs to or None if the object is not part of a group.
:type: :class:`KX_GameObject` or None
.. attribute:: collisionGroup
The object's collision group.
:type: bitfield
.. attribute:: collisionMask
The object's collision mask.
:type: bitfield
.. attribute:: collisionCallbacks
A list of functions to be called when a collision occurs.
@@ -432,6 +452,12 @@ base class --- :class:`SCA_IObject`
If true, the object's and children's debug properties will be displayed on screen.
:type: boolean
.. attribute:: currentLodLevel
The index of the level of detail (LOD) currently used by this object (read-only).
:type: int
.. method:: endObject()
@@ -647,13 +673,19 @@ base class --- :class:`SCA_IObject`
:arg angular_damping: Angular ("rotational") damping factor.
:type angular_damping: float ∈ [0, 1]
.. method:: suspendDynamics()
.. method:: suspendDynamics([ghost])
Suspends physics for this object.
:arg ghost: When set to `True`, collisions with the object will be ignored, similar to the "ghost" checkbox in
Blender. When `False` (the default), the object becomes static but still collide with other objects.
:type ghost: bool
.. seealso:: :py:attr:`isSuspendDynamics` allows you to inspect whether the object is in a suspended state.
.. method:: restoreDynamics()
Resumes physics for this object.
Resumes physics for this object. Also reinstates collisions; the object will no longer be a ghost.
.. note::

View File

@@ -83,6 +83,12 @@ base class --- :class:`PyObjectPlus`
This can be set directly from python to avoid using the :class:`KX_SceneActuator`.
.. attribute:: world
The current active world, (read-only).
:type: :class:`KX_WorldInfo`
.. attribute:: suspended
True if the scene is suspended, (read-only).
@@ -119,21 +125,27 @@ base class --- :class:`PyObjectPlus`
:type: list
.. attribute:: pre_draw_setup
A list of callables to be run before the drawing setup (i.e., before the model view and projection matrices are computed).
:type: list
.. attribute:: gravity
The scene gravity using the world x, y and z axis.
:type: Vector((gx, gy, gz))
.. method:: addObject(object, other, time=0)
.. method:: addObject(object, reference, time=0)
Adds an object to the scene like the Add Object Actuator would.
:arg object: The object to add
:arg object: The (name of the) object to add.
:type object: :class:`KX_GameObject` or string
:arg other: The object's center to use when adding the object
:type other: :class:`KX_GameObject` or string
:arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever.
:arg reference: The (name of the) object which position, orientation, and scale to copy (optional), if the object to add is a light and there is not reference the light's layer will be the same that the active layer in the blender scene.
:type reference: :class:`KX_GameObject` or string
:arg time: The lifetime of the added object, in frames. A time of 0 means the object will last forever (optional).
:type time: integer
:return: The newly added object.
:rtype: :class:`KX_GameObject`

View File

@@ -25,6 +25,12 @@ base class --- :class:`SCA_IObject`
:type: Vector((u, v))
.. attribute:: uvs
A list of all the texture coordinates of the vertex.
:type: list of Vector((u, v))
.. attribute:: normal
The normal of the vertex.
@@ -120,18 +126,24 @@ base class --- :class:`SCA_IObject`
:arg pos: the new position for this vertex in local coordinates.
.. method:: getUV()
.. method:: getUV(index=0)
Gets the UV (texture) coordinates of this vertex.
:arg index: the UV (texture) channel (optional).
:type index: integer
:return: this vertexes UV (texture) coordinates.
:rtype: Vector((u, v))
.. method:: setUV(uv)
.. method:: setUV(uv, index=0)
Sets the UV (texture) coordinates of this vertex.
:type: Vector((u, v))
:arg uv: the UV (texture) coordinate of this vertex.
:type uv: Vector((u, v))
:arg index: the UV (texture) channel (optional).
:type index: integer
.. method:: getUV2()
@@ -140,14 +152,16 @@ base class --- :class:`SCA_IObject`
:return: this vertexes UV (texture) coordinates.
:rtype: Vector((u, v))
.. method:: setUV2(uv, unit)
.. deprecated:: use :meth:`getUV`
.. method:: setUV2(uv)
Sets the 2nd UV (texture) coordinates of this vertex.
:type: Vector((u, v))
:arg uv: the 2nd (texture) UV coordinate of this vertex.
:type uv: Vector((u, v))
:arg unit: optional argument, FLAT==1, SECOND_UV==2, defaults to SECOND_UV
:arg unit: integer
.. deprecated:: use :meth:`setUV`
.. method:: getRGBA()

View File

@@ -0,0 +1,79 @@
KX_WordlInfo(PyObjectPlus)
=============================
.. module:: bge.types
base class --- :class:`PyObjectPlus`
.. class:: KX_WorldInfo(PyObjectPlus)
A wolrd object.
.. code-block:: python
# Set the mist color to red.
import bge
sce = bge.logic.getCurrentScene()
sce.world.mistColor = [1.0, 0.0, 0.0]
.. data:: KX_MIST_QUADRATIC
Type of quadratic attenuation used to fade mist.
.. data:: KX_MIST_LINEAR
Type of linear attenuation used to fade mist.
.. data:: KX_MIST_INV_QUADRATIC
Type of inverse quadratic attenuation used to fade mist.
.. attribute:: mistEnable
Return the state of the mist.
:type: bool
.. attribute:: mistStart
The mist start point.
:type: float
.. attribute:: mistDistance
The mist distance fom the start point to reach 100% mist.
:type: float
.. attribute:: mistIntensity
The mist intensity.
:type: float
.. attribute:: mistType
The type of mist - must be KX_MIST_QUADRATIC, KX_MIST_LINEAR or KX_MIST_INV_QUADRATIC
.. attribute:: mistColor
The color of the mist. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: backgroundColor
The color of the background. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
Mist and background color sould always set to the same color.
:type: :class:`mathutils.Vector`
.. attribute:: ambientColor
The color of the ambient light. Black = [0.0, 0.0, 0.0], White = [1.0, 1.0, 1.0].
:type: :class:`mathutils.Vector`

View File

@@ -23,8 +23,14 @@ base class --- :class:`SCA_ILogicBrick`
.. attribute:: frequency
The frequency for pulse mode sensors.
The frequency for pulse mode sensors. (Deprecated: use SCA_ISensor.skippedTicks)
:type: integer
.. attribute:: skippedTicks
Number of logic ticks skipped between 2 active pulses
:type: integer
.. attribute:: level

View File

@@ -8,19 +8,17 @@ This module wraps OpenGL constants and functions, making them available from
within Blender Python.
The complete list can be retrieved from the module itself, by listing its
contents: dir(bgl). A simple search on the net can point to more
contents: dir(bgl). A simple search on the web can point to more
than enough material to teach OpenGL programming, from books to many
collections of tutorials.
The "red book": "I{OpenGL Programming Guide: The Official Guide to Learning
OpenGL}" and the online NeHe tutorials are two of the best resources.
Here is a comprehensive `list of books <http://www.opengl.org/documentation/books/>`_ (non free). The `arcsynthesis tutorials <http://www.arcsynthesis.org/gltut/>`_ is one of the best resources to learn modern OpenGL and `g-truc <http://www.g-truc.net/post-tech-content-sample.html>`_ offers a set of extensive examples, including advanced features.
.. note::
You can use the :class:`Image` type to load and set textures.
See :class:`Image.gl_load` and :class:`Image.gl_load`,
for example.
`OpenGL.org <http://www.opengl.org>`_
`NeHe GameDev <http://nehe.gamedev.net>`_
.. function:: glAccum(op, value):

View File

@@ -86,9 +86,15 @@ Consider the calculations that might go into working out the object's final tran
To avoid expensive recalculations every time a property is modified, Blender defers making the actual calculations until they are needed.
However, while the script runs you may want to access the updated values.
In this case you need to call :class:`bpy.types.Scene.update` after modifying values, for example:
This can be done by calling :class:`bpy.types.Scene.update` after modifying values which recalculates all data that is tagged to be updated.
.. code-block:: python
bpy.context.object.location = 1, 2, 3
bpy.context.scene.update()
Now all dependent data (child objects, modifiers, drivers... etc) has been recalculated and is available to the script.
Can I redraw during the script?
-------------------------------

View File

@@ -138,19 +138,9 @@ def handle_args():
parser.add_argument("-T", "--sphinx-theme",
dest="sphinx_theme",
type=str,
default='default',
help=
# see SPHINX_THEMES below
"Sphinx theme (default='default')\n"
"Available themes\n"
"----------------\n"
"(Blender Foundation) blender-org\n" # naiad
"(Sphinx) agogo, basic, epub, haiku, nature, "
"scrolls, sphinxdoc, traditional\n",
# choices=['naiad', 'blender-org'] + # bf
# ['agogo', 'basic', 'epub',
# 'haiku', 'nature', 'scrolls',
# 'sphinxdoc', 'traditional'], # sphinx
default="classic",
help="Sphinx theme (default='classic'), "
"see: http://sphinx-doc.org/theming.html",
required=False)
parser.add_argument("-N", "--sphinx-named-output",
@@ -267,6 +257,7 @@ else:
"bpy.props",
"bpy.types", # supports filtering
"bpy.utils",
"bpy.utils.previews",
"bpy_extras",
"gpu",
"mathutils",
@@ -419,23 +410,7 @@ BLENDER_ZIP_FILENAME = "%s.zip" % REFERENCE_NAME
# -------------------------------SPHINX-----------------------------------------
SPHINX_THEMES = {'bf': ['blender-org'], # , 'naiad',
'sphinx': ['agogo',
'basic',
'default',
'epub',
'haiku',
'nature',
'scrolls',
'sphinxdoc',
'traditional']}
available_themes = SPHINX_THEMES['bf'] + SPHINX_THEMES['sphinx']
if ARGS.sphinx_theme not in available_themes:
print("Please choose a theme among: %s" % ', '.join(available_themes))
sys.exit()
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
SPHINX_THEME_DIR = os.path.join(ARGS.output_dir, ARGS.sphinx_theme)
SPHINX_THEME_SVN_DIR = os.path.join(SCRIPT_DIR, ARGS.sphinx_theme)
@@ -480,9 +455,11 @@ ClassMethodDescriptorType = type(dict.__dict__['fromkeys'])
MethodDescriptorType = type(dict.get)
GetSetDescriptorType = type(int.real)
StaticMethodType = type(staticmethod(lambda: None))
from types import (MemberDescriptorType,
MethodType,
)
from types import (
MemberDescriptorType,
MethodType,
FunctionType,
)
_BPY_STRUCT_FAKE = "bpy_struct"
_BPY_PROP_COLLECTION_FAKE = "bpy_prop_collection"
@@ -659,19 +636,26 @@ def pyfunc2sphinx(ident, fw, module_name, type_name, identifier, py_func, is_cla
func_type = "function"
# ther rest are class methods
elif arg_str.startswith("(self, "):
arg_str = "(" + arg_str[7:]
elif arg_str.startswith("(self, ") or arg_str == "(self)":
arg_str = "()" if (arg_str == "(self)") else ("(" + arg_str[7:])
func_type = "method"
elif arg_str.startswith("(cls, "):
arg_str = "(" + arg_str[6:]
arg_str = "()" if (arg_str == "(cls)") else ("(" + arg_str[6:])
func_type = "classmethod"
else:
func_type = "staticmethod"
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
if py_func.__doc__:
write_indented_lines(ident + " ", fw, py_func.__doc__)
doc = py_func.__doc__
if (not doc) or (not doc.startswith(".. %s:: " % func_type)):
fw(ident + ".. %s:: %s%s\n\n" % (func_type, identifier, arg_str))
ident_temp = ident + " "
else:
ident_temp = ident
if doc:
write_indented_lines(ident_temp, fw, doc)
fw("\n")
del doc, ident_temp
if is_class:
write_example_ref(ident + " ", fw, module_name + "." + type_name + "." + identifier)
@@ -887,7 +871,7 @@ def pymodule2sphinx(basepath, module_name, module, title):
module_dir_value_type.sort(key=lambda triple: str(triple[2]))
for attribute, value, value_type in module_dir_value_type:
if value_type == types.FunctionType:
if value_type == FunctionType:
pyfunc2sphinx("", fw, module_name, None, attribute, value, is_class=False)
elif value_type in {types.BuiltinMethodType, types.BuiltinFunctionType}: # both the same at the moment but to be future proof
# note: can't get args from these, so dump the string as is
@@ -942,19 +926,24 @@ def pymodule2sphinx(basepath, module_name, module, title):
fw(value.__doc__)
else:
fw(".. class:: %s\n\n" % type_name)
write_indented_lines(" ", fw, value.__doc__, False)
write_indented_lines(" ", fw, value.__doc__, True)
else:
fw(".. class:: %s\n\n" % type_name)
fw("\n")
write_example_ref(" ", fw, module_name + "." + type_name)
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("__")]
descr_items = [(key, descr) for key, descr in sorted(value.__dict__.items()) if not key.startswith("_")]
for key, descr in descr_items:
if type(descr) == ClassMethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
# needed for pure python classes
for key, descr in descr_items:
if type(descr) == FunctionType:
pyfunc2sphinx(" ", fw, module_name, type_name, key, descr, is_class=True)
for key, descr in descr_items:
if type(descr) == MethodDescriptorType:
py_descr2sphinx(" ", fw, descr, module_name, type_name, key)
@@ -1265,6 +1254,7 @@ def pyrna2sphinx(basepath):
fw("\n\n")
subclass_ids = [s.identifier for s in structs.values() if s.base is struct if not rna_info.rna_id_ignore(s.identifier)]
subclass_ids.sort()
if subclass_ids:
fw("subclasses --- \n" + ", ".join((":class:`%s`" % s) for s in subclass_ids) + "\n\n")
@@ -1572,7 +1562,7 @@ def write_sphinx_conf_py(basepath):
if ARGS.sphinx_theme != 'default':
fw("html_theme = '%s'\n" % ARGS.sphinx_theme)
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
fw("html_theme_path = ['../']\n")
# copied with the theme, exclude else we get an error [#28873]
fw("html_favicon = 'favicon.ico'\n") # in <theme>/static/
@@ -1633,6 +1623,7 @@ def write_rst_contents(basepath):
# py modules
"bpy.utils",
"bpy.utils.previews",
"bpy.path",
"bpy.app",
"bpy.app.handlers",
@@ -1987,7 +1978,7 @@ def main():
copy_function=shutil.copy)
# eventually, copy the theme dir
if ARGS.sphinx_theme in SPHINX_THEMES['bf']:
if ARGS.sphinx_theme == "blender-org":
if os.path.exists(SPHINX_THEME_DIR):
shutil.rmtree(SPHINX_THEME_DIR, True)
shutil.copytree(SPHINX_THEME_SVN_DIR,

View File

@@ -26,11 +26,14 @@
# Otherwise we get warnings here that we cant fix in external projects
remove_strict_flags()
add_subdirectory(colamd)
add_subdirectory(rangetree)
add_subdirectory(wcwidth)
add_subdirectory(libmv)
if(WITH_OPENNL)
add_subdirectory(colamd)
endif()
if(WITH_BULLET)
if(NOT WITH_SYSTEM_BULLET)
add_subdirectory(bullet2)
@@ -66,7 +69,7 @@ if(WITH_IMAGE_REDCODE)
add_subdirectory(libredcode)
endif()
if(WITH_LZO)
if(WITH_LZO AND NOT WITH_SYSTEM_LZO)
add_subdirectory(lzo)
endif()

View File

@@ -6,3 +6,8 @@ Erwin
Apply patches/convex_hull.patch to add access to the convex hull
operation, used in the BMesh convex hull operator.
Documentation is available at:
http://code.google.com/p/bullet/source/browse/trunk/Bullet_User_Manual.pdf
and:
https://github.com/bulletphysics/bullet3/tree/master/docs

View File

@@ -15,7 +15,7 @@ subject to the following restrictions:
/**
* @mainpage Bullet Documentation
* @page Bullet Documentation
*
* @section intro_sec Introduction
* Bullet is a Collision Detection and Rigid Body Dynamics Library. The Library is Open Source and free for commercial use, under the ZLib license ( http://opensource.org/licenses/zlib-license.php ).

View File

@@ -2751,6 +2751,30 @@ CLEW_FUN_EXPORT PFNCLGETGLCONTEXTINFOKHR __clewGetGLContextInfoKH
#endif
#define clGetGLContextInfoKHR CLEW_GET_FUN(__clewGetGLContextInfoKHR )
/* cl_ext */
/******************************************
* cl_nv_device_attribute_query extension *
******************************************/
/* cl_nv_device_attribute_query extension - no extension #define since it has no functions */
#define CL_DEVICE_COMPUTE_CAPABILITY_MAJOR_NV 0x4000
#define CL_DEVICE_COMPUTE_CAPABILITY_MINOR_NV 0x4001
#define CL_DEVICE_REGISTERS_PER_BLOCK_NV 0x4002
#define CL_DEVICE_WARP_SIZE_NV 0x4003
#define CL_DEVICE_GPU_OVERLAP_NV 0x4004
#define CL_DEVICE_KERNEL_EXEC_TIMEOUT_NV 0x4005
#define CL_DEVICE_INTEGRATED_MEMORY_NV 0x4006
/*********************************
* cl_amd_device_attribute_query *
*********************************/
#define CL_DEVICE_PROFILING_TIMER_OFFSET_AMD 0x4036
/*********************************
* cl_arm_printf extension
*********************************/
#define CL_PRINTF_CALLBACK_ARM 0x40B0
#define CL_PRINTF_BUFFERSIZE_ARM 0x40B1
#define CLEW_SUCCESS 0 //!< Success error code
#define CLEW_ERROR_OPEN_FAILED -1 //!< Error code for failing to open the dynamic library

View File

@@ -48,7 +48,7 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
)
list(APPEND INC_SYS
../Eigen3
${EIGEN3_INCLUDE_DIRS}
${PNG_INCLUDE_DIRS}
${ZLIB_INCLUDE_DIRS}
)

View File

@@ -141,7 +141,7 @@ if(WITH_LIBMV OR WITH_GTESTS OR (WITH_CYCLES AND WITH_CYCLES_LOGGING))
)
list(APPEND INC_SYS
../Eigen3
\${EIGEN3_INCLUDE_DIRS}
\${PNG_INCLUDE_DIRS}
\${ZLIB_INCLUDE_DIRS}
)

View File

@@ -179,20 +179,20 @@ void libmv_reconstructionDestroy(
/* ************ Feature detector ************ */
libmv_Features *libmv_detectFeaturesByte(const unsigned char */*image_buffer*/,
libmv_Features *libmv_detectFeaturesByte(const unsigned char * /*image_buffer*/,
int /*width*/,
int /*height*/,
int /*channels*/,
libmv_DetectOptions */*options*/) {
libmv_DetectOptions * /*options*/) {
return NULL;
}
struct libmv_Features *libmv_detectFeaturesFloat(
const float */*image_buffer*/,
const float * /*image_buffer*/,
int /*width*/,
int /*height*/,
int /*channels*/,
libmv_DetectOptions */*options*/) {
libmv_DetectOptions * /*options*/) {
return NULL;
}
@@ -247,7 +247,7 @@ void libmv_cameraIntrinsicsSetThreads(
}
void libmv_cameraIntrinsicsExtractOptions(
const libmv_CameraIntrinsics */*libmv_intrinsics*/,
const libmv_CameraIntrinsics * /*libmv_intrinsics*/,
libmv_CameraIntrinsicsOptions *camera_intrinsics_options) {
memset(camera_intrinsics_options, 0, sizeof(libmv_CameraIntrinsicsOptions));
camera_intrinsics_options->focal_length = 1.0;
@@ -355,7 +355,7 @@ void libmv_autoTrackSetOptions(libmv_AutoTrack* /*libmv_autotrack*/,
int libmv_autoTrackMarker(libmv_AutoTrack* /*libmv_autotrack*/,
const libmv_TrackRegionOptions* /*libmv_options*/,
libmv_Marker */*libmv_tracker_marker*/,
libmv_Marker * /*libmv_tracker_marker*/,
libmv_TrackRegionResult* /*libmv_result*/)
{
return 0;
@@ -390,7 +390,7 @@ void libmv_FrameAccessorDestroy(libmv_FrameAccessor* /*frame_accessor*/)
}
int64_t libmv_frameAccessorgetTransformKey(
const libmv_FrameTransform */*transform*/)
const libmv_FrameTransform * /*transform*/)
{
return 0;
}

View File

@@ -154,6 +154,7 @@ bool AutoTrack::TrackMarker(Marker* tracked_marker,
frame_accessor_,
&tracked_image);
if (!tracked_key) {
frame_accessor_->ReleaseImage(reference_key);
LG << "Couldn't get frame for tracked marker: " << tracked_marker;
return false;
}

View File

@@ -179,8 +179,12 @@ void GetNormalizedPoints(const Mat &original_points,
class HomographySymmetricGeometricCostFunctor {
public:
HomographySymmetricGeometricCostFunctor(const Vec2 &x,
const Vec2 &y)
: x_(x), y_(y) { }
const Vec2 &y) {
xx_ = x(0);
xy_ = x(1);
yx_ = y(0);
yy_ = y(1);
}
template<typename T>
bool operator()(const T *homography_parameters, T *residuals) const {
@@ -189,8 +193,8 @@ class HomographySymmetricGeometricCostFunctor {
Mat3 H(homography_parameters);
Vec3 x(T(x_(0)), T(x_(1)), T(1.0));
Vec3 y(T(y_(0)), T(y_(1)), T(1.0));
Vec3 x(T(xx_), T(xy_), T(1.0));
Vec3 y(T(yx_), T(yy_), T(1.0));
Vec3 H_x = H * x;
Vec3 Hinv_y = H.inverse() * y;
@@ -199,18 +203,19 @@ class HomographySymmetricGeometricCostFunctor {
Hinv_y /= Hinv_y(2);
// This is a forward error.
residuals[0] = H_x(0) - T(y_(0));
residuals[1] = H_x(1) - T(y_(1));
residuals[0] = H_x(0) - T(yx_);
residuals[1] = H_x(1) - T(yy_);
// This is a backward error.
residuals[2] = Hinv_y(0) - T(x_(0));
residuals[3] = Hinv_y(1) - T(x_(1));
residuals[2] = Hinv_y(0) - T(xx_);
residuals[3] = Hinv_y(1) - T(xy_);
return true;
}
const Vec2 x_;
const Vec2 y_;
// TODO(sergey): Think of better naming.
double xx_, xy_;
double yx_, yy_;
};
// Termination checking callback used for homography estimation.

View File

@@ -36,7 +36,7 @@ set(INC
)
set(INC_SYS
../../../Eigen3
${EIGEN3_INCLUDE_DIRS}
)
set(SRC

View File

@@ -129,7 +129,7 @@ set(INC
)
set(INC_SYS
../../../Eigen3
${EIGEN3_INCLUDE_DIRS}
)
set(SRC

View File

@@ -23,6 +23,8 @@
#
# ***** END GPL LICENSE BLOCK *****
remove_strict_flags()
set(INC
)

View File

@@ -14,8 +14,8 @@
02110-1301, USA.
*/
#ifndef RANGE_TREE_C_API_H
#define RANGE_TREE_C_API_H
#ifndef __RANGE_TREE_C_API_H__
#define __RANGE_TREE_C_API_H__
#ifdef __cplusplus
extern "C" {
@@ -59,4 +59,4 @@ unsigned int range_tree_uint_allocation_lower_bound(const RangeTreeUInt *rt);
}
#endif
#endif /* __DUALCON_H__ */
#endif /* __RANGE_TREE_C_API_H__ */

View File

@@ -77,6 +77,10 @@ if(WITH_OPENNL)
add_subdirectory(opennl)
endif()
if(WITH_MOD_QUADREMESH)
add_subdirectory(quadremesh)
endif()
# only windows needs utf16 converter
if(WIN32)
add_subdirectory(utfconv)

View File

@@ -77,6 +77,27 @@
# define LG_SIZEOF_INT 2
#endif
/************************/
/* Function prototypes. */
#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)
ATOMIC_INLINE uint64_t atomic_add_uint64(uint64_t *p, uint64_t x);
ATOMIC_INLINE uint64_t atomic_sub_uint64(uint64_t *p, uint64_t x);
ATOMIC_INLINE uint64_t atomic_cas_uint64(uint64_t *v, uint64_t old, uint64_t _new);
#endif
ATOMIC_INLINE uint32_t atomic_add_uint32(uint32_t *p, uint32_t x);
ATOMIC_INLINE uint32_t atomic_sub_uint32(uint32_t *p, uint32_t x);
ATOMIC_INLINE uint32_t atomic_cas_uint32(uint32_t *v, uint32_t old, uint32_t _new);
ATOMIC_INLINE size_t atomic_add_z(size_t *p, size_t x);
ATOMIC_INLINE size_t atomic_sub_z(size_t *p, size_t x);
ATOMIC_INLINE size_t atomic_cas_z(size_t *v, size_t old, size_t _new);
ATOMIC_INLINE unsigned atomic_add_u(unsigned *p, unsigned x);
ATOMIC_INLINE unsigned atomic_sub_u(unsigned *p, unsigned x);
ATOMIC_INLINE unsigned atomic_cas_u(unsigned *v, unsigned old, unsigned _new);
/******************************************************************************/
/* 64-bit operations. */
#if (LG_SIZEOF_PTR == 3 || LG_SIZEOF_INT == 3)

View File

@@ -19,6 +19,8 @@
#
# ***** END LGPL LICENSE BLOCK *****
remove_extra_strict_flags()
set(INC
.
FX

View File

@@ -276,49 +276,48 @@ bool AUD_OpenALDevice::AUD_OpenALHandle::seek(float position)
alGetSourcei(m_source, AL_SOURCE_STATE, &info);
if(info != AL_PLAYING)
// we need to stop playing sounds as well to clear the buffers
// this might cause clicks, but fixes a bug regarding position determination
if(info == AL_PAUSED || info == AL_PLAYING)
alSourceStop(m_source);
alSourcei(m_source, AL_BUFFER, 0);
m_current = 0;
ALenum err;
if((err = alGetError()) == AL_NO_ERROR)
{
if(info == AL_PAUSED)
alSourceStop(m_source);
int length;
AUD_DeviceSpecs specs = m_device->m_specs;
specs.specs = m_reader->getSpecs();
m_device->m_buffer.assureSize(m_device->m_buffersize * AUD_DEVICE_SAMPLE_SIZE(specs));
alSourcei(m_source, AL_BUFFER, 0);
m_current = 0;
ALenum err;
if((err = alGetError()) == AL_NO_ERROR)
for(int i = 0; i < CYCLE_BUFFERS; i++)
{
int length;
AUD_DeviceSpecs specs = m_device->m_specs;
specs.specs = m_reader->getSpecs();
m_device->m_buffer.assureSize(m_device->m_buffersize * AUD_DEVICE_SAMPLE_SIZE(specs));
length = m_device->m_buffersize;
m_reader->read(length, m_eos, m_device->m_buffer.getBuffer());
for(int i = 0; i < CYCLE_BUFFERS; i++)
if(length == 0)
{
length = m_device->m_buffersize;
m_reader->read(length, m_eos, m_device->m_buffer.getBuffer());
if(length == 0)
{
// AUD_XXX: TODO: don't fill all buffers and enqueue them later
length = 1;
memset(m_device->m_buffer.getBuffer(), 0, length * AUD_DEVICE_SAMPLE_SIZE(specs));
}
alBufferData(m_buffers[i], m_format, m_device->m_buffer.getBuffer(),
length * AUD_DEVICE_SAMPLE_SIZE(specs), specs.rate);
if(alGetError() != AL_NO_ERROR)
break;
// AUD_XXX: TODO: don't fill all buffers and enqueue them later
length = 1;
memset(m_device->m_buffer.getBuffer(), 0, length * AUD_DEVICE_SAMPLE_SIZE(specs));
}
if(m_loopcount != 0)
m_eos = false;
alBufferData(m_buffers[i], m_format, m_device->m_buffer.getBuffer(),
length * AUD_DEVICE_SAMPLE_SIZE(specs), specs.rate);
alSourceQueueBuffers(m_source, CYCLE_BUFFERS, m_buffers);
if(alGetError() != AL_NO_ERROR)
break;
}
alSourceRewind(m_source);
if(m_loopcount != 0)
m_eos = false;
alSourceQueueBuffers(m_source, CYCLE_BUFFERS, m_buffers);
}
alSourceRewind(m_source);
}
if(m_status == AUD_STATUS_STOPPED)
@@ -343,9 +342,14 @@ float AUD_OpenALDevice::AUD_OpenALHandle::getPosition()
if(!m_isBuffered)
{
int queued;
// this usually always returns CYCLE_BUFFERS
alGetSourcei(m_source, AL_BUFFERS_QUEUED, &queued);
AUD_Specs specs = m_reader->getSpecs();
position += (m_reader->getPosition() - m_device->m_buffersize *
CYCLE_BUFFERS) / (float)specs.rate;
queued) / (float)specs.rate;
}
return position;

View File

@@ -119,13 +119,11 @@ void AUD_AnimateableProperty::write(const float* data, int position, int count)
{
m_unknown.push_back(Unknown(pos, position - 1));
// if the buffer was not animated before, we copy the previous static value
if(pos == 0)
{
for(int i = 0; i < position; i++)
memcpy(buf + i * m_count, data, m_count * sizeof(float));
}
else
updateUnknownCache(pos, position - 1);
pos = 1;
updateUnknownCache(pos, position - 1);
}
// otherwise it's not at the end, let's check if some unknown part got filled
else

View File

@@ -222,7 +222,7 @@ static PyMethodDef meth_getcdevice[] = {
};
extern "C" {
extern void *sound_get_factory(void *sound);
extern void *BKE_sound_get_factory(void *sound);
}
static PyObject *AUD_getSoundFromPointer(PyObject *self, PyObject *args)
@@ -231,7 +231,7 @@ static PyObject *AUD_getSoundFromPointer(PyObject *self, PyObject *args)
if (PyArg_Parse(args, "l:_sound_from_pointer", &lptr)) {
if (lptr) {
boost::shared_ptr<AUD_IFactory>* factory = (boost::shared_ptr<AUD_IFactory>*) sound_get_factory((void *) lptr);
boost::shared_ptr<AUD_IFactory>* factory = (boost::shared_ptr<AUD_IFactory>*) BKE_sound_get_factory((void *) lptr);
if (factory) {
Factory *obj = (Factory *)Factory_empty();

View File

@@ -64,7 +64,7 @@ elseif(CMAKE_COMPILER_IS_GNUCC)
set(CYCLES_AVX_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mfpmath=sse")
endif()
if(CXX_HAS_AVX2)
set(CYCLES_AVX2_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mfpmath=sse")
set(CYCLES_AVX2_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mf16c -mfpmath=sse")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -80,7 +80,7 @@ elseif(CMAKE_CXX_COMPILER_ID MATCHES "Clang")
set(CYCLES_AVX_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx")
endif()
if(CXX_HAS_AVX2)
set(CYCLES_AVX2_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2")
set(CYCLES_AVX2_KERNEL_FLAGS "-ffast-math -msse -msse2 -msse3 -mssse3 -msse4.1 -mavx -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mf16c")
endif()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -ffast-math")
endif()
@@ -152,6 +152,27 @@ add_definitions(
-DWITH_MULTI
)
TEST_UNORDERED_MAP_SUPPORT()
if(HAVE_STD_UNORDERED_MAP_HEADER)
if(HAVE_UNORDERED_MAP_IN_STD_NAMESPACE)
add_definitions(-DCYCLES_STD_UNORDERED_MAP)
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
add_definitions(-DCYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE)
else()
add_definitions(-DCYCLES_NO_UNORDERED_MAP)
message(STATUS "Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
else()
if(HAVE_UNORDERED_MAP_IN_TR1_NAMESPACE)
add_definitions(-DCYCLES_TR1_UNORDERED_MAP)
else()
add_definitions(-DCYCLES_NO_UNORDERED_MAP)
message(STATUS "Replacing unordered_map/set with map/set (warning: slower!)")
endif()
endif()
# Logging capabilities using GLog library.
if(WITH_CYCLES_LOGGING)
add_definitions(-DWITH_CYCLES_LOGGING)

View File

@@ -47,6 +47,18 @@ cxxflags = Split(env['CXXFLAGS'])
defs += env['BF_GL_DEFINITIONS']
if env['WITH_UNORDERED_MAP_SUPPORT']:
if env['UNORDERED_MAP_HEADER'] == 'unordered_map':
if env['UNORDERED_MAP_NAMESPACE'] == 'std':
defs.append('CYCLES_STD_UNORDERED_MAP')
elif env['UNORDERED_MAP_NAMESPACE'] == 'std::tr1':
defs.append('CYCLES_STD_UNORDERED_MAP_IN_TR1_NAMESPACE')
elif env['UNORDERED_MAP_NAMESPACE'] == 'std::tr1':
defs.append('CYCLES_TR1_UNORDERED_MAP')
else:
print("-- Replacing unordered_map/set with map/set (warning: slower!)")
defs.append('CYCLES_NO_UNORDERED_MAP')
defs.append('CCL_NAMESPACE_BEGIN=namespace ccl {')
defs.append('CCL_NAMESPACE_END=}')
@@ -128,7 +140,7 @@ else:
if (env['C_COMPILER_ID'] == 'gcc' and env['CCVERSION'] >= '4.6') or (env['C_COMPILER_ID'] == 'clang' and env['CCVERSION'] >= '3.1'):
kernel_flags['avx'] = kernel_flags['sse41'] + ' -mavx'
kernel_flags['avx2'] = kernel_flags['avx'] + ' -mavx2 -mfma -mlzcnt -mbmi -mbmi2'
kernel_flags['avx2'] = kernel_flags['avx'] + ' -mavx2 -mfma -mlzcnt -mbmi -mbmi2 -mf16c'
for kernel_type in kernel_flags.keys():
defs.append('WITH_KERNEL_' + kernel_type.upper())

View File

@@ -45,7 +45,9 @@ if(CYCLES_STANDALONE_REPOSITORY)
endif()
else()
list(APPEND LIBRARIES bf_intern_glew_mx)
list(APPEND LIBRARIES extern_glog)
if(WITH_CYCLES_LOGGING)
list(APPEND LIBRARIES extern_glog)
endif()
endif()
if(WITH_CYCLES_STANDALONE AND WITH_CYCLES_STANDALONE_GUI)

View File

@@ -24,6 +24,7 @@
#include "util_stats.h"
#include "util_string.h"
#include "util_task.h"
#include "util_logging.h"
using namespace ccl;
@@ -66,7 +67,7 @@ int main(int argc, const char **argv)
exit(EXIT_FAILURE);
}
if (debug) {
if(debug) {
util_logging_start();
util_logging_verbosity_set(verbosity);
}

View File

@@ -124,7 +124,7 @@ static void scene_init()
xml_read_file(options.scene, options.filepath.c_str());
/* Camera width/height override? */
if (!(options.width == 0 || options.height == 0)) {
if(!(options.width == 0 || options.height == 0)) {
options.scene->camera->width = options.width;
options.scene->camera->height = options.height;
}
@@ -367,7 +367,7 @@ static void options_parse(int argc, const char **argv)
exit(EXIT_FAILURE);
}
if (debug) {
if(debug) {
util_logging_start();
util_logging_verbosity_set(verbosity);
}
@@ -377,7 +377,8 @@ static void options_parse(int argc, const char **argv)
printf("Devices:\n");
foreach(DeviceInfo& info, devices) {
printf(" %s%s\n",
printf(" %-10s%s%s\n",
Device::string_from_type(info.type).c_str(),
info.description.c_str(),
(info.display_device)? " (display)": "");
}

View File

@@ -55,6 +55,16 @@ struct XMLReadState {
string base; /* base path to current file*/
float dicing_rate; /* current dicing rate */
Mesh::DisplacementMethod displacement_method;
XMLReadState()
: scene(NULL),
smooth(false),
shader(0),
dicing_rate(0.0f),
displacement_method(Mesh::DISPLACE_BUMP)
{
tfm = transform_identity();
}
};
/* Attribute Reading */
@@ -225,21 +235,21 @@ static ShaderSocketType xml_read_socket_type(pugi::xml_node node, const char *na
if(attr) {
string value = attr.value();
if (string_iequals(value, "float"))
if(string_iequals(value, "float"))
return SHADER_SOCKET_FLOAT;
else if (string_iequals(value, "int"))
else if(string_iequals(value, "int"))
return SHADER_SOCKET_INT;
else if (string_iequals(value, "color"))
else if(string_iequals(value, "color"))
return SHADER_SOCKET_COLOR;
else if (string_iequals(value, "vector"))
else if(string_iequals(value, "vector"))
return SHADER_SOCKET_VECTOR;
else if (string_iequals(value, "point"))
else if(string_iequals(value, "point"))
return SHADER_SOCKET_POINT;
else if (string_iequals(value, "normal"))
else if(string_iequals(value, "normal"))
return SHADER_SOCKET_NORMAL;
else if (string_iequals(value, "closure color"))
else if(string_iequals(value, "closure color"))
return SHADER_SOCKET_CLOSURE;
else if (string_iequals(value, "string"))
else if(string_iequals(value, "string"))
return SHADER_SOCKET_STRING;
else
fprintf(stderr, "Unknown shader socket type \"%s\" for attribute \"%s\".\n", value.c_str(), name);
@@ -419,25 +429,25 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
* Socket names must be stored in the extra lists instead. */
/* read input values */
for(pugi::xml_node param = node.first_child(); param; param = param.next_sibling()) {
if (string_iequals(param.name(), "input")) {
if(string_iequals(param.name(), "input")) {
string name;
if (!xml_read_string(&name, param, "name"))
if(!xml_read_string(&name, param, "name"))
continue;
ShaderSocketType type = xml_read_socket_type(param, "type");
if (type == SHADER_SOCKET_UNDEFINED)
if(type == SHADER_SOCKET_UNDEFINED)
continue;
osl->input_names.push_back(ustring(name));
osl->add_input(osl->input_names.back().c_str(), type);
}
else if (string_iequals(param.name(), "output")) {
else if(string_iequals(param.name(), "output")) {
string name;
if (!xml_read_string(&name, param, "name"))
if(!xml_read_string(&name, param, "name"))
continue;
ShaderSocketType type = xml_read_socket_type(param, "type");
if (type == SHADER_SOCKET_UNDEFINED)
if(type == SHADER_SOCKET_UNDEFINED)
continue;
osl->output_names.push_back(ustring(name));
@@ -493,10 +503,6 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
xml_read_int(&magic->depth, node, "depth");
snode = magic;
}
else if(string_iequals(node.name(), "noise_texture")) {
NoiseTextureNode *dist = new NoiseTextureNode();
snode = dist;
}
else if(string_iequals(node.name(), "wave_texture")) {
WaveTextureNode *wave = new WaveTextureNode();
xml_read_enum(&wave->type, WaveTextureNode::type_enum, node, "type");
@@ -637,10 +643,10 @@ static void xml_read_shader_graph(const XMLReadState& state, Shader *shader, pug
snode = new SeparateHSVNode();
}
else if(string_iequals(node.name(), "combine_xyz")) {
snode = new CombineHSVNode();
snode = new CombineXYZNode();
}
else if(string_iequals(node.name(), "separate_xyz")) {
snode = new SeparateHSVNode();
snode = new SeparateXYZNode();
}
else if(string_iequals(node.name(), "hsv")) {
snode = new HSVNode();
@@ -1028,13 +1034,28 @@ static void xml_read_light(const XMLReadState& state, pugi::xml_node node)
xml_read_float(&light->sizev, node, "sizev");
xml_read_float3(&light->axisu, node, "axisu");
xml_read_float3(&light->axisv, node, "axisv");
/* Portal? (Area light only) */
xml_read_bool(&light->is_portal, node, "is_portal");
/* Generic */
xml_read_float(&light->size, node, "size");
xml_read_float3(&light->dir, node, "dir");
xml_read_float3(&light->co, node, "P");
light->co = transform_point(&state.tfm, light->co);
/* Settings */
xml_read_bool(&light->cast_shadow, node, "cast_shadow");
xml_read_bool(&light->use_mis, node, "use_mis");
xml_read_int(&light->samples, node, "samples");
xml_read_int(&light->max_bounces, node, "max_bounces");
/* Ray Visibility */
xml_read_bool(&light->use_diffuse, node, "use_diffuse");
xml_read_bool(&light->use_glossy, node, "use_glossy");
xml_read_bool(&light->use_transmission, node, "use_transmission");
xml_read_bool(&light->use_scatter, node, "use_scatter");
state.scene->lights.push_back(light);
}
@@ -1178,7 +1199,8 @@ static void xml_read_include(const XMLReadState& state, const string& src)
XMLReadState substate = state;
substate.base = path_dirname(path);
xml_read_scene(substate, doc);
pugi::xml_node cycles = doc.child("cycles");
xml_read_scene(substate, cycles);
}
else {
fprintf(stderr, "%s read error: %s\n", src.c_str(), parse_result.description());

View File

@@ -30,8 +30,10 @@ bl_info = {
import bpy
from . import engine
from . import version_update
from . import (
engine,
version_update,
)
class CyclesRender(bpy.types.RenderEngine):
@@ -50,26 +52,23 @@ class CyclesRender(bpy.types.RenderEngine):
# final render
def update(self, data, scene):
if self.is_preview:
if not self.session:
if not self.session:
if self.is_preview:
cscene = bpy.context.scene.cycles
use_osl = cscene.shading_system and cscene.device == 'CPU'
engine.create(self, data, scene,
None, None, None, use_osl)
else:
if not self.session:
engine.create(self, data, scene, background=bpy.app.background)
else:
engine.reset(self, data, scene)
engine.update(self, data, scene)
engine.create(self, data, scene)
else:
engine.reset(self, data, scene)
def render(self, scene):
engine.render(self)
def bake(self, scene, obj, pass_type, pixel_array, num_pixels, depth, result):
engine.bake(self, obj, pass_type, pixel_array, num_pixels, depth, result)
def bake(self, scene, obj, pass_type, object_id, pixel_array, num_pixels, depth, result):
engine.bake(self, obj, pass_type, object_id, pixel_array, num_pixels, depth, result)
# viewport render
def view_update(self, context):

View File

@@ -25,10 +25,10 @@ def init():
path = os.path.dirname(__file__)
user_path = os.path.dirname(os.path.abspath(bpy.utils.user_resource('CONFIG', '')))
_cycles.init(path, user_path)
_cycles.init(path, user_path, bpy.app.background)
def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False, background=False):
def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=False):
import bpy
import _cycles
@@ -42,7 +42,7 @@ def create(engine, data, scene, region=None, v3d=None, rv3d=None, preview_osl=Fa
if rv3d:
rv3d = rv3d.as_pointer()
engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl, background)
engine.session = _cycles.create(engine.as_pointer(), userpref, data, scene, region, v3d, rv3d, preview_osl)
def free(engine):
@@ -59,11 +59,11 @@ def render(engine):
_cycles.render(engine.session)
def bake(engine, obj, pass_type, pixel_array, num_pixels, depth, result):
def bake(engine, obj, pass_type, object_id, pixel_array, num_pixels, depth, result):
import _cycles
session = getattr(engine, "session", None)
if session is not None:
_cycles.bake(engine.session, obj.as_pointer(), pass_type, pixel_array.as_pointer(), num_pixels, depth, result.as_pointer())
_cycles.bake(engine.session, obj.as_pointer(), pass_type, object_id, pixel_array.as_pointer(), num_pixels, depth, result.as_pointer())
def reset(engine, data, scene):

View File

@@ -58,7 +58,7 @@ enum_filter_types = (
enum_aperture_types = (
('RADIUS', "Radius", "Directly change the size of the aperture"),
('FSTOP', "F/stop", "Change the size of the aperture by f/stops"),
('FSTOP', "F-stop", "Change the size of the aperture by f-stop"),
)
enum_panorama_types = (
@@ -66,6 +66,7 @@ enum_panorama_types = (
('FISHEYE_EQUIDISTANT', "Fisheye Equidistant", "Ideal for fulldomes, ignore the sensor dimensions"),
('FISHEYE_EQUISOLID', "Fisheye Equisolid",
"Similar to most fisheye modern lens, takes sensor dimensions into consideration"),
('MIRRORBALL', "Mirror Ball", "Uses the mirror ball mapping"),
)
enum_curve_primitives = (
@@ -116,7 +117,7 @@ enum_volume_sampling = (
enum_volume_interpolation = (
('LINEAR', "Linear", "Good smoothness and speed"),
('CUBIC', 'Cubic', 'Smoothed high quality interpolation, but slower')
('CUBIC', "Cubic", "Smoothed high quality interpolation, but slower")
)
@@ -393,6 +394,12 @@ class CyclesRenderSettings(bpy.types.PropertyGroup):
default=0,
)
cls.use_animated_seed = BoolProperty(
name="Use Animated Seed",
description="Use different seed values (and hence noise patterns) at different frames",
default=False,
)
cls.sample_clamp_direct = FloatProperty(
name="Clamp Direct",
description="If non-zero, the maximum value for a direct sample, "
@@ -522,13 +529,13 @@ class CyclesCameraSettings(bpy.types.PropertyGroup):
cls.aperture_type = EnumProperty(
name="Aperture Type",
description="Use F/stop number or aperture radius",
description="Use f-stop number or aperture radius",
items=enum_aperture_types,
default='RADIUS',
)
cls.aperture_fstop = FloatProperty(
name="Aperture F/stop",
description="F/stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
name="Aperture f-stop",
description="F-stop ratio (lower numbers give more defocus, higher numbers give a sharper image)",
min=0.0, soft_min=0.1, soft_max=64.0,
default=5.6,
step=10,
@@ -652,7 +659,7 @@ class CyclesMaterialSettings(bpy.types.PropertyGroup):
cls.volume_interpolation = EnumProperty(
name="Volume Interpolation",
description="Interpolation method to use for volumes",
description="Interpolation method to use for smoke/fire volumes",
items=enum_volume_interpolation,
default='LINEAR',
)
@@ -693,6 +700,12 @@ class CyclesLampSettings(bpy.types.PropertyGroup):
"reduces noise for area lamps and sharp glossy materials",
default=False,
)
cls.is_portal = BoolProperty(
name="Is Portal",
description="Use this area lamp to guide sampling of the background, "
"note that this will make the lamp invisible",
default=False,
)
@classmethod
def unregister(cls):

View File

@@ -18,7 +18,11 @@
import bpy
from bpy.types import Panel, Menu, Operator
from bpy.types import (
Panel,
Menu,
Operator,
)
class CYCLES_MT_sampling_presets(Menu):
@@ -56,7 +60,15 @@ def use_cpu(context):
return (device_type == 'NONE' or cscene.device == 'CPU')
def draw_samples_info(layout, cscene):
def use_branched_path(context):
cscene = context.scene.cycles
device_type = context.user_preferences.system.compute_device_type
return (cscene.progressive == 'BRANCHED_PATH' and device_type != 'OPENCL')
def draw_samples_info(layout, context):
cscene = context.scene.cycles
integrator = cscene.progressive
# Calculate sample values
@@ -86,7 +98,7 @@ def draw_samples_info(layout, cscene):
# Draw interface
# Do not draw for progressive, when Square Samples are disabled
if (integrator == 'BRANCHED_PATH') or (cscene.use_square_samples and integrator == 'PATH'):
if use_branched_path(context) or (cscene.use_square_samples and integrator == 'PATH'):
col = layout.column(align=True)
col.scale_y = 0.6
col.label("Total Samples:")
@@ -110,6 +122,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
scene = context.scene
cscene = scene.cycles
device_type = context.user_preferences.system.compute_device_type
row = layout.row(align=True)
row.menu("CYCLES_MT_sampling_presets", text=bpy.types.CYCLES_MT_sampling_presets.bl_label)
@@ -117,7 +130,9 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
row.operator("render.cycles_sampling_preset_add", text="", icon="ZOOMOUT").remove_active = True
row = layout.row()
row.prop(cscene, "progressive", text="")
sub = row.row()
sub.active = device_type != 'OPENCL'
sub.prop(cscene, "progressive", text="")
row.prop(cscene, "use_square_samples")
split = layout.split()
@@ -125,11 +140,15 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
col = split.column()
sub = col.column(align=True)
sub.label("Settings:")
sub.prop(cscene, "seed")
seed_sub = sub.row(align=True)
seed_sub.prop(cscene, "seed")
seed_sub.prop(cscene, "use_animated_seed", text="", icon="TIME")
sub.prop(cscene, "sample_clamp_direct")
sub.prop(cscene, "sample_clamp_indirect")
if cscene.progressive == 'PATH':
if cscene.progressive == 'PATH' or use_branched_path(context) == False:
col = split.column()
sub = col.column(align=True)
sub.label(text="Samples:")
@@ -163,7 +182,7 @@ class CyclesRender_PT_sampling(CyclesButtonsPanel, Panel):
layout.row().prop(cscene, "use_layer_samples")
break
draw_samples_info(layout, cscene)
draw_samples_info(layout, context)
class CyclesRender_PT_volume_sampling(CyclesButtonsPanel, Panel):
@@ -413,6 +432,48 @@ class CyclesRender_PT_layer_passes(CyclesButtonsPanel, Panel):
col.prop(rl, "use_pass_environment")
class CyclesRender_PT_views(CyclesButtonsPanel, Panel):
bl_label = "Views"
bl_context = "render_layer"
def draw_header(self, context):
rd = context.scene.render
self.layout.prop(rd, "use_multiview", text="")
def draw(self, context):
layout = self.layout
scene = context.scene
rd = scene.render
rv = rd.views.active
layout.active = rd.use_multiview
basic_stereo = (rd.views_format == 'STEREO_3D')
row = layout.row()
row.prop(rd, "views_format", expand=True)
if basic_stereo:
row = layout.row()
row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "stereo_views", rd.views, "active_index", rows=2)
row = layout.row()
row.label(text="File Suffix:")
row.prop(rv, "file_suffix", text="")
else:
row = layout.row()
row.template_list("RENDERLAYER_UL_renderviews", "name", rd, "views", rd.views, "active_index", rows=2)
col = row.column(align=True)
col.operator("scene.render_view_add", icon='ZOOMIN', text="")
col.operator("scene.render_view_remove", icon='ZOOMOUT', text="")
row = layout.row()
row.label(text="Camera Suffix:")
row.prop(rv, "camera_suffix", text="")
class Cycles_PT_post_processing(CyclesButtonsPanel, Panel):
bl_label = "Post Processing"
bl_options = {'DEFAULT_CLOSED'}
@@ -445,6 +506,7 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
cam = context.camera
ccam = cam.cycles
dof_options = cam.gpu_dof
split = layout.split()
@@ -456,6 +518,16 @@ class CyclesCamera_PT_dof(CyclesButtonsPanel, Panel):
sub.active = cam.dof_object is None
sub.prop(cam, "dof_distance", text="Distance")
hq_support = dof_options.is_hq_supported
sub = col.column(align=True)
sub.label("Viewport:")
subhq = sub.column()
subhq.active = hq_support
subhq.prop(dof_options, "use_high_quality")
sub.prop(dof_options, "fstop")
if dof_options.use_high_quality and hq_support:
sub.prop(dof_options, "blades")
col = split.column()
col.label("Aperture:")
@@ -488,11 +560,16 @@ class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
ob = context.object
slot = context.material_slot
space = context.space_data
is_sortable = len(ob.material_slots) > 1
if ob:
rows = 1
if (is_sortable):
rows = 4
row = layout.row()
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=1)
row.template_list("MATERIAL_UL_matslots", "", ob, "material_slots", ob, "active_material_index", rows=rows)
col = row.column(align=True)
col.operator("object.material_slot_add", icon='ZOOMIN', text="")
@@ -500,6 +577,12 @@ class Cycles_PT_context_material(CyclesButtonsPanel, Panel):
col.menu("MATERIAL_MT_specials", icon='DOWNARROW_HLT', text="")
if is_sortable:
col.separator()
col.operator("object.material_slot_move", icon='TRIA_UP', text="").direction = 'UP'
col.operator("object.material_slot_move", icon='TRIA_DOWN', text="").direction = 'DOWN'
if ob.mode == 'EDIT':
row = layout.row(align=True)
row.operator("object.material_slot_assign", text="Assign")
@@ -689,7 +772,10 @@ class CyclesLamp_PT_preview(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
return context.lamp and CyclesButtonsPanel.poll(context)
return context.lamp and \
not (context.lamp.type == 'AREA' and
context.lamp.cycles.is_portal) \
and CyclesButtonsPanel.poll(context)
def draw(self, context):
self.layout.template_preview(context.lamp)
@@ -727,13 +813,21 @@ class CyclesLamp_PT_lamp(CyclesButtonsPanel, Panel):
sub.prop(lamp, "size", text="Size X")
sub.prop(lamp, "size_y", text="Size Y")
if cscene.progressive == 'BRANCHED_PATH':
col.prop(clamp, "samples")
col.prop(clamp, "max_bounces")
if not (lamp.type == 'AREA' and clamp.is_portal):
sub = col.column(align=True)
if use_branched_path(context):
sub.prop(clamp, "samples")
sub.prop(clamp, "max_bounces")
col = split.column()
col.prop(clamp, "cast_shadow")
col.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance")
sub = col.column(align=True)
sub.active = not (lamp.type == 'AREA' and clamp.is_portal)
sub.prop(clamp, "cast_shadow")
sub.prop(clamp, "use_multiple_importance_sampling", text="Multiple Importance")
if lamp.type == 'AREA':
col.prop(clamp, "is_portal", text="Portal")
if lamp.type == 'HEMI':
layout.label(text="Not supported, interpreted as sun lamp")
@@ -745,7 +839,9 @@ class CyclesLamp_PT_nodes(CyclesButtonsPanel, Panel):
@classmethod
def poll(cls, context):
return context.lamp and CyclesButtonsPanel.poll(context)
return context.lamp and not (context.lamp.type == 'AREA' and
context.lamp.cycles.is_portal) and \
CyclesButtonsPanel.poll(context)
def draw(self, context):
layout = self.layout
@@ -928,7 +1024,7 @@ class CyclesWorld_PT_settings(CyclesButtonsPanel, Panel):
sub = col.column(align=True)
sub.active = cworld.sample_as_light
sub.prop(cworld, "sample_map_resolution")
if cscene.progressive == 'BRANCHED_PATH':
if use_branched_path(context):
sub.prop(cworld, "samples")
col = split.column()
@@ -1030,7 +1126,7 @@ class CyclesMaterial_PT_settings(CyclesButtonsPanel, Panel):
sub = col.column()
sub.active = use_cpu(context)
sub.prop(cmat, "volume_sampling", text="")
col.prop(cmat, "volume_interpolation", text="")
sub.prop(cmat, "volume_interpolation", text="")
col.prop(cmat, "homogeneous_volume", text="Homogeneous")
layout.separator()
@@ -1342,10 +1438,17 @@ class CyclesScene_PT_simplify(CyclesButtonsPanel, Panel):
rd = context.scene.render
layout.active = rd.use_simplify
split = layout.split()
row = layout.row()
row.prop(rd, "simplify_subdivision", text="Subdivision")
row.prop(rd, "simplify_child_particles", text="Child Particles")
col = split.column()
col.label(text="Viewport:")
col.prop(rd, "simplify_subdivision", text="Subdivision")
col.prop(rd, "simplify_child_particles", text="Child Particles")
col = split.column()
col.label(text="Render:")
col.prop(rd, "simplify_subdivision_render", text="Subdivision")
col.prop(rd, "simplify_child_particles_render", text="Child Particles")
def draw_device(self, context):
@@ -1417,6 +1520,7 @@ def get_panels():
"DATA_PT_vertex_colors",
"DATA_PT_camera",
"DATA_PT_camera_display",
"DATA_PT_camera_stereoscopy",
"DATA_PT_camera_safe_areas",
"DATA_PT_lens",
"DATA_PT_speaker",

View File

@@ -21,10 +21,8 @@ import bpy
from bpy.app.handlers import persistent
def check_is_new_shading_material(material):
if not material.node_tree:
return False
for node in material.node_tree.nodes:
def check_is_new_shading_ntree(node_tree):
for node in node_tree.nodes:
# If material has any node with ONLY new shading system
# compatibility then it's considered a Cycles material
# and versioning code would need to perform on it.
@@ -44,6 +42,24 @@ def check_is_new_shading_material(material):
return False
def check_is_new_shading_material(material):
if not material.node_tree:
return False
return check_is_new_shading_ntree(material.node_tree)
def check_is_new_shading_world(world):
if not world.node_tree:
return False
return check_is_new_shading_ntree(world.node_tree)
def check_is_new_shading_lamp(lamp):
if not lamp.node_tree:
return False
return check_is_new_shading_ntree(lamp.node_tree)
def foreach_notree_node(nodetree, callback, traversed):
if nodetree in traversed:
return
@@ -61,6 +77,16 @@ def foreach_cycles_node(callback):
foreach_notree_node(material.node_tree,
callback,
traversed)
for world in bpy.data.worlds:
if check_is_new_shading_world(world):
foreach_notree_node(world.node_tree,
callback,
traversed)
for lamp in bpy.data.lamps:
if check_is_new_shading_world(lamp):
foreach_notree_node(lamp.node_tree,
callback,
traversed)
def mapping_node_order_flip(node):

View File

@@ -72,7 +72,7 @@ struct BlenderCamera {
Transform matrix;
};
static void blender_camera_init(BlenderCamera *bcam, BL::RenderSettings b_render, BL::Scene b_scene)
static void blender_camera_init(BlenderCamera *bcam, BL::RenderSettings b_render)
{
memset(bcam, 0, sizeof(BlenderCamera));
@@ -95,7 +95,7 @@ static void blender_camera_init(BlenderCamera *bcam, BL::RenderSettings b_render
bcam->full_height = render_resolution_y(b_render);
}
static float blender_camera_focal_distance(BL::Object b_ob, BL::Camera b_camera)
static float blender_camera_focal_distance(BL::RenderEngine b_engine, BL::Object b_ob, BL::Camera b_camera)
{
BL::Object b_dof_object = b_camera.dof_object();
@@ -103,14 +103,16 @@ static float blender_camera_focal_distance(BL::Object b_ob, BL::Camera b_camera)
return b_camera.dof_distance();
/* for dof object, return distance along camera Z direction */
Transform obmat = transform_clear_scale(get_transform(b_ob.matrix_world()));
BL::Array<float, 16> b_ob_matrix;
b_engine.camera_model_matrix(b_ob, b_ob_matrix);
Transform obmat = get_transform(b_ob_matrix);
Transform dofmat = get_transform(b_dof_object.matrix_world());
Transform mat = transform_inverse(obmat) * dofmat;
return fabsf(transform_get_column(&mat, 3).z);
}
static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, bool skip_panorama = false)
static void blender_camera_from_object(BlenderCamera *bcam, BL::RenderEngine b_engine, BL::Object b_ob, bool skip_panorama = false)
{
BL::ID b_ob_data = b_ob.data();
@@ -146,6 +148,9 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, boo
case 2:
bcam->panorama_type = PANORAMA_FISHEYE_EQUISOLID;
break;
case 3:
bcam->panorama_type = PANORAMA_MIRRORBALL;
break;
case 0:
default:
bcam->panorama_type = PANORAMA_EQUIRECTANGULAR;
@@ -181,10 +186,10 @@ static void blender_camera_from_object(BlenderCamera *bcam, BL::Object b_ob, boo
bcam->apertureblades = RNA_int_get(&ccamera, "aperture_blades");
bcam->aperturerotation = RNA_float_get(&ccamera, "aperture_rotation");
bcam->focaldistance = blender_camera_focal_distance(b_ob, b_camera);
bcam->focaldistance = blender_camera_focal_distance(b_engine, b_ob, b_camera);
bcam->aperture_ratio = RNA_float_get(&ccamera, "aperture_ratio");
bcam->shift.x = b_camera.shift_x();
bcam->shift.x = b_engine.camera_shift_x(b_ob);
bcam->shift.y = b_camera.shift_y();
bcam->sensor_width = b_camera.sensor_width();
@@ -303,7 +308,7 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
&cam->viewplane, &aspectratio, &sensor_size);
/* panorama sensor */
if (bcam->type == CAMERA_PANORAMA && bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID) {
if(bcam->type == CAMERA_PANORAMA && bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID) {
float fit_xratio = (float)bcam->full_width*bcam->pixelaspect.x;
float fit_yratio = (float)bcam->full_height*bcam->pixelaspect.y;
bool horizontal_fit;
@@ -380,7 +385,7 @@ static void blender_camera_sync(Camera *cam, BlenderCamera *bcam, int width, int
void BlenderSync::sync_camera(BL::RenderSettings b_render, BL::Object b_override, int width, int height)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_render, b_scene);
blender_camera_init(&bcam, b_render);
/* pixel aspect */
bcam.pixelaspect.x = b_render.pixel_aspect_x();
@@ -402,8 +407,10 @@ void BlenderSync::sync_camera(BL::RenderSettings b_render, BL::Object b_override
b_ob = b_override;
if(b_ob) {
blender_camera_from_object(&bcam, b_ob);
bcam.matrix = get_transform(b_ob.matrix_world());
BL::Array<float, 16> b_ob_matrix;
blender_camera_from_object(&bcam, b_engine, b_ob);
b_engine.camera_model_matrix(b_ob, b_ob_matrix);
bcam.matrix = get_transform(b_ob_matrix);
}
/* sync */
@@ -414,8 +421,9 @@ void BlenderSync::sync_camera(BL::RenderSettings b_render, BL::Object b_override
void BlenderSync::sync_camera_motion(BL::Object b_ob, float motion_time)
{
Camera *cam = scene->camera;
Transform tfm = get_transform(b_ob.matrix_world());
BL::Array<float, 16> b_ob_matrix;
b_engine.camera_model_matrix(b_ob, b_ob_matrix);
Transform tfm = get_transform(b_ob_matrix);
tfm = blender_camera_matrix(tfm, cam->type);
if(tfm != cam->matrix) {
@@ -433,10 +441,10 @@ void BlenderSync::sync_camera_motion(BL::Object b_ob, float motion_time)
/* Sync 3D View Camera */
static void blender_camera_view_subset(BL::RenderSettings b_render, BL::Scene b_scene, BL::Object b_ob, BL::SpaceView3D b_v3d,
static void blender_camera_view_subset(BL::RenderEngine b_engine, BL::RenderSettings b_render, BL::Scene b_scene, BL::Object b_ob, BL::SpaceView3D b_v3d,
BL::RegionView3D b_rv3d, int width, int height, BoundBox2D *view_box, BoundBox2D *cam_box);
static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height, bool skip_panorama = false)
static void blender_camera_from_view(BlenderCamera *bcam, BL::RenderEngine b_engine, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height, bool skip_panorama = false)
{
/* 3d view parameters */
bcam->nearclip = b_v3d.clip_start();
@@ -449,13 +457,13 @@ static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL:
BL::Object b_ob = (b_v3d.lock_camera_and_layers())? b_scene.camera(): b_v3d.camera();
if(b_ob) {
blender_camera_from_object(bcam, b_ob, skip_panorama);
blender_camera_from_object(bcam, b_engine, b_ob, skip_panorama);
if(!skip_panorama && bcam->type == CAMERA_PANORAMA) {
/* in panorama camera view, we map viewplane to camera border */
BoundBox2D view_box, cam_box;
blender_camera_view_subset(b_scene.render(), b_scene, b_ob, b_v3d, b_rv3d, width, height,
blender_camera_view_subset(b_engine, b_scene.render(), b_scene, b_ob, b_v3d, b_rv3d, width, height,
&view_box, &cam_box);
bcam->pano_viewplane = view_box.make_relative_to(cam_box);
@@ -493,7 +501,7 @@ static void blender_camera_from_view(BlenderCamera *bcam, BL::Scene b_scene, BL:
bcam->matrix = transform_inverse(get_transform(b_rv3d.view_matrix()));
}
static void blender_camera_view_subset(BL::RenderSettings b_render, BL::Scene b_scene, BL::Object b_ob, BL::SpaceView3D b_v3d,
static void blender_camera_view_subset(BL::RenderEngine b_engine, BL::RenderSettings b_render, BL::Scene b_scene, BL::Object b_ob, BL::SpaceView3D b_v3d,
BL::RegionView3D b_rv3d, int width, int height, BoundBox2D *view_box, BoundBox2D *cam_box)
{
BoundBox2D cam, view;
@@ -501,16 +509,16 @@ static void blender_camera_view_subset(BL::RenderSettings b_render, BL::Scene b_
/* get viewport viewplane */
BlenderCamera view_bcam;
blender_camera_init(&view_bcam, b_render, b_scene);
blender_camera_from_view(&view_bcam, b_scene, b_v3d, b_rv3d, width, height, true);
blender_camera_init(&view_bcam, b_render);
blender_camera_from_view(&view_bcam, b_engine, b_scene, b_v3d, b_rv3d, width, height, true);
blender_camera_viewplane(&view_bcam, width, height,
&view, &view_aspect, &sensor_size);
/* get camera viewplane */
BlenderCamera cam_bcam;
blender_camera_init(&cam_bcam, b_render, b_scene);
blender_camera_from_object(&cam_bcam, b_ob, true);
blender_camera_init(&cam_bcam, b_render);
blender_camera_from_object(&cam_bcam, b_engine, b_ob, true);
blender_camera_viewplane(&cam_bcam, cam_bcam.full_width, cam_bcam.full_height,
&cam, &cam_aspect, &sensor_size);
@@ -520,7 +528,8 @@ static void blender_camera_view_subset(BL::RenderSettings b_render, BL::Scene b_
*cam_box = cam * (1.0f/cam_aspect);
}
static void blender_camera_border_subset(BL::RenderSettings b_render,
static void blender_camera_border_subset(BL::RenderEngine b_engine,
BL::RenderSettings b_render,
BL::Scene b_scene,
BL::SpaceView3D b_v3d,
BL::RegionView3D b_rv3d,
@@ -531,7 +540,7 @@ static void blender_camera_border_subset(BL::RenderSettings b_render,
{
/* Determine camera viewport subset. */
BoundBox2D view_box, cam_box;
blender_camera_view_subset(b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height,
blender_camera_view_subset(b_engine, b_render, b_scene, b_ob, b_v3d, b_rv3d, width, height,
&view_box, &cam_box);
/* Determine viewport subset matching given border. */
@@ -539,7 +548,7 @@ static void blender_camera_border_subset(BL::RenderSettings b_render,
*result = cam_box.subset(border);
}
static void blender_camera_border(BlenderCamera *bcam, BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d,
static void blender_camera_border(BlenderCamera *bcam, BL::RenderEngine b_engine, BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d,
BL::RegionView3D b_rv3d, int width, int height)
{
bool is_camera_view;
@@ -568,7 +577,8 @@ static void blender_camera_border(BlenderCamera *bcam, BL::RenderSettings b_rend
/* Determine camera border inside the viewport. */
BoundBox2D full_border;
blender_camera_border_subset(b_render,
blender_camera_border_subset(b_engine,
b_render,
b_scene,
b_v3d,
b_rv3d,
@@ -587,7 +597,8 @@ static void blender_camera_border(BlenderCamera *bcam, BL::RenderSettings b_rend
bcam->border.top = b_render.border_max_y();
/* Determine viewport subset matching camera border. */
blender_camera_border_subset(b_render,
blender_camera_border_subset(b_engine,
b_render,
b_scene,
b_v3d,
b_rv3d,
@@ -601,14 +612,14 @@ static void blender_camera_border(BlenderCamera *bcam, BL::RenderSettings b_rend
void BlenderSync::sync_view(BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, int width, int height)
{
BlenderCamera bcam;
blender_camera_init(&bcam, b_scene.render(), b_scene);
blender_camera_from_view(&bcam, b_scene, b_v3d, b_rv3d, width, height);
blender_camera_border(&bcam, b_scene.render(), b_scene, b_v3d, b_rv3d, width, height);
blender_camera_init(&bcam, b_scene.render());
blender_camera_from_view(&bcam, b_engine, b_scene, b_v3d, b_rv3d, width, height);
blender_camera_border(&bcam, b_engine, b_scene.render(), b_scene, b_v3d, b_rv3d, width, height);
blender_camera_sync(scene->camera, &bcam, width, height);
}
BufferParams BlenderSync::get_buffer_params(BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, Camera *cam, int width, int height)
BufferParams BlenderSync::get_buffer_params(BL::RenderSettings b_render, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, Camera *cam, int width, int height)
{
BufferParams params;
bool use_border = false;
@@ -623,10 +634,12 @@ BufferParams BlenderSync::get_buffer_params(BL::RenderSettings b_render, BL::Sce
if(use_border) {
/* border render */
params.full_x = (int)(cam->border.left * (float)width);
params.full_y = (int)(cam->border.bottom * (float)height);
params.width = (int)(cam->border.right * (float)width) - params.full_x;
params.height = (int)(cam->border.top * (float)height) - params.full_y;
/* the viewport may offset the border outside the view */
BoundBox2D border = cam->border.clamp();
params.full_x = (int)(border.left * (float)width);
params.full_y = (int)(border.bottom * (float)height);
params.width = (int)(border.right * (float)width) - params.full_x;
params.height = (int)(border.top * (float)height) - params.full_y;
/* survive in case border goes out of view or becomes too small */
params.width = max(params.width, 1);

View File

@@ -44,8 +44,8 @@ void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CData);
void ExportCurveTrianglePlanes(Mesh *mesh, ParticleCurveData *CData,
float3 RotCam, bool is_ortho);
void ExportCurveTriangleGeometry(Mesh *mesh, ParticleCurveData *CData, int resolution);
void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int vert_offset, int resol, float3 *uvdata);
void ExportCurveTriangleVcol(Mesh *mesh, ParticleCurveData *CData, int vert_offset, int resol, uchar4 *cdata);
void ExportCurveTriangleUV(ParticleCurveData *CData, int vert_offset, int resol, float3 *uvdata);
void ExportCurveTriangleVcol(ParticleCurveData *CData, int vert_offset, int resol, uchar4 *cdata);
ParticleCurveData::ParticleCurveData()
{
@@ -152,7 +152,7 @@ bool ObtainCacheParticleData(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
continue;
int ren_step = (1 << draw_step) + 1;
if (b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
if(b_part.kink() == BL::ParticleSettings::kink_SPIRAL)
ren_step += b_part.kink_extra_steps();
PointerRNA cpsys = RNA_pointer_get(&b_part.ptr, "cycles");
@@ -233,10 +233,10 @@ bool ObtainCacheParticleUV(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Parti
int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
int totcurves = totchild;
if (b_part.child_type() == 0)
if(b_part.child_type() == 0)
totcurves += totparts;
if (totcurves == 0)
if(totcurves == 0)
continue;
int pa_no = 0;
@@ -287,10 +287,10 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * (float)b_part.draw_percentage() / 100.0f);
int totcurves = totchild;
if (b_part.child_type() == 0)
if(b_part.child_type() == 0)
totcurves += totparts;
if (totcurves == 0)
if(totcurves == 0)
continue;
int pa_no = 0;
@@ -322,11 +322,11 @@ bool ObtainCacheParticleVcol(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, Par
return true;
}
static void set_resolution(Mesh *mesh, BL::Mesh *b_mesh, BL::Object *b_ob, BL::Scene *scene, bool render)
static void set_resolution(BL::Object *b_ob, BL::Scene *scene, bool render)
{
BL::Object::modifiers_iterator b_mod;
for(b_ob->modifiers.begin(b_mod); b_mod != b_ob->modifiers.end(); ++b_mod) {
if ((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) {
if((b_mod->type() == b_mod->type_PARTICLE_SYSTEM) && ((b_mod->show_viewport()) || (b_mod->show_render()))) {
BL::ParticleSystemModifier psmd((const PointerRNA)b_mod->ptr);
BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr);
b_psys.set_resolution(*scene, *b_ob, (render)? 2: 1);
@@ -513,7 +513,7 @@ void ExportCurveTriangleGeometry(Mesh *mesh, ParticleCurveData *CData, int resol
ybasis = normalize(cross(xbasis, v2));
for (; subv <= 1; subv++) {
for(; subv <= 1; subv++) {
float3 ickey_loc = make_float3(0.0f,0.0f,0.0f);
float time = 0.0f;
@@ -581,7 +581,7 @@ void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CData)
}
}
if (num_curves > 0) {
if(num_curves > 0) {
VLOG(1) << "Exporting curve segments for mesh " << mesh->name;
}
@@ -621,7 +621,7 @@ void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CData)
}
/* check allocation */
if((mesh->curve_keys.size() != num_keys) || (mesh->curves.size() != num_curves)) {
if((mesh->curve_keys.size() != num_keys) || (mesh->curves.size() != num_curves)) {
VLOG(1) << "Allocation failed, clearing data";
mesh->curve_keys.clear();
mesh->curves.clear();
@@ -629,7 +629,7 @@ void ExportCurveSegments(Scene *scene, Mesh *mesh, ParticleCurveData *CData)
}
}
static void ExportCurveSegmentsMotion(Scene *scene, Mesh *mesh, ParticleCurveData *CData, int time_index)
static void ExportCurveSegmentsMotion(Mesh *mesh, ParticleCurveData *CData, int time_index)
{
VLOG(1) << "Exporting curve motion segments for mesh " << mesh->name
<< ", time index " << time_index;
@@ -705,7 +705,7 @@ static void ExportCurveSegmentsMotion(Scene *scene, Mesh *mesh, ParticleCurveDat
}
}
void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int vert_offset, int resol, float3 *uvdata)
void ExportCurveTriangleUV(ParticleCurveData *CData, int vert_offset, int resol, float3 *uvdata)
{
if(uvdata == NULL)
return;
@@ -750,7 +750,7 @@ void ExportCurveTriangleUV(Mesh *mesh, ParticleCurveData *CData, int vert_offset
}
}
void ExportCurveTriangleVcol(Mesh *mesh, ParticleCurveData *CData, int vert_offset, int resol, uchar4 *cdata)
void ExportCurveTriangleVcol(ParticleCurveData *CData, int vert_offset, int resol, uchar4 *cdata)
{
if(cdata == NULL)
return;
@@ -801,30 +801,38 @@ void BlenderSync::sync_curve_settings()
curve_system_manager->subdivisions = get_int(csscene, "subdivisions");
curve_system_manager->use_backfacing = !get_boolean(csscene, "cull_backfacing");
if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_RIBBON) {
/* Triangles */
if(curve_system_manager->primitive == CURVE_TRIANGLES) {
/* camera facing planes */
curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES;
curve_system_manager->resolution = 1;
if(curve_system_manager->curve_shape == CURVE_RIBBON) {
curve_system_manager->triangle_method = CURVE_CAMERA_TRIANGLES;
curve_system_manager->resolution = 1;
}
else if(curve_system_manager->curve_shape == CURVE_THICK) {
curve_system_manager->triangle_method = CURVE_TESSELATED_TRIANGLES;
}
}
else if(curve_system_manager->primitive == CURVE_TRIANGLES && curve_system_manager->curve_shape == CURVE_THICK) {
/* camera facing planes */
curve_system_manager->triangle_method = CURVE_TESSELATED_TRIANGLES;
/* Line Segments */
else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS) {
if(curve_system_manager->curve_shape == CURVE_RIBBON) {
/* tangent shading */
curve_system_manager->line_method = CURVE_UNCORRECTED;
curve_system_manager->use_encasing = true;
curve_system_manager->use_backfacing = false;
curve_system_manager->use_tangent_normal_geometry = true;
}
else if(curve_system_manager->curve_shape == CURVE_THICK) {
curve_system_manager->line_method = CURVE_ACCURATE;
curve_system_manager->use_encasing = false;
curve_system_manager->use_tangent_normal_geometry = false;
}
}
else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) {
/* tangent shading */
curve_system_manager->line_method = CURVE_UNCORRECTED;
curve_system_manager->use_encasing = true;
curve_system_manager->use_backfacing = false;
curve_system_manager->use_tangent_normal_geometry = true;
}
else if(curve_system_manager->primitive == CURVE_LINE_SEGMENTS && curve_system_manager->curve_shape == CURVE_THICK) {
curve_system_manager->line_method = CURVE_ACCURATE;
curve_system_manager->use_encasing = false;
curve_system_manager->use_tangent_normal_geometry = false;
}
else if(curve_system_manager->primitive == CURVE_SEGMENTS && curve_system_manager->curve_shape == CURVE_RIBBON) {
curve_system_manager->primitive = CURVE_RIBBONS;
curve_system_manager->use_backfacing = false;
/* Curve Segments */
else if(curve_system_manager->primitive == CURVE_SEGMENTS) {
if(curve_system_manager->curve_shape == CURVE_RIBBON) {
curve_system_manager->primitive = CURVE_RIBBONS;
curve_system_manager->use_backfacing = false;
}
}
if(curve_system_manager->modified_mesh(prev_curve_system_manager)) {
@@ -878,7 +886,7 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
ParticleCurveData CData;
if(!preview)
set_resolution(mesh, &b_mesh, &b_ob, &b_scene, true);
set_resolution(&b_ob, &b_scene, true);
ObtainCacheParticleData(mesh, &b_mesh, &b_ob, &CData, !preview);
@@ -909,7 +917,7 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
}
else {
if(motion)
ExportCurveSegmentsMotion(scene, mesh, &CData, time_index);
ExportCurveSegmentsMotion(mesh, &CData, time_index);
else
ExportCurveSegments(scene, mesh, &CData);
}
@@ -958,7 +966,7 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
uchar4 *cdata = attr_vcol->data_uchar4();
ExportCurveTriangleVcol(mesh, &CData, tri_num * 3, used_res, cdata);
ExportCurveTriangleVcol(&CData, tri_num * 3, used_res, cdata);
}
else {
Attribute *attr_vcol = mesh->curve_attributes.add(
@@ -1001,7 +1009,7 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
float3 *uv = attr_uv->data_float3();
ExportCurveTriangleUV(mesh, &CData, tri_num * 3, used_res, uv);
ExportCurveTriangleUV(&CData, tri_num * 3, used_res, uv);
}
else {
if(active_render)
@@ -1024,7 +1032,7 @@ void BlenderSync::sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool
}
if(!preview)
set_resolution(mesh, &b_mesh, &b_ob, &b_scene, false);
set_resolution(&b_ob, &b_scene, false);
mesh->compute_bounds();
}

View File

@@ -20,6 +20,7 @@
#include "scene.h"
#include "blender_sync.h"
#include "blender_session.h"
#include "blender_util.h"
#include "subd_mesh.h"
@@ -106,7 +107,9 @@ static void mikk_get_texture_coordinate(const SMikkTSpaceContext *context, float
int vert_idx = userdata->mesh.tessfaces[face_num].vertices()[vert_num];
float3 orco =
get_float3(userdata->mesh.vertices[vert_idx].undeformed_co());
map_to_sphere(&uv[0], &uv[1], orco[0], orco[1], orco[2]);
float2 tmp = map_to_sphere(make_float3(orco[0], orco[1], orco[2]));
uv[0] = tmp.x;
uv[1] = tmp.y;
}
}
@@ -299,7 +302,7 @@ static void attr_create_uv_map(Scene *scene,
BL::Mesh b_mesh,
const vector<int>& nverts)
{
if (b_mesh.tessface_uv_textures.length() != 0) {
if(b_mesh.tessface_uv_textures.length() != 0) {
BL::Mesh::tessface_uv_textures_iterator l;
for(b_mesh.tessface_uv_textures.begin(l); l != b_mesh.tessface_uv_textures.end(); ++l) {
@@ -321,15 +324,15 @@ static void attr_create_uv_map(Scene *scene,
size_t i = 0;
for(l->data.begin(t); t != l->data.end(); ++t, ++i) {
fdata[0] = get_float3(t->uv1());
fdata[1] = get_float3(t->uv2());
fdata[2] = get_float3(t->uv3());
fdata[0] = get_float3(t->uv1());
fdata[1] = get_float3(t->uv2());
fdata[2] = get_float3(t->uv3());
fdata += 3;
if(nverts[i] == 4) {
fdata[0] = get_float3(t->uv1());
fdata[1] = get_float3(t->uv3());
fdata[2] = get_float3(t->uv4());
fdata[0] = get_float3(t->uv1());
fdata[1] = get_float3(t->uv3());
fdata[2] = get_float3(t->uv4());
fdata += 3;
}
}
@@ -375,9 +378,9 @@ static void attr_create_pointiness(Scene *scene,
int i = 0;
for(b_mesh.edges.begin(e); e != b_mesh.edges.end(); ++e, ++i) {
int v0 = b_mesh.edges[i].vertices()[0],
v1 = b_mesh.edges[i].vertices()[1];
v1 = b_mesh.edges[i].vertices()[1];
float3 co0 = get_float3(b_mesh.vertices[v0].co()),
co1 = get_float3(b_mesh.vertices[v1].co());
co1 = get_float3(b_mesh.vertices[v1].co());
float3 edge = normalize(co1 - co0);
edge_accum[v0] += edge;
edge_accum[v1] += -edge;
@@ -403,7 +406,7 @@ static void attr_create_pointiness(Scene *scene,
i = 0;
for(b_mesh.edges.begin(e); e != b_mesh.edges.end(); ++e, ++i) {
int v0 = b_mesh.edges[i].vertices()[0],
v1 = b_mesh.edges[i].vertices()[1];
v1 = b_mesh.edges[i].vertices()[1];
data[v0] += raw_data[v1];
data[v1] += raw_data[v0];
++counter[v0];
@@ -466,6 +469,9 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
generated[i++] = get_float3(v->undeformed_co())*size - loc;
}
/* Create needed vertex attributes. */
attr_create_pointiness(scene, mesh, b_mesh);
/* create faces */
vector<int> nverts(numfaces);
int fi = 0, ti = 0;
@@ -522,7 +528,6 @@ static void create_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, const vector<
*/
attr_create_vertex_color(scene, mesh, b_mesh, nverts);
attr_create_uv_map(scene, mesh, b_mesh, nverts);
attr_create_pointiness(scene, mesh, b_mesh);
/* for volume objects, create a matrix to transform from object space to
* mesh texture space. this does not work with deformations but that can
@@ -584,6 +589,14 @@ static void create_subd_mesh(Scene *scene, Mesh *mesh, BL::Mesh b_mesh, PointerR
Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris)
{
/* When viewport display is not needed during render we can force some
* caches to be releases from blender side in order to reduce peak memory
* footprint during synchronization process.
*/
const bool is_interface_locked = b_engine.render() &&
b_engine.render().use_lock_interface();
const bool can_free_caches = BlenderSession::headless || is_interface_locked;
/* test if we can instance or if the object is modified */
BL::ID b_ob_data = b_ob.data();
BL::ID key = (BKE_object_is_modified(b_ob))? b_ob: b_ob_data;
@@ -608,7 +621,13 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
}
/* test if we need to sync */
bool use_mesh_geometry = render_layer.use_surfaces || render_layer.use_hair;
int requested_geometry_flags = Mesh::GEOMETRY_NONE;
if(render_layer.use_surfaces) {
requested_geometry_flags |= Mesh::GEOMETRY_TRIANGLES;
}
if(render_layer.use_hair) {
requested_geometry_flags |= Mesh::GEOMETRY_CURVES;
}
Mesh *mesh;
if(!mesh_map.sync(&mesh, key)) {
@@ -617,7 +636,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
/* test if shaders changed, these can be object level so mesh
* does not get tagged for recalc */
else if(mesh->used_shaders != used_shaders);
else if(use_mesh_geometry != mesh->geometry_synced);
else if(requested_geometry_flags != mesh->geometry_flags);
else {
/* even if not tagged for recalc, we may need to sync anyway
* because the shader needs different mesh attributes */
@@ -651,7 +670,7 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
mesh->used_shaders = used_shaders;
mesh->name = ustring(b_ob_data.name().c_str());
if(use_mesh_geometry) {
if(requested_geometry_flags != Mesh::GEOMETRY_NONE) {
/* mesh objects does have special handle in the dependency graph,
* they're ensured to have properly updated.
*
@@ -677,11 +696,15 @@ Mesh *BlenderSync::sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tri
if(render_layer.use_hair)
sync_curves(mesh, b_mesh, b_ob, false);
if(can_free_caches) {
b_ob.cache_release();
}
/* free derived mesh */
b_data.meshes.remove(b_mesh);
}
mesh->geometry_synced = true;
}
mesh->geometry_flags = requested_geometry_flags;
/* displacement method */
if(cmesh.data) {
@@ -844,13 +867,13 @@ void BlenderSync::sync_mesh_motion(BL::Object b_ob, Object *object, float motion
if(new_attribute) {
if(i != numverts || memcmp(mP, &mesh->verts[0], sizeof(float3)*numverts) == 0) {
/* no motion, remove attributes again */
VLOG(1) << "No actual motion for mesh " << b_mesh.name();
VLOG(1) << "No actual deformation motion for object " << b_ob.name();
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_POSITION);
if(attr_mN)
mesh->attributes.remove(ATTR_STD_MOTION_VERTEX_NORMAL);
}
else if(time_index > 0) {
VLOG(1) << "Filling motion for mesh " << b_mesh.name();
VLOG(1) << "Filling deformation motion for object " << b_ob.name();
/* motion, fill up previous steps that we might have skipped because
* they had no motion, but we need them anyway now */
float3 *P = &mesh->verts[0];

View File

@@ -90,14 +90,17 @@ static uint object_ray_visibility(BL::Object b_ob)
/* Light */
void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm)
void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm, bool *use_portal)
{
/* test if we need to sync */
Light *light;
ObjectKey key(b_parent, persistent_id, b_ob);
if(!light_map.sync(&light, b_ob, b_parent, key))
if(!light_map.sync(&light, b_ob, b_parent, key)) {
if(light->is_portal)
*use_portal = true;
return;
}
BL::Lamp b_lamp(b_ob.data());
@@ -171,6 +174,14 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
light->max_bounces = get_int(clamp, "max_bounces");
if(light->type == LIGHT_AREA)
light->is_portal = get_boolean(clamp, "is_portal");
else
light->is_portal = false;
if(light->is_portal)
*use_portal = true;
/* visibility */
uint visibility = object_ray_visibility(b_ob);
light->use_diffuse = (visibility & PATH_RAY_DIFFUSE) != 0;
@@ -182,7 +193,7 @@ void BlenderSync::sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSI
light->tag_update(scene);
}
void BlenderSync::sync_background_light()
void BlenderSync::sync_background_light(bool use_portal)
{
BL::World b_world = b_scene.world();
@@ -191,19 +202,20 @@ void BlenderSync::sync_background_light()
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
bool sample_as_light = get_boolean(cworld, "sample_as_light");
if(sample_as_light) {
if(sample_as_light || use_portal) {
/* test if we need to sync */
Light *light;
ObjectKey key(b_world, 0, b_world);
if(light_map.sync(&light, b_world, b_world, key) ||
world_recalc ||
b_world.ptr.data != world_map)
world_recalc ||
b_world.ptr.data != world_map)
{
light->type = LIGHT_BACKGROUND;
light->map_resolution = get_int(cworld, "sample_map_resolution");
light->shader = scene->default_background;
light->use_mis = sample_as_light;
int samples = get_int(cworld, "samples");
if(get_boolean(cscene, "use_square_samples"))
light->samples = samples * samples;
@@ -223,7 +235,7 @@ void BlenderSync::sync_background_light()
/* Object */
Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_ob,
Transform& tfm, uint layer_flag, float motion_time, bool hide_tris)
Transform& tfm, uint layer_flag, float motion_time, bool hide_tris, bool *use_portal)
{
BL::Object b_ob = (b_dupli_ob ? b_dupli_ob.object() : b_parent);
bool motion = motion_time != 0.0f;
@@ -232,7 +244,7 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
if(object_is_light(b_ob)) {
/* don't use lamps for excluded layers used as mask layer */
if(!motion && !((layer_flag & render_layer.holdout_layer) && (layer_flag & render_layer.exclude_layer)))
sync_light(b_parent, persistent_id, b_ob, tfm);
sync_light(b_parent, persistent_id, b_ob, tfm, use_portal);
return NULL;
}
@@ -356,7 +368,7 @@ Object *BlenderSync::sync_object(BL::Object b_parent, int persistent_id[OBJECT_P
object->random_id ^= hash_int(hash_string(b_parent.name().c_str()));
/* dupli texture coordinates */
if (b_dupli_ob) {
if(b_dupli_ob) {
object->dupli_generated = 0.5f*get_float3(b_dupli_ob.orco()) - make_float3(0.5f, 0.5f, 0.5f);
object->dupli_uv = get_float2(b_dupli_ob.uv());
}
@@ -476,6 +488,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, float motion_time)
int dupli_settings = preview ? 1 : 2;
bool cancel = false;
bool use_portal = false;
for(; b_sce && !cancel; b_sce = b_sce.background_set()) {
for(b_sce.object_bases.begin(b_base); b_base != b_sce.object_bases.end() && !cancel; ++b_base) {
@@ -506,7 +519,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, float motion_time)
BL::Array<int, OBJECT_PERSISTENT_ID_SIZE> persistent_id = b_dup->persistent_id();
/* sync object and mesh or light data */
Object *object = sync_object(b_ob, persistent_id.data, *b_dup, tfm, ob_layer, motion_time, hide_tris);
Object *object = sync_object(b_ob, persistent_id.data, *b_dup, tfm, ob_layer, motion_time, hide_tris, &use_portal);
/* sync possible particle data, note particle_id
* starts counting at 1, first is dummy particle */
@@ -526,7 +539,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, float motion_time)
if(!object_render_hide(b_ob, true, true, hide_tris)) {
/* object itself */
Transform tfm = get_transform(b_ob.matrix_world());
sync_object(b_ob, NULL, PointerRNA_NULL, tfm, ob_layer, motion_time, hide_tris);
sync_object(b_ob, NULL, PointerRNA_NULL, tfm, ob_layer, motion_time, hide_tris, &use_portal);
}
}
@@ -537,7 +550,7 @@ void BlenderSync::sync_objects(BL::SpaceView3D b_v3d, float motion_time)
progress.set_sync_status("");
if(!cancel && !motion) {
sync_background_light();
sync_background_light(use_portal);
/* handle removed data and modified pointers */
if(light_map.post_sync())

View File

@@ -76,7 +76,7 @@ bool BlenderSync::sync_dupli_particle(BL::Object b_ob, BL::DupliObject b_dup, Ob
psys->particles.push_back(pa);
if (object->particle_index != psys->particles.size() - 1)
if(object->particle_index != psys->particles.size() - 1)
scene->object_manager->tag_update(scene);
object->particle_system = psys;
object->particle_index = psys->particles.size() - 1;

View File

@@ -25,6 +25,7 @@
#include "util_md5.h"
#include "util_opengl.h"
#include "util_path.h"
#include "util_types.h"
#ifdef WITH_OSL
#include "osl.h"
@@ -70,11 +71,12 @@ static const char *PyC_UnicodeAsByte(PyObject *py_str, PyObject **coerce)
return "";
}
static PyObject *init_func(PyObject *self, PyObject *args)
static PyObject *init_func(PyObject * /*self*/, PyObject *args)
{
PyObject *path, *user_path;
int headless;
if(!PyArg_ParseTuple(args, "OO", &path, &user_path)) {
if(!PyArg_ParseTuple(args, "OOi", &path, &user_path, &headless)) {
return NULL;
}
@@ -84,16 +86,18 @@ static PyObject *init_func(PyObject *self, PyObject *args)
Py_XDECREF(path_coerce);
Py_XDECREF(user_path_coerce);
BlenderSession::headless = headless;
Py_RETURN_NONE;
}
static PyObject *create_func(PyObject *self, PyObject *args)
static PyObject *create_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pyengine, *pyuserpref, *pydata, *pyscene, *pyregion, *pyv3d, *pyrv3d;
int preview_osl, background;
int preview_osl;
if(!PyArg_ParseTuple(args, "OOOOOOOii", &pyengine, &pyuserpref, &pydata, &pyscene,
&pyregion, &pyv3d, &pyrv3d, &preview_osl, &background))
if(!PyArg_ParseTuple(args, "OOOOOOOi", &pyengine, &pyuserpref, &pydata, &pyscene,
&pyregion, &pyv3d, &pyrv3d, &preview_osl))
{
return NULL;
}
@@ -146,12 +150,6 @@ static PyObject *create_func(PyObject *self, PyObject *args)
RNA_boolean_set(&cscene, "use_progressive_refine", true);
}
/* Use more optimal tile order when rendering from the command line. */
if(background) {
PointerRNA cscene = RNA_pointer_get(&sceneptr, "cycles");
RNA_enum_set(&cscene, "tile_order", (int)TILE_BOTTOM_TO_TOP);
}
/* offline session or preview render */
session = new BlenderSession(engine, userpref, data, scene);
}
@@ -165,14 +163,14 @@ static PyObject *create_func(PyObject *self, PyObject *args)
return PyLong_FromVoidPtr(session);
}
static PyObject *free_func(PyObject *self, PyObject *value)
static PyObject *free_func(PyObject * /*self*/, PyObject *value)
{
delete (BlenderSession*)PyLong_AsVoidPtr(value);
Py_RETURN_NONE;
}
static PyObject *render_func(PyObject *self, PyObject *value)
static PyObject *render_func(PyObject * /*self*/, PyObject *value)
{
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
@@ -186,14 +184,14 @@ static PyObject *render_func(PyObject *self, PyObject *value)
}
/* pixel_array and result passed as pointers */
static PyObject *bake_func(PyObject *self, PyObject *args)
static PyObject *bake_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pysession, *pyobject;
PyObject *pypixel_array, *pyresult;
const char *pass_type;
int num_pixels, depth;
int num_pixels, depth, object_id;
if(!PyArg_ParseTuple(args, "OOsOiiO", &pysession, &pyobject, &pass_type, &pypixel_array, &num_pixels, &depth, &pyresult))
if(!PyArg_ParseTuple(args, "OOsiOiiO", &pysession, &pyobject, &pass_type, &object_id, &pypixel_array, &num_pixels, &depth, &pyresult))
return NULL;
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(pysession);
@@ -210,14 +208,14 @@ static PyObject *bake_func(PyObject *self, PyObject *args)
python_thread_state_save(&session->python_thread_state);
session->bake(b_object, pass_type, b_bake_pixel, (size_t)num_pixels, depth, (float *)b_result);
session->bake(b_object, pass_type, object_id, b_bake_pixel, (size_t)num_pixels, depth, (float *)b_result);
python_thread_state_restore(&session->python_thread_state);
Py_RETURN_NONE;
}
static PyObject *draw_func(PyObject *self, PyObject *args)
static PyObject *draw_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pysession, *pyv3d, *pyrv3d;
@@ -237,7 +235,7 @@ static PyObject *draw_func(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
static PyObject *reset_func(PyObject *self, PyObject *args)
static PyObject *reset_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pysession, *pydata, *pyscene;
@@ -263,7 +261,7 @@ static PyObject *reset_func(PyObject *self, PyObject *args)
Py_RETURN_NONE;
}
static PyObject *sync_func(PyObject *self, PyObject *value)
static PyObject *sync_func(PyObject * /*self*/, PyObject *value)
{
BlenderSession *session = (BlenderSession*)PyLong_AsVoidPtr(value);
@@ -276,7 +274,7 @@ static PyObject *sync_func(PyObject *self, PyObject *value)
Py_RETURN_NONE;
}
static PyObject *available_devices_func(PyObject *self, PyObject *args)
static PyObject *available_devices_func(PyObject * /*self*/, PyObject * /*args*/)
{
vector<DeviceInfo>& devices = Device::available_devices();
PyObject *ret = PyTuple_New(devices.size());
@@ -291,7 +289,7 @@ static PyObject *available_devices_func(PyObject *self, PyObject *args)
#ifdef WITH_OSL
static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args)
{
PyObject *pynodegroup, *pynode;
const char *filepath = NULL;
@@ -393,7 +391,7 @@ static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
/* find socket socket */
BL::NodeSocket b_sock(PointerRNA_NULL);
if (param->isoutput) {
if(param->isoutput) {
b_sock = b_node.outputs[param->name.string()];
/* remove if type no longer matches */
if(b_sock && b_sock.bl_idname() != socket_type) {
@@ -447,7 +445,7 @@ static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
removed = false;
for (b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
for(b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
if(used_sockets.find(b_input->ptr.data) == used_sockets.end()) {
b_node.inputs.remove(*b_input);
removed = true;
@@ -455,7 +453,7 @@ static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
}
}
for (b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
for(b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
if(used_sockets.find(b_output->ptr.data) == used_sockets.end()) {
b_node.outputs.remove(*b_output);
removed = true;
@@ -467,7 +465,7 @@ static PyObject *osl_update_node_func(PyObject *self, PyObject *args)
Py_RETURN_TRUE;
}
static PyObject *osl_compile_func(PyObject *self, PyObject *args)
static PyObject *osl_compile_func(PyObject * /*self*/, PyObject *args)
{
const char *inputfile = NULL, *outputfile = NULL;
@@ -482,7 +480,7 @@ static PyObject *osl_compile_func(PyObject *self, PyObject *args)
}
#endif
static PyObject *system_info_func(PyObject *self, PyObject *value)
static PyObject *system_info_func(PyObject * /*self*/, PyObject * /*value*/)
{
string system_info = Device::device_capabilities();
return PyUnicode_FromString(system_info.c_str());

View File

@@ -41,6 +41,8 @@
CCL_NAMESPACE_BEGIN
bool BlenderSession::headless = false;
BlenderSession::BlenderSession(BL::RenderEngine b_engine_, BL::UserPreferences b_userpref_,
BL::BlendData b_data_, BL::Scene b_scene_)
: b_engine(b_engine_), b_userpref(b_userpref_), b_data(b_data_), b_render(b_engine_.render()), b_scene(b_scene_),
@@ -131,7 +133,7 @@ void BlenderSession::create_session()
}
/* set buffer parameters */
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
session->reset(buffer_params, session_params.samples);
b_engine.use_highlight_tiles(session_params.progressive_refine == false);
@@ -184,7 +186,7 @@ void BlenderSession::reset_session(BL::BlendData b_data_, BL::Scene b_scene_)
sync->sync_integrator();
sync->sync_camera(b_render, b_engine.camera_override(), width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, PointerRNA_NULL, PointerRNA_NULL, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, PointerRNA_NULL, PointerRNA_NULL, scene->camera, width, height);
session->reset(buffer_params, session_params.samples);
b_engine.use_highlight_tiles(session_params.progressive_refine == false);
@@ -329,9 +331,9 @@ static ShaderEvalType get_shader_type(const string& pass_type)
return SHADER_EVAL_BAKE;
}
static BL::RenderResult begin_render_result(BL::RenderEngine b_engine, int x, int y, int w, int h, const char *layername)
static BL::RenderResult begin_render_result(BL::RenderEngine b_engine, int x, int y, int w, int h, const char *layername, const char *viewname)
{
return b_engine.begin_result(x, y, w, h, layername);
return b_engine.begin_result(x, y, w, h, layername, viewname);
}
static void end_render_result(BL::RenderEngine b_engine, BL::RenderResult b_rr, bool cancel, bool do_merge_results)
@@ -348,10 +350,10 @@ void BlenderSession::do_write_update_render_tile(RenderTile& rtile, bool do_upda
int h = params.height;
/* get render result */
BL::RenderResult b_rr = begin_render_result(b_engine, x, y, w, h, b_rlay_name.c_str());
BL::RenderResult b_rr = begin_render_result(b_engine, x, y, w, h, b_rlay_name.c_str(), b_rview_name.c_str());
/* can happen if the intersected rectangle gives 0 width or height */
if (b_rr.ptr.data == NULL) {
if(b_rr.ptr.data == NULL) {
return;
}
@@ -364,10 +366,10 @@ void BlenderSession::do_write_update_render_tile(RenderTile& rtile, bool do_upda
BL::RenderLayer b_rlay = *b_single_rlay;
if (do_update_only) {
if(do_update_only) {
/* update only needed */
if (rtile.sample != 0) {
if(rtile.sample != 0) {
/* sample would be zero at initial tile update, which is only needed
* to tag tile form blender side as IN PROGRESS for proper highlight
* no buffers should be sent to blender yet
@@ -395,7 +397,7 @@ void BlenderSession::update_render_tile(RenderTile& rtile)
* be updated in blender side
* would need to be investigated a bit further, but for now shall be fine
*/
if (!b_engine.is_preview())
if(!b_engine.is_preview())
do_write_update_render_tile(rtile, true);
else
do_write_update_render_tile(rtile, false);
@@ -409,17 +411,18 @@ void BlenderSession::render()
/* get buffer parameters */
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
/* render each layer */
BL::RenderSettings r = b_scene.render();
BL::RenderSettings::layers_iterator b_iter;
BL::RenderSettings::layers_iterator b_layer_iter;
BL::RenderResult::views_iterator b_view_iter;
for(r.layers.begin(b_iter); b_iter != r.layers.end(); ++b_iter) {
b_rlay_name = b_iter->name();
for(r.layers.begin(b_layer_iter); b_layer_iter != r.layers.end(); ++b_layer_iter) {
b_rlay_name = b_layer_iter->name();
/* temporary render result to find needed passes */
BL::RenderResult b_rr = begin_render_result(b_engine, 0, 0, 1, 1, b_rlay_name.c_str());
/* temporary render result to find needed passes and views */
BL::RenderResult b_rr = begin_render_result(b_engine, 0, 0, 1, 1, b_rlay_name.c_str(), NULL);
BL::RenderResult::layers_iterator b_single_rlay;
b_rr.layers.begin(b_single_rlay);
@@ -454,39 +457,49 @@ void BlenderSession::render()
}
}
/* free result without merging */
end_render_result(b_engine, b_rr, true, false);
buffer_params.passes = passes;
scene->film->pass_alpha_threshold = b_iter->pass_alpha_threshold();
scene->film->pass_alpha_threshold = b_layer_iter->pass_alpha_threshold();
scene->film->tag_passes_update(scene, passes);
scene->film->tag_update(scene);
scene->integrator->tag_update(scene);
/* update scene */
sync->sync_camera(b_render, b_engine.camera_override(), width, height);
sync->sync_data(b_v3d, b_engine.camera_override(), &python_thread_state, b_rlay_name.c_str());
for(b_rr.views.begin(b_view_iter); b_view_iter != b_rr.views.end(); ++b_view_iter) {
b_rview_name = b_view_iter->name();
/* update number of samples per layer */
int samples = sync->get_layer_samples();
bool bound_samples = sync->get_layer_bound_samples();
/* set the current view */
b_engine.active_view_set(b_rview_name.c_str());
if(samples != 0 && (!bound_samples || (samples < session_params.samples)))
session->reset(buffer_params, samples);
else
session->reset(buffer_params, session_params.samples);
/* update scene */
sync->sync_camera(b_render, b_engine.camera_override(), width, height);
sync->sync_data(b_v3d, b_engine.camera_override(), &python_thread_state, b_rlay_name.c_str());
/* render */
session->start();
session->wait();
/* update number of samples per layer */
int samples = sync->get_layer_samples();
bool bound_samples = sync->get_layer_bound_samples();
if(samples != 0 && (!bound_samples || (samples < session_params.samples)))
session->reset(buffer_params, samples);
else
session->reset(buffer_params, session_params.samples);
/* render */
session->start();
session->wait();
if(session->progress.get_cancel())
break;
}
/* free result without merging */
end_render_result(b_engine, b_rr, true, false);
if(session->progress.get_cancel())
break;
}
/* clear callback */
session->write_render_tile_cb = NULL;
session->update_render_tile_cb = NULL;
session->write_render_tile_cb = function_null;
session->update_render_tile_cb = function_null;
/* free all memory used (host and device), so we wouldn't leave render
* engine with extra memory allocated
@@ -498,18 +511,22 @@ void BlenderSession::render()
sync = NULL;
}
static void populate_bake_data(BakeData *data, BL::BakePixel pixel_array, const int num_pixels)
static void populate_bake_data(BakeData *data, const int object_id, BL::BakePixel pixel_array, const int num_pixels)
{
BL::BakePixel bp = pixel_array;
int i;
for(i=0; i < num_pixels; i++) {
data->set(i, bp.primitive_id(), bp.uv(), bp.du_dx(), bp.du_dy(), bp.dv_dx(), bp.dv_dy());
if(bp.object_id() == object_id) {
data->set(i, bp.primitive_id(), bp.uv(), bp.du_dx(), bp.du_dy(), bp.dv_dx(), bp.dv_dy());
} else {
data->set_null(i);
}
bp = bp.next();
}
}
void BlenderSession::bake(BL::Object b_object, const string& pass_type, BL::BakePixel pixel_array, const size_t num_pixels, const int depth, float result[])
void BlenderSession::bake(BL::Object b_object, const string& pass_type, const int object_id, BL::BakePixel pixel_array, const size_t num_pixels, const int /*depth*/, float result[])
{
ShaderEvalType shader_type = get_shader_type(pass_type);
size_t object_index = OBJECT_NONE;
@@ -541,7 +558,7 @@ void BlenderSession::bake(BL::Object b_object, const string& pass_type, BL::Bake
/* get buffer parameters */
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
scene->bake_manager->set_shader_limit((size_t)b_engine.tile_x(), (size_t)b_engine.tile_y());
scene->bake_manager->set_baking(true);
@@ -565,7 +582,7 @@ void BlenderSession::bake(BL::Object b_object, const string& pass_type, BL::Bake
BakeData *bake_data = scene->bake_manager->init(object, tri_offset, num_pixels);
populate_bake_data(bake_data, pixel_array, num_pixels);
populate_bake_data(bake_data, object_id, pixel_array, num_pixels);
/* set number of samples */
session->tile_manager.set_samples(session_params.samples);
@@ -599,7 +616,7 @@ void BlenderSession::do_write_update_render_result(BL::RenderResult b_rr, BL::Re
vector<float> pixels(params.width*params.height*4);
if (!do_update_only) {
if(!do_update_only) {
/* copy each pass */
BL::RenderLayer::passes_iterator b_iter;
@@ -617,10 +634,12 @@ void BlenderSession::do_write_update_render_result(BL::RenderResult b_rr, BL::Re
b_pass.rect(&pixels[0]);
}
}
/* copy combined pass */
if(buffers->get_pass_rect(PASS_COMBINED, exposure, rtile.sample, 4, &pixels[0]))
b_rlay.rect(&pixels[0]);
else {
/* copy combined pass */
BL::RenderPass b_combined_pass(b_rlay.passes.find_by_type(BL::RenderPass::type_COMBINED, b_rview_name.c_str()));
if(buffers->get_pass_rect(PASS_COMBINED, exposure, rtile.sample, 4, &pixels[0]))
b_combined_pass.rect(&pixels[0]);
}
/* tag result as updated */
b_engine.update_result(b_rr);
@@ -690,7 +709,7 @@ void BlenderSession::synchronize()
/* reset if needed */
if(scene->need_reset()) {
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
session->reset(buffer_params, session_params.samples);
/* reset time */
@@ -745,7 +764,7 @@ bool BlenderSession::draw(int w, int h)
/* reset if requested */
if(reset) {
SessionParams session_params = BlenderSync::get_session_params(b_engine, b_userpref, b_scene, background);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
bool session_pause = BlenderSync::get_session_pause(b_scene, background);
if(session_pause == false) {
@@ -762,7 +781,7 @@ bool BlenderSession::draw(int w, int h)
update_status_progress();
/* draw */
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_scene, b_v3d, b_rv3d, scene->camera, width, height);
BufferParams buffer_params = BlenderSync::get_buffer_params(b_render, b_v3d, b_rv3d, scene->camera, width, height);
DeviceDrawParams draw_params;
if(session->params.display_buffer_linear) {
@@ -839,6 +858,9 @@ void BlenderSession::update_status_progress()
scene += " | " + b_scene.name();
if(b_rlay_name != "")
scene += ", " + b_rlay_name;
if(b_rview_name != "")
scene += ", " + b_rview_name;
}
else {
BLI_timestr(total_time, time_str, sizeof(time_str));
@@ -867,7 +889,7 @@ void BlenderSession::update_status_progress()
last_progress = progress;
}
if (session->progress.get_error()) {
if(session->progress.get_error()) {
string error = session->progress.get_error_message();
if(error != last_error) {
/* TODO(sergey): Currently C++ RNA API doesn't let us to
@@ -998,18 +1020,19 @@ bool BlenderSession::builtin_image_pixels(const string &builtin_name, void *buil
unsigned char *image_pixels;
image_pixels = image_get_pixels_for_frame(b_image, frame);
size_t num_pixels = ((size_t)width) * height;
if(image_pixels) {
memcpy(pixels, image_pixels, width * height * channels * sizeof(unsigned char));
memcpy(pixels, image_pixels, num_pixels * channels * sizeof(unsigned char));
MEM_freeN(image_pixels);
}
else {
if(channels == 1) {
memset(pixels, 0, width * height * sizeof(unsigned char));
memset(pixels, 0, num_pixels * sizeof(unsigned char));
}
else {
unsigned char *cp = pixels;
for(int i = 0; i < width * height; i++, cp += channels) {
for(size_t i = 0; i < num_pixels; i++, cp += channels) {
cp[0] = 255;
cp[1] = 0;
cp[2] = 255;
@@ -1021,7 +1044,7 @@ bool BlenderSession::builtin_image_pixels(const string &builtin_name, void *buil
/* premultiply, byte images are always straight for blender */
unsigned char *cp = pixels;
for(int i = 0; i < width * height; i++, cp += channels) {
for(size_t i = 0; i < num_pixels; i++, cp += channels) {
cp[0] = (cp[0] * cp[3]) >> 8;
cp[1] = (cp[1] * cp[3]) >> 8;
cp[2] = (cp[2] * cp[3]) >> 8;
@@ -1050,18 +1073,19 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, void
float *image_pixels;
image_pixels = image_get_float_pixels_for_frame(b_image, frame);
size_t num_pixels = ((size_t)width) * height;
if(image_pixels) {
memcpy(pixels, image_pixels, width * height * channels * sizeof(float));
memcpy(pixels, image_pixels, num_pixels * channels * sizeof(float));
MEM_freeN(image_pixels);
}
else {
if(channels == 1) {
memset(pixels, 0, width * height * sizeof(float));
memset(pixels, 0, num_pixels * sizeof(float));
}
else {
float *fp = pixels;
for(int i = 0; i < width * height; i++, fp += channels) {
for(int i = 0; i < num_pixels; i++, fp += channels) {
fp[0] = 1.0f;
fp[1] = 0.0f;
fp[2] = 1.0f;
@@ -1087,11 +1111,12 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, void
int width = resolution.x * amplify;
int height = resolution.y * amplify;
int depth = resolution.z * amplify;
size_t num_pixels = ((size_t)width) * height * depth;
if(builtin_name == Attribute::standard_name(ATTR_STD_VOLUME_DENSITY)) {
SmokeDomainSettings_density_grid_get_length(&b_domain.ptr, &length);
if(length == width*height*depth) {
if(length == num_pixels) {
SmokeDomainSettings_density_grid_get(&b_domain.ptr, pixels);
return true;
}
@@ -1101,7 +1126,7 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, void
* as 1500..3000 K with the first part faded to zero density */
SmokeDomainSettings_flame_grid_get_length(&b_domain.ptr, &length);
if(length == width*height*depth) {
if(length == num_pixels) {
SmokeDomainSettings_flame_grid_get(&b_domain.ptr, pixels);
return true;
}
@@ -1110,7 +1135,7 @@ bool BlenderSession::builtin_image_float_pixels(const string &builtin_name, void
/* the RGB is "premultiplied" by density for better interpolation results */
SmokeDomainSettings_color_grid_get_length(&b_domain.ptr, &length);
if(length == width*height*depth*4) {
if(length == num_pixels*4) {
SmokeDomainSettings_color_grid_get(&b_domain.ptr, pixels);
return true;
}

View File

@@ -52,7 +52,7 @@ public:
/* offline render */
void render();
void bake(BL::Object b_object, const string& pass_type, BL::BakePixel pixel_array, const size_t num_pixels, const int depth, float pixels[]);
void bake(BL::Object b_object, const string& pass_type, const int object_id, BL::BakePixel pixel_array, const size_t num_pixels, const int depth, float pixels[]);
void write_render_result(BL::RenderResult b_rr, BL::RenderLayer b_rlay, RenderTile& rtile);
void write_render_tile(RenderTile& rtile);
@@ -76,6 +76,7 @@ public:
void update_bake_progress();
bool background;
static bool headless;
Session *session;
Scene *scene;
BlenderSync *sync;
@@ -89,6 +90,7 @@ public:
BL::SpaceView3D b_v3d;
BL::RegionView3D b_rv3d;
string b_rlay_name;
string b_rview_name;
string last_status;
string last_error;

View File

@@ -106,7 +106,7 @@ static ShaderSocketType convert_socket_type(BL::NodeSocket b_socket)
}
}
static void set_default_value(ShaderInput *input, BL::Node b_node, BL::NodeSocket b_sock, BL::BlendData b_data, BL::ID b_id)
static void set_default_value(ShaderInput *input, BL::NodeSocket b_sock, BL::BlendData b_data, BL::ID b_id)
{
/* copy values for non linked inputs */
switch(input->type) {
@@ -179,53 +179,59 @@ static bool is_output_node(BL::Node b_node)
|| b_node.is_a(&RNA_ShaderNodeOutputLamp));
}
static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, ShaderGraph *graph, BL::ShaderNodeTree b_ntree, BL::ShaderNode b_node)
static ShaderNode *add_node(Scene *scene,
BL::RenderEngine b_engine,
BL::BlendData b_data,
BL::Scene b_scene,
ShaderGraph *graph,
BL::ShaderNodeTree b_ntree,
BL::ShaderNode b_node)
{
ShaderNode *node = NULL;
/* existing blender nodes */
if (b_node.is_a(&RNA_ShaderNodeRGBCurve)) {
if(b_node.is_a(&RNA_ShaderNodeRGBCurve)) {
BL::ShaderNodeRGBCurve b_curve_node(b_node);
RGBCurvesNode *curves = new RGBCurvesNode();
curvemapping_color_to_array(b_curve_node.mapping(), curves->curves, RAMP_TABLE_SIZE, true);
node = curves;
}
if (b_node.is_a(&RNA_ShaderNodeVectorCurve)) {
if(b_node.is_a(&RNA_ShaderNodeVectorCurve)) {
BL::ShaderNodeVectorCurve b_curve_node(b_node);
VectorCurvesNode *curves = new VectorCurvesNode();
curvemapping_color_to_array(b_curve_node.mapping(), curves->curves, RAMP_TABLE_SIZE, false);
node = curves;
}
else if (b_node.is_a(&RNA_ShaderNodeValToRGB)) {
else if(b_node.is_a(&RNA_ShaderNodeValToRGB)) {
RGBRampNode *ramp = new RGBRampNode();
BL::ShaderNodeValToRGB b_ramp_node(b_node);
colorramp_to_array(b_ramp_node.color_ramp(), ramp->ramp, RAMP_TABLE_SIZE);
ramp->interpolate = b_ramp_node.color_ramp().interpolation() != BL::ColorRamp::interpolation_CONSTANT;
node = ramp;
}
else if (b_node.is_a(&RNA_ShaderNodeRGB)) {
else if(b_node.is_a(&RNA_ShaderNodeRGB)) {
ColorNode *color = new ColorNode();
color->value = get_node_output_rgba(b_node, "Color");
node = color;
}
else if (b_node.is_a(&RNA_ShaderNodeValue)) {
else if(b_node.is_a(&RNA_ShaderNodeValue)) {
ValueNode *value = new ValueNode();
value->value = get_node_output_value(b_node, "Value");
node = value;
}
else if (b_node.is_a(&RNA_ShaderNodeCameraData)) {
else if(b_node.is_a(&RNA_ShaderNodeCameraData)) {
node = new CameraNode();
}
else if (b_node.is_a(&RNA_ShaderNodeInvert)) {
else if(b_node.is_a(&RNA_ShaderNodeInvert)) {
node = new InvertNode();
}
else if (b_node.is_a(&RNA_ShaderNodeGamma)) {
else if(b_node.is_a(&RNA_ShaderNodeGamma)) {
node = new GammaNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBrightContrast)) {
else if(b_node.is_a(&RNA_ShaderNodeBrightContrast)) {
node = new BrightContrastNode();
}
else if (b_node.is_a(&RNA_ShaderNodeMixRGB)) {
else if(b_node.is_a(&RNA_ShaderNodeMixRGB)) {
BL::ShaderNodeMixRGB b_mix_node(b_node);
MixNode *mix = new MixNode();
mix->type = MixNode::type_enum[b_mix_node.blend_type()];
@@ -236,44 +242,44 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
mix->use_clamp = b_mix_node.use_clamp();
node = mix;
}
else if (b_node.is_a(&RNA_ShaderNodeSeparateRGB)) {
else if(b_node.is_a(&RNA_ShaderNodeSeparateRGB)) {
node = new SeparateRGBNode();
}
else if (b_node.is_a(&RNA_ShaderNodeCombineRGB)) {
else if(b_node.is_a(&RNA_ShaderNodeCombineRGB)) {
node = new CombineRGBNode();
}
else if (b_node.is_a(&RNA_ShaderNodeSeparateHSV)) {
else if(b_node.is_a(&RNA_ShaderNodeSeparateHSV)) {
node = new SeparateHSVNode();
}
else if (b_node.is_a(&RNA_ShaderNodeCombineHSV)) {
else if(b_node.is_a(&RNA_ShaderNodeCombineHSV)) {
node = new CombineHSVNode();
}
else if (b_node.is_a(&RNA_ShaderNodeSeparateXYZ)) {
else if(b_node.is_a(&RNA_ShaderNodeSeparateXYZ)) {
node = new SeparateXYZNode();
}
else if (b_node.is_a(&RNA_ShaderNodeCombineXYZ)) {
else if(b_node.is_a(&RNA_ShaderNodeCombineXYZ)) {
node = new CombineXYZNode();
}
else if (b_node.is_a(&RNA_ShaderNodeHueSaturation)) {
else if(b_node.is_a(&RNA_ShaderNodeHueSaturation)) {
node = new HSVNode();
}
else if (b_node.is_a(&RNA_ShaderNodeRGBToBW)) {
else if(b_node.is_a(&RNA_ShaderNodeRGBToBW)) {
node = new ConvertNode(SHADER_SOCKET_COLOR, SHADER_SOCKET_FLOAT);
}
else if (b_node.is_a(&RNA_ShaderNodeMath)) {
else if(b_node.is_a(&RNA_ShaderNodeMath)) {
BL::ShaderNodeMath b_math_node(b_node);
MathNode *math = new MathNode();
math->type = MathNode::type_enum[b_math_node.operation()];
math->use_clamp = b_math_node.use_clamp();
node = math;
}
else if (b_node.is_a(&RNA_ShaderNodeVectorMath)) {
else if(b_node.is_a(&RNA_ShaderNodeVectorMath)) {
BL::ShaderNodeVectorMath b_vector_math_node(b_node);
VectorMathNode *vmath = new VectorMathNode();
vmath->type = VectorMathNode::type_enum[b_vector_math_node.operation()];
node = vmath;
}
else if (b_node.is_a(&RNA_ShaderNodeVectorTransform)) {
else if(b_node.is_a(&RNA_ShaderNodeVectorTransform)) {
BL::ShaderNodeVectorTransform b_vector_transform_node(b_node);
VectorTransformNode *vtransform = new VectorTransformNode();
vtransform->type = VectorTransformNode::type_enum[b_vector_transform_node.type()];
@@ -281,7 +287,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
vtransform->convert_to = VectorTransformNode::convert_space_enum[b_vector_transform_node.convert_to()];
node = vtransform;
}
else if (b_node.is_a(&RNA_ShaderNodeNormal)) {
else if(b_node.is_a(&RNA_ShaderNodeNormal)) {
BL::Node::outputs_iterator out_it;
b_node.outputs.begin(out_it);
@@ -289,7 +295,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
norm->direction = get_node_output_vector(b_node, "Normal");
node = norm;
}
else if (b_node.is_a(&RNA_ShaderNodeMapping)) {
else if(b_node.is_a(&RNA_ShaderNodeMapping)) {
BL::ShaderNodeMapping b_mapping_node(b_node);
MappingNode *mapping = new MappingNode();
@@ -297,31 +303,31 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
node = mapping;
}
else if (b_node.is_a(&RNA_ShaderNodeFresnel)) {
else if(b_node.is_a(&RNA_ShaderNodeFresnel)) {
node = new FresnelNode();
}
else if (b_node.is_a(&RNA_ShaderNodeLayerWeight)) {
else if(b_node.is_a(&RNA_ShaderNodeLayerWeight)) {
node = new LayerWeightNode();
}
else if (b_node.is_a(&RNA_ShaderNodeAddShader)) {
else if(b_node.is_a(&RNA_ShaderNodeAddShader)) {
node = new AddClosureNode();
}
else if (b_node.is_a(&RNA_ShaderNodeMixShader)) {
else if(b_node.is_a(&RNA_ShaderNodeMixShader)) {
node = new MixClosureNode();
}
else if (b_node.is_a(&RNA_ShaderNodeAttribute)) {
else if(b_node.is_a(&RNA_ShaderNodeAttribute)) {
BL::ShaderNodeAttribute b_attr_node(b_node);
AttributeNode *attr = new AttributeNode();
attr->attribute = b_attr_node.attribute_name();
node = attr;
}
else if (b_node.is_a(&RNA_ShaderNodeBackground)) {
else if(b_node.is_a(&RNA_ShaderNodeBackground)) {
node = new BackgroundNode();
}
else if (b_node.is_a(&RNA_ShaderNodeHoldout)) {
else if(b_node.is_a(&RNA_ShaderNodeHoldout)) {
node = new HoldoutNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfAnisotropic)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfAnisotropic)) {
BL::ShaderNodeBsdfAnisotropic b_aniso_node(b_node);
AnisotropicBsdfNode *aniso = new AnisotropicBsdfNode();
@@ -340,10 +346,10 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
node = aniso;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfDiffuse)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfDiffuse)) {
node = new DiffuseBsdfNode();
}
else if (b_node.is_a(&RNA_ShaderNodeSubsurfaceScattering)) {
else if(b_node.is_a(&RNA_ShaderNodeSubsurfaceScattering)) {
BL::ShaderNodeSubsurfaceScattering b_subsurface_node(b_node);
SubsurfaceScatteringNode *subsurface = new SubsurfaceScatteringNode();
@@ -359,7 +365,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
node = subsurface;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfGlossy)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfGlossy)) {
BL::ShaderNodeBsdfGlossy b_glossy_node(b_node);
GlossyBsdfNode *glossy = new GlossyBsdfNode();
@@ -379,7 +385,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = glossy;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfGlass)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfGlass)) {
BL::ShaderNodeBsdfGlass b_glass_node(b_node);
GlassBsdfNode *glass = new GlassBsdfNode();
switch(b_glass_node.distribution()) {
@@ -395,7 +401,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = glass;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfRefraction)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfRefraction)) {
BL::ShaderNodeBsdfRefraction b_refraction_node(b_node);
RefractionBsdfNode *refraction = new RefractionBsdfNode();
switch(b_refraction_node.distribution()) {
@@ -411,7 +417,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = refraction;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfToon)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfToon)) {
BL::ShaderNodeBsdfToon b_toon_node(b_node);
ToonBsdfNode *toon = new ToonBsdfNode();
switch(b_toon_node.component()) {
@@ -424,7 +430,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = toon;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfHair)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfHair)) {
BL::ShaderNodeBsdfHair b_hair_node(b_node);
HairBsdfNode *hair = new HairBsdfNode();
switch(b_hair_node.component()) {
@@ -437,64 +443,64 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = hair;
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfTranslucent)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfTranslucent)) {
node = new TranslucentBsdfNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfTransparent)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfTransparent)) {
node = new TransparentBsdfNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBsdfVelvet)) {
else if(b_node.is_a(&RNA_ShaderNodeBsdfVelvet)) {
node = new VelvetBsdfNode();
}
else if (b_node.is_a(&RNA_ShaderNodeEmission)) {
else if(b_node.is_a(&RNA_ShaderNodeEmission)) {
node = new EmissionNode();
}
else if (b_node.is_a(&RNA_ShaderNodeAmbientOcclusion)) {
else if(b_node.is_a(&RNA_ShaderNodeAmbientOcclusion)) {
node = new AmbientOcclusionNode();
}
else if (b_node.is_a(&RNA_ShaderNodeVolumeScatter)) {
else if(b_node.is_a(&RNA_ShaderNodeVolumeScatter)) {
node = new ScatterVolumeNode();
}
else if (b_node.is_a(&RNA_ShaderNodeVolumeAbsorption)) {
else if(b_node.is_a(&RNA_ShaderNodeVolumeAbsorption)) {
node = new AbsorptionVolumeNode();
}
else if (b_node.is_a(&RNA_ShaderNodeNewGeometry)) {
else if(b_node.is_a(&RNA_ShaderNodeNewGeometry)) {
node = new GeometryNode();
}
else if (b_node.is_a(&RNA_ShaderNodeWireframe)) {
else if(b_node.is_a(&RNA_ShaderNodeWireframe)) {
BL::ShaderNodeWireframe b_wireframe_node(b_node);
WireframeNode *wire = new WireframeNode();
wire->use_pixel_size = b_wireframe_node.use_pixel_size();
node = wire;
}
else if (b_node.is_a(&RNA_ShaderNodeWavelength)) {
else if(b_node.is_a(&RNA_ShaderNodeWavelength)) {
node = new WavelengthNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBlackbody)) {
else if(b_node.is_a(&RNA_ShaderNodeBlackbody)) {
node = new BlackbodyNode();
}
else if (b_node.is_a(&RNA_ShaderNodeLightPath)) {
else if(b_node.is_a(&RNA_ShaderNodeLightPath)) {
node = new LightPathNode();
}
else if (b_node.is_a(&RNA_ShaderNodeLightFalloff)) {
else if(b_node.is_a(&RNA_ShaderNodeLightFalloff)) {
node = new LightFalloffNode();
}
else if (b_node.is_a(&RNA_ShaderNodeObjectInfo)) {
else if(b_node.is_a(&RNA_ShaderNodeObjectInfo)) {
node = new ObjectInfoNode();
}
else if (b_node.is_a(&RNA_ShaderNodeParticleInfo)) {
else if(b_node.is_a(&RNA_ShaderNodeParticleInfo)) {
node = new ParticleInfoNode();
}
else if (b_node.is_a(&RNA_ShaderNodeHairInfo)) {
else if(b_node.is_a(&RNA_ShaderNodeHairInfo)) {
node = new HairInfoNode();
}
else if (b_node.is_a(&RNA_ShaderNodeBump)) {
else if(b_node.is_a(&RNA_ShaderNodeBump)) {
BL::ShaderNodeBump b_bump_node(b_node);
BumpNode *bump = new BumpNode();
bump->invert = b_bump_node.invert();
node = bump;
}
else if (b_node.is_a(&RNA_ShaderNodeScript)) {
else if(b_node.is_a(&RNA_ShaderNodeScript)) {
#ifdef WITH_OSL
if(scene->shader_manager->use_osl()) {
/* create script node */
@@ -510,16 +516,16 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
* Socket names must be stored in the extra lists instead. */
BL::Node::inputs_iterator b_input;
for (b_script_node.inputs.begin(b_input); b_input != b_script_node.inputs.end(); ++b_input) {
for(b_script_node.inputs.begin(b_input); b_input != b_script_node.inputs.end(); ++b_input) {
script_node->input_names.push_back(ustring(b_input->name()));
ShaderInput *input = script_node->add_input(script_node->input_names.back().c_str(),
convert_socket_type(*b_input));
set_default_value(input, b_node, *b_input, b_data, b_ntree);
set_default_value(input, *b_input, b_data, b_ntree);
}
BL::Node::outputs_iterator b_output;
for (b_script_node.outputs.begin(b_output); b_output != b_script_node.outputs.end(); ++b_output) {
for(b_script_node.outputs.begin(b_output); b_output != b_script_node.outputs.end(); ++b_output) {
script_node->output_names.push_back(ustring(b_output->name()));
script_node->add_output(script_node->output_names.back().c_str(),
convert_socket_type(*b_output));
@@ -543,9 +549,12 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
node = script_node;
}
#else
(void)b_data;
(void)b_ntree;
#endif
}
else if (b_node.is_a(&RNA_ShaderNodeTexImage)) {
else if(b_node.is_a(&RNA_ShaderNodeTexImage)) {
BL::ShaderNodeTexImage b_image_node(b_node);
BL::Image b_image(b_image_node.image());
ImageTextureNode *image = new ImageTextureNode();
@@ -555,7 +564,8 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
*/
bool is_builtin = b_image.packed_file() ||
b_image.source() == BL::Image::source_GENERATED ||
b_image.source() == BL::Image::source_MOVIE;
b_image.source() == BL::Image::source_MOVIE ||
b_engine.is_preview();
if(is_builtin) {
/* for builtin images we're using image datablock name to find an image to
@@ -578,7 +588,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
image->use_alpha = b_image.use_alpha();
/* TODO(sergey): Does not work properly when we change builtin type. */
if (b_image.is_updated()) {
if(b_image.is_updated()) {
scene->image_manager->tag_reload_image(image->filename,
image->builtin_data,
(InterpolationType)b_image_node.interpolation());
@@ -591,14 +601,15 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
get_tex_mapping(&image->tex_mapping, b_image_node.texture_mapping());
node = image;
}
else if (b_node.is_a(&RNA_ShaderNodeTexEnvironment)) {
else if(b_node.is_a(&RNA_ShaderNodeTexEnvironment)) {
BL::ShaderNodeTexEnvironment b_env_node(b_node);
BL::Image b_image(b_env_node.image());
EnvironmentTextureNode *env = new EnvironmentTextureNode();
if(b_image) {
bool is_builtin = b_image.packed_file() ||
b_image.source() == BL::Image::source_GENERATED ||
b_image.source() == BL::Image::source_MOVIE;
b_image.source() == BL::Image::source_MOVIE ||
b_engine.is_preview();
if(is_builtin) {
int scene_frame = b_scene.frame_current();
@@ -615,7 +626,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
env->use_alpha = b_image.use_alpha();
/* TODO(sergey): Does not work properly when we change builtin type. */
if (b_image.is_updated()) {
if(b_image.is_updated()) {
scene->image_manager->tag_reload_image(env->filename,
env->builtin_data,
INTERPOLATION_LINEAR);
@@ -626,41 +637,41 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
get_tex_mapping(&env->tex_mapping, b_env_node.texture_mapping());
node = env;
}
else if (b_node.is_a(&RNA_ShaderNodeTexGradient)) {
else if(b_node.is_a(&RNA_ShaderNodeTexGradient)) {
BL::ShaderNodeTexGradient b_gradient_node(b_node);
GradientTextureNode *gradient = new GradientTextureNode();
gradient->type = GradientTextureNode::type_enum[(int)b_gradient_node.gradient_type()];
get_tex_mapping(&gradient->tex_mapping, b_gradient_node.texture_mapping());
node = gradient;
}
else if (b_node.is_a(&RNA_ShaderNodeTexVoronoi)) {
else if(b_node.is_a(&RNA_ShaderNodeTexVoronoi)) {
BL::ShaderNodeTexVoronoi b_voronoi_node(b_node);
VoronoiTextureNode *voronoi = new VoronoiTextureNode();
voronoi->coloring = VoronoiTextureNode::coloring_enum[(int)b_voronoi_node.coloring()];
get_tex_mapping(&voronoi->tex_mapping, b_voronoi_node.texture_mapping());
node = voronoi;
}
else if (b_node.is_a(&RNA_ShaderNodeTexMagic)) {
else if(b_node.is_a(&RNA_ShaderNodeTexMagic)) {
BL::ShaderNodeTexMagic b_magic_node(b_node);
MagicTextureNode *magic = new MagicTextureNode();
magic->depth = b_magic_node.turbulence_depth();
get_tex_mapping(&magic->tex_mapping, b_magic_node.texture_mapping());
node = magic;
}
else if (b_node.is_a(&RNA_ShaderNodeTexWave)) {
else if(b_node.is_a(&RNA_ShaderNodeTexWave)) {
BL::ShaderNodeTexWave b_wave_node(b_node);
WaveTextureNode *wave = new WaveTextureNode();
wave->type = WaveTextureNode::type_enum[(int)b_wave_node.wave_type()];
get_tex_mapping(&wave->tex_mapping, b_wave_node.texture_mapping());
node = wave;
}
else if (b_node.is_a(&RNA_ShaderNodeTexChecker)) {
else if(b_node.is_a(&RNA_ShaderNodeTexChecker)) {
BL::ShaderNodeTexChecker b_checker_node(b_node);
CheckerTextureNode *checker = new CheckerTextureNode();
get_tex_mapping(&checker->tex_mapping, b_checker_node.texture_mapping());
node = checker;
}
else if (b_node.is_a(&RNA_ShaderNodeTexBrick)) {
else if(b_node.is_a(&RNA_ShaderNodeTexBrick)) {
BL::ShaderNodeTexBrick b_brick_node(b_node);
BrickTextureNode *brick = new BrickTextureNode();
brick->offset = b_brick_node.offset();
@@ -670,20 +681,20 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
get_tex_mapping(&brick->tex_mapping, b_brick_node.texture_mapping());
node = brick;
}
else if (b_node.is_a(&RNA_ShaderNodeTexNoise)) {
else if(b_node.is_a(&RNA_ShaderNodeTexNoise)) {
BL::ShaderNodeTexNoise b_noise_node(b_node);
NoiseTextureNode *noise = new NoiseTextureNode();
get_tex_mapping(&noise->tex_mapping, b_noise_node.texture_mapping());
node = noise;
}
else if (b_node.is_a(&RNA_ShaderNodeTexMusgrave)) {
else if(b_node.is_a(&RNA_ShaderNodeTexMusgrave)) {
BL::ShaderNodeTexMusgrave b_musgrave_node(b_node);
MusgraveTextureNode *musgrave = new MusgraveTextureNode();
musgrave->type = MusgraveTextureNode::type_enum[(int)b_musgrave_node.musgrave_type()];
get_tex_mapping(&musgrave->tex_mapping, b_musgrave_node.texture_mapping());
node = musgrave;
}
else if (b_node.is_a(&RNA_ShaderNodeTexCoord)) {
else if(b_node.is_a(&RNA_ShaderNodeTexCoord)) {
BL::ShaderNodeTexCoord b_tex_coord_node(b_node);
TextureCoordinateNode *tex_coord = new TextureCoordinateNode();
tex_coord->from_dupli = b_tex_coord_node.from_dupli();
@@ -693,7 +704,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
}
node = tex_coord;
}
else if (b_node.is_a(&RNA_ShaderNodeTexSky)) {
else if(b_node.is_a(&RNA_ShaderNodeTexSky)) {
BL::ShaderNodeTexSky b_sky_node(b_node);
SkyTextureNode *sky = new SkyTextureNode();
sky->type = SkyTextureNode::type_enum[(int)b_sky_node.sky_type()];
@@ -703,14 +714,14 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
get_tex_mapping(&sky->tex_mapping, b_sky_node.texture_mapping());
node = sky;
}
else if (b_node.is_a(&RNA_ShaderNodeNormalMap)) {
else if(b_node.is_a(&RNA_ShaderNodeNormalMap)) {
BL::ShaderNodeNormalMap b_normal_map_node(b_node);
NormalMapNode *nmap = new NormalMapNode();
nmap->space = NormalMapNode::space_enum[(int)b_normal_map_node.space()];
nmap->attribute = b_normal_map_node.uv_map();
node = nmap;
}
else if (b_node.is_a(&RNA_ShaderNodeTangent)) {
else if(b_node.is_a(&RNA_ShaderNodeTangent)) {
BL::ShaderNodeTangent b_tangent_node(b_node);
TangentNode *tangent = new TangentNode();
tangent->direction_type = TangentNode::direction_type_enum[(int)b_tangent_node.direction_type()];
@@ -718,7 +729,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
tangent->attribute = b_tangent_node.uv_map();
node = tangent;
}
else if (b_node.is_a(&RNA_ShaderNodeUVMap)) {
else if(b_node.is_a(&RNA_ShaderNodeUVMap)) {
BL::ShaderNodeUVMap b_uvmap_node(b_node);
UVMapNode *uvm = new UVMapNode();
uvm->attribute = b_uvmap_node.uv_map();
@@ -734,7 +745,7 @@ static ShaderNode *add_node(Scene *scene, BL::BlendData b_data, BL::Scene b_scen
static bool node_use_modified_socket_name(ShaderNode *node)
{
if (node->special_type == SHADER_SPECIAL_TYPE_SCRIPT)
if(node->special_type == SHADER_SPECIAL_TYPE_SCRIPT)
return false;
return true;
@@ -744,14 +755,14 @@ static ShaderInput *node_find_input_by_name(ShaderNode *node, BL::Node b_node, B
{
string name = b_socket.name();
if (node_use_modified_socket_name(node)) {
if(node_use_modified_socket_name(node)) {
BL::Node::inputs_iterator b_input;
bool found = false;
int counter = 0, total = 0;
for (b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
if (b_input->name() == name) {
if (!found)
for(b_node.inputs.begin(b_input); b_input != b_node.inputs.end(); ++b_input) {
if(b_input->name() == name) {
if(!found)
counter++;
total++;
}
@@ -761,10 +772,10 @@ static ShaderInput *node_find_input_by_name(ShaderNode *node, BL::Node b_node, B
}
/* rename if needed */
if (name == "Shader")
if(name == "Shader")
name = "Closure";
if (total > 1)
if(total > 1)
name = string_printf("%s%d", name.c_str(), counter);
}
@@ -775,14 +786,14 @@ static ShaderOutput *node_find_output_by_name(ShaderNode *node, BL::Node b_node,
{
string name = b_socket.name();
if (node_use_modified_socket_name(node)) {
if(node_use_modified_socket_name(node)) {
BL::Node::outputs_iterator b_output;
bool found = false;
int counter = 0, total = 0;
for (b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
if (b_output->name() == name) {
if (!found)
for(b_node.outputs.begin(b_output); b_output != b_node.outputs.end(); ++b_output) {
if(b_output->name() == name) {
if(!found)
counter++;
total++;
}
@@ -792,18 +803,24 @@ static ShaderOutput *node_find_output_by_name(ShaderNode *node, BL::Node b_node,
}
/* rename if needed */
if (name == "Shader")
if(name == "Shader")
name = "Closure";
if (total > 1)
if(total > 1)
name = string_printf("%s%d", name.c_str(), counter);
}
return node->output(name.c_str());
}
static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, ShaderGraph *graph, BL::ShaderNodeTree b_ntree,
const ProxyMap &proxy_input_map, const ProxyMap &proxy_output_map)
static void add_nodes(Scene *scene,
BL::RenderEngine b_engine,
BL::BlendData b_data,
BL::Scene b_scene,
ShaderGraph *graph,
BL::ShaderNodeTree b_ntree,
const ProxyMap &proxy_input_map,
const ProxyMap &proxy_output_map)
{
/* add nodes */
BL::ShaderNodeTree::nodes_iterator b_node;
@@ -818,7 +835,7 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
BL::ShaderNode output_node(PointerRNA_NULL);
for(b_ntree.nodes.begin(b_node); b_node != b_ntree.nodes.end(); ++b_node) {
if (is_output_node(*b_node)) {
if(is_output_node(*b_node)) {
BL::ShaderNodeOutputMaterial b_output_node(*b_node);
if(b_output_node.is_active_output()) {
@@ -834,10 +851,10 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
/* add nodes */
for(b_ntree.nodes.begin(b_node); b_node != b_ntree.nodes.end(); ++b_node) {
if (b_node->mute() || b_node->is_a(&RNA_NodeReroute)) {
if(b_node->mute() || b_node->is_a(&RNA_NodeReroute)) {
/* replace muted node with internal links */
BL::Node::internal_links_iterator b_link;
for (b_node->internal_links.begin(b_link); b_link != b_node->internal_links.end(); ++b_link) {
for(b_node->internal_links.begin(b_link); b_link != b_node->internal_links.end(); ++b_link) {
ProxyNode *proxy = new ProxyNode(convert_socket_type(b_link->to_socket()));
input_map[b_link->from_socket().ptr.data] = proxy->inputs[0];
@@ -846,10 +863,10 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
graph->add(proxy);
}
}
else if (b_node->is_a(&RNA_ShaderNodeGroup) || b_node->is_a(&RNA_NodeCustomGroup)) {
else if(b_node->is_a(&RNA_ShaderNodeGroup) || b_node->is_a(&RNA_NodeCustomGroup)) {
BL::ShaderNodeTree b_group_ntree(PointerRNA_NULL);
if (b_node->is_a(&RNA_ShaderNodeGroup))
if(b_node->is_a(&RNA_ShaderNodeGroup))
b_group_ntree = BL::ShaderNodeTree(((BL::NodeGroup)(*b_node)).node_tree());
else
b_group_ntree = BL::ShaderNodeTree(((BL::NodeCustomGroup)(*b_node)).node_tree());
@@ -868,7 +885,7 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
input_map[b_input->ptr.data] = proxy->inputs[0];
set_default_value(proxy->inputs[0], *b_node, *b_input, b_data, b_ntree);
set_default_value(proxy->inputs[0], *b_input, b_data, b_ntree);
}
for(b_node->outputs.begin(b_output); b_output != b_node->outputs.end(); ++b_output) {
ProxyNode *proxy = new ProxyNode(convert_socket_type(*b_output));
@@ -880,33 +897,41 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
output_map[b_output->ptr.data] = proxy->outputs[0];
}
if (b_group_ntree)
add_nodes(scene, b_data, b_scene, graph, b_group_ntree, group_proxy_input_map, group_proxy_output_map);
if (b_group_ntree) {
add_nodes(scene,
b_engine,
b_data,
b_scene,
graph,
b_group_ntree,
group_proxy_input_map,
group_proxy_output_map);
}
}
else if (b_node->is_a(&RNA_NodeGroupInput)) {
else if(b_node->is_a(&RNA_NodeGroupInput)) {
/* map each socket to a proxy node */
for(b_node->outputs.begin(b_output); b_output != b_node->outputs.end(); ++b_output) {
ProxyMap::const_iterator proxy_it = proxy_input_map.find(b_output->identifier());
if (proxy_it != proxy_input_map.end()) {
if(proxy_it != proxy_input_map.end()) {
ProxyNode *proxy = proxy_it->second;
output_map[b_output->ptr.data] = proxy->outputs[0];
}
}
}
else if (b_node->is_a(&RNA_NodeGroupOutput)) {
else if(b_node->is_a(&RNA_NodeGroupOutput)) {
BL::NodeGroupOutput b_output_node(*b_node);
/* only the active group output is used */
if (b_output_node.is_active_output()) {
if(b_output_node.is_active_output()) {
/* map each socket to a proxy node */
for(b_node->inputs.begin(b_input); b_input != b_node->inputs.end(); ++b_input) {
ProxyMap::const_iterator proxy_it = proxy_output_map.find(b_input->identifier());
if (proxy_it != proxy_output_map.end()) {
if(proxy_it != proxy_output_map.end()) {
ProxyNode *proxy = proxy_it->second;
input_map[b_input->ptr.data] = proxy->inputs[0];
set_default_value(proxy->inputs[0], *b_node, *b_input, b_data, b_ntree);
set_default_value(proxy->inputs[0], *b_input, b_data, b_ntree);
}
}
}
@@ -914,30 +939,36 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
else {
ShaderNode *node = NULL;
if (is_output_node(*b_node)) {
if (b_node->ptr.data == output_node.ptr.data) {
if(is_output_node(*b_node)) {
if(b_node->ptr.data == output_node.ptr.data) {
node = graph->output();
}
}
else {
node = add_node(scene, b_data, b_scene, graph, b_ntree, BL::ShaderNode(*b_node));
node = add_node(scene,
b_engine,
b_data,
b_scene,
graph,
b_ntree,
BL::ShaderNode(*b_node));
}
if(node) {
/* map node sockets for linking */
for(b_node->inputs.begin(b_input); b_input != b_node->inputs.end(); ++b_input) {
ShaderInput *input = node_find_input_by_name(node, *b_node, *b_input);
if (!input) {
if(!input) {
/* XXX should not happen, report error? */
continue;
}
input_map[b_input->ptr.data] = input;
set_default_value(input, *b_node, *b_input, b_data, b_ntree);
set_default_value(input, *b_input, b_data, b_ntree);
}
for(b_node->outputs.begin(b_output); b_output != b_node->outputs.end(); ++b_output) {
ShaderOutput *output = node_find_output_by_name(node, *b_node, *b_output);
if (!output) {
if(!output) {
/* XXX should not happen, report error? */
continue;
}
@@ -951,6 +982,10 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
BL::NodeTree::links_iterator b_link;
for(b_ntree.links.begin(b_link); b_link != b_ntree.links.end(); ++b_link) {
/* Ignore invalid links to avoid unwanted cycles created in graph. */
if(!b_link->is_valid()) {
continue;
}
/* get blender link data */
BL::NodeSocket b_from_sock = b_link->from_socket();
BL::NodeSocket b_to_sock = b_link->to_socket();
@@ -959,10 +994,10 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
ShaderInput *input = 0;
PtrOutputMap::iterator output_it = output_map.find(b_from_sock.ptr.data);
if (output_it != output_map.end())
if(output_it != output_map.end())
output = output_it->second;
PtrInputMap::iterator input_it = input_map.find(b_to_sock.ptr.data);
if (input_it != input_map.end())
if(input_it != input_map.end())
input = input_it->second;
/* either node may be NULL when the node was not exported, typically
@@ -972,10 +1007,22 @@ static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, Sha
}
}
static void add_nodes(Scene *scene, BL::BlendData b_data, BL::Scene b_scene, ShaderGraph *graph, BL::ShaderNodeTree b_ntree)
static void add_nodes(Scene *scene,
BL::RenderEngine b_engine,
BL::BlendData b_data,
BL::Scene b_scene,
ShaderGraph *graph,
BL::ShaderNodeTree b_ntree)
{
static const ProxyMap empty_proxy_map;
add_nodes(scene, b_data, b_scene, graph, b_ntree, empty_proxy_map, empty_proxy_map);
add_nodes(scene,
b_engine,
b_data,
b_scene,
graph,
b_ntree,
empty_proxy_map,
empty_proxy_map);
}
/* Sync Materials */
@@ -1001,7 +1048,7 @@ void BlenderSync::sync_materials(bool update_all)
if(b_mat->use_nodes() && b_mat->node_tree()) {
BL::ShaderNodeTree b_ntree(b_mat->node_tree());
add_nodes(scene, b_data, b_scene, graph, b_ntree);
add_nodes(scene, b_engine, b_data, b_scene, graph, b_ntree);
}
else {
ShaderNode *closure, *out;
@@ -1044,7 +1091,7 @@ void BlenderSync::sync_world(bool update_all)
if(b_world && b_world.use_nodes() && b_world.node_tree()) {
BL::ShaderNodeTree b_ntree(b_world.node_tree());
add_nodes(scene, b_data, b_scene, graph, b_ntree);
add_nodes(scene, b_engine, b_data, b_scene, graph, b_ntree);
/* volume */
PointerRNA cworld = RNA_pointer_get(&b_world.ptr, "cycles");
@@ -1130,7 +1177,7 @@ void BlenderSync::sync_lamps(bool update_all)
BL::ShaderNodeTree b_ntree(b_lamp->node_tree());
add_nodes(scene, b_data, b_scene, graph, b_ntree);
add_nodes(scene, b_engine, b_data, b_scene, graph, b_ntree);
}
else {
ShaderNode *closure, *out;

View File

@@ -30,11 +30,13 @@
#include "device.h"
#include "blender_sync.h"
#include "blender_session.h"
#include "blender_util.h"
#include "util_debug.h"
#include "util_foreach.h"
#include "util_opengl.h"
#include "util_hash.h"
CCL_NAMESPACE_BEGIN
@@ -110,7 +112,7 @@ bool BlenderSync::sync_recalc()
if(b_ob->is_updated_data()) {
BL::Object::particle_systems_iterator b_psys;
for (b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
for(b_ob->particle_systems.begin(b_psys); b_psys != b_ob->particle_systems.end(); ++b_psys)
particle_system_map.set_recalc(*b_ob);
}
}
@@ -149,6 +151,7 @@ void BlenderSync::sync_data(BL::SpaceView3D b_v3d, BL::Object b_override, void *
sync_integrator();
sync_film();
sync_shaders();
sync_images();
sync_curve_settings();
mesh_synced.clear(); /* use for objects and motion sync */
@@ -193,6 +196,9 @@ void BlenderSync::sync_integrator()
integrator->filter_glossy = get_float(cscene, "blur_glossy");
integrator->seed = get_int(cscene, "seed");
if(get_boolean(cscene, "use_animated_seed"))
integrator->seed = hash_int_2d(b_scene.frame_current(), get_int(cscene, "seed"));
integrator->sampling_pattern = (SamplingPattern)RNA_enum_get(&cscene, "sampling_pattern");
integrator->layer_flag = render_layer.layer;
@@ -359,6 +365,39 @@ void BlenderSync::sync_render_layers(BL::SpaceView3D b_v3d, const char *layer)
}
}
/* Images */
void BlenderSync::sync_images()
{
/* Sync is a convention for this API, but currently it frees unused buffers. */
const bool is_interface_locked = b_engine.render() &&
b_engine.render().use_lock_interface();
if(is_interface_locked == false && BlenderSession::headless == false) {
/* If interface is not locked, it's possible image is needed for
* the display.
*/
return;
}
/* Free buffers used by images which are not needed for render. */
BL::BlendData::images_iterator b_image;
for(b_data.images.begin(b_image);
b_image != b_data.images.end();
++b_image)
{
/* TODO(sergey): Consider making it an utility function to check
* whether image is considered builtin.
*/
const bool is_builtin = b_image->packed_file() ||
b_image->source() == BL::Image::source_GENERATED ||
b_image->source() == BL::Image::source_MOVIE ||
b_engine.is_preview();
if(is_builtin == false) {
b_image->buffers_free();
}
/* TODO(sergey): Free builtin images not used by any shader. */
}
}
/* Scene Parameters */
SceneParams BlenderSync::get_scene_params(BL::Scene b_scene, bool background, bool is_cpu)
@@ -407,7 +446,10 @@ bool BlenderSync::get_session_pause(BL::Scene b_scene, bool background)
return (background)? false: get_boolean(cscene, "preview_pause");
}
SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::UserPreferences b_userpref, BL::Scene b_scene, bool background)
SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine,
BL::UserPreferences b_userpref,
BL::Scene b_scene,
bool background)
{
SessionParams params;
PointerRNA cscene = RNA_pointer_get(&b_scene.ptr, "cycles");
@@ -496,8 +538,13 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
params.tile_size = make_int2(tile_x, tile_y);
}
params.tile_order = (TileOrder)RNA_enum_get(&cscene, "tile_order");
if(BlenderSession::headless == false) {
params.tile_order = (TileOrder)RNA_enum_get(&cscene, "tile_order");
}
else {
params.tile_order = TILE_BOTTOM_TO_TOP;
}
params.start_resolution = get_int(cscene, "preview_start_resolution");
@@ -545,6 +592,13 @@ SessionParams BlenderSync::get_session_params(BL::RenderEngine b_engine, BL::Use
b_engine.support_display_space_shader(b_scene);
}
if(b_engine.is_preview()) {
/* For preview rendering we're using same timeout as
* blender's job update.
*/
params.progressive_update_timeout = 0.1;
}
return params;
}

View File

@@ -63,9 +63,12 @@ public:
/* get parameters */
static SceneParams get_scene_params(BL::Scene b_scene, bool background, bool is_cpu);
static SessionParams get_session_params(BL::RenderEngine b_engine, BL::UserPreferences b_userpref, BL::Scene b_scene, bool background);
static SessionParams get_session_params(BL::RenderEngine b_engine,
BL::UserPreferences b_userpref,
BL::Scene b_scene,
bool background);
static bool get_session_pause(BL::Scene b_scene, bool background);
static BufferParams get_buffer_params(BL::RenderSettings b_render, BL::Scene b_scene, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, Camera *cam, int width, int height);
static BufferParams get_buffer_params(BL::RenderSettings b_render, BL::SpaceView3D b_v3d, BL::RegionView3D b_rv3d, Camera *cam, int width, int height);
private:
/* sync */
@@ -83,15 +86,18 @@ private:
Mesh *sync_mesh(BL::Object b_ob, bool object_updated, bool hide_tris);
void sync_curves(Mesh *mesh, BL::Mesh b_mesh, BL::Object b_ob, bool motion, int time_index = 0);
Object *sync_object(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::DupliObject b_dupli_ob,
Transform& tfm, uint layer_flag, float motion_time, bool hide_tris);
void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm);
void sync_background_light();
Transform& tfm, uint layer_flag, float motion_time, bool hide_tris, bool *use_portal);
void sync_light(BL::Object b_parent, int persistent_id[OBJECT_PERSISTENT_ID_SIZE], BL::Object b_ob, Transform& tfm, bool *use_portal);
void sync_background_light(bool use_portal);
void sync_mesh_motion(BL::Object b_ob, Object *object, float motion_time);
void sync_camera_motion(BL::Object b_ob, float motion_time);
/* particles */
bool sync_dupli_particle(BL::Object b_ob, BL::DupliObject b_dup, Object *object);
/* Images. */
void sync_images();
/* util */
void find_shader(BL::ID id, vector<uint>& used_shaders, int default_shader);
bool BKE_object_is_modified(BL::Object b_ob);

View File

@@ -43,11 +43,11 @@ void python_thread_state_restore(void **python_thread_state);
static inline BL::Mesh object_to_mesh(BL::BlendData data, BL::Object object, BL::Scene scene, bool apply_modifiers, bool render, bool calc_undeformed)
{
BL::Mesh me = data.meshes.new_from_object(scene, object, apply_modifiers, (render)? 2: 1, false, calc_undeformed);
if ((bool)me) {
if (me.use_auto_smooth()) {
if((bool)me) {
if(me.use_auto_smooth()) {
me.calc_normals_split();
}
me.calc_tessface();
me.calc_tessface(true);
}
return me;
}
@@ -310,7 +310,7 @@ static inline string get_string(PointerRNA& ptr, const char *name)
char cstrbuf[1024];
char *cstr = RNA_string_get_alloc(&ptr, name, cstrbuf, sizeof(cstrbuf));
string str(cstr);
if (cstr != cstrbuf)
if(cstr != cstrbuf)
MEM_freeN(cstr);
return str;
@@ -388,7 +388,7 @@ static inline BL::SmokeDomainSettings object_smoke_domain_find(BL::Object b_ob)
BL::Object::modifiers_iterator b_mod;
for(b_ob.modifiers.begin(b_mod); b_mod != b_ob.modifiers.end(); ++b_mod) {
if (b_mod->is_a(&RNA_SmokeModifier)) {
if(b_mod->is_a(&RNA_SmokeModifier)) {
BL::SmokeModifier b_smd(*b_mod);
if(b_smd.smoke_type() == BL::SmokeModifier::smoke_type_DOMAIN)

View File

@@ -28,6 +28,7 @@
#include "util_cache.h"
#include "util_debug.h"
#include "util_foreach.h"
#include "util_logging.h"
#include "util_map.h"
#include "util_progress.h"
#include "util_system.h"
@@ -106,25 +107,25 @@ bool BVH::cache_read(CacheData& key)
if(!(value.read(pack.root_index) &&
value.read(pack.SAH) &&
value.read(pack.nodes) &&
value.read(pack.leaf_nodes) &&
value.read(pack.object_node) &&
value.read(pack.tri_woop) &&
value.read(pack.prim_type) &&
value.read(pack.prim_visibility) &&
value.read(pack.prim_index) &&
value.read(pack.prim_object) &&
value.read(pack.is_leaf)))
value.read(pack.prim_object)))
{
/* Clear the pack if load failed. */
pack.root_index = 0;
pack.SAH = 0.0f;
pack.nodes.clear();
pack.leaf_nodes.clear();
pack.object_node.clear();
pack.tri_woop.clear();
pack.prim_type.clear();
pack.prim_visibility.clear();
pack.prim_index.clear();
pack.prim_object.clear();
pack.is_leaf.clear();
return false;
}
return true;
@@ -141,13 +142,13 @@ void BVH::cache_write(CacheData& key)
value.add(pack.SAH);
value.add(pack.nodes);
value.add(pack.leaf_nodes);
value.add(pack.object_node);
value.add(pack.tri_woop);
value.add(pack.prim_type);
value.add(pack.prim_visibility);
value.add(pack.prim_index);
value.add(pack.prim_object);
value.add(pack.is_leaf);
Cache::global.insert(key, value);
@@ -205,6 +206,9 @@ void BVH::build(Progress& progress)
pack.prim_type = prim_type;
pack.prim_index = prim_index;
pack.prim_object = prim_object;
prim_type.free_memory();
prim_index.free_memory();
prim_object.free_memory();
/* compute SAH */
if(!params.top_level)
@@ -226,9 +230,8 @@ void BVH::build(Progress& progress)
/* pack nodes */
progress.set_substatus("Packing BVH nodes");
array<int> tmp_prim_object = pack.prim_object;
pack_nodes(tmp_prim_object, root);
pack_nodes(root);
/* free build nodes */
root->deleteSubtree();
@@ -266,9 +269,6 @@ void BVH::pack_triangle(int idx, float4 woop[3])
assert(tob >= 0 && tob < objects.size());
const Mesh *mesh = objects[tob]->mesh;
if(mesh->has_motion_blur())
return;
int tidx = pack.prim_index[idx];
const int *vidx = mesh->triangles[tidx].v;
const float3* vpos = &mesh->verts[0];
@@ -297,9 +297,14 @@ void BVH::pack_primitives()
if(pack.prim_index[i] != -1) {
float4 woop[3];
if(pack.prim_type[i] & PRIMITIVE_ALL_TRIANGLE)
if(pack.prim_type[i] & PRIMITIVE_TRIANGLE) {
pack_triangle(i, woop);
}
else {
/* Avoid use of uninitialized memory. */
memset(&woop, 0, sizeof(woop));
}
memcpy(&pack.tri_woop[i * nsize], woop, sizeof(float4)*3);
int tob = pack.prim_object[i];
@@ -318,13 +323,14 @@ void BVH::pack_primitives()
/* Pack Instances */
void BVH::pack_instances(size_t nodes_size)
void BVH::pack_instances(size_t nodes_size, size_t leaf_nodes_size)
{
/* The BVH's for instances are built separately, but for traversal all
* BVH's are stored in global arrays. This function merges them into the
* top level BVH, adjusting indexes and offsets where appropriate. */
bool use_qbvh = params.use_qbvh;
size_t nsize = (use_qbvh)? BVH_QNODE_SIZE: BVH_NODE_SIZE;
size_t nsize_leaf = (use_qbvh)? BVH_QNODE_LEAF_SIZE: BVH_NODE_LEAF_SIZE;
/* adjust primitive index to point to the triangle in the global array, for
* meshes with transform applied and already in the top level BVH */
@@ -339,6 +345,7 @@ void BVH::pack_instances(size_t nodes_size)
/* track offsets of instanced BVH data in global array */
size_t prim_offset = pack.prim_index.size();
size_t nodes_offset = nodes_size;
size_t nodes_leaf_offset = leaf_nodes_size;
/* clear array that gives the node indexes for instanced objects */
pack.object_node.clear();
@@ -350,6 +357,7 @@ void BVH::pack_instances(size_t nodes_size)
size_t pack_prim_index_offset = prim_index_size;
size_t pack_tri_woop_offset = tri_woop_size;
size_t pack_nodes_offset = nodes_size;
size_t pack_leaf_nodes_offset = leaf_nodes_size;
size_t object_offset = 0;
map<Mesh*, int> mesh_map;
@@ -363,6 +371,7 @@ void BVH::pack_instances(size_t nodes_size)
prim_index_size += bvh->pack.prim_index.size();
tri_woop_size += bvh->pack.tri_woop.size();
nodes_size += bvh->pack.nodes.size();
leaf_nodes_size += bvh->pack.leaf_nodes.size();
mesh_map[mesh] = 1;
}
@@ -377,6 +386,7 @@ void BVH::pack_instances(size_t nodes_size)
pack.prim_visibility.resize(prim_index_size);
pack.tri_woop.resize(tri_woop_size);
pack.nodes.resize(nodes_size);
pack.leaf_nodes.resize(leaf_nodes_size);
pack.object_node.resize(objects.size());
int *pack_prim_index = (pack.prim_index.size())? &pack.prim_index[0]: NULL;
@@ -385,6 +395,7 @@ void BVH::pack_instances(size_t nodes_size)
uint *pack_prim_visibility = (pack.prim_visibility.size())? &pack.prim_visibility[0]: NULL;
float4 *pack_tri_woop = (pack.tri_woop.size())? &pack.tri_woop[0]: NULL;
int4 *pack_nodes = (pack.nodes.size())? &pack.nodes[0]: NULL;
int4 *pack_leaf_nodes = (pack.leaf_nodes.size())? &pack.leaf_nodes[0]: NULL;
/* merge */
foreach(Object *ob, objects) {
@@ -410,12 +421,13 @@ void BVH::pack_instances(size_t nodes_size)
BVH *bvh = mesh->bvh;
int noffset = nodes_offset/nsize;
int noffset_leaf = nodes_leaf_offset/nsize_leaf;
int mesh_tri_offset = mesh->tri_offset;
int mesh_curve_offset = mesh->curve_offset;
/* fill in node indexes for instances */
if((bvh->pack.is_leaf.size() != 0) && bvh->pack.is_leaf[0])
pack.object_node[object_offset++] = -noffset-1;
if(bvh->pack.root_index == -1)
pack.object_node[object_offset++] = -noffset_leaf-1;
else
pack.object_node[object_offset++] = noffset;
@@ -449,6 +461,18 @@ void BVH::pack_instances(size_t nodes_size)
}
/* merge nodes */
if(bvh->pack.leaf_nodes.size()) {
int4 *leaf_nodes_offset = &bvh->pack.leaf_nodes[0];
size_t leaf_nodes_offset_size = bvh->pack.leaf_nodes.size();
for(size_t i = 0, j = 0; i < leaf_nodes_offset_size; i+=nsize_leaf, j++) {
int4 data = leaf_nodes_offset[i];
data.x += prim_offset;
data.y += prim_offset;
pack_leaf_nodes[pack_leaf_nodes_offset] = data;
pack_leaf_nodes_offset += nsize_leaf;
}
}
if(bvh->pack.nodes.size()) {
/* For QBVH we're packing a child bbox into 6 float4,
* and for regular BVH they're packed into 3 float4.
@@ -456,7 +480,6 @@ void BVH::pack_instances(size_t nodes_size)
size_t nsize_bbox = (use_qbvh)? 6: 3;
int4 *bvh_nodes = &bvh->pack.nodes[0];
size_t bvh_nodes_size = bvh->pack.nodes.size();
bool *bvh_is_leaf = (bvh->pack.is_leaf.size() != 0) ? &bvh->pack.is_leaf[0] : NULL;
for(size_t i = 0, j = 0; i < bvh_nodes_size; i+=nsize, j++) {
memcpy(pack_nodes + pack_nodes_offset, bvh_nodes + i, nsize_bbox*sizeof(int4));
@@ -464,18 +487,12 @@ void BVH::pack_instances(size_t nodes_size)
/* modify offsets into arrays */
int4 data = bvh_nodes[i + nsize_bbox];
if(bvh_is_leaf && bvh_is_leaf[j]) {
data.x += prim_offset;
data.y += prim_offset;
}
else {
data.x += (data.x < 0)? -noffset: noffset;
data.y += (data.y < 0)? -noffset: noffset;
data.x += (data.x < 0)? -noffset_leaf: noffset;
data.y += (data.y < 0)? -noffset_leaf: noffset;
if(use_qbvh) {
data.z += (data.z < 0)? -noffset: noffset;
data.w += (data.w < 0)? -noffset: noffset;
}
if(use_qbvh) {
data.z += (data.z < 0)? -noffset_leaf: noffset;
data.w += (data.w < 0)? -noffset_leaf: noffset;
}
pack_nodes[pack_nodes_offset + nsize_bbox] = data;
@@ -492,6 +509,7 @@ void BVH::pack_instances(size_t nodes_size)
}
nodes_offset += bvh->pack.nodes.size();
nodes_leaf_offset += bvh->pack.leaf_nodes.size();
prim_offset += bvh->pack.prim_index.size();
}
}
@@ -505,20 +523,24 @@ RegularBVH::RegularBVH(const BVHParams& params_, const vector<Object*>& objects_
void RegularBVH::pack_leaf(const BVHStackEntry& e, const LeafNode *leaf)
{
float4 data[BVH_NODE_LEAF_SIZE];
memset(data, 0, sizeof(data));
if(leaf->num_triangles() == 1 && pack.prim_index[leaf->m_lo] == -1) {
/* object */
pack_node(e.idx, leaf->m_bounds, leaf->m_bounds, ~(leaf->m_lo), 0,
leaf->m_visibility, leaf->m_visibility);
data[0].x = __int_as_float(~(leaf->m_lo));
data[0].y = __int_as_float(0);
}
else {
int prim_type = leaf->num_triangles() ? pack.prim_type[leaf->m_lo] : 0;
/* Triangle/curve primitive leaf. */
pack_node(e.idx, leaf->m_bounds, leaf->m_bounds,
leaf->m_lo, leaf->m_hi,
leaf->m_visibility,
prim_type);
/* triangle */
data[0].x = __int_as_float(leaf->m_lo);
data[0].y = __int_as_float(leaf->m_hi);
}
data[0].z = __uint_as_float(leaf->m_visibility);
if(leaf->num_triangles() != 0) {
data[0].w = __uint_as_float(pack.prim_type[leaf->m_lo]);
}
memcpy(&pack.leaf_nodes[e.idx * BVH_NODE_LEAF_SIZE], data, sizeof(float4)*BVH_NODE_LEAF_SIZE);
}
void RegularBVH::pack_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1)
@@ -539,33 +561,38 @@ void RegularBVH::pack_node(int idx, const BoundBox& b0, const BoundBox& b1, int
memcpy(&pack.nodes[idx * BVH_NODE_SIZE], data, sizeof(int4)*BVH_NODE_SIZE);
}
void RegularBVH::pack_nodes(const array<int>& prims, const BVHNode *root)
void RegularBVH::pack_nodes(const BVHNode *root)
{
size_t node_size = root->getSubtreeSize(BVH_STAT_NODE_COUNT);
size_t tot_node_size = root->getSubtreeSize(BVH_STAT_NODE_COUNT);
size_t leaf_node_size = root->getSubtreeSize(BVH_STAT_LEAF_COUNT);
size_t node_size = tot_node_size - leaf_node_size;
/* resize arrays */
pack.nodes.clear();
pack.is_leaf.clear();
pack.is_leaf.resize(node_size);
/* for top level BVH, first merge existing BVH's so we know the offsets */
if(params.top_level)
pack_instances(node_size*BVH_NODE_SIZE);
else
if(params.top_level) {
pack_instances(node_size*BVH_NODE_SIZE,
leaf_node_size*BVH_NODE_LEAF_SIZE);
}
else {
pack.nodes.resize(node_size*BVH_NODE_SIZE);
pack.leaf_nodes.resize(leaf_node_size*BVH_NODE_LEAF_SIZE);
}
int nextNodeIdx = 0;
int nextNodeIdx = 0, nextLeafNodeIdx = 0;
vector<BVHStackEntry> stack;
stack.reserve(BVHParams::MAX_DEPTH*2);
stack.push_back(BVHStackEntry(root, nextNodeIdx++));
if(root->is_leaf())
stack.push_back(BVHStackEntry(root, nextLeafNodeIdx++));
else
stack.push_back(BVHStackEntry(root, nextNodeIdx++));
while(stack.size()) {
BVHStackEntry e = stack.back();
stack.pop_back();
pack.is_leaf[e.idx] = e.node->is_leaf();
if(e.node->is_leaf()) {
/* leaf node */
const LeafNode* leaf = reinterpret_cast<const LeafNode*>(e.node);
@@ -573,15 +600,17 @@ void RegularBVH::pack_nodes(const array<int>& prims, const BVHNode *root)
}
else {
/* innner node */
stack.push_back(BVHStackEntry(e.node->get_child(0), nextNodeIdx++));
stack.push_back(BVHStackEntry(e.node->get_child(1), nextNodeIdx++));
int idx0 = (e.node->get_child(0)->is_leaf())? (nextLeafNodeIdx++) : (nextNodeIdx++);
int idx1 = (e.node->get_child(1)->is_leaf())? (nextLeafNodeIdx++) : (nextNodeIdx++);
stack.push_back(BVHStackEntry(e.node->get_child(0), idx0));
stack.push_back(BVHStackEntry(e.node->get_child(1), idx1));
pack_inner(e, stack[stack.size()-2], stack[stack.size()-1]);
}
}
/* root index to start traversal at, to handle case of single leaf node */
pack.root_index = (pack.is_leaf[0])? -1: 0;
pack.root_index = (root->is_leaf())? -1: 0;
}
void RegularBVH::refit_nodes()
@@ -590,17 +619,15 @@ void RegularBVH::refit_nodes()
BoundBox bbox = BoundBox::empty;
uint visibility = 0;
refit_node(0, (pack.is_leaf[0])? true: false, bbox, visibility);
refit_node(0, (pack.root_index == -1)? true: false, bbox, visibility);
}
void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility)
{
int4 *data = &pack.nodes[idx*BVH_NODE_SIZE];
int c0 = data[3].x;
int c1 = data[3].y;
if(leaf) {
int4 *data = &pack.leaf_nodes[idx*BVH_NODE_LEAF_SIZE];
int c0 = data[0].x;
int c1 = data[0].y;
/* refit leaf node */
for(int prim = c0; prim < c1; prim++) {
int pidx = pack.prim_index[prim];
@@ -634,7 +661,7 @@ void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility
size_t steps = mesh->motion_steps - 1;
float4 *key_steps = attr->data_float4();
for (size_t i = 0; i < steps; i++)
for(size_t i = 0; i < steps; i++)
curve.bounds_grow(k, key_steps + i*mesh_size, bbox);
}
}
@@ -656,7 +683,7 @@ void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility
size_t steps = mesh->motion_steps - 1;
float3 *vert_steps = attr->data_float3();
for (size_t i = 0; i < steps; i++)
for(size_t i = 0; i < steps; i++)
triangle.bounds_grow(vert_steps + i*mesh_size, bbox);
}
}
@@ -666,9 +693,20 @@ void RegularBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility
visibility |= ob->visibility;
}
pack_node(idx, bbox, bbox, c0, c1, visibility, data[3].w);
/* TODO(sergey): De-duplicate with pack_leaf(). */
float4 leaf_data[BVH_NODE_LEAF_SIZE];
leaf_data[0].x = __int_as_float(c0);
leaf_data[0].y = __int_as_float(c1);
leaf_data[0].z = __uint_as_float(visibility);
leaf_data[0].w = __uint_as_float(data[0].w);
memcpy(&pack.leaf_nodes[idx * BVH_NODE_LEAF_SIZE],
leaf_data,
sizeof(float4)*BVH_NODE_LEAF_SIZE);
}
else {
int4 *data = &pack.nodes[idx*BVH_NODE_SIZE];
int c0 = data[3].x;
int c1 = data[3].y;
/* refit inner node, set bbox from children */
BoundBox bbox0 = BoundBox::empty, bbox1 = BoundBox::empty;
uint visibility0 = 0, visibility1 = 0;
@@ -694,26 +732,24 @@ QBVH::QBVH(const BVHParams& params_, const vector<Object*>& objects_)
void QBVH::pack_leaf(const BVHStackEntry& e, const LeafNode *leaf)
{
float4 data[BVH_QNODE_SIZE];
float4 data[BVH_QNODE_LEAF_SIZE];
memset(data, 0, sizeof(data));
if(leaf->num_triangles() == 1 && pack.prim_index[leaf->m_lo] == -1) {
/* object */
data[6].x = __int_as_float(~(leaf->m_lo));
data[6].y = __int_as_float(0);
data[0].x = __int_as_float(~(leaf->m_lo));
data[0].y = __int_as_float(0);
}
else {
/* triangle */
data[6].x = __int_as_float(leaf->m_lo);
data[6].y = __int_as_float(leaf->m_hi);
data[0].x = __int_as_float(leaf->m_lo);
data[0].y = __int_as_float(leaf->m_hi);
}
data[6].z = __uint_as_float(leaf->m_visibility);
data[0].z = __uint_as_float(leaf->m_visibility);
if(leaf->num_triangles() != 0) {
data[6].w = __uint_as_float(pack.prim_type[leaf->m_lo]);
data[0].w = __uint_as_float(pack.prim_type[leaf->m_lo]);
}
memcpy(&pack.nodes[e.idx * BVH_QNODE_SIZE], data, sizeof(float4)*BVH_QNODE_SIZE);
memcpy(&pack.leaf_nodes[e.idx * BVH_QNODE_LEAF_SIZE], data, sizeof(float4)*BVH_QNODE_LEAF_SIZE);
}
void QBVH::pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num)
@@ -755,33 +791,41 @@ void QBVH::pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num)
/* Quad SIMD Nodes */
void QBVH::pack_nodes(const array<int>& prims, const BVHNode *root)
void QBVH::pack_nodes(const BVHNode *root)
{
size_t node_size = root->getSubtreeSize(BVH_STAT_QNODE_COUNT);
size_t tot_node_size = root->getSubtreeSize(BVH_STAT_QNODE_COUNT);
size_t leaf_node_size = root->getSubtreeSize(BVH_STAT_LEAF_COUNT);
size_t node_size = tot_node_size - leaf_node_size;
/* resize arrays */
pack.nodes.clear();
pack.is_leaf.clear();
pack.is_leaf.resize(node_size);
pack.leaf_nodes.clear();
/* for top level BVH, first merge existing BVH's so we know the offsets */
if(params.top_level)
pack_instances(node_size*BVH_QNODE_SIZE);
else
if(params.top_level) {
pack_instances(node_size*BVH_QNODE_SIZE,
leaf_node_size*BVH_QNODE_LEAF_SIZE);
}
else {
pack.nodes.resize(node_size*BVH_QNODE_SIZE);
pack.leaf_nodes.resize(leaf_node_size*BVH_QNODE_LEAF_SIZE);
}
int nextNodeIdx = 0;
int nextNodeIdx = 0, nextLeafNodeIdx = 0;
vector<BVHStackEntry> stack;
stack.reserve(BVHParams::MAX_DEPTH*2);
stack.push_back(BVHStackEntry(root, nextNodeIdx++));
if(root->is_leaf()) {
stack.push_back(BVHStackEntry(root, nextLeafNodeIdx++));
}
else {
stack.push_back(BVHStackEntry(root, nextNodeIdx++));
}
while(stack.size()) {
BVHStackEntry e = stack.back();
stack.pop_back();
pack.is_leaf[e.idx] = e.node->is_leaf();
if(e.node->is_leaf()) {
/* leaf node */
const LeafNode* leaf = reinterpret_cast<const LeafNode*>(e.node);
@@ -814,8 +858,16 @@ void QBVH::pack_nodes(const array<int>& prims, const BVHNode *root)
}
/* push entries on the stack */
for(int i = 0; i < numnodes; i++)
stack.push_back(BVHStackEntry(nodes[i], nextNodeIdx++));
for(int i = 0; i < numnodes; i++) {
int idx;
if(nodes[i]->is_leaf()) {
idx = nextLeafNodeIdx++;
}
else {
idx = nextNodeIdx++;
}
stack.push_back(BVHStackEntry(nodes[i], idx));
}
/* set node */
pack_inner(e, &stack[stack.size()-numnodes], numnodes);
@@ -823,7 +875,7 @@ void QBVH::pack_nodes(const array<int>& prims, const BVHNode *root)
}
/* root index to start traversal at, to handle case of single leaf node */
pack.root_index = (pack.is_leaf[0])? -1: 0;
pack.root_index = (root->is_leaf())? -1: 0;
}
void QBVH::refit_nodes()
@@ -832,14 +884,14 @@ void QBVH::refit_nodes()
BoundBox bbox = BoundBox::empty;
uint visibility = 0;
refit_node(0, (pack.is_leaf[0])? true: false, bbox, visibility);
refit_node(0, (pack.root_index == -1)? true: false, bbox, visibility);
}
void QBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility)
{
int4 *data = &pack.nodes[idx*BVH_QNODE_SIZE];
int4 c = data[6];
if(leaf) {
int4 *data = &pack.leaf_nodes[idx*BVH_QNODE_LEAF_SIZE];
int4 c = data[0];
/* Refit leaf node. */
for(int prim = c.x; prim < c.y; prim++) {
int pidx = pack.prim_index[prim];
@@ -873,7 +925,7 @@ void QBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility)
size_t steps = mesh->motion_steps - 1;
float4 *key_steps = attr->data_float4();
for (size_t i = 0; i < steps; i++)
for(size_t i = 0; i < steps; i++)
curve.bounds_grow(k, key_steps + i*mesh_size, bbox);
}
}
@@ -895,7 +947,7 @@ void QBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility)
size_t steps = mesh->motion_steps - 1;
float3 *vert_steps = attr->data_float3();
for (size_t i = 0; i < steps; i++)
for(size_t i = 0; i < steps; i++)
triangle.bounds_grow(vert_steps + i*mesh_size, bbox);
}
}
@@ -915,17 +967,18 @@ void QBVH::refit_node(int idx, bool leaf, BoundBox& bbox, uint& visibility)
*
* Same applies to the inner nodes case below.
*/
float4 leaf_data[BVH_QNODE_SIZE];
memset(leaf_data, 0, sizeof(leaf_data));
leaf_data[6].x = __int_as_float(c.x);
leaf_data[6].y = __int_as_float(c.y);
leaf_data[6].z = __uint_as_float(visibility);
leaf_data[6].w = __uint_as_float(c.w);
memcpy(&pack.nodes[idx * BVH_QNODE_SIZE],
float4 leaf_data[BVH_QNODE_LEAF_SIZE];
leaf_data[0].x = __int_as_float(c.x);
leaf_data[0].y = __int_as_float(c.y);
leaf_data[0].z = __uint_as_float(visibility);
leaf_data[0].w = __uint_as_float(c.w);
memcpy(&pack.leaf_nodes[idx * BVH_QNODE_LEAF_SIZE],
leaf_data,
sizeof(float4)*BVH_QNODE_SIZE);
sizeof(float4)*BVH_QNODE_LEAF_SIZE);
}
else {
int4 *data = &pack.nodes[idx*BVH_QNODE_SIZE];
int4 c = data[6];
/* Refit inner node, set bbox from children. */
BoundBox child_bbox[4] = {BoundBox::empty,
BoundBox::empty,

View File

@@ -36,7 +36,9 @@ class Object;
class Progress;
#define BVH_NODE_SIZE 4
#define BVH_NODE_LEAF_SIZE 1
#define BVH_QNODE_SIZE 7
#define BVH_QNODE_LEAF_SIZE 1
#define BVH_ALIGN 4096
#define TRI_NODE_SIZE 3
@@ -47,7 +49,9 @@ class Progress;
struct PackedBVH {
/* BVH nodes storage, one node is 4x int4, and contains two bounding boxes,
* and child, triangle or object indexes depending on the node type */
array<int4> nodes;
array<int4> nodes;
/* BVH leaf nodes storage. */
array<int4> leaf_nodes;
/* object index to BVH node index mapping for instances */
array<int> object_node;
/* precomputed triangle intersection data, one triangle is 4x float4 */
@@ -61,9 +65,6 @@ struct PackedBVH {
array<int> prim_index;
/* mapping from BVH primitive index, to the object id of that primitive. */
array<int> prim_object;
/* quick array to lookup if a node is a leaf, not used for traversal, only
* for instance BVH merging */
array<bool> is_leaf;
/* index of the root node. */
int root_index;
@@ -108,10 +109,10 @@ protected:
void pack_triangle(int idx, float4 woop[3]);
/* merge instance BVH's */
void pack_instances(size_t nodes_size);
void pack_instances(size_t nodes_size, size_t leaf_nodes_size);
/* for subclasses to implement */
virtual void pack_nodes(const array<int>& prims, const BVHNode *root) = 0;
virtual void pack_nodes(const BVHNode *root) = 0;
virtual void refit_nodes() = 0;
};
@@ -126,7 +127,7 @@ protected:
RegularBVH(const BVHParams& params, const vector<Object*>& objects);
/* pack */
void pack_nodes(const array<int>& prims, const BVHNode *root);
void pack_nodes(const BVHNode *root);
void pack_leaf(const BVHStackEntry& e, const LeafNode *leaf);
void pack_inner(const BVHStackEntry& e, const BVHStackEntry& e0, const BVHStackEntry& e1);
void pack_node(int idx, const BoundBox& b0, const BoundBox& b1, int c0, int c1, uint visibility0, uint visibility1);
@@ -147,7 +148,7 @@ protected:
QBVH(const BVHParams& params, const vector<Object*>& objects);
/* pack */
void pack_nodes(const array<int>& prims, const BVHNode *root);
void pack_nodes(const BVHNode *root);
void pack_leaf(const BVHStackEntry& e, const LeafNode *leaf);
void pack_inner(const BVHStackEntry& e, const BVHStackEntry *en, int num);

View File

@@ -29,10 +29,10 @@ CCL_NAMESPACE_BEGIN
/* SSE replacements */
__forceinline void prefetch_L1 (const void* ptr) { }
__forceinline void prefetch_L2 (const void* ptr) { }
__forceinline void prefetch_L3 (const void* ptr) { }
__forceinline void prefetch_NTA(const void* ptr) { }
__forceinline void prefetch_L1 (const void* /*ptr*/) { }
__forceinline void prefetch_L2 (const void* /*ptr*/) { }
__forceinline void prefetch_L3 (const void* /*ptr*/) { }
__forceinline void prefetch_NTA(const void* /*ptr*/) { }
template<size_t src> __forceinline float extract(const int4& b)
{ return b[src]; }

Some files were not shown because too many files have changed in this diff Show More