Saving .vrscene file for each frame with filename not possible

We want to automate our product rendering and have built it using Grasshopper and Vray. But now I notice that it says the following:

Since for each frame we actually load an .obj or .3dm file to be placed in our scene, the export animation function can’t be used.

So, I am curious why the normal Export function isn’t just exposed as a pin. Then I could set it to true and just give it a file name and then it would save a .vrscene file every time Grasshopper recalculates (ie. every frame of the animation).

Now I could only use the “Export Sequence” function, but I actually want it to only do it for when it runs and the filename would be different for each (it uses the original file name of the imported object).

Only Export actually uses the input file name, but that’s the one I can’t trigger for each frame or I would have to do it manually, which of course does not work.

It would have been super easy to just add a boolean input for Export and then it would be possible to batch export .vrscene files.

Right now I don’t see a way to do that. Any reason it was done like that?

There was a lengthy discussion why it is a bad idea to hide functionality inside components and I am still a firm believer in that. If you hide functionality in right-click buttons you essentially break what Grasshopper is built for. But maybe there is a reason for it similar to what I outline in the last post - that it might trigger something that cannot be reliably triggered in a GH recalculation and therefore needs to be triggered separately. It would be great to understand it. If on the other hand it was purely done to “keep it simple” as was mentioned before by Chaos Group to be the goal of Vray for GH, then that would be a sad moment. For me Vray for GH is not there to make it simple, but to enable advanced workflows like ours and as such should strive for maximum functionality and flexibility and not simplicity.

1 Like

Omg, I can’t believe I found a person with the exact same problem I have.

I have to render 56 color variations of 400 different product models.

I was thinking to export each scene and then batch render the scenes on a self-built GPU cluster.

I hit the same wall you did. I’m thinking to myself, “Do I have to manually right click and export 56 f***ing scenes, per model of 400 products?”

Did you ever figure out some sort of automation for this?

Let me explain the reasoning behind this decision. It is all about files. Writing files to disk is error-prone, and need to be handled with care. I cannot share the same views like you because I see day and night users get crashes, hangs, freezes, and so on because they think “it is just a file”. Well not so much.

First - the good news. It is not a bool input, but a checkbox in the menu, that you can check and you will get this auto-save-on-change you want
image.
I believe you were one of the reasons I put that option in, although I was strongly against it.

Next. We removed the limitation for the spawned objects - now you can have objects in animations popping up in frame N and disappearing in frame N+n, and that will work correctly. We had to invent a set of new APIs for that to happen elegantly, and it is now there. There are still limitations, but it is better
image

Now about the files.
People like sharing data - files on a network location. There are even entire user profiles on a network locations - desktop, documents, even system temp folder. The problem with the network location is that it might disappear out of the blue. Imagine you have a scene locally. You open it. There are 100 texture files on a network location in that scene. However you haven’t open that network location in explorer lately and your session has expired. GH tries to load the first texture. It calls a Windows API function, and it waits for it to return. That is a kernel call, you cannot skip or terminate it. You just need to wait for it to return. The function checks your credentials for the remote server and sees you don’t have an active session. You need to enter your password first. But the function cannot just popup the credentials dialog! That’s a whole different ball game. So it waits for a session cookie to appear… and waits 20 seconds, since that is the timeout smart guys in MS decided to hardcode. And it returns FALSE - e.g. the file is not on the drive. It doesn’t say “you don’t have credentials” - only “no such file”. So we try to resolve the file to some other location - subfolder, search paths… etc. Those might also be network paths.
And so on with the other 99 files. 20 seconds each - at minimum (without the extra file resolution step).
So we have 2000 seconds freeze time situation we can’t do anything about. You cannot interrupt, terminate, ,etc… it is just a freeze.

Imagine the same thing with saving files. Imagine a whole myriad of situations with files - believe I’ve seen a lot over the years. Programs unexpectedly freeze, hang or crash, and the people curse Chaos all day long. While in fact it was their own fault.

So I learnt the hard way to be very cautious with files. They can simply fail in so many ways, especially if you do not control (or know enough about) the target file location.

That’s way it is a checkbox - a not so obvious thing, so you don’t accidently shoot yourself in the foot

Cheers