Jump to content

#include Statement In Ifd


Recommended Posts

Hi,

Anyone knows if there is a way to include a custom IFD snippet into a main render IFD file?

I tried to add it to an object as pre/post include, but unfortunately that gets folded in the main file.

Also, variations of include, ray_include..etc didn't really lead anywhere.

Explanation: there is a heavy point cloud that holds instances of objectA, B..etc. Now when I generate the IFD, the instancing gets folded out into ray_object -i -M calls (and couple of lines of transform/shader..etc data). As the instancing is not changing during the sequence (and I didn't find a way to stop Houdini to cook this per frame), what I'm trying to do is reuse the unfolded instance code in the main IFD sequence.

Just to avoid confusion: it's not the object/attribute generation that takes a long time, but actually executing (unfolding) the point instancing. Alternative ways are also welcome.

Thanks,

Andras

Link to comment
Share on other sites

Anyone knows if there is a way to include a custom IFD snippet into a main render IFD file?

I tried to add it to an object as pre/post include, but unfortunately that gets folded in the main file.

Also, variations of include, ray_include..etc didn't really lead anywhere.

Explanation: there is a heavy point cloud that holds instances of objectA, B..etc. Now when I generate the IFD, the instancing gets folded out into ray_object -i -M calls (and couple of lines of transform/shader..etc data). As the instancing is not changing during the sequence (and I didn't find a way to stop Houdini to cook this per frame), what I'm trying to do is reuse the unfolded instance code in the main IFD sequence.

Just to avoid confusion: it's not the object/attribute generation that takes a long time, but actually executing (unfolding) the point instancing. Alternative ways are also welcome.

We've fought with this in the past and there were three solutions. :)

- Wait for Houdini 9. :ph34r:

- If your data is static and your camera transforms are seperate you can 'include' all the ray_object -i calls using the "source" command. (Remember that IFD is just a subset of hscript.)

- Write a Mantra Procedural which handles all the Instancing. (Basically a Mantra Copy SOP). It makes the instancing IFD generation near instantaneous and mantra renders at same speed or a little faster. I wrote one of these a few months ago and its a huge time saver.

Link to comment
Share on other sites

Thanks Wolfwood, really handy to know these.

Unfortunately option 1 and option 3 are not available this time (need this in about 2 days, preferably today :D).

As this case is quite optimal from this point of view, I will give option 2 a shot this weekend.

Gonna be curious to see how the next version of mantra deals with this.

Thanks again,

Andras

Link to comment
Share on other sites

If you're desperate, you could work out a way of using another preprocessor like "cpp" or "m4" perhaps? You could put a tiny wrapper around mantra (an executable shell script ahead of the distributed mantra in the $PATH) which calls your own preprocessor first.

#!/bin/tcsh
echo "calling mantra how i want to"
$HFS/bin/mantra $*

Link to comment
Share on other sites

Thanks Jason.

I think Wolfwoods second method is the one I would prefer to use. (as it could be operated a bit more easily by non-technical users) Now the problem became a bit theoretical as it looks like it's going be ok speedwise..gonna give it a try, but I'm afraid Houdini9 public beta is going to be out by then :)

cheers,

Andras

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...