Struct vtubestudio::data::ItemListRequest
source · [−]pub struct ItemListRequest {
pub include_available_spots: bool,
pub include_item_instances_in_scene: bool,
pub include_available_item_files: bool,
pub only_items_with_file_name: Option<String>,
pub only_items_with_instance_id: Option<String>,
}
Expand description
Requesting list of available items or items in scene.
This request lets you request a list of items that are currently in the scene. It also lets you request a list of item files that are available to be loaded on the user’s PC, including Live2D items, animation folders, etc.
If you want to know which order-spots are available to load items into right now, set
"includeAvailableSpots"
to true
. Otherwise, the "availableSpots"
array in the
response will be empty.
If you want to know which items are loaded in the scene right now, set
"includeItemInstancesInScene"
to true
. Otherwise, the "itemInstancesInScene"
array in the response will be empty.
If you want to know which item files are available to be loaded, set
"includeAvailableItemFiles"
to true
. Otherwise, the "availableItemFiles"
array in
the response will be empty.
IMPORTANT: This reads the full list of item files from the user’s PC. This may lag
the app for a small moment, so do not use this request with
"includeAvailableItemFiles"
set to true
often. Only use it if you really need to
refresh the list of available item files. Set it to false
in any other case.
Filtering for specific items
If you only want the item lists to contain items with a certain item instance ID or a
certain filename, you can provide them in the "onlyItemsWithInstanceID"
and
"onlyItemsWithFileName"
fields respectively.
There will only ever be at most one item with a certain instance ID in the scene, but there could be many items with the same filename because you can load many item instances based on the same item file.
Please also note that item filenames are unique, meaning there cannot be two item files with the same filename. They are also case-sensitive, so if you want to refer to one specific file, make sure to not change the capitalization.
This request returns ItemListResponse
.
Fields
include_available_spots: bool
Include available spots.
include_item_instances_in_scene: bool
Include item instances in scene.
include_available_item_files: bool
Include available item files.
only_items_with_file_name: Option<String>
Include only items with file name. E.g., my_item_filename.png
.
The filename is the name of the item file. This is the name you can use to load an instance of the item into the scene. For JPG/PNG/GIF items, this is the full filename (without path) including the file extension (for example “my_item.jpg”). For animation folders, it’s the folder name. For Live2D items, it is also the folder name.
only_items_with_instance_id: Option<String>
Include only items with instance ID. E.g., IONAL_InstanceIdOfItemInScene
Trait Implementations
sourceimpl Clone for ItemListRequest
impl Clone for ItemListRequest
sourcefn clone(&self) -> ItemListRequest
fn clone(&self) -> ItemListRequest
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresourceimpl Debug for ItemListRequest
impl Debug for ItemListRequest
sourceimpl Default for ItemListRequest
impl Default for ItemListRequest
sourcefn default() -> ItemListRequest
fn default() -> ItemListRequest
sourceimpl<'de> Deserialize<'de> for ItemListRequest
impl<'de> Deserialize<'de> for ItemListRequest
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
sourceimpl PartialEq<ItemListRequest> for ItemListRequest
impl PartialEq<ItemListRequest> for ItemListRequest
sourcefn eq(&self, other: &ItemListRequest) -> bool
fn eq(&self, other: &ItemListRequest) -> bool
sourceimpl Request for ItemListRequest
impl Request for ItemListRequest
type Response = ItemListResponse
type Response = ItemListResponse
Response
type for this request.