Cycles Raytraced mode support request for GH Slider Animations

This would be an awesome feature to test in Rhino 8 WIP.

this feature can be achieved on 7

It seems to work for render mode, but not for ray-trace mode.
My title was a bit vague, it should have clarified ray-trace mode (added it to the title).
If the ray-trace mode works, I must be missing something, That would be good :slight_smile:
I’m using 7 and 8wip

            // Capture view.
            var cycles = myView.RealtimeDisplayMode;
            var oldpasses = cycles.MaxPasses;
            cycles.PostEffectsOn = true;
            cycles.MaxPasses = 2;
            cycles.Paused = true;

            var viewCapture = new Rhino.Display.ViewCapture();
            viewCapture.Width = imageWidth;
            viewCapture.Height = imageHeight;
            viewCapture.ScaleScreenItems = false;
            viewCapture.DrawAxes = false;
            viewCapture.DrawGrid = false;
            viewCapture.DrawGridAxes = false;
            viewCapture.TransparentBackground = transBG_ON;
            viewCapture.RealtimeRenderPasses = 10;

            var bitmap = viewCapture.CaptureToBitmap(myView);

            // Save image.
            string filename;
            List<string> images = new List<string>();
            if (!saveSeries_ON)
                filename = string.Format("{0}_{1}.png", fullPath, "Capture");
                bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
                // Assume index=0 for the first filename.
                filename = string.Format("{0}_0.png", fullPath);
                // Try to increment the index until we find a name which doesn't exist yet.
                if (System.IO.File.Exists(filename))
                    for (int i = 1; i < int.MaxValue; i++)
                        string localName = string.Format("{0}_{1}.png", fullPath, i.ToString());

                        if (localName == filename)

                        if (!System.IO.File.Exists(localName))
                            filename = localName;
                bitmap.Save(filename, System.Drawing.Imaging.ImageFormat.Png);
            cycles.MaxPasses = oldpasses;
            cycles.Paused = false;

            DA.SetDataList(0, images);

try this code, I copied from my plugin. it works in c# component, but need some modification.

Set viewCapture.RealtimeRenderPasses to a higher number to get better converged results.

1 Like

@nathanletwory Something that could be considered for the Rhino 8 WIP Slider Animation feature with the added parameter for viewCapture.RealtimeRenderPasses or inherent that from the render setting? Based on the @zhuangjia777 C# example it may be that most of the elements are there to connect to the slider animation feature. Quite a big functionality gain based on the cycles integration.

This is already logged as RH-64509 Grasshopper animation should support Raytraced.

I’ve added this topic to the issue.


How can I get the viewcaptured PNG by using the code?
I inserted into GH python, but I’m having a trouble of animating it.
Where should I connect the animate slider?

Any chance to nudge this topic along in the WIP version?

Not yet, other things on my list still that are higher priority :slight_smile:

Is this still on the radar?

Could the set NumberOfPassesForRealtimeDisplay parameter be used? The same as for record animation?

On the very edge of my radar, not any time soon. You could still try the approach Cycles Raytraced mode support request for GH Slider Animations - #4 by zhuangjia777 by @zhuangjia777 .

Could someone show me how to stick the @zhuangjia777 code in a GH component?


I am struggling to implement @zhuangjia777 code as well. I don’t have any c# experience, would you care to share how you resolved this? It would be greatly appreciated. (8.4 KB)Here you are

Sorry for the late reply. Thank you!