File tree Expand file tree Collapse file tree 1 file changed +8
-2
lines changed
addons/block_code/ui/block_canvas Expand file tree Collapse file tree 1 file changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -160,10 +160,16 @@ func clear_canvas():
160
160
161
161
162
162
func load_tree (parent : Node , node : SerializedBlockTreeNode ):
163
- var _block_scene_path = _block_scenes_by_class [node .serialized_block .block_class ]
164
- var scene : Block = load (_block_scene_path ).instantiate ()
163
+ var scene : Block = Util .instantiate_block (node .name )
164
+
165
+ # TODO: Remove once the data/UI decouple is done.
166
+ if scene == null :
167
+ var _block_scene_path = _block_scenes_by_class [node .serialized_block .block_class ]
168
+ scene = load (_block_scene_path ).instantiate ()
165
169
for prop_pair in node .serialized_block .serialized_props :
166
170
scene .set (prop_pair [0 ], prop_pair [1 ])
171
+
172
+ scene .position = node .position
167
173
parent .add_child (scene )
168
174
169
175
var scene_block : Block = scene as Block
You can’t perform that action at this time.
0 commit comments