The latest clang compiler (at least the one in Xcode 9.4.1) warns about the register keyword and macro expansions using defined().
Since these warnings come from third party code, we can't address them directly in Blender. Silencing them via #pramgas will
at least keep the warnings during a build down to the ones that are relevant to Blender code.
block and layout could be NULL and checking this everywhere
wasn't practical.
Instead of lazy initializing, add UI_popup_menu_end_or_cancel
which cancels empty popup menus.
Again, we cannot actually get rid of G_MAIN global access here, so in
most case just 'marked' them as valid, and added assert checks to ensure
we do only work with IDs in G_MAIN in those cases.
Validate some cases using G_MAIN instead (I don't think we want to work
on any other Main than G.main one when registering/unregistering nodes
etc.).
And when freeing, all ID not in Main shall now be tagged accordingly, so
we *should* not need to do that stupi search over all ntrees in G.main
to check wether we have to free it ourself or not!
SculptSession.mode_type wasn't initialized until painting,
making it unreliable for checks in other parts of the code.
Also remove unnecessary initialization,
matching sculpt mode more closely.
There were two issues here, introduced by rB66aa4af836:
* Forgot to change length of some filter_glob var deep in filebrowser code.
* Truncating filter_glob in general can be dangerous, generating
unexpected patterns.
Last point was the root of the issue here, truncating to 63 chars string
left last group as 'match everything' `*` pattern.
To fix that to some extent, added a new BLI_path_extension_glob_validate
helper to BLI_path_util, which ensures we do not have last
wildcards-only group in our pattern, when there are more than one group.
Limit to a restricted set of built-ins, as well as the math module.
Also restrict of op-codes, disallowing imports and attribute access.
This allows most math expressions to run
without any performance cost once the initial check is done.
See: D1862 for details.
This means the shader can now be used for procedural texturing. New
settings on the node are Samples, Inside, Local Only and Distance.
Original patch by Lukas with further changes by Brecht.
Differential Revision: https://developer.blender.org/D3479
Need to use the 'use_partial_connect' option in island connect,
so changed signatures of various functions to pass that into and
then down from BM_mesh_intersect (making true for intersect, false
for boolean).
Then fix bm_face_split_edgenet_partial_connect to work when
input edges are not necessarily wire, but at least not in the
face they are being connected in. That caused generalization
of core BM_vert_separate_hflag_wire (which is only used in
this one place in all Blender).
this is actually adding option to add buggy behavior, but.. NPR often
expects buggy behaviors, and its one of the main targets for normal editing.
So think it's reasonable to add that option (disabled by default of
course).
Note that am not really happy with UI, but:
* Not sure where to put it, it's kind of own self-contained area option.
* Don't to make it too much visible, using this should be the exception!
For grouped undo we should not skip the undo push, rather replace the
previous undo push. This way undo goes back to the state after the last
operation in the group.
Note that due to RNA get/setters issue, that one may actually add some
G.main usages to the total... But at least it's not hidden anymore in a
very low-level, dark corner of BKE pointcache code!
This is supposed to be handled by calling code! Henceforce, no need to
call BKE_sequencer_clear_scene_in_allseqs() here, and... no need for
that ugly G.main case. ;)
atoi usage in BLI_stringdec could overflow, use strtoll instead and
check
valid range with INT_MIN and INT_MAX
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3452
use better poll and get ob with 'ED_object_active_context' (instead of
'CTX_data_active_object')
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3467
Notes:
* Really need to address RNA setters case, end up adding way too much
G.main here these days... :/
* Added Main pointer into bAnimContext, helps a lot in anim code ;)
This helps making things clearer and cleaner. Func returning filepath of
G.main is separate, so that we can easily track its usages, and
hopefully deprecate it at some point. Though that usage of G.main is
likely the less evil one, you nearly always want current blendfile path
in those cases anyway.
This is really convenient for development. Either for profiling the
generated shaders or to check if the generated code is correct.
It writes the shaders to the temporary blender session folder.
(ported over from blender2.8)
This will currently only work for the RelWithDebInfo configuration since asan
does not support the debug crt. for source line information in the reports,
you need a copy of llvm-symbolizer in the blender folder or set the
ASAN_SYMBOLIZER_PATH environment variable to point to it. Currently (as of
6.0.0) llvm-symbolizer does not ship with the binary clang/llvm distribution.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3446
This commit contains the minimum to make clang build/work with blender, asan and ninja build support is forthcoming
Things to note:
1) Builds and runs, and is able to pass all tests (except for the freestyle_stroke_material.blend test which was broken at that time for all platforms by the looks of it)
2) It's slightly faster than msvc when using cycles. (time in seconds, on an i7-3370)
victor_cpu
msvc:3099.51
clang:2796.43
pavillon_barcelona_cpu
msvc:1872.05
clang:1827.72
koro_cpu
msvc:1097.58
clang:1006.51
fishy_cat_cpu
msvc:815.37
clang:722.2
classroom_cpu
msvc:1705.39
clang:1575.43
bmw27_cpu
msvc:552.38
clang:561.53
barbershop_interior_cpu
msvc:2134.93
clang:1922.33
3) clang on windows uses a drop in replacement for the Microsoft cl.exe (takes some of the Microsoft parameters, but not all, and takes some of the clang parameters but not all) and uses ms headers + libraries + linker, so you still need visual studio installed and will use our existing vc14 svn libs.
4) X64 only currently, X86 builds but crashes on startup.
5) Tested with llvm/clang 6.0.0
6) Requires visual studio integration, available at https://github.com/LazyDodo/llvm-vs2017-integration
7) The Microsoft compiler spawns a few copies of cl in parallel to get faster build times, clang doesn't, so the build time is 3-4x slower than with msvc.
8) No openmp support yet. Have not looked at this much, the binary distribution of clang doesn't seem to include it on windows.
9) No ASAN support yet, some of the sanitizers can be made to work, but it was decided to leave support out of this commit.
Reviewers: campbellbarton
Differential Revision: https://developer.blender.org/D3304
This patch adds support for IES files, a file format that is commonly used to store the directional intensity distribution of light sources.
The new IES node is supposed to be plugged into the Strength input of the Emission node of the lamp.
Since people generating IES files do not really seem to care about the standard, the parser is flexible enough to accept all test files I have tried.
Some common weirdnesses are distributing values over multiple lines that should go into one line, using commas instead of spaces as delimiters and adding various useless stuff at the end of the file.
The user interface of the node is similar to the script node, the user can either select an internal Text or load a file.
Internally, IES files are handled similar to Image textures: They are stored in slots by the LightManager and each unique IES is assigned to one slot.
The local coordinate system of the lamp is used, so that the direction of the light can be changed. For UI reasons, it's usually best to add an area light,
rotate it and then change its type, since especially the point light does not immediately show its local coordinate system in the viewport.
Reviewers: #cycles, dingto, sergey, brecht
Reviewed By: #cycles, dingto, brecht
Subscribers: OgDEV, crazyrobinhood, secundar, cardboard, pisuke, intrah, swerner, micah_denn, harvester, gottfried, disnel, campbellbarton, duarteframos, Lapineige, brecht, juicyfruit, dingto, marek, rickyblender, bliblubli, lockal, sergey
Differential Revision: https://developer.blender.org/D1543
This commit adds number formatting (thousands separator) to the baking panel. It also adds a new function to format memory sizes (KB/GB/etc) and applies it to the baking panel and scene stats. The new function is unit tested.
Reviewers: Severin
Tags: #user_interface
Differential Revision: https://developer.blender.org/D1248
The Math node currently has the normal atan() function, but for
actual angles this is fairly useless without additional nodes to handle the signs.
Since the node has two inputs anyways, it only makes sense to add an arctan2 option.
Reviewers: sergey, brecht
Differential Revision: https://developer.blender.org/D3430
affects one item
UI editing multiple selected items missed the case of PROP_POINTER
properties
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3373
Some conversion helper functions were (most likely by accident) contained
inside an ifdef for SSE2 support, so on e.g. ARM they would be undefined
and therefore cause compilation to fail.
Regression in recent undo system changes,
This caused T55048.
When each mode had its own undo stack it was important
to initialize it when entering edit-mode.
Freeing sequencer would always do usercount, which is now forbidden when
called from main ID freeing code.
Annoying in 2.7x, much more critical issue in 2.8!
Also, moved RNA sequencer API functions to proper rna_scene_api.c file.
Readcode always set relative paths of indirectly linked libs relative to
*current* .blend file, not to the library using it.
But BKE_library_filepath_set was then setting them relative to their
parent library, breaking checking code (and saved files even :((( ).
Some years-old deprecated stuff has now been removed.
Correct solution is probably to use valid defines etc. in own code, but
this is more FFMEPG maintainer task (since it also may change how old
FFMPEG we do support...).
frames
caused division by zero if both dupli_frames_on and dupli_frames_off are
zero. doing this doesnt seem useful, dupliframes can be disabled in
other ways.
Reviewed By: campbellbarton
Differential Revision: https://developer.blender.org/D3132
The value of epsilon was never used to create this bvhtree because whenever we activate this constraint, a bvhtree with parameter epsilon 0.0 was created and cached.
Seems to be only related on linked nature of particles.
This is caused by some conflicting optimization done for viewport, which
does not do particles re-calculation if they do not depend on time
(which is crucial for big layout scene grass fields) and particle render
setting switch which was relying on fact that render pipeline will do
particle update via time dependency.
Now we extent an old workaround for invisible objects, which now also
deals with particles in the same way as old dependency graph was dealing
with this: tag object data for update if there is particle system.
There shouldn't be any speed difference between old and new depsgraph,
since tagging was already needed and was happening.
In Blender 2.8 such things should be easier to deal with since the whole
depsgraph is to be evaluated for render engine anyway.