Skip to content

Commit 8e90ba8

Browse files
authored
added ColorTintRequest call (#43)
* added basic ColorTintRequest, takes in exact name list, RGBA, and jeb mode * Added tint_all bool * changed docstring grammer * added the rest of the parameters * Added mix lighting param
1 parent 6293eda commit 8e90ba8

File tree

1 file changed

+70
-0
lines changed

1 file changed

+70
-0
lines changed

pyvts/vts_request.py

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,6 +259,76 @@ def requestDeleteCustomParameter(self, parameter) -> dict:
259259
data = {"parameterName": parameter}
260260
return self.BaseRequest("ParameterDeletionRequest", data=data)
261261

262+
def ColorTintRequest(
263+
self,
264+
red: int = 0,
265+
green: int = 0,
266+
blue: int = 0,
267+
alpha: int = 255,
268+
jeb: bool = False,
269+
mix_with_scene_lighting_color: float = 1,
270+
tint_all: bool = False,
271+
art_mesh_number: list = [],
272+
name_exact: list = [],
273+
name_contains: list = [],
274+
tag_exact: list = [],
275+
tag_contains: list = [],
276+
) -> dict:
277+
"""
278+
Alter the color of an Artmesh on the current model
279+
280+
Args
281+
-----------
282+
red : int, optional
283+
red value of tint (0-255)
284+
green : int, optional
285+
green value of tint (0-255)
286+
blue : int, optional
287+
blue value of tint (0-255)
288+
alpha : int, optional
289+
alpha value of tint (0-255)
290+
jeb : bool, optional
291+
boolean option to activate "jeb mode"(rainbow cycle) on art meshes
292+
mix_with_scene_lighting_color: float, optional
293+
float between 0 and 1, determines how much tint is mixed with scene lighting
294+
tint_all: bool, optional
295+
boolean option to tint all
296+
art_mesh_number: list, optional
297+
list of ints corresponding to art mesh numbers to color
298+
name_exact: list, optional
299+
list of strings of exact names of meshes to color
300+
name_contains: list, optional
301+
list of strings of partial names of meshes to color
302+
tag_exact: list, optional
303+
list of strings of exact tags of meshes to color
304+
tag_contains: list, optional
305+
list of strings of partial names of tags of meshes to color
306+
307+
308+
Returns
309+
-------
310+
the organized message sending to ``Vtubestudio API``
311+
"""
312+
data = {
313+
"colorTint": {
314+
"colorR": red,
315+
"colorG": green,
316+
"colorB": blue,
317+
"colorA": alpha,
318+
"mixWithSceneLightingColor": mix_with_scene_lighting_color,
319+
"jeb_": jeb,
320+
},
321+
"artMeshMatcher": {
322+
"tintAll": tint_all,
323+
"artMeshNumber": art_mesh_number,
324+
"nameExact": name_exact,
325+
"nameContains": name_contains,
326+
"tagExact": tag_exact,
327+
"tagContains": tag_contains,
328+
},
329+
}
330+
return self.BaseRequest("ColorTintRequest", data=data)
331+
262332
def eventSubscription(
263333
self, event_name: str, on: bool = True, cfg: dict = {"0": 0}
264334
) -> dict:

0 commit comments

Comments
 (0)