PDA

View Full Version : Macro-Troublopolis


chris.scherer
02-05-2006, 07:14 PM
Hello World,

In order to efficiently prototype a database-based compositing-solution I need some nifty scripting for Shake, running on my Powerbook in a Wintel-network.

Hereīs the set up: Several FileIn-Nodes and some Color-Nodes are mashed together. The FileIn Nodes use a composit filename that goes like:

:pathname.text+elementname.text+"_passname"

Naturally, I included some text fields called pathname and elementname to keep the information accessible. The "_passname" is hard-wired of course.

Now, the node-tree works well when assembled in Shake, with all the flexibility I asked for: Easily change the path for several files chewed out by Maya as I write this.


Unfortunately, when I make a Macro out of it, there seem to be some problems with the file-name-handling etc. as the "node is in error", and the console tells me it cant resolve the pass. But then, it even looks for the wrong stuff, as the Macro-Maker enters "<undefined><range>" where the ":pathname.text+elementname.text+"_passname"" should be. Humming explicit lyrics. Really loud.

Here's an excerpt of the macro Shake yields, censorship and some debugging-attempts of mine applied. I, for example, replaced the "undefined range" with the script-line as it is written when I paste the original tree into a textpad:
------------------------------------------------------------------------------------
image LastRitesA(
const char *text="lack_allgemein_",
const char *pathname_text="//IP-Adress/pathname/"
)
{
pathname = Text(720, 486, 1, pathname_text, "Utopia Regular",
100, xFontScale/GetDefaultAspect(), 1, width/2, height/2,
0, 2, 2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);
elementname = Text(720, 486, 1, text, "Utopia Regular", 100,
xFontScale/GetDefaultAspect(), 1, width/2, height/2, 0, 2,
2, 1, 1, 1, 1, 0, 0, 0, 45, 0, 1);

Diffusepass = SFileIn(:pathname.text+elementname.text+"diffuse.tga", "Auto", 0, 0,
"v1.1","0", "");
Highlightpass = SFileIn(:pathname.text+elementname.text+"highlight.tga", "Auto", 0, 0,
"v1.1", "0", "");
Metallicpass = SFileIn(:pathname.text+elementname.text+"metallic.tga", "Auto", 0, 0,
"v1.1", "0", "");
Mirror = SFileIn(:pathname.text+elementname.text+"mirror.tga", "Auto", 0, 0,
"v1.1", "0", "");
Reflectivity = SFileIn(:pathname.text+elementname.text+"reflectivity.tga", "Auto", 0, 0,
"v1.1", "0", "");

...here there be compositing...
return CoMpOsItInG;
}
----------------------------------------------------------------

On a secondary battlefront I want to incorporate several color-fields in the macro. Yet, with Macro-Maker, only the first works out fine, the other parameters (red,green,blue) are represented as sliders. Is there any way I can work around this ?

Thanks in advance, chris.scherer

End

chris.scherer
02-05-2006, 07:15 PM
Sorry for the smilies %-)

chris.scherer
02-06-2006, 05:07 AM
Getting better all the time: The Macro abobe, in itīs working edit, prevents Shake from starting up. Humming really loud.

pixel mixer
02-09-2006, 07:29 PM
if i remember it well, using a filein in a macro does not work well, but in order to be sure check the docs or contact support. they are real pros.

beaker
02-09-2006, 07:41 PM
You can use it in a file-in node, we have a few here that work just fine. Quickpaint is the only no-no for macros.

chris.scherer
02-10-2006, 01:32 PM
methinks it's the expression IN the filenodes base-line...that one gets corrupted. Still hanging in there, but in the meantime Iīve just made a huge number of groups. Handles not quite that good, but at least it works.

CGTalk Moderation
02-10-2006, 01:32 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.