[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
[Monthly Archives]
[List Home]
Re: [Virtools] SDK : getting to the materials and textures
- Subject: Re: [Virtools] SDK : getting to the materials and textures
- From: "Romain Sididris" <roro@next-url.com>
- Date: Tue, 2 Jan 2001 12:23:08 +0100
- This code will returns the list of all existing materials and textures
and check for unused textures :
- Just a warning some textures may be used whereas there is no material
using it ( for exemple as input parameter of a behavior)
------ 1.0.1 Version --------
// Get The list of materials
CK_ID* Materials = CKGetObjectsListByClassID(CKCID_MATERIAL);
int MaterialCount = GetObjectsCountByClassID(CKCID_MATERIAL);
// iterate though all material and set a marker on
// the texture using "user application data" which was the simpliest way
// for this sample
for (int i =0; i < MaterialCount ; ++i) {
CKMaterial* mat = (CKMaterial*)CKGetObject(Materials[i]);
CKTexture* tex = mat->GetTexture();
//
if (tex) tex->SetAppData((void*)12345);
}
// Get all the textures ...
CK_ID* Textures = CKGetObjectsListByClassID(CKCID_TEXTURE);
int TextureCount = GetObjectsCountByClassID(CKCID_TEXTURE);
// iterate though all textures and test if the marker is set
for (int i =0; i < TextureCount ; ++i) {
CKTexture* tex = (CKTexture*)CKGetObject(Textures [i]);
// if the marker is not present this texture is not used by a
material
if (!tex->GetAppData()) {
// Texture is not used
} else {
// Restore application Data to 0
tex->SetAppData(0);
}
}
----- Original Message -----
From: "Patrick Hogenboom" <phogenboom@mcw.nl>
To: "Virtools User Group (E-mail)"
<virtools-user-group@lists.theswapmeet.com>
Sent: Friday, December 29, 2000 4:08 PM
Subject: [Virtools] SDK : getting to the materials and textures
> Hi there,
>
> Does anybody know how I can get to a list of all materials (and textures)
within the SDK ?
> I want to make a building block that searches for unused textures and
removes them.
>
> Thanks, Patrick
>
> Patrick Hogenboom
> MCW Studio's
> ...............................................................
> Distributed via the virtools-user-group list:
http://www.theswapmeet.com/numl.html
> To reply to the list instead of its author, use "Reply to All"
> To unsubscribe: send "unsubscribe virtools-user-group" to
Majordomo@lists.theswapmeet.com
> To subscribe: send "subscribe virtools-user-group" to
Majordomo@lists.theswapmeet.com
> To post a message: send it to virtools-user-group@lists.theswapmeet.com
> ...............................................................
>
...............................................................
Distributed via the virtools-user-group list: http://www.theswapmeet.com/numl.html
To reply to the list instead of its author, use "Reply to All"
To unsubscribe: send "unsubscribe virtools-user-group" to Majordomo@lists.theswapmeet.com
To subscribe: send "subscribe virtools-user-group" to Majordomo@lists.theswapmeet.com
To post a message: send it to virtools-user-group@lists.theswapmeet.com
...............................................................
References: