Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brecht@blender.org>2020-05-12 22:55:33 +0300
committerBrecht Van Lommel <brecht@blender.org>2020-05-12 22:57:04 +0300
commit5ca1eb96c7f2d078016ffda3f42067c57a0d06d3 (patch)
tree0a9da19f81c61e53955038b3ef79ba1df67a1bc5
parent289242fef912b0a51ca9b07972a304f651c6cc25 (diff)
parent829dce524dbbf34439422cd2906b94ce0e7920ed (diff)
Merge branch 'blender-v2.83-release'
-rw-r--r--build_files/cmake/Modules/FindOpenEXR.cmake1
-rw-r--r--build_files/cmake/Modules/FindUSD.cmake1
-rw-r--r--intern/cycles/graph/node.cpp6
-rw-r--r--release/datafiles/colormanagement/config.ocio10
-rwxr-xr-xrelease/freedesktop/snap/blender-wrapper19
-rw-r--r--release/freedesktop/snap/snapcraft.yaml.in7
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp28
-rw-r--r--source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h6
8 files changed, 60 insertions, 18 deletions
diff --git a/build_files/cmake/Modules/FindOpenEXR.cmake b/build_files/cmake/Modules/FindOpenEXR.cmake
index 2038726863f..3cf559a5da1 100644
--- a/build_files/cmake/Modules/FindOpenEXR.cmake
+++ b/build_files/cmake/Modules/FindOpenEXR.cmake
@@ -104,6 +104,7 @@ FOREACH(COMPONENT ${_openexr_FIND_COMPONENTS})
FIND_LIBRARY(OPENEXR_${UPPERCOMPONENT}_LIBRARY
NAMES
${COMPONENT}-${_openexr_libs_ver} ${COMPONENT}
+ NAMES_PER_DIR
HINTS
${_openexr_SEARCH_DIRS}
PATH_SUFFIXES
diff --git a/build_files/cmake/Modules/FindUSD.cmake b/build_files/cmake/Modules/FindUSD.cmake
index 97830af1dd9..043a10ffa98 100644
--- a/build_files/cmake/Modules/FindUSD.cmake
+++ b/build_files/cmake/Modules/FindUSD.cmake
@@ -43,6 +43,7 @@ FIND_PATH(USD_INCLUDE_DIR
FIND_LIBRARY(USD_LIBRARY
NAMES
usd_m usd_ms
+ NAMES_PER_DIR
HINTS
${_usd_SEARCH_DIRS}
PATH_SUFFIXES
diff --git a/intern/cycles/graph/node.cpp b/intern/cycles/graph/node.cpp
index 1439fb5a407..c437c6fda1e 100644
--- a/intern/cycles/graph/node.cpp
+++ b/intern/cycles/graph/node.cpp
@@ -133,7 +133,7 @@ void Node::set(const SocketType &input, const Transform &value)
void Node::set(const SocketType &input, Node *value)
{
- assert(input.type == SocketType::TRANSFORM);
+ assert(input.type == SocketType::NODE);
get_socket_value<Node *>(this, input) = value;
}
@@ -213,7 +213,7 @@ float Node::get_float(const SocketType &input) const
float2 Node::get_float2(const SocketType &input) const
{
- assert(input.type == SocketType::FLOAT);
+ assert(input.type == SocketType::POINT2);
return get_socket_value<float2>(this, input);
}
@@ -272,7 +272,7 @@ const array<float> &Node::get_float_array(const SocketType &input) const
const array<float2> &Node::get_float2_array(const SocketType &input) const
{
- assert(input.type == SocketType::FLOAT_ARRAY);
+ assert(input.type == SocketType::POINT2_ARRAY);
return get_socket_value<array<float2>>(this, input);
}
diff --git a/release/datafiles/colormanagement/config.ocio b/release/datafiles/colormanagement/config.ocio
index c224c2c3c2d..5ad937e3efb 100644
--- a/release/datafiles/colormanagement/config.ocio
+++ b/release/datafiles/colormanagement/config.ocio
@@ -33,9 +33,8 @@ roles:
# Default color space sequencer is working in
default_sequencer: sRGB
- # Color spaces for color picking and texture painting (not internally supported yet)
+ # Distribution of colors in color picker
color_picking: sRGB
- texture_paint: Raw
# Non-color data
data: Non-Color
@@ -43,6 +42,13 @@ roles:
# CIE XYZ color space
XYZ: XYZ
+ # Specifed by OCIO, not used in Blender
+ color_timing: Filmic Log
+ compositing_log: Filmic Log
+ default: Linear
+ matte_paint: Linear
+ texture_paint: Linear
+
displays:
sRGB:
- !<View> {name: Standard, colorspace: sRGB}
diff --git a/release/freedesktop/snap/blender-wrapper b/release/freedesktop/snap/blender-wrapper
new file mode 100755
index 00000000000..c116a4c2712
--- /dev/null
+++ b/release/freedesktop/snap/blender-wrapper
@@ -0,0 +1,19 @@
+# Disable ALSA and OSS as they are not available, and trying to initialize them
+# breaks sound in other apps. Use PulseAudio instead.
+export ALSOFT_DRIVERS=-oss,-alsa,
+export SDL_AUDIODRIVER=pulseaudio
+
+# Make PulseAudio socket available inside the snap-specific $XDG_RUNTIME_DIR
+# This is adapted from https://github.com/ubuntu/snapcraft-desktop-helpers,
+# in common/desktop-exports.
+mkdir -p $XDG_RUNTIME_DIR -m 700
+if [ -n "$XDG_RUNTIME_DIR" ]; then
+ pulsenative="pulse/native"
+ pulseaudio_sockpath="$XDG_RUNTIME_DIR/../$pulsenative"
+ if [ -S "$pulseaudio_sockpath" ]; then
+ export PULSE_SERVER="unix:${pulseaudio_sockpath}"
+ fi
+fi
+
+# Run Blender
+$SNAP/blender
diff --git a/release/freedesktop/snap/snapcraft.yaml.in b/release/freedesktop/snap/snapcraft.yaml.in
index a79d9ccc0a2..eb3ef97eba8 100644
--- a/release/freedesktop/snap/snapcraft.yaml.in
+++ b/release/freedesktop/snap/snapcraft.yaml.in
@@ -24,7 +24,7 @@ confinement: classic
apps:
blender:
- command: ./blender
+ command: ./blender-wrapper
desktop: ./blender.desktop
version: '@VERSION@'
@@ -46,3 +46,8 @@ parts:
- libxfixes3
- libxrender1
- libxxf86vm1
+ wrapper:
+ plugin: copy
+ source: .
+ files:
+ blender-wrapper: blender-wrapper
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
index a53df06e8c9..68b5b4baeca 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp
@@ -461,7 +461,7 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
vector<StrokeGroup *> *groups = hasTex ? &self->texturedStrokeGroups : &self->strokeGroups;
StrokeGroup *group;
if (groups->empty() || !(groups->back()->totvert + totvert < MESH_MAX_VERTS &&
- groups->back()->totcol + 1 < MAXMAT)) {
+ groups->back()->materials.size() + 1 < MAXMAT)) {
group = new StrokeGroup;
groups->push_back(group);
}
@@ -473,7 +473,10 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const
group->totedge += totedge;
group->totpoly += totpoly;
group->totloop += totloop;
- group->totcol++;
+
+ if (!group->materials.contains(ma)) {
+ group->materials.add_new(ma, group->materials.size());
+ }
}
// Check if the triangle is visible (i.e., within the render image boundary)
@@ -585,7 +588,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
mesh->totedge = group->totedge;
mesh->totpoly = group->totpoly;
mesh->totloop = group->totloop;
- mesh->totcol = group->totcol;
+ mesh->totcol = group->materials.size();
mesh->mvert = (MVert *)CustomData_add_layer(
&mesh->vdata, CD_MVERT, CD_CALLOC, NULL, mesh->totvert);
@@ -626,12 +629,20 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
mesh->mloopcol = colors;
mesh->mat = (Material **)MEM_mallocN(sizeof(Material *) * mesh->totcol, "MaterialList");
+ for (const auto &item : group->materials.items()) {
+ Material *material = item.key;
+ const int matnr = item.value;
+ mesh->mat[matnr] = material;
+ if (material) {
+ id_us_plus(&material->id);
+ }
+ }
////////////////////
// Data copy
////////////////////
- int vertex_index = 0, edge_index = 0, loop_index = 0, material_index = 0;
+ int vertex_index = 0, edge_index = 0, loop_index = 0;
int visible_faces, visible_segments;
bool visible;
Strip::vertex_container::iterator v[3];
@@ -642,8 +653,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
itend = group->strokes.end();
it != itend;
++it) {
- mesh->mat[material_index] = (*it)->getMaterial();
- id_us_plus(&mesh->mat[material_index]->id);
+ const int matnr = group->materials.lookup_default((*it)->getMaterial(), 0);
vector<Strip *> &strips = (*it)->getStrips();
for (vector<Strip *>::const_iterator s = strips.begin(), send = strips.end(); s != send; ++s) {
@@ -725,7 +735,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
// poly
polys->loopstart = loop_index;
polys->totloop = 3;
- polys->mat_nr = material_index;
+ polys->mat_nr = matnr;
++polys;
// Even and odd loops connect triangles vertices differently
@@ -810,8 +820,7 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
}
} // loop over strip vertices
} // loop over strips
- material_index++;
- } // loop over strokes
+ } // loop over strokes
BKE_object_materials_test(freestyle_bmain, object_mesh, (ID *)mesh);
@@ -819,7 +828,6 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex)
BLI_assert(mesh->totvert == vertex_index);
BLI_assert(mesh->totedge == edge_index);
BLI_assert(mesh->totloop == loop_index);
- BLI_assert(mesh->totcol == material_index);
BKE_mesh_validate(mesh, true, true);
#endif
}
diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
index c333319ada1..ee29519c849 100644
--- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
+++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.h
@@ -21,6 +21,8 @@
* \ingroup freestyle
*/
+#include "BLI_map.hh"
+
#include "../stroke/StrokeRenderer.h"
#include "../system/FreestyleConfig.h"
@@ -50,15 +52,15 @@ class BlenderStrokeRenderer : public StrokeRenderer {
Object *NewMesh() const;
struct StrokeGroup {
- explicit StrokeGroup() : totvert(0), totedge(0), totpoly(0), totloop(0), totcol(0)
+ explicit StrokeGroup() : totvert(0), totedge(0), totpoly(0), totloop(0)
{
}
vector<StrokeRep *> strokes;
+ BLI::Map<Material *, int> materials;
int totvert;
int totedge;
int totpoly;
int totloop;
- int totcol;
};
vector<StrokeGroup *> strokeGroups, texturedStrokeGroups;