Skip to content

Commit

Permalink
Fix up UI for property panel (#157)
Browse files Browse the repository at this point in the history
  • Loading branch information
kwokcb authored May 28, 2024
1 parent 92b7fb4 commit 74d9de9
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
17 changes: 13 additions & 4 deletions javascript/JsMaterialXNodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2377,7 +2377,8 @@ class MxShadingGraphEditor {

//console.log('Scan input:', inputName, ' on node: ', node.graph);

var property_info = node.properties_info[i];
var property_info = node.getPropertyInfo(inputName);
//console.log('1. get property info for i: ', inputName, 'info: ', property_info)

var skipInterorConnectedInput = false;
if (node.graph._is_subgraph)
Expand Down Expand Up @@ -2456,11 +2457,15 @@ class MxShadingGraphEditor {

propertypanelcontent.appendChild(current_details);
}
else
{
//current_details = null;
}
}
else {
current_details = null;
}
//console.log('>>>>>>>>>>>> uiName:', uiName, 'uimin:', uimin, 'uimax:', uimax);
//console.log('2. uiName:', uiName, 'uimin:', uimin, 'uimax:', uimax, 'uiFolder:', property_info.uifolder);
}
else {
current_details = null;
Expand Down Expand Up @@ -2915,10 +2920,14 @@ class MxShadingGraphEditor {
}
//elem.innerHTML = "<em>" + i + "</em> : " + property;
if (elem) {
if (current_details)
if (current_details) {
//console.log('3a. append child to details:', current_details.id, elem, inputName);
current_details.appendChild(elem);
else
}
else {
propertypanelcontent.appendChild(elem);
//console.log('3b. append child to parent content:', elem, inputName);
}
}
}
}
Expand Down
17 changes: 13 additions & 4 deletions javascript/materialxnode/dist/JsMaterialXNodeEditor.js
Original file line number Diff line number Diff line change
Expand Up @@ -2377,7 +2377,8 @@ class MxShadingGraphEditor {

//console.log('Scan input:', inputName, ' on node: ', node.graph);

var property_info = node.properties_info[i];
var property_info = node.getPropertyInfo(inputName);
//console.log('1. get property info for i: ', inputName, 'info: ', property_info)

var skipInterorConnectedInput = false;
if (node.graph._is_subgraph)
Expand Down Expand Up @@ -2456,11 +2457,15 @@ class MxShadingGraphEditor {

propertypanelcontent.appendChild(current_details);
}
else
{
//current_details = null;
}
}
else {
current_details = null;
}
//console.log('>>>>>>>>>>>> uiName:', uiName, 'uimin:', uimin, 'uimax:', uimax);
//console.log('2. uiName:', uiName, 'uimin:', uimin, 'uimax:', uimax, 'uiFolder:', property_info.uifolder);
}
else {
current_details = null;
Expand Down Expand Up @@ -2915,10 +2920,14 @@ class MxShadingGraphEditor {
}
//elem.innerHTML = "<em>" + i + "</em> : " + property;
if (elem) {
if (current_details)
if (current_details) {
//console.log('3a. append child to details:', current_details.id, elem, inputName);
current_details.appendChild(elem);
else
}
else {
propertypanelcontent.appendChild(elem);
//console.log('3b. append child to parent content:', elem, inputName);
}
}
}
}
Expand Down

0 comments on commit 74d9de9

Please sign in to comment.