Jump to content

[SOLVED] Error when a property is reassigned in Node Editor


photo

Recommended Posts

With latest Unigine version (2013-03-26)

 

 

Reproduction Steps

  1. Create a Dummy node in editor
  2. Assign node_base property to the node.
  3. Disable Intersection parameter for that node property. Press Ok.
  4. Put focus on Property edit widget again and press enter.
  5. Open Assigned property editor, the property parameters are set to their original values (Intersection is checked again)

​If you don't change the property, there is no point to make a property reassignation removing all the custom parameter values for that node.

 

 

 

Suggested solution

 

In editor_nodes.h (ln 845)

 

	/*
	 */
	void property_pressed() {
		State s = new State();
		if(property_el.getText() != "") {
			Property property = node.getProperty();
#ifdef OLD_WAY
			if(property == NULL) s.init_modify(nodes,node);
			else if(property.getName() != property_el.getText()) s.init_modify(nodes,node);
			node.setProperty(property_el.getText());
			property = node.getProperty();
#else /* OLD_WAY */
			if(property == NULL) {
				s.init_modify(nodes,node);
			} else if(property.getName() != property_el.getText()) {
				s.init_modify(nodes,node);
				node.setProperty(property_el.getText());
				property = node.getProperty();
			}
#endif /* OLD_WAY */
			if(property == NULL) {
				//...
			} else {
				//...
			}
		} else {
			//...
		}
		//...
	}

 

For materials, it behaves in this way, you can customize surface material parameters, and if you try to assign the same material, nothing is done, respecting custom values.

Link to comment
  • 4 months later...

Thanks. But I think the patch must be:

if(property == NULL || property.getName() != property_el.getText()) {
    s.init_modify(nodes,node);
    node.setProperty(property_el.getText());
    property = node.getProperty();
}
And the same stuff for property_load_clicked() callback is also required.
Link to comment
×
×
  • Create New...