PDA

View Full Version : Add Normal Map / Use Nodes via lscript



vfxdomain
01-16-2011, 02:17 PM
Hey guys and gals!

I am developing pipeline tool that should load geometry and parse text file to assign surfaces/textures/uvs to that geometry. Everything is OK more or less, but there is one huge problem - i can't find any way to create normal map in LW!!! There is absolutely no access to nodes via lscript (i can't see any way to do it), and there is no other (non-nodal) way to do it!

Please tell me what i can do about it, is there any workaround?

P.S.
If i have nodes created, is there any way to check "Edit Nodes" checkbox to enable use of nodes in layout via lscript? Maybe some hack/workaround to simulate this keypress?

evenflcw
01-16-2011, 02:44 PM
I'm working on a similar tool (automatic texture assignment, although sticking to layers).

Unfortunately there is no nodal access what so ever from lscript.

Sensei
01-16-2011, 03:45 PM
There is not even from C/C++.. not just LScript..

But there is only one workaround - build file dynamically, and then loading it using NodeEditorFuncs->load().


and there is no other (non-nodal) way to do it!

Of course there is- make your own shader and add it to surface..

vfxdomain
01-17-2011, 06:47 AM
One more question, I've found NormalMap Shader, and i can embed it in my script in binary form, i can place it in plugins folder and apply it using CommandInput("Surf_AddShader MyShader"), but can i change it's parameters via lscript somehow? This shader should have only one argument, the image file, but i dunno how i can pass it, can't find any info about manipulating shader parameters in lscript docs...

Sensei
01-17-2011, 06:52 AM
This shader should have only one argument, the image file, but i dunno how i can pass it, can't find any info about manipulating shader parameters in lscript docs...

Because there is no any. In C/C++ too.

I told you - you have to write *your own* shader. In C/C++. And pass parameters to it f.e. as global variables.

But it's easier to create temporary file, and load it, then delete..

Lightwolf
01-17-2011, 06:54 AM
I told you - you have to write *your own* shader. In C/C++. And pass parameters to it f.e. as global variables.

But it's easier to create temporary file, and load it, then delete..
Or use the ComRing which is ideal for something like this.

Cheers,
Mike

vfxdomain
01-17-2011, 08:48 AM
OK, thanks for your help guys, i see there is no "easy" ways with lscript... I'll see what i am going to do about it.

BTW, how about simulating key press in UI via lscript, no-go as well?