Unintuitive cameraViewport

I think the Reset function of the cameraViewport function is weirdly defined. Why is a default transform of (0,0,5) hardcoded in there. I personally feel like the intuitive thing would be to load the Xform parameters on Reset as a transformation.
Also, one cannot set the orthographic width directly in the user interface?

Thanks for the feedback. The (0,0,5) position was just chosen because that’s the default position for a newly placed basic Camera OBJ in TouchDesigner. You can change that if you want to in the Reset function in the CameraExt DAT inside the cameraViewport.

The orthographic width is set on the ‘View’ page of the cameraViewport node. It’s set as read-only because it’s normally controlled by the viewport interaction, but you can also set it manually either via python or by turning off the read-only state.

Let me know if you have any other questions or suggestions. We do continue to make improvements and additions to the cameraViewport component, but the intention is also to make it accessible for users to customize to particular projects.

How about defining the resetPosition via an objectCOMP?

And resetFunction gets this:

def Reset(self) -> None:
		mat = ( self.ownerComp.par.Resetcamera.eval() or self.ownerComp.op("default_reset_cam") ).localTransform
		#mat = tdu.Matrix();
		#mat.translate(0,0,5);
1 Like

I find super usefull the cameraViewport, i can see how it can be adapt to many projets.

But i’m curious, is the CameraViewport need to be at the root of a projet ? Normally it’s a Container.

I have difficulty to manage the camera inside a container.
I will be happy to see how. (why the panel and the render are inside the camera ?)

Because at the end this is a lot to talk about modular component hierachy inside project.

Camera is good but if i have a second module to select and move points or draw, where will be the best spot for the code ?

The cameraViewport doesn’t necessarily have to be at the root of a project, but 3D containers like Geos or Cameras do inherit the transform of the 3D container that they are in so this can affect the camera’s movement. If they are inside a Panel or Base node type that will not affect them.

The panel and review are included inside of the cameraViewport as examples, in most cases you will want to use the parameters to point to your own panel or render top.

I’d generally recommend keeping your own code modules outside of the camera so that it is easier to update the cameraViewport later on if you need to.