Update Remote IO document

master
Jeremy Hu 2019-03-23 07:44:02 +09:30
parent 278ac68ea6
commit ebf16eeb1a
1 changed files with 166 additions and 163 deletions

View File

@ -10,6 +10,9 @@ Protocol
| Other software connect to tcp host 127.0.0.1:53309, send command, get reply and receive event from Dust3D. One command, or one response, consists of one packet, each packet encoded as hex string, and choose '\\0' as packet splitter. | Other software connect to tcp host 127.0.0.1:53309, send command, get reply and receive event from Dust3D. One command, or one response, consists of one packet, each packet encoded as hex string, and choose '\\0' as packet splitter.
| |
| Each response start with a '+' or '-' when there is an error, the error message comes after the minus sign. | Each response start with a '+' or '-' when there is an error, the error message comes after the minus sign.
|
| Event start with a '#'.
|
Python Example Python Example
================= =================
@ -52,167 +55,167 @@ Python Example
Commands Commands
================== ==================
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Command | Examples | | Command | Examples |
+==============================================================+============================================================================================================================+ +==============================================================+=======================================================================================================================================================================================================+
| listWindow | | send> listwindow | | listWindow | | send> listwindow |
| | | +OK | | | | +OK |
| | | {658cac48-4cc4-42bf-a561-dbd28330777e} Dust3D%201.0.0-beta.17%20* | | | | {658cac48-4cc4-42bf-a561-dbd28330777e} Dust3D%201.0.0-beta.17%20* |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| selectWindow <windowId> | | send> selectwindow {658cac48-4cc4-42bf-a561-dbd28330777e} | | selectWindow <windowId> | | send> selectwindow {658cac48-4cc4-42bf-a561-dbd28330777e} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| undo | | send> undo | | undo | | send> undo |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| redo | | send> redo | | redo | | send> redo |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| paste | | send> paste | | paste | | send> paste |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| removeNode <nodeId> | | send> removeNode {3dc475f6-dcda-45b8-bb76-59948db39968} | | removeNode <nodeId> | | send> removeNode {3dc475f6-dcda-45b8-bb76-59948db39968} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| removeEdge <edgeId> | | send> removeEdge {a75f39ac-3c78-4754-b34a-dce70779832b} | | removeEdge <edgeId> | | send> removeEdge {a75f39ac-3c78-4754-b34a-dce70779832b} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| removePart <partId> | | send> removePart {79a15562-908c-4b74-a489-af604796b1a0} | | removePart <partId> | | send> removePart {79a15562-908c-4b74-a489-af604796b1a0} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| addNode <x> <y> <z> <radius> <fromNodeId> | | send> addNode 0.51 0.51 1.01 0.08 | | addNode <x> <y> <z> <radius> <fromNodeId> | | send> addNode 0.51 0.51 1.01 0.08 |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> addNode 0.51 0.51 1.01 0.08 {3dc475f6-dcda-45b8-bb76-59948db39968} | | | | send> addNode 0.51 0.51 1.01 0.08 {3dc475f6-dcda-45b8-bb76-59948db39968} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| addNodeWithId <nodeId> <x> <y> <z> <radius> <fromNodeId> | | send> addNodeWithId {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 0.08 | | addNodeWithId <nodeId> <x> <y> <z> <radius> <fromNodeId> | | send> addNodeWithId {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 0.08 |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> addNodeWithId {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 0.08 {3dc475f6-dcda-45b8-bb76-59948db39968} | | | | send> addNodeWithId {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 0.08 {3dc475f6-dcda-45b8-bb76-59948db39968} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| scaleNodeByAddRadius <nodeId> <amount> | | send> scaleNodeByAddRadius {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.05 | | scaleNodeByAddRadius <nodeId> <amount> | | send> scaleNodeByAddRadius {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.05 |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| moveNodeBy <nodeId> <x> <y> <z> | | send> moveNodeBy {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.05 0.05 0.05 | | moveNodeBy <nodeId> <x> <y> <z> | | send> moveNodeBy {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.05 0.05 0.05 |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setNodeOrigin <nodeId> <x> <y> <z> | | send> setNodeOrigin {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 | | setNodeOrigin <nodeId> <x> <y> <z> | | send> setNodeOrigin {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.51 0.51 1.01 |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setNodeRadius <nodeId> <radius> | | send> setNodeRadius {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.08 | | setNodeRadius <nodeId> <radius> | | send> setNodeRadius {8d443cbf-fc73-4281-b3a1-268dd38b1c73} 0.08 |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setNodeBoneMark <nodeId> <boneMark> | | Available bone marks: Neck/Limb/Tail/Joint/None | | setNodeBoneMark <nodeId> <boneMark> | | Available bone marks: Neck/Limb/Tail/Joint/None |
| | | | | | | |
| | | send> setNodeBoneMark {8d443cbf-fc73-4281-b3a1-268dd38b1c73} Neck | | | | send> setNodeBoneMark {8d443cbf-fc73-4281-b3a1-268dd38b1c73} Neck |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| switchNodeXZ <nodeId> | | send> switchNodeXZ {8d443cbf-fc73-4281-b3a1-268dd38b1c73} | | switchNodeXZ <nodeId> | | send> switchNodeXZ {8d443cbf-fc73-4281-b3a1-268dd38b1c73} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| moveOriginBy <x> <y> <z> | | send> moveOriginBy 0.01, 0.02, 0.013 | | moveOriginBy <x> <y> <z> | | send> moveOriginBy 0.01, 0.02, 0.013 |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| addEdge <fromNodeId> <toNodeId> | | send> addEdge {a75f39ac-3c78-4754-b34a-dce70779832b} {507328fd-9baf-41d1-9e05-850fb41fcbfa} | | addEdge <fromNodeId> <toNodeId> | | send> addEdge {a75f39ac-3c78-4754-b34a-dce70779832b} {507328fd-9baf-41d1-9e05-850fb41fcbfa} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartLockState <partId> <lockState> | | send> setPartLockState {79a15562-908c-4b74-a489-af604796b1a0} locked | | setPartLockState <partId> <lockState> | | send> setPartLockState {79a15562-908c-4b74-a489-af604796b1a0} locked |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartLockState {79a15562-908c-4b74-a489-af604796b1a0} unlocked | | | | send> setPartLockState {79a15562-908c-4b74-a489-af604796b1a0} unlocked |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartVisibleState <partId> <visibleState> | | send> setPartVisibleState {79a15562-908c-4b74-a489-af604796b1a0} visible | | setPartVisibleState <partId> <visibleState> | | send> setPartVisibleState {79a15562-908c-4b74-a489-af604796b1a0} visible |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartVisibleState {79a15562-908c-4b74-a489-af604796b1a0} invisible | | | | send> setPartVisibleState {79a15562-908c-4b74-a489-af604796b1a0} invisible |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartSubdivState <partId> <subdivState> | | send> setPartSubdivState {79a15562-908c-4b74-a489-af604796b1a0} subdived | | setPartSubdivState <partId> <subdivState> | | send> setPartSubdivState {79a15562-908c-4b74-a489-af604796b1a0} subdived |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartSubdivState {79a15562-908c-4b74-a489-af604796b1a0} unsubdived | | | | send> setPartSubdivState {79a15562-908c-4b74-a489-af604796b1a0} unsubdived |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartChamferState <partId> <chamferState> | | send> setPartChamferState {79a15562-908c-4b74-a489-af604796b1a0} chamfered | | setPartChamferState <partId> <chamferState> | | send> setPartChamferState {79a15562-908c-4b74-a489-af604796b1a0} chamfered |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartChamferState {79a15562-908c-4b74-a489-af604796b1a0} unchamfered | | | | send> setPartChamferState {79a15562-908c-4b74-a489-af604796b1a0} unchamfered |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartRoundState <partId> <roundState> | | send> setPartRoundState {79a15562-908c-4b74-a489-af604796b1a0} rounded | | setPartRoundState <partId> <roundState> | | send> setPartRoundState {79a15562-908c-4b74-a489-af604796b1a0} rounded |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartRoundState {79a15562-908c-4b74-a489-af604796b1a0} unrounded | | | | send> setPartRoundState {79a15562-908c-4b74-a489-af604796b1a0} unrounded |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartDisableState <partId> <disableState> | | send> setPartDisableState {79a15562-908c-4b74-a489-af604796b1a0} disabled | | setPartDisableState <partId> <disableState> | | send> setPartDisableState {79a15562-908c-4b74-a489-af604796b1a0} disabled |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartDisableState {79a15562-908c-4b74-a489-af604796b1a0} undisabled | | | | send> setPartDisableState {79a15562-908c-4b74-a489-af604796b1a0} undisabled |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartXmirrorState <partId> <xMirrorState> | | send> setPartXmirrorState {79a15562-908c-4b74-a489-af604796b1a0} mirrored | | setPartXmirrorState <partId> <xMirrorState> | | send> setPartXmirrorState {79a15562-908c-4b74-a489-af604796b1a0} mirrored |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartXmirrorState {79a15562-908c-4b74-a489-af604796b1a0} unmirrored | | | | send> setPartXmirrorState {79a15562-908c-4b74-a489-af604796b1a0} unmirrored |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| setPartColor <partId> <colorName> | | send> setPartColor {79a15562-908c-4b74-a489-af604796b1a0} red | | setPartColor <partId> <colorName> | | send> setPartColor {79a15562-908c-4b74-a489-af604796b1a0} red |
| | | +OK | | | | +OK |
| | | | | | | |
| | | send> setPartColor {79a15562-908c-4b74-a489-af604796b1a0} | | | | send> setPartColor {79a15562-908c-4b74-a489-af604796b1a0} |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| getNodePartId <nodeId> | | send> getNodePartId {3dc475f6-dcda-45b8-bb76-59948db39968} | | getNodePartId <nodeId> | | send> getNodePartId {3dc475f6-dcda-45b8-bb76-59948db39968} |
| | | +OK | | | | +OK |
| | | {b8f9ae53-999c-4851-9c2b-69a427fca10c} | | | | {b8f9ae53-999c-4851-9c2b-69a427fca10c} |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| saveSnapshot | | send> saveSnapshot | | saveSnapshot | | send> saveSnapshot |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| getSnapshot | | send> getSnapshot | | getSnapshot | | send> getSnapshot |
| | | +OK | | | +OK |
| | | <?xml version="1.0"?> | | | <?xml version="1.0"?> |
| | | <canvas> | | | <canvas> |
| | | <nodes> | | | <nodes> |
| | | <node id="{3dc475f6-dcda-45b8-bb76-59948db39968}" partId="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" radius="0.08" x="0.51" y="0.51" z="1.01"/> | | | <node id="{3dc475f6-dcda-45b8-bb76-59948db39968}" partId="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" radius="0.08" x="0.51" y="0.51" z="1.01"/> |
| | | </nodes> | | | </nodes> |
| | | <edges/> | | | <edges/> |
| | | <parts> | | | <parts> |
| | | <part chamfered="false" disabled="false" id="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" locked="false" rounded="false" subdived="false" visible="true" xMirrored="false" zMirrored="false"/> | | | <part chamfered="false" disabled="false" id="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" locked="false" rounded="false" subdived="false" visible="true" xMirrored="false" zMirrored="false"/> |
| | | </parts> | | | </parts> |
| | | <components> | | | <components> |
| | | <component combineMode="Normal" expanded="false" id="{946dad8f-28d5-40c8-8c70-709ecc1ca048}" linkData="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" linkDataType="partId"/> | | | <component combineMode="Normal" expanded="false" id="{946dad8f-28d5-40c8-8c70-709ecc1ca048}" linkData="{b8f9ae53-999c-4851-9c2b-69a427fca10c}" linkDataType="partId"/> |
| | | </components> | | | </components> |
| | | <materials/> | | | <materials/> |
| | | <poses/> | | | <poses/> |
| | | <motions/> | | | <motions/> |
| | | </canvas> | | | | </canvas> |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| exportAsObj | | send> exportAsObj | | exportAsObj | | send> exportAsObj |
| | | +OK | | | +OK |
| | | # DUST3D | | | # DUST3D |
| | | v -0.08 0.08 0.08 | | | v -0.08 0.08 0.08 |
| | | v -0.08 -0.08 0.08 | | | v -0.08 -0.08 0.08 |
| | | v 0.08 -0.08 0.08 | | | v 0.08 -0.08 0.08 |
| | | v 0.08 -0.08 -0.08 | | | v 0.08 -0.08 -0.08 |
| | | v -0.08 -0.08 -0.08 | | | v -0.08 -0.08 -0.08 |
| | | v -0.08 0.08 -0.08 | | | v -0.08 0.08 -0.08 |
| | | v 0.08 0.08 -0.08 | | | v 0.08 0.08 -0.08 |
| | | v 0.08 0.08 0.08 | | | v 0.08 0.08 0.08 |
| | | f 2 1 6 5 | | | f 2 1 6 5 |
| | | f 3 2 5 4 | | | f 3 2 5 4 |
| | | f 2 3 8 1 | | | f 2 3 8 1 |
| | | f 8 3 4 7 | | | f 8 3 4 7 |
| | | f 5 6 7 4 | | | f 5 6 7 4 |
| | | f 1 8 7 6 | | | | f 1 8 7 6 |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| new | | send> new | | new | | send> new |
| | | +OK | | | | +OK |
+--------------------------------------------------------------+----------------------------------------------------------------------------------------------------------------------------+ +--------------------------------------------------------------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
Events Events
@ -308,9 +311,9 @@ Events
+--------------------------------------------------------------+ +--------------------------------------------------------------+
| radiuslockstatechanged | | radiuslockstatechanged |
+--------------------------------------------------------------+ +--------------------------------------------------------------+
| checkpart <partId | | checkpart <partId> |
+--------------------------------------------------------------+ +--------------------------------------------------------------+
| partchecked <partId | | partchecked <partId> |
+--------------------------------------------------------------+ +--------------------------------------------------------------+
| partunchecked | | partunchecked |
+--------------------------------------------------------------+ +--------------------------------------------------------------+