Merge branch 'blender-v2.83-release'
This commit is contained in:
commit
5ca1eb96c7
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
|
|
@ -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
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue