@dcl/protocol 1.0.0-16412845337.commit-aad5651 → 1.0.0-16428499484.commit-7aab7c2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/out-js/decentraland/sdk/components/gltf_node_modifiers.gen.d.ts +57 -0
- package/out-js/decentraland/sdk/components/gltf_node_modifiers.gen.js +164 -0
- package/out-js/decentraland/sdk/components/gltf_node_modifiers.gen.js.map +1 -0
- package/out-ts/decentraland/sdk/components/gltf_node_modifiers.gen.ts +204 -0
- package/package.json +2 -2
- package/proto/decentraland/sdk/components/gltf_node_modifiers.proto +25 -0
- package/public/sdk-components.proto +1 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import _m0 from "protobufjs/minimal";
|
|
2
|
+
import { PBMaterial } from "./material.gen";
|
|
3
|
+
export declare const protobufPackage = "decentraland.sdk.components";
|
|
4
|
+
/**
|
|
5
|
+
* GltfNodeModifiers component is to be used attached to entities that have the GltfContainer component.
|
|
6
|
+
*
|
|
7
|
+
* This allows to override either the Material or the Casting Shadows behaviour of the target GLTF Node.
|
|
8
|
+
*
|
|
9
|
+
* * If the 'path' of the first modifier in the collection is an empty string: the configuration will
|
|
10
|
+
* affect all of the GLTF Nodes (as a global modifier).
|
|
11
|
+
* * Otherwise, for the modifiers whose 'path' is found in the GLTF hierarchy, the modifier will affect only
|
|
12
|
+
* the target Nodes.
|
|
13
|
+
*/
|
|
14
|
+
export interface PBGltfNodeModifiers {
|
|
15
|
+
modifiers: PBGltfNodeModifiers_GltfNodeModifier[];
|
|
16
|
+
}
|
|
17
|
+
export interface PBGltfNodeModifiers_GltfNodeModifier {
|
|
18
|
+
/** The GLTF hierarchy path of the target Node to be affected */
|
|
19
|
+
path: string;
|
|
20
|
+
/** The casting shadows enabled override */
|
|
21
|
+
castShadows?: boolean | undefined;
|
|
22
|
+
/** The Material that will be overridden on the target Node */
|
|
23
|
+
material?: PBMaterial | undefined;
|
|
24
|
+
}
|
|
25
|
+
export declare namespace PBGltfNodeModifiers {
|
|
26
|
+
function encode(message: PBGltfNodeModifiers, writer?: _m0.Writer): _m0.Writer;
|
|
27
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBGltfNodeModifiers;
|
|
28
|
+
function fromJSON(object: any): PBGltfNodeModifiers;
|
|
29
|
+
function toJSON(message: PBGltfNodeModifiers): unknown;
|
|
30
|
+
function create<I extends Exact<DeepPartial<PBGltfNodeModifiers>, I>>(base?: I): PBGltfNodeModifiers;
|
|
31
|
+
function fromPartial<I extends Exact<DeepPartial<PBGltfNodeModifiers>, I>>(object: I): PBGltfNodeModifiers;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace PBGltfNodeModifiers_GltfNodeModifier {
|
|
34
|
+
function encode(message: PBGltfNodeModifiers_GltfNodeModifier, writer?: _m0.Writer): _m0.Writer;
|
|
35
|
+
function decode(input: _m0.Reader | Uint8Array, length?: number): PBGltfNodeModifiers_GltfNodeModifier;
|
|
36
|
+
function fromJSON(object: any): PBGltfNodeModifiers_GltfNodeModifier;
|
|
37
|
+
function toJSON(message: PBGltfNodeModifiers_GltfNodeModifier): unknown;
|
|
38
|
+
function create<I extends Exact<DeepPartial<PBGltfNodeModifiers_GltfNodeModifier>, I>>(base?: I): PBGltfNodeModifiers_GltfNodeModifier;
|
|
39
|
+
function fromPartial<I extends Exact<DeepPartial<PBGltfNodeModifiers_GltfNodeModifier>, I>>(object: I): PBGltfNodeModifiers_GltfNodeModifier;
|
|
40
|
+
}
|
|
41
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
42
|
+
export type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {
|
|
43
|
+
$case: string;
|
|
44
|
+
} ? {
|
|
45
|
+
[K in keyof Omit<T, "$case">]?: DeepPartial<T[K]>;
|
|
46
|
+
} & {
|
|
47
|
+
$case: T["$case"];
|
|
48
|
+
} : T extends {} ? {
|
|
49
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
50
|
+
} : Partial<T>;
|
|
51
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
52
|
+
export type Exact<P, I extends P> = P extends Builtin ? P : P & {
|
|
53
|
+
[K in keyof P]: Exact<P[K], I[K]>;
|
|
54
|
+
} & {
|
|
55
|
+
[K in Exclude<keyof I, KeysOfUnion<P>>]: never;
|
|
56
|
+
};
|
|
57
|
+
export {};
|
|
@@ -0,0 +1,164 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.PBGltfNodeModifiers_GltfNodeModifier = exports.PBGltfNodeModifiers = exports.protobufPackage = void 0;
|
|
7
|
+
/* eslint-disable */
|
|
8
|
+
const minimal_1 = __importDefault(require("protobufjs/minimal"));
|
|
9
|
+
const material_gen_1 = require("./material.gen");
|
|
10
|
+
exports.protobufPackage = "decentraland.sdk.components";
|
|
11
|
+
function createBasePBGltfNodeModifiers() {
|
|
12
|
+
return { modifiers: [] };
|
|
13
|
+
}
|
|
14
|
+
var PBGltfNodeModifiers;
|
|
15
|
+
(function (PBGltfNodeModifiers) {
|
|
16
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
17
|
+
for (const v of message.modifiers) {
|
|
18
|
+
PBGltfNodeModifiers_GltfNodeModifier.encode(v, writer.uint32(10).fork()).ldelim();
|
|
19
|
+
}
|
|
20
|
+
return writer;
|
|
21
|
+
}
|
|
22
|
+
PBGltfNodeModifiers.encode = encode;
|
|
23
|
+
function decode(input, length) {
|
|
24
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
25
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
26
|
+
const message = createBasePBGltfNodeModifiers();
|
|
27
|
+
while (reader.pos < end) {
|
|
28
|
+
const tag = reader.uint32();
|
|
29
|
+
switch (tag >>> 3) {
|
|
30
|
+
case 1:
|
|
31
|
+
if (tag !== 10) {
|
|
32
|
+
break;
|
|
33
|
+
}
|
|
34
|
+
message.modifiers.push(PBGltfNodeModifiers_GltfNodeModifier.decode(reader, reader.uint32()));
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
reader.skipType(tag & 7);
|
|
41
|
+
}
|
|
42
|
+
return message;
|
|
43
|
+
}
|
|
44
|
+
PBGltfNodeModifiers.decode = decode;
|
|
45
|
+
function fromJSON(object) {
|
|
46
|
+
return {
|
|
47
|
+
modifiers: Array.isArray(object === null || object === void 0 ? void 0 : object.modifiers)
|
|
48
|
+
? object.modifiers.map((e) => PBGltfNodeModifiers_GltfNodeModifier.fromJSON(e))
|
|
49
|
+
: [],
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
PBGltfNodeModifiers.fromJSON = fromJSON;
|
|
53
|
+
function toJSON(message) {
|
|
54
|
+
const obj = {};
|
|
55
|
+
if (message.modifiers) {
|
|
56
|
+
obj.modifiers = message.modifiers.map((e) => e ? PBGltfNodeModifiers_GltfNodeModifier.toJSON(e) : undefined);
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
obj.modifiers = [];
|
|
60
|
+
}
|
|
61
|
+
return obj;
|
|
62
|
+
}
|
|
63
|
+
PBGltfNodeModifiers.toJSON = toJSON;
|
|
64
|
+
function create(base) {
|
|
65
|
+
return PBGltfNodeModifiers.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
66
|
+
}
|
|
67
|
+
PBGltfNodeModifiers.create = create;
|
|
68
|
+
function fromPartial(object) {
|
|
69
|
+
var _a;
|
|
70
|
+
const message = createBasePBGltfNodeModifiers();
|
|
71
|
+
message.modifiers = ((_a = object.modifiers) === null || _a === void 0 ? void 0 : _a.map((e) => PBGltfNodeModifiers_GltfNodeModifier.fromPartial(e))) || [];
|
|
72
|
+
return message;
|
|
73
|
+
}
|
|
74
|
+
PBGltfNodeModifiers.fromPartial = fromPartial;
|
|
75
|
+
})(PBGltfNodeModifiers || (exports.PBGltfNodeModifiers = PBGltfNodeModifiers = {}));
|
|
76
|
+
function createBasePBGltfNodeModifiers_GltfNodeModifier() {
|
|
77
|
+
return { path: "", castShadows: undefined, material: undefined };
|
|
78
|
+
}
|
|
79
|
+
var PBGltfNodeModifiers_GltfNodeModifier;
|
|
80
|
+
(function (PBGltfNodeModifiers_GltfNodeModifier) {
|
|
81
|
+
function encode(message, writer = minimal_1.default.Writer.create()) {
|
|
82
|
+
if (message.path !== "") {
|
|
83
|
+
writer.uint32(10).string(message.path);
|
|
84
|
+
}
|
|
85
|
+
if (message.castShadows !== undefined) {
|
|
86
|
+
writer.uint32(16).bool(message.castShadows);
|
|
87
|
+
}
|
|
88
|
+
if (message.material !== undefined) {
|
|
89
|
+
material_gen_1.PBMaterial.encode(message.material, writer.uint32(26).fork()).ldelim();
|
|
90
|
+
}
|
|
91
|
+
return writer;
|
|
92
|
+
}
|
|
93
|
+
PBGltfNodeModifiers_GltfNodeModifier.encode = encode;
|
|
94
|
+
function decode(input, length) {
|
|
95
|
+
const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input);
|
|
96
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
97
|
+
const message = createBasePBGltfNodeModifiers_GltfNodeModifier();
|
|
98
|
+
while (reader.pos < end) {
|
|
99
|
+
const tag = reader.uint32();
|
|
100
|
+
switch (tag >>> 3) {
|
|
101
|
+
case 1:
|
|
102
|
+
if (tag !== 10) {
|
|
103
|
+
break;
|
|
104
|
+
}
|
|
105
|
+
message.path = reader.string();
|
|
106
|
+
continue;
|
|
107
|
+
case 2:
|
|
108
|
+
if (tag !== 16) {
|
|
109
|
+
break;
|
|
110
|
+
}
|
|
111
|
+
message.castShadows = reader.bool();
|
|
112
|
+
continue;
|
|
113
|
+
case 3:
|
|
114
|
+
if (tag !== 26) {
|
|
115
|
+
break;
|
|
116
|
+
}
|
|
117
|
+
message.material = material_gen_1.PBMaterial.decode(reader, reader.uint32());
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
reader.skipType(tag & 7);
|
|
124
|
+
}
|
|
125
|
+
return message;
|
|
126
|
+
}
|
|
127
|
+
PBGltfNodeModifiers_GltfNodeModifier.decode = decode;
|
|
128
|
+
function fromJSON(object) {
|
|
129
|
+
return {
|
|
130
|
+
path: isSet(object.path) ? String(object.path) : "",
|
|
131
|
+
castShadows: isSet(object.castShadows) ? Boolean(object.castShadows) : undefined,
|
|
132
|
+
material: isSet(object.material) ? material_gen_1.PBMaterial.fromJSON(object.material) : undefined,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
PBGltfNodeModifiers_GltfNodeModifier.fromJSON = fromJSON;
|
|
136
|
+
function toJSON(message) {
|
|
137
|
+
const obj = {};
|
|
138
|
+
message.path !== undefined && (obj.path = message.path);
|
|
139
|
+
message.castShadows !== undefined && (obj.castShadows = message.castShadows);
|
|
140
|
+
message.material !== undefined &&
|
|
141
|
+
(obj.material = message.material ? material_gen_1.PBMaterial.toJSON(message.material) : undefined);
|
|
142
|
+
return obj;
|
|
143
|
+
}
|
|
144
|
+
PBGltfNodeModifiers_GltfNodeModifier.toJSON = toJSON;
|
|
145
|
+
function create(base) {
|
|
146
|
+
return PBGltfNodeModifiers_GltfNodeModifier.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
147
|
+
}
|
|
148
|
+
PBGltfNodeModifiers_GltfNodeModifier.create = create;
|
|
149
|
+
function fromPartial(object) {
|
|
150
|
+
var _a, _b;
|
|
151
|
+
const message = createBasePBGltfNodeModifiers_GltfNodeModifier();
|
|
152
|
+
message.path = (_a = object.path) !== null && _a !== void 0 ? _a : "";
|
|
153
|
+
message.castShadows = (_b = object.castShadows) !== null && _b !== void 0 ? _b : undefined;
|
|
154
|
+
message.material = (object.material !== undefined && object.material !== null)
|
|
155
|
+
? material_gen_1.PBMaterial.fromPartial(object.material)
|
|
156
|
+
: undefined;
|
|
157
|
+
return message;
|
|
158
|
+
}
|
|
159
|
+
PBGltfNodeModifiers_GltfNodeModifier.fromPartial = fromPartial;
|
|
160
|
+
})(PBGltfNodeModifiers_GltfNodeModifier || (exports.PBGltfNodeModifiers_GltfNodeModifier = PBGltfNodeModifiers_GltfNodeModifier = {}));
|
|
161
|
+
function isSet(value) {
|
|
162
|
+
return value !== null && value !== undefined;
|
|
163
|
+
}
|
|
164
|
+
//# sourceMappingURL=gltf_node_modifiers.gen.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gltf_node_modifiers.gen.js","sourceRoot":"","sources":["../../../../out-ts/decentraland/sdk/components/gltf_node_modifiers.gen.ts"],"names":[],"mappings":";;;;;;AAAA,oBAAoB;AACpB,iEAAqC;AACrC,iDAA4C;AAE/B,QAAA,eAAe,GAAG,6BAA6B,CAAC;AA2B7D,SAAS,6BAA6B;IACpC,OAAO,EAAE,SAAS,EAAE,EAAE,EAAE,CAAC;AAC3B,CAAC;AAED,IAAiB,mBAAmB,CA0DnC;AA1DD,WAAiB,mBAAmB;IAClC,SAAgB,MAAM,CAAC,OAA4B,EAAE,SAAqB,iBAAG,CAAC,MAAM,CAAC,MAAM,EAAE;QAC3F,KAAK,MAAM,CAAC,IAAI,OAAO,CAAC,SAAS,EAAE,CAAC;YAClC,oCAAoC,CAAC,MAAM,CAAC,CAAE,EAAE,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;QACrF,CAAC;QACD,OAAO,MAAM,CAAC;IAChB,CAAC;IALe,0BAAM,SAKrB,CAAA;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,gDAAW,cAU1B,CAAA;AACH,CAAC,EAxFgB,oCAAoC,oDAApC,oCAAoC,QAwFpD;AAcD,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,KAAK,KAAK,IAAI,IAAI,KAAK,KAAK,SAAS,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
import _m0 from "protobufjs/minimal";
|
|
3
|
+
import { PBMaterial } from "./material.gen";
|
|
4
|
+
|
|
5
|
+
export const protobufPackage = "decentraland.sdk.components";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* GltfNodeModifiers component is to be used attached to entities that have the GltfContainer component.
|
|
9
|
+
*
|
|
10
|
+
* This allows to override either the Material or the Casting Shadows behaviour of the target GLTF Node.
|
|
11
|
+
*
|
|
12
|
+
* * If the 'path' of the first modifier in the collection is an empty string: the configuration will
|
|
13
|
+
* affect all of the GLTF Nodes (as a global modifier).
|
|
14
|
+
* * Otherwise, for the modifiers whose 'path' is found in the GLTF hierarchy, the modifier will affect only
|
|
15
|
+
* the target Nodes.
|
|
16
|
+
*/
|
|
17
|
+
export interface PBGltfNodeModifiers {
|
|
18
|
+
modifiers: PBGltfNodeModifiers_GltfNodeModifier[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface PBGltfNodeModifiers_GltfNodeModifier {
|
|
22
|
+
/** The GLTF hierarchy path of the target Node to be affected */
|
|
23
|
+
path: string;
|
|
24
|
+
/** The casting shadows enabled override */
|
|
25
|
+
castShadows?:
|
|
26
|
+
| boolean
|
|
27
|
+
| undefined;
|
|
28
|
+
/** The Material that will be overridden on the target Node */
|
|
29
|
+
material?: PBMaterial | undefined;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function createBasePBGltfNodeModifiers(): PBGltfNodeModifiers {
|
|
33
|
+
return { modifiers: [] };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export namespace PBGltfNodeModifiers {
|
|
37
|
+
export function encode(message: PBGltfNodeModifiers, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
|
|
38
|
+
for (const v of message.modifiers) {
|
|
39
|
+
PBGltfNodeModifiers_GltfNodeModifier.encode(v!, writer.uint32(10).fork()).ldelim();
|
|
40
|
+
}
|
|
41
|
+
return writer;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBGltfNodeModifiers {
|
|
45
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
46
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
47
|
+
const message = createBasePBGltfNodeModifiers();
|
|
48
|
+
while (reader.pos < end) {
|
|
49
|
+
const tag = reader.uint32();
|
|
50
|
+
switch (tag >>> 3) {
|
|
51
|
+
case 1:
|
|
52
|
+
if (tag !== 10) {
|
|
53
|
+
break;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
message.modifiers.push(PBGltfNodeModifiers_GltfNodeModifier.decode(reader, reader.uint32()));
|
|
57
|
+
continue;
|
|
58
|
+
}
|
|
59
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
60
|
+
break;
|
|
61
|
+
}
|
|
62
|
+
reader.skipType(tag & 7);
|
|
63
|
+
}
|
|
64
|
+
return message;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export function fromJSON(object: any): PBGltfNodeModifiers {
|
|
68
|
+
return {
|
|
69
|
+
modifiers: Array.isArray(object?.modifiers)
|
|
70
|
+
? object.modifiers.map((e: any) => PBGltfNodeModifiers_GltfNodeModifier.fromJSON(e))
|
|
71
|
+
: [],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export function toJSON(message: PBGltfNodeModifiers): unknown {
|
|
76
|
+
const obj: any = {};
|
|
77
|
+
if (message.modifiers) {
|
|
78
|
+
obj.modifiers = message.modifiers.map((e) => e ? PBGltfNodeModifiers_GltfNodeModifier.toJSON(e) : undefined);
|
|
79
|
+
} else {
|
|
80
|
+
obj.modifiers = [];
|
|
81
|
+
}
|
|
82
|
+
return obj;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export function create<I extends Exact<DeepPartial<PBGltfNodeModifiers>, I>>(base?: I): PBGltfNodeModifiers {
|
|
86
|
+
return PBGltfNodeModifiers.fromPartial(base ?? {});
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export function fromPartial<I extends Exact<DeepPartial<PBGltfNodeModifiers>, I>>(object: I): PBGltfNodeModifiers {
|
|
90
|
+
const message = createBasePBGltfNodeModifiers();
|
|
91
|
+
message.modifiers = object.modifiers?.map((e) => PBGltfNodeModifiers_GltfNodeModifier.fromPartial(e)) || [];
|
|
92
|
+
return message;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
function createBasePBGltfNodeModifiers_GltfNodeModifier(): PBGltfNodeModifiers_GltfNodeModifier {
|
|
97
|
+
return { path: "", castShadows: undefined, material: undefined };
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export namespace PBGltfNodeModifiers_GltfNodeModifier {
|
|
101
|
+
export function encode(
|
|
102
|
+
message: PBGltfNodeModifiers_GltfNodeModifier,
|
|
103
|
+
writer: _m0.Writer = _m0.Writer.create(),
|
|
104
|
+
): _m0.Writer {
|
|
105
|
+
if (message.path !== "") {
|
|
106
|
+
writer.uint32(10).string(message.path);
|
|
107
|
+
}
|
|
108
|
+
if (message.castShadows !== undefined) {
|
|
109
|
+
writer.uint32(16).bool(message.castShadows);
|
|
110
|
+
}
|
|
111
|
+
if (message.material !== undefined) {
|
|
112
|
+
PBMaterial.encode(message.material, writer.uint32(26).fork()).ldelim();
|
|
113
|
+
}
|
|
114
|
+
return writer;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function decode(input: _m0.Reader | Uint8Array, length?: number): PBGltfNodeModifiers_GltfNodeModifier {
|
|
118
|
+
const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
|
|
119
|
+
let end = length === undefined ? reader.len : reader.pos + length;
|
|
120
|
+
const message = createBasePBGltfNodeModifiers_GltfNodeModifier();
|
|
121
|
+
while (reader.pos < end) {
|
|
122
|
+
const tag = reader.uint32();
|
|
123
|
+
switch (tag >>> 3) {
|
|
124
|
+
case 1:
|
|
125
|
+
if (tag !== 10) {
|
|
126
|
+
break;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
message.path = reader.string();
|
|
130
|
+
continue;
|
|
131
|
+
case 2:
|
|
132
|
+
if (tag !== 16) {
|
|
133
|
+
break;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
message.castShadows = reader.bool();
|
|
137
|
+
continue;
|
|
138
|
+
case 3:
|
|
139
|
+
if (tag !== 26) {
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
message.material = PBMaterial.decode(reader, reader.uint32());
|
|
144
|
+
continue;
|
|
145
|
+
}
|
|
146
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
147
|
+
break;
|
|
148
|
+
}
|
|
149
|
+
reader.skipType(tag & 7);
|
|
150
|
+
}
|
|
151
|
+
return message;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
export function fromJSON(object: any): PBGltfNodeModifiers_GltfNodeModifier {
|
|
155
|
+
return {
|
|
156
|
+
path: isSet(object.path) ? String(object.path) : "",
|
|
157
|
+
castShadows: isSet(object.castShadows) ? Boolean(object.castShadows) : undefined,
|
|
158
|
+
material: isSet(object.material) ? PBMaterial.fromJSON(object.material) : undefined,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
export function toJSON(message: PBGltfNodeModifiers_GltfNodeModifier): unknown {
|
|
163
|
+
const obj: any = {};
|
|
164
|
+
message.path !== undefined && (obj.path = message.path);
|
|
165
|
+
message.castShadows !== undefined && (obj.castShadows = message.castShadows);
|
|
166
|
+
message.material !== undefined &&
|
|
167
|
+
(obj.material = message.material ? PBMaterial.toJSON(message.material) : undefined);
|
|
168
|
+
return obj;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
export function create<I extends Exact<DeepPartial<PBGltfNodeModifiers_GltfNodeModifier>, I>>(
|
|
172
|
+
base?: I,
|
|
173
|
+
): PBGltfNodeModifiers_GltfNodeModifier {
|
|
174
|
+
return PBGltfNodeModifiers_GltfNodeModifier.fromPartial(base ?? {});
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
export function fromPartial<I extends Exact<DeepPartial<PBGltfNodeModifiers_GltfNodeModifier>, I>>(
|
|
178
|
+
object: I,
|
|
179
|
+
): PBGltfNodeModifiers_GltfNodeModifier {
|
|
180
|
+
const message = createBasePBGltfNodeModifiers_GltfNodeModifier();
|
|
181
|
+
message.path = object.path ?? "";
|
|
182
|
+
message.castShadows = object.castShadows ?? undefined;
|
|
183
|
+
message.material = (object.material !== undefined && object.material !== null)
|
|
184
|
+
? PBMaterial.fromPartial(object.material)
|
|
185
|
+
: undefined;
|
|
186
|
+
return message;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
|
|
191
|
+
|
|
192
|
+
export type DeepPartial<T> = T extends Builtin ? T
|
|
193
|
+
: T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
|
|
194
|
+
: T extends { $case: string } ? { [K in keyof Omit<T, "$case">]?: DeepPartial<T[K]> } & { $case: T["$case"] }
|
|
195
|
+
: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
196
|
+
: Partial<T>;
|
|
197
|
+
|
|
198
|
+
type KeysOfUnion<T> = T extends T ? keyof T : never;
|
|
199
|
+
export type Exact<P, I extends P> = P extends Builtin ? P
|
|
200
|
+
: P & { [K in keyof P]: Exact<P[K], I[K]> } & { [K in Exclude<keyof I, KeysOfUnion<P>>]: never };
|
|
201
|
+
|
|
202
|
+
function isSet(value: any): boolean {
|
|
203
|
+
return value !== null && value !== undefined;
|
|
204
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dcl/protocol",
|
|
3
|
-
"version": "1.0.0-
|
|
3
|
+
"version": "1.0.0-16428499484.commit-7aab7c2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"repository": "decentraland/protocol.git",
|
|
6
6
|
"homepage": "https://github.com/decentraland/protocol#readme",
|
|
@@ -30,5 +30,5 @@
|
|
|
30
30
|
"out-js",
|
|
31
31
|
"public"
|
|
32
32
|
],
|
|
33
|
-
"commit": "
|
|
33
|
+
"commit": "7aab7c2283cf58d6bfa82ac990af42933526ef45"
|
|
34
34
|
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
|
|
3
|
+
package decentraland.sdk.components;
|
|
4
|
+
|
|
5
|
+
import "decentraland/sdk/components/common/id.proto";
|
|
6
|
+
import "decentraland/sdk/components/material.proto";
|
|
7
|
+
|
|
8
|
+
option (common.ecs_component_id) = 1099;
|
|
9
|
+
|
|
10
|
+
// GltfNodeModifiers component is to be used attached to entities that have the GltfContainer component.
|
|
11
|
+
//
|
|
12
|
+
// This allows to override either the Material or the Casting Shadows behaviour of the target GLTF Node.
|
|
13
|
+
//
|
|
14
|
+
// * If the 'path' of the first modifier in the collection is an empty string: the configuration will
|
|
15
|
+
// affect all of the GLTF Nodes (as a global modifier).
|
|
16
|
+
// * Otherwise, for the modifiers whose 'path' is found in the GLTF hierarchy, the modifier will affect only
|
|
17
|
+
// the target Nodes.
|
|
18
|
+
message PBGltfNodeModifiers {
|
|
19
|
+
message GltfNodeModifier {
|
|
20
|
+
string path = 1; // The GLTF hierarchy path of the target Node to be affected
|
|
21
|
+
optional bool cast_shadows = 2; // The casting shadows enabled override
|
|
22
|
+
optional PBMaterial material = 3; // The Material that will be overridden on the target Node
|
|
23
|
+
}
|
|
24
|
+
repeated GltfNodeModifier modifiers = 1;
|
|
25
|
+
}
|
|
@@ -15,6 +15,7 @@ import public "decentraland/sdk/components/camera_mode_area.proto";
|
|
|
15
15
|
import public "decentraland/sdk/components/camera_mode.proto";
|
|
16
16
|
import public "decentraland/sdk/components/engine_info.proto";
|
|
17
17
|
import public "decentraland/sdk/components/gltf_container.proto";
|
|
18
|
+
import public "decentraland/sdk/components/gltf_node_modifiers.proto";
|
|
18
19
|
import public "decentraland/sdk/components/gltf_container_loading_state.proto";
|
|
19
20
|
import public "decentraland/sdk/components/material.proto";
|
|
20
21
|
import public "decentraland/sdk/components/mesh_collider.proto";
|