All graphs in NodeCanvas can be exported to or imported from a JSON file. This proves usefull for sharing graphs, designs or patterns with others in a simple format. Importing and Exporting to/from a JSON file can be done either in the Graph Inspector, or from within the NodeCanvas editor under the “File” menu.
So for example the following behaviour tree…
…can be exported or imported to/from the following JSON file. (In practice, default values are not serialized, but this is an example)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 |
{ "nodes": [ { "dynamic": false, "random": false, "_collapsed": false, "_position": { "x": 5708.0, "y": 5031.0 }, "_name": null, "_tag": null, "_comment": null, "_isBreakpoint": false, "$type": "NodeCanvas.BehaviourTrees.Sequencer", "$id": "1" }, { "dynamic": false, "random": false, "_collapsed": false, "_position": { "x": 5608.0, "y": 5147.0 }, "_name": null, "_tag": null, "_comment": null, "_isBreakpoint": false, "$type": "NodeCanvas.BehaviourTrees.Sequencer", "$id": "2" }, { "_condition": null, "_collapsed": false, "_position": { "x": 5512.998046875, "y": 5259.998046875 }, "_name": null, "_tag": null, "_comment": null, "_isBreakpoint": false, "$type": "NodeCanvas.BehaviourTrees.ConditionNode", "$id": "3" }, { "_action": null, "_collapsed": false, "_position": { "x": 5705.0, "y": 5262.0 }, "_name": null, "_tag": null, "_comment": null, "_isBreakpoint": false, "$type": "NodeCanvas.BehaviourTrees.ActionNode", "$id": "4" }, { "_action": null, "_collapsed": false, "_position": { "x": 5822.0, "y": 5150.0 }, "_name": null, "_tag": null, "_comment": null, "_isBreakpoint": false, "$type": "NodeCanvas.BehaviourTrees.ActionNode", "$id": "5" } ], "connections": [ { "_sourceNode": { "$ref": "1" }, "_targetNode": { "$ref": "2" }, "_isDisabled": false, "$type": "NodeCanvas.BehaviourTrees.BTConnection" }, { "_sourceNode": { "$ref": "1" }, "_targetNode": { "$ref": "5" }, "_isDisabled": false, "$type": "NodeCanvas.BehaviourTrees.BTConnection" }, { "_sourceNode": { "$ref": "2" }, "_targetNode": { "$ref": "3" }, "_isDisabled": false, "$type": "NodeCanvas.BehaviourTrees.BTConnection" }, { "_sourceNode": { "$ref": "2" }, "_targetNode": { "$ref": "4" }, "_isDisabled": false, "$type": "NodeCanvas.BehaviourTrees.BTConnection" } ], "canvasGroups": null, "localBlackboard": { "_name": "Local Blackboard", "_variables": [], "$type": "NodeCanvas.Framework.Internal.BlackboardSource" } } |
© Paradox Notion 2014-2024. All rights reserved.