-
Notifications
You must be signed in to change notification settings - Fork 0
Texture
Mr_qsdf edited this page Apr 7, 2025
·
1 revision
The Texture class contains all the relevant data associated with a texture from a .bbmodel file, including methods to retrieve various properties and convert source data into an image.
-
path: String - Path to the texture file. -
name: String - Name of the texture. -
folder: String - Folder containing the texture. -
namespace: String - Namespace for the texture. -
id: String - ID of the texture. -
group: String - Group associated with the texture. -
width: Float - Texture width. -
height: Float - Texture height. -
uv_width: Float - UV mapping width. -
uv_height: Float - UV mapping height. -
particle: boolean - Whether this texture is a particle texture. -
use_as_default: boolean - If the texture is used as default. -
layers_enabled: boolean - Layers enabled or not. -
sync_to_project: String - Project synchronization information. -
render_mode: String - Render mode of the texture. -
render_sides: String - Sides rendering settings. -
frame_time: Float - Frame time for animated textures. -
frame_order_type: String - Frame order type. -
frame_order: String - Frame order. -
frame_interpolate: boolean - Frame interpolation enabled or not. -
visible: boolean - Visibility of the texture. -
internal: boolean - Internal usage status. -
saved: boolean - Saved state. -
uuid: String - Unique identifier. -
relative_path: String - Relative path to the texture file. -
source: String - Base64 encoded source data of the texture.
Returns an Image object generated from the Base64 encoded source data.
Here's an example of how to retrieve an image using the Texture class:
import fr.mrqsdf.bbmodelreader.BbModelReader;
import fr.mrqsdf.bbmodelreader.data.Texture;
import java.awt.Image;
public class Example {
public void retrieveTextureImage() {
// Retrieve the model first
Texture[] textures = BbModelReader.getModel("ModelName").getTextures();
for (Texture texture : texture){
System.out.println(texture.getName());
Image image = texture.getImage();
if (image != null) {
System.out.println("image generated with base64");
}
}
// Get the image
Image image = texture.getImage();
// Use the image as needed
}
}This example assumes that you have already loaded your model using the BbModelReader. Adjust "ModelName" to match your specific use case.