Page 1 of 1

Imported asset nodes. Cant change filename on texture

PostPosted: Fri Jul 03, 2015 8:17 am
by Wallan
I have made a reusable material setup for my DAZ meshes.

Grouped everything used in the material and saved as an orb package.

Idea is to import the mesh and the node with materials.
Then run code that connect mesh and material.
After that it should change the A_FILENAME on some of the texture node to match the specific mesh.

I have written code that connects the mesh pins but when I try to change A_FILENAME on a texture I get an error.
Path seems ok.
Is there something specific with an imported asset that includes texture that prevents me from changing them by code?

I tried the following as well.
I manually changed the texture to the image i wanted.
Then in code i printed out the path with mytexture.getAttribute(octane.A_FILENAME) and i could see it pointing to the image in question.
in the following code row i did mytexture.setAttribute(octane.A_FILENAME, (with the path to the same image as I got above), true) but then I got the error.

Attached error message in case that can help to figure out whats wrong.


EDIT:

I tried this.
currentTextureNode:setAttribute(octane.A_FILENAME,currentTextureNode:getAttribute(octane.A_FILENAME), true)

That is to set path to same at it was already and that works so it does not seems to be anything preventing me prom setting the path.
If I look at the path it has to begin with and been set back to again it is, "assets\imagename.jpg"

The image I try to set is something like c:/xx/image.jpg

So it's a absolute path in the problem case and a relative in the case that works.
Is that the problem and how do I solve it?

EDIT:
OK, I can se that there is a A_PACKAGE attribute in the texture.
So how do I set it back to not use Package and just a file.

Re: Imported asset nodes. Cant change filename on texture

PostPosted: Tue Jul 07, 2015 1:15 pm
by bepeg4d
Hi,
maybe a stupid question, but why you have :rgba at the end of the path name?
ciao beppe

Re: Imported asset nodes. Cant change filename on texture

PostPosted: Tue Jul 07, 2015 9:15 pm
by stratified
hi,

Octane appends the :rgba in the error message. It indicates that the texture it couldn't load was meant to be used as an image with texture (in case of a float image texture it would output :mono).

A_PACKAGE and A_FILENAME are coupled. When you want to load the image directly from file, you need to clear the package attribute via node:clearAttribute(octane.A_PACKAGE).

cheers,
Thomas