[SOLVED] Setting Camera Display Persistence

dyodyodyodyo Posts: 42

How do I toggle the 'display persistence' property of a DzCamera -- it doesn't appear in the API reference.

I'm guessing there's some object that I can iterate through that contains all properties of the selected camera, and I vaguely recall a post to this effect, but didn't bookmark it (of course ;) ).

Help :D

Post edited by dyodyo on

Comments

  • Cris PalominoCris Palomino Posts: 11,151

    DzBasicCamera

     

  • Remember that there is inheritance in Daz Script - objects have not only their own properties and methods but the properties and methods of the objects from which they derive.

  • dyodyodyodyo Posts: 42

    Remember that there is inheritance in Daz Script - objects have not only their own properties and methods but the properties and methods of the objects from which they derive.

    Cris' suggestion works perfectly (thanks) and I now have control over the display persistence property of the camera (and lots more), but I'm kinda confused as to why it works.

    I'm getting a DzCamera object from:

    MainWindow.getViewportMgr().getActiveViewport().get3DViewport().getCamera();

    DzBasicCamera inherits from DzCamera (and everything up the chain), but the DzCamera doesn't have the 'getDisplayPersistenceChannel()' property, as this property belongs to DzBasicCamera (I think). So, how does --

    MainWindow.getViewportMgr().getActiveViewport().get3DViewport().getCamera().getDisplayPersistenceChannel()

    -- return an object? Or, does DzCamera have a load of hidden properties? Or, am I completely misunderstanding inheritance? Or, does 'getCamera()' actually return a DzBasicCamera, and the API docs are wrong?

  • A method that returns a camera can return anything that is of the right type - you can view the scene through a regular camera, a view, a light, or a shader camera. They will all return true for object.inherits( "DzCamera" ) but not necessarily for object.isA( "DzCamera" ) - you will notice that there is not in fact a creator function for DzCamera. In the same way Scene.getSkeletonList() will return an array of objects that inherit DzSkeleton, but none of them will be DzSkeletons (I think I am right in saying that DS 4.5+ does not have actual DzSkeletons, everything is a derived object type). When checking item types it is almost always best to use inherits( objectName ) rahter than isA( objectName ) for this reason.

    You could do with some error trapping in that long run of calls..

  • dyodyodyodyo Posts: 42

    A method that returns a camera can return anything that is of the right type - you can view the scene through a regular camera, a view, a light, or a shader camera. They will all return true for object.inherits( "DzCamera" ) but not necessarily for object.isA( "DzCamera" ) - you will notice that there is not in fact a creator function for DzCamera. In the same way Scene.getSkeletonList() will return an array of objects that inherit DzSkeleton, but none of them will be DzSkeletons (I think I am right in saying that DS 4.5+ does not have actual DzSkeletons, everything is a derived object type). When checking item types it is almost always best to use inherits( objectName ) rahter than isA( objectName ) for this reason.

    You could do with some error trapping in that long run of calls..

    Many thanks Cris and Richard for the answers -- lots of new things for me to explore and learn :)

Sign In or Register to comment.