@volter/blender-engine 0.1.24 → 0.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/browser/session.py
CHANGED
|
@@ -1613,6 +1613,25 @@ class Session:
|
|
|
1613
1613
|
"(`bpy_web_export.cc::write_image`)."
|
|
1614
1614
|
% (material.get("name", "?"), name))
|
|
1615
1615
|
|
|
1616
|
+
# A MATERIAL'S NODE GRAPH samples its pictures through Image Texture nodes, which
|
|
1617
|
+
# the slots above do not cover: a graph naming a picture that was never sent had
|
|
1618
|
+
# the presenter refuse the whole frame, so a file whose textures are missing did
|
|
1619
|
+
# not open at all (measured on `16-market-courtyard` saved with its textures
|
|
1620
|
+
# outside the project). Blender opens such a file and draws each missing picture
|
|
1621
|
+
# magenta; the node is kept, marked, and the presenter draws it so.
|
|
1622
|
+
graph = material.get("graph")
|
|
1623
|
+
for node in ((graph or {}).get("nodes") or {}).values():
|
|
1624
|
+
props = node.get("props") or {}
|
|
1625
|
+
image = props.get("image")
|
|
1626
|
+
name = image.get("name") if isinstance(image, dict) else None
|
|
1627
|
+
if name is None or name in carried or ("image:" + name) in self._known:
|
|
1628
|
+
continue
|
|
1629
|
+
props["image"] = None
|
|
1630
|
+
props["image_missing"] = True
|
|
1631
|
+
warn("material %s: the picture %s is not readable in this program (%s), so it "
|
|
1632
|
+
"draws magenta, as Blender draws a missing image."
|
|
1633
|
+
% (material.get("name", "?"), name, "a path outside the project, or no pixels"))
|
|
1634
|
+
|
|
1616
1635
|
def _reconcile_with_presenter(self, answer, frame):
|
|
1617
1636
|
"""THE PRESENTER'S REPORT OUTRANKS THE SESSION'S RECORD.
|
|
1618
1637
|
|
|
@@ -780,8 +780,14 @@ class Compiler {
|
|
|
780
780
|
case 'ShaderNodeTexImage': {
|
|
781
781
|
const image = prop<{name: string; revision: number} | null>(node, 'image');
|
|
782
782
|
if (image === null) {
|
|
783
|
+
// A PICTURE THAT COULD NOT BE READ draws magenta, as Blender draws a missing image
|
|
784
|
+
// (`session.py::_drop_unreachable_textures` marks it); a node with no image is
|
|
783
785
|
// node_tex_image_empty.
|
|
784
|
-
body.push(
|
|
786
|
+
body.push(
|
|
787
|
+
node.props['image_missing'] === true
|
|
788
|
+
? `${outs([0])} = vec4(1.0, 0.0, 1.0, 1.0); ${outs([1])} = 1.0;`
|
|
789
|
+
: `${outs([0])} = vec4(0.0); ${outs([1])} = 0.0;`,
|
|
790
|
+
);
|
|
785
791
|
break;
|
|
786
792
|
}
|
|
787
793
|
// node_shader_gpu_tex_image.
|