diff --git a/prop_tool/prop_tool.cpp b/prop_tool/prop_tool.cpp index 282b45e..f1ceedc 100644 --- a/prop_tool/prop_tool.cpp +++ b/prop_tool/prop_tool.cpp @@ -38,6 +38,8 @@ void PropTool::save() { _target_prop->set_snap_axis(_snap_axis); ResourceSaver::save(_target_prop->get_path(), _target_prop); + + print_error("save"); } void PropTool::save_node(Node *node, Transform parent_transform) { @@ -147,6 +149,10 @@ void PropTool::refresh_set(bool value) { rebuild_hierarchy(); } +Ref PropTool::get_target_prop() { + return _target_prop; +} + void PropTool::set_target_prop(const Ref &prop) { _target_prop = prop; @@ -208,6 +214,9 @@ PropTool::~PropTool() { } void PropTool::_bind_methods() { + ClassDB::bind_method(D_METHOD("get_target_prop"), &PropTool::get_target_prop); + ClassDB::bind_method(D_METHOD("set_target_prop", "value"), &PropTool::set_target_prop); + //ADD_PROPERTY(PropertyInfo(Variant::OBJECT, "target_prop", PROPERTY_HINT_RESOURCE_TYPE, "PropData"), "set_target_prop", "get_target_prop"); } #endif \ No newline at end of file diff --git a/prop_tool/prop_tool.h b/prop_tool/prop_tool.h index 2255fc8..f45a7a2 100644 --- a/prop_tool/prop_tool.h +++ b/prop_tool/prop_tool.h @@ -45,7 +45,10 @@ public: void save_node(Node *node, Transform parent_transform); void rebuild_hierarchy(); void refresh_set(bool value); + + Ref get_target_prop(); void set_target_prop(const Ref &prop); + void target_prop_set(const Ref &prop); void load_scene_for(PropTool *t, const Ref &prop);