steve3d Posted November 1, 2011 Share Posted November 1, 2011 I've successfully created a full featured tcb-spline for unigine, now I'm writing editor script for it, I've found other scripts using State class to create undo, So I use following script to save state State s = new State(); s.init_modify(nodes, curve); current_key.setPosition(pos.xyz); point_position_el[0].setText(editorFormat(pos.x)); point_position_el[1].setText(editorFormat(pos.y)); point_position_el[2].setText(editorFormat(pos.z)); curve.setKey(int(current_point_el.getText()), current_key); save_state(s); but after I move the manipulator for curve point, press Ctrl+Z didn't undo any thing.my curve object already implemented saveState function with all its' points stored in stream.so, How can I add undo functionality to editor script? Link to comment
manguste Posted November 16, 2011 Share Posted November 16, 2011 Try checking data/core/editor/editor_render_unredo.h script for a reference how undo functionality needs to be implemented. Link to comment
Recommended Posts