Camera Culling

Vertex selection based on the camera. Facing, FoV, and Clip Planes are considered.

This is a WIP, version 0.4, has known issues:
1) The FoV is horizontal only and does not account for the image aspect, so it’s a conical “frustrum”. I should be able to read in the render settings, so that’s fixable.
2) The selection is based on individual vertices. They don’t look at the other vertices on the face. So if you put a Delete Mesh after this, you might remove more faces than you you want. You can put another Genome in between that converts the vertex selection to a face selection iff all 3 vertices are selected. I might go back and add this as an option at some point though.
3) Doesn’t work on orthographic cameras, may not work on 3rd party plugin cameras.

As far as examples go, it shows some of the ways you can use the Logic nodes along with exposed Integers to make mutually exclusive radio buttons. It’s also a mild example of logical branching to make selections for a specific output.

As for bad experiences, I found that you couldn’t edit the magmaNode notes after you saved the preset. I usually do notes at the end, so this was a it weird. Also, the notes don’t text wrap. I had to put in my own line breaks. Also, I couldn’t seem to remove Center from the the PropertyQuery. So it’s just hanging out. You can of course remove it in the .magmascript, but I wanted to leave it in case it was an unusual bug. Finally, I suspect this would have been easier if I could just have used the projection matrix or NDC. Maybe that could be done by accessing it in a script from the camera and doing the all the transforms in Genome, but I’m not about to try that yet :slight_smile: . But it might allow us to do funny frustrums for cameras that are skewed or whatnot.
CameraCulling_04.rar (2.56 KB)

Sure you can. Open the Magma editor, select the < Current Flow > entry on the Presets list and type away. Then save the flow under the same (or new) name and the nodes will be there.
I might change the entry to < Edit Current Flow Notes > so it is clear what it is for.

The MAXScript edittext does no wrapping. I would have to switch to some dotnet control I guess… Will give it a try.

Thanks, will try to fix this ASAP.

Oh, and the notes don’t scroll. So if the text falls off the bottom edge of the note text box, then it’s hard to get at.

If I get a new text widget there, it will do it all. Will have to test a bit.

I fixed the Remove button to work on Center (or any other outputs). There was a limit not to allow the removal of sockets if there were other sockets already connected behind them. I rewrote it to rewire all connected outputs correctly so removing Center retains all following connections.

Here is a prototype of the Editor that uses a TextBox control for notes.
Given the issues you have with the Debugger ListViews, I hope it does not introduce more problems due to the switch to DotNet.
Please back up the original file before replacing!

This is WIP and might be buggy!

I also fixed the pick button exposure to use the node’s notes as tooltip. So if you enter notes for the Camera picker for example, they will appear as tooltip when you mouseover in the Command panel.

Also changed the Presets list’s top entry to < Edit Current Flow Notes >, and the caption of the edit text field to “EDIT Current Flow Notes” / “User Notes”. The background will be greenish when editing is enabled, reddish when read-only (the disabled display of these controls drops the wrapping, so I had to do something else).

In this version, you should be able to remove the Center output of the PropertyQuery without problems.
Genome_MagmaFlow_20120330.zip (69.9 KB)