the only thing I could not solve is how to add the image texture with the texture inside, someone can find the solution to that ( maybe aoktar XD )

tutorial here -----------------> https://youtu.be/60Zft6Syovs
Moderators: aoktar, ChrisHekman
Please take a look this code. Let me know the resultsFelipeCortes wrote: the only thing I could not solve is how to add the image texture with the texture inside, someone can find the solution to that ( maybe aoktar XD )
Code: Select all
#define ID_OCTANE_IMAGE_TEXTURE 1029508
IMAGETEXTURE_FILE =1100
///------------------------------------------------------------------------
BaseShader* addImageTextureToNode(GeListNode *node, long slotID, String name)
{
if(!node) return NULL;
BaseContainer *data = ((BaseShader*)node)->GetDataInstance();
if(!data) return NULL;
BaseList2D *oldBL = data->GetLink(slotID, node->GetDocument());
removeLinkedShadersFromNode(oldBL);
BaseShader *newShd = BaseShader::Alloc(ID_OCTANE_IMAGE_TEXTURE);
if (!newShd) return NULL;
BaseContainer *shdBC = newShd->GetDataInstance();
if(!shdBC) return NULL;
Filename fn(name);
shdBC->SetString(IMAGETEXTURE_FILE, name);
data->SetLink(slotID, newShd);
insertOurNode((BaseList2D*)node, newShd);
EventAdd();
return newShd;
}