|
42 | 42 | (def rive-scene-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveSceneDesc"))
|
43 | 43 | (def rive-model-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveModelDesc"))
|
44 | 44 | (def blend-mode-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveModelDesc$BlendMode"))
|
| 45 | +(def coordinate-system-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveModelDesc$CoordinateSystem")) |
| 46 | +(def artboard-fit-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveModelDesc$Fit")) |
| 47 | +(def artboard-alignment-pb-class (workspace/load-class! "com.dynamo.rive.proto.Rive$RiveModelDesc$Alignment")) |
45 | 48 |
|
46 | 49 | (def rive-file-icon "/defold-rive/editor/resources/icons/32/Icons_17-Rive-file.png")
|
47 | 50 | (def rive-scene-icon "/defold-rive/editor/resources/icons/32/Icons_16-Rive-scene.png")
|
|
95 | 98 | default-animation :default-animation
|
96 | 99 | default-state-machine :default-state-machine
|
97 | 100 | blend-mode :blend-mode
|
98 |
| - create-go-bones :create-go-bones)))) |
| 101 | + create-go-bones :create-go-bones |
| 102 | + coordinate-system :coordinate-system |
| 103 | + artboard-fit :artboard-fit |
| 104 | + artboard-alignment :artboard-alignment)))) |
99 | 105 |
|
100 | 106 | (g/defnk produce-transform [position rotation scale]
|
101 | 107 | (math/->mat4-non-uniform (Vector3d. (double-array position))
|
|
605 | 611 | (dynamic error (g/fnk [_node-id atlas]
|
606 | 612 | (validate-scene-atlas _node-id atlas))))
|
607 | 613 |
|
608 |
| -; This property isn't visible, but here to allow us to preview the .spinescene |
| 614 | +; This property isn't visible, but here to allow us to preview the .rivescene |
609 | 615 | (property material resource/Resource ; Default assigned in load-fn.
|
610 | 616 | (value (gu/passthrough material-resource))
|
611 | 617 | (set (fn [evaluation-context self old-value new-value]
|
|
667 | 673 | ; .rivemodel (The "instance" file)
|
668 | 674 | ;
|
669 | 675 |
|
670 |
| -(g/defnk produce-rivemodel-save-value [rive-scene-resource artboard default-animation default-state-machine material-resource blend-mode create-go-bones] |
| 676 | +(g/defnk produce-rivemodel-save-value [rive-scene-resource artboard default-animation default-state-machine material-resource blend-mode create-go-bones coordinate-system artboard-fit artboard-alignment] |
671 | 677 | (protobuf/make-map-without-defaults rive-model-pb-class
|
672 | 678 | :scene (resource/resource->proj-path rive-scene-resource)
|
673 | 679 | :material (resource/resource->proj-path material-resource)
|
674 | 680 | :artboard artboard
|
675 | 681 | :default-animation default-animation
|
676 | 682 | :default-state-machine default-state-machine
|
677 | 683 | :blend-mode blend-mode
|
678 |
| - :create-go-bones create-go-bones)) |
| 684 | + :create-go-bones create-go-bones |
| 685 | + :coordinate-system coordinate-system |
| 686 | + :artboard-fit artboard-fit |
| 687 | + :artboard-alignment artboard-alignment)) |
679 | 688 |
|
680 | 689 | (defn- validate-model-artboard [node-id rive-scene rive-artboards artboard]
|
681 | 690 | (when (and rive-scene (not-empty artboard))
|
|
788 | 797 | (dynamic edit-type (g/fnk [rive-anim-ids] (properties/->choicebox (cons "" rive-anim-ids)))))
|
789 | 798 | (property create-go-bones g/Bool (default (protobuf/default rive-model-pb-class :create-go-bones)))
|
790 | 799 |
|
| 800 | + (property coordinate-system g/Any (default (protobuf/default rive-model-pb-class :coordinate-system)) |
| 801 | + (dynamic edit-type (g/constantly (properties/->pb-choicebox coordinate-system-pb-class)))) |
| 802 | + |
| 803 | + (property artboard-fit g/Any (default (protobuf/default rive-model-pb-class :artboard-fit)) |
| 804 | + (dynamic edit-type (g/constantly (properties/->pb-choicebox artboard-fit-pb-class)))) |
| 805 | + |
| 806 | + (property artboard-alignment g/Any (default (protobuf/default rive-model-pb-class :artboard-alignment)) |
| 807 | + (dynamic edit-type (g/constantly (properties/->pb-choicebox artboard-alignment-pb-class)))) |
| 808 | + |
791 | 809 | (input dep-build-targets g/Any :array)
|
792 | 810 | (input rive-file-handle g/Any)
|
793 | 811 | (input rive-scene-resource resource/Resource)
|
|
0 commit comments