Repository navigation
Expand file tree
/
Copy pathplugin.js
More file actions
165 lines (156 loc) · 5.52 KB
/
Copy pathplugin.js
File metadata and controls
165 lines (156 loc) · 5.52 KB
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
"use strict"
{
const SDK = self.SDK
const PLUGIN_ID = "Mikal_3DObject"
const PLUGIN_VERSION = "2.82.187"
const PLUGIN_CATEGORY = "3d"
const PLUGIN_CLASS = (SDK.Plugins.Mikal_3DObject = class Object3DPlugin extends SDK.IPluginBase {
constructor() {
super(PLUGIN_ID)
SDK.Lang.PushContext("plugins." + PLUGIN_ID.toLowerCase())
this._info.SetName(lang(".name"))
this._info.SetDescription(lang(".description"))
this._info.SetVersion(PLUGIN_VERSION)
this._info.SetCategory(PLUGIN_CATEGORY)
this._info.SetAuthor("Mikal")
this._info.SetHelpUrl(lang(".help-url"))
this._info.SetPluginType("world") // mark as world plugin, which can draw
this._info.SetIsResizable(true) // allow to be resized
this._info.SetIsRotatable(false) // allow to be rotated
this._info.SetHasImage(true)
this._info.SetSupportsEffects(true) // allow effects
this._info.SetMustPreDraw(false)
this._info.SetCanBeBundled(false)
this._info.SetIs3D(true)
this._info.SetSupportsColor(true)
this._info.AddCommonPositionACEs()
// this._info.AddCommonAngleACEs();
this._info.AddCommonAppearanceACEs()
this._info.AddCommonZOrderACEs()
// this._info.AddCommonSizeACEs();
this._info.AddCommonSceneGraphACEs()
this._info.SetSupportsZElevation(true)
this._info.SetSupportedRuntimes(["c3"])
SDK.Lang.PushContext(".properties")
this._info.SetProperties([
new SDK.PluginProperty("text", "scale", "1"),
new SDK.PluginProperty("float", "z-elevation", {
interpolatable: false,
initialValue: 0,
}),
new SDK.PluginProperty("float", "angle-x", {
interpolatable: true,
initialValue: 0,
}),
new SDK.PluginProperty("float", "angle-y", {
interpolatable: true,
initialValue: 0,
}),
new SDK.PluginProperty("float", "angle-z", {
interpolatable: true,
initialValue: 0,
}),
new SDK.PluginProperty("combo", "rotation-order", {
initialValue: "xyz",
items: ["xyz", "xzy", "yxz", "yzx", "zxy", "zyx"],
interpolatable: false,
}),
new SDK.PluginProperty("link", "edit-image", {
linkCallback: function (sdkType) {
sdkType.GetObjectType().EditImage()
},
callbackType: "once-for-type",
}),
new SDK.PluginProperty("text", "gtlf-path", "", {
interpolatable: false,
}),
new SDK.PluginProperty("check", "debug", false, {
interpolatable: false,
}),
new SDK.PluginProperty("float", "animation-blend", 0, {
interpolatable: false,
}),
new SDK.PluginProperty("check", "instance-model", false, {
interpolatable: false,
}),
new SDK.PluginProperty("check", "image-texture", false, {
interpolatable: false,
}),
new SDK.PluginProperty("float", "x-scale", {
interpolatable: true,
initialValue: 1,
}),
new SDK.PluginProperty("float", "y-scale", {
interpolatable: true,
initialValue: 1,
}),
new SDK.PluginProperty("float", "z-scale", {
interpolatable: true,
initialValue: 1,
}),
new SDK.PluginProperty("check", "wireframe", false, {
interpolatable: false,
}),
new SDK.PluginProperty("check", "worker-animation", false, {
interpolatable: false,
}),
new SDK.PluginProperty("check", "cpu-xform", false, {
interpolatable: false,
}),
new SDK.PluginProperty("check", "disable-load", false, {
interpolatable: false,
}),
])
this._info.AddFileDependency({
filename: "gl-matrix.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/gltfData.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/boneBuffer.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/objectBuffer.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/uniformLocationCache.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/gltfModel.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/gltfModelW.js",
type: "external-runtime-script",
})
this._info.AddFileDependency({
filename: "c3runtime/gltfWorker.js",
type: "copy-to-output",
fileType: "text",
})
this._info.AddFileDependency({
filename: "c3runtime/draco_wasm_wrapper.js",
type: "copy-to-output",
fileType: "application/javascript",
})
this._info.AddFileDependency({
filename: "c3runtime/draco_decoder.wasm",
type: "copy-to-output",
fileType: "application/wasm",
})
this._info.AddFileDependency({
filename: "c3runtime/DRACOLoader.js",
type: "external-runtime-script",
})
SDK.Lang.PopContext() //.properties
SDK.Lang.PopContext()
}
})
PLUGIN_CLASS.Register(PLUGIN_ID, PLUGIN_CLASS)
}