Imported asset nodes. Cant change filename on texture

Forums: Imported asset nodes. Cant change filename on texture
Forum for OctaneRender Lua scripting examples, discussion and support.

Imported asset nodes. Cant change filename on texture

Postby Wallan » Fri Jul 03, 2015 8:17 am

Wallan Fri Jul 03, 2015 8:17 am
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.
Attachments
Error.png
Windows 7 Ultimate 64bit 32Gb RAM. Intel Core i7-5820K [email protected] GHZ. Display uses a Gigabyte GTX 460 1Gb VRAM. Octane uses an EVGA GTX 970 4Gb VRAM.
Wallan
Licensed Customer
Licensed Customer
 
Posts: 47
Joined: Fri Jan 23, 2015 6:13 pm

Re: Imported asset nodes. Cant change filename on texture

Postby bepeg4d » Tue Jul 07, 2015 1:15 pm

bepeg4d Tue Jul 07, 2015 1:15 pm
Hi,
maybe a stupid question, but why you have :rgba at the end of the path name?
ciao beppe
User avatar
bepeg4d
Octane Guru
Octane Guru
 
Posts: 6510
Joined: Wed Jun 02, 2010 6:02 am
Location: Italy

Re: Imported asset nodes. Cant change filename on texture

Postby stratified » Tue Jul 07, 2015 9:15 pm

stratified Tue Jul 07, 2015 9:15 pm
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
User avatar
stratified
OctaneRender Team
OctaneRender Team
 
Posts: 945
Joined: Wed Aug 15, 2012 6:32 am
Location: Auckland, New Zealand

Return to Lua Scripting


Who is online

Users browsing this forum: No registered users and 1 guest

Sat Jul 20, 2019 3:01 am [ UTC ]