Save Particles Warning

Does there exist someplace (I am not seeing it) a setting to ALWAYS warn the user if they hit render when Krakatoa is set to save particles? When I partition something out and then reload it in and want to preview it I almost always forget to set Krak back to render particles. Would be nice to pretty much always have a warning, not just if I am going to overwrite something.

Thanks.

In theory, latest Krakatoa v2.3 should pop up a message like

[code]---------------------------
KRAKATOA:Save Particles To File Sequence

You are about to SAVE
–>Current Single Frame 0<–
to the particles file sequence

c:\temp\something.prt

including the following Channels:

Position float32[3]
Velocity float16[3]
Density float16[1]
Color float16[3]
Normal float16[3]
ID int32[1]

Click [Yes] to CONTINUE with saving.
Click [No] to EXIT and adjust the settings.

Yes No
---------------------------[/code]

But since this is handled by the MAXScript UI code, it will only happen if you use the BIG BUTTON in the Krakatoa UI. Plus we have the red outline there.
Also note that the RENDER button in the VFB is grayed out in SAVE mode, so if you are using that, you should not be able to save by accident.

I might have to try to register a pre-render callback to pop up a similar warning if you hit the render icon (teapot) in the Main Toolbar, but I am not sure how I could cancel the rendering if you answered with No because that’s C++ code… Will see if I can at least allow you to switch the Krakatoa settings from Save to Render…

In other words, Krakatoa assumes you will be pressing its own RENDER/SAVE button and not the Max icon or SHIFT+Q shortcut (which I have never used in my life, but I know a lot of people use that).

I am using the Shift-Q (mapped to F9, but the same thing).

Perhaps I will try the big button, but that is a hard habit to break :wink:

I guess I just need more discipline before hitting render.

Thanks.

A side note, with regard to that warning message, there appears to be a small bug. If you change from a single frame to a range of frames in the render options dialog when you click Save Particles the warning still shows a single frame. The same is true if you change from a range to a single frame. It shows the original state.

Closing the Render Setup dialog updates it. I have some other plugins that automatically close the Render Setup dialog, probably because of this “feature,” which I am guessing is a Max thing.

Yes, the render dialog was implemented in a moronic way waaay back and it does not update unless closed. But there is a MAXScript command to commit all changes which I should have called before popping up the message.

You can fix it yourself by going to line 5948 and changing the code to

on btn_quickRender pressed do ( renderSceneDialog.commit() --> NEW CODE

I will add this to the fixes for the next point release.

Thanks for noticing!

Once again, incredible service!

Thanks, Bobo.

Was thinking, perhaps it would make the most sense to offer two little scripts that a user could assign to a hotkey or button. One would set Krak to Save Particles mode and “render,” the other would set it to Render Particles mode and render. That way a user would always know which operation they were performing.

The render normally one could even check to see if Krak was the current renderer, and just invoke the normal render if it was not.

Thoughts?

We already ship two icons that show the mode and switch it (see Krakatoa Toolbar category, RND and SAV red text icons). But these do not trigger the actual rendering/saving, because we assumed you would prefer to keep on using the F9 / SHIFT+Q shortcuts.

You are not gonna relearn your F9, so I will see if I can show an optional popup when rendering is triggered in Saving mode to confirm that that’s what you intended to do…

Haha. Good point that I am not going to relearn. :wink: (well over a decade and a half since switching to LightWave from Electric Image) I just did it again, which was why I came back.

It just seems to make more sense to have one button to serve each purpose, rather than one button that serves two completely different purposes. I understand why it needs to be like that (for net rendering).

No, it does not need to be like that, but it IS like that right now (for various historical and technical reasons). The main trouble is that the F9 and the teapot icon in the Main Toolbar of Max are Max’ own, and we don’t control them. They just fire up the current renderer. And since the saving of particles was implemented as a special mode of the rendering process, that’s what it does (rendering particles to disk). The main benefit of this approach is that we can perform lighting of the particles as part of the saving process, so it REALLY IS rendering to disk.

We wanted to split the Saving from Rendering during the 2.0 development, but realized it would be too much work and postponed it. It might happen for 3.0 eventually. But right now we have to figure out how the Krakatoa UI (which is nearly 100% MAXScript) can handle someone running the Max-own “render” commands, including the Render button in the Render Setup dialog, the Render icon in the Main Toolbar, the Render menu item in the Render menu, the ‘max quick render’ command in MAXScript, the F9/SHIFT+Q shortcut etc. Adding new buttons will not help as they won’t work with Scanline/VRay/mental ray/iRay/whateverRay. We need to intercept the render call of Max and do something in a pre-render callback…

I will do some tests next year :wink:

If you can intercept it then that is obviously ideal. I guess I was thinking of a button/shortcut that would act as its own intercept. Check if Krak is the renderer. If so, set it to render particles mode, then invoke the regular Render command. If Krak is not current renderer then just invoke regular render command.

This doesn’t trap the main UI buttons of course, but gives the user a single button to handle both (assuming that is technically possible).

I did some testing.

I was able to intercept the render start message, and pop up a Yes/No message. Unfortunately, changing the mode from “Save” to “Render” within that callback does update the property but does not update the renderer which was already fired up. So while no PRTs get saved, no images get rendered either.

I will have to request a “cancel rendering” function as part of the Krakatoa MAXScript interface to stop the renderer prematurely, so the message will probably be “Yes to continue with saving particles, No to cancel and change the mode manually”.

With the current toolset, I can warn you about the problem, but cannot switch to the desired mode from the warning dialog.