WIP: MaterialX: Implement Script node #113341
No reviewers
Labels
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender#113341
Loading…
Reference in New Issue
No description provided.
Delete Branch "DagerD/blender:matx-add-script-node"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Purpose
Implement conversion for Script node
Technical steps
Implemented conversion for Script node
Ref: #112864
@ -66,0 +74,4 @@
/* Look for first script node with assigned file.
* If it's found, we load content and ignore everything other. */
LISTBASE_FOREACH (bNode *, node, &material->nodetree->nodes) {
if (node->typeinfo->type == SH_NODE_SCRIPT) {
move this part with
if
to separate function@ -66,0 +102,4 @@
Text *text = reinterpret_cast<Text *>(node->id);
if (text) {
script_found = true;
std::string text_content;
Seem
std::stringstream
suits better here.@ -66,2 +126,3 @@
bNode *output_node = ntreeShaderOutputNode(material->nodetree, SHD_OUTPUT_ALL);
if (output_node) {
if (output_node && !script_found) {
Should be
Otherwise
else
block will beexecuted@ -57,0 +72,4 @@
if (node->typeinfo->type == SH_NODE_SCRIPT) {
NodeShaderScript *script = static_cast<NodeShaderScript *>(node->storage);
if (script->mode == NODE_SCRIPT_EXTERNAL) {
if (script->filepath[0] != '\0') {
Use explicit
STREQ(script->filepath, "")
@ -57,0 +92,4 @@
material->id.name,
node->name);
}
break;
I think no need to use
script_found
justreturn true
here@ -87,0 +138,4 @@
* If it's found, we load content and ignore everything other. */
script_found = export_script_node(doc, depsgraph, material);
if (!script_found) {
if (!export_script_node(doc, depsgraph, material)) {
Tested - works good
I thought a script node would work like the existing ones, where it gets inputs and outputs that you connect to other things. If it's just using the first script node in the shader graph and ignores everything else, it doesn't seem like that functionality should be a node at all.
This sounds more like it sound be a material wide property that disables the node graph for that material. And then later it could support viewing and editing the contents of the MaterialX file in Blender.
MaterialX: Implement Script nodeto WIP: MaterialX: Implement Script nodeYes, your proposal looks better, need to investigate more this task, set to WIP.
Checkout
From your project repository, check out a new branch and test the changes.