All AxisOp::_validate() is doing to create _matrix is multiplying the input0
matrix by _local, so you can do that easily yourself.
The main reason you need to call Camera::_validate() is to get the projection
matrix up to date, then you can do anything you want to the transform matrix.
I do exactly that in a Stereo camera plugin that doesn't mess with the
projection matrix, it simply does a translate on _matrix after it's already
been concatenated.
So:
1) Call CameraOp::_validate() to get the projection matrix up to date
2) Overwrite the transform matrix via AxisOp::matrix()
-jonathan
On Jun 20, 2011, at 6:53 AM, Buddly wrote:
> Thanks for your answer Jonathan !
>
> You're right, I forgot to call validate and it seems that AxisOp::_validate()
> does the transfer between _matrix and _local, but I'm still stuck in a
> probably stupid problem...
>
> My code is the following :
>
> Op* aCamera = Op::create("Camera");
> _nukeCamera = dynamic_cast(aCamera);
>
> _nukeCamera->film_width( _haperture[time]);
> _nukeCamera->film_height( _vaperture[time] );
> _nukeCamera->focal_length( _focal_length[time] );
> _nukeCamera->Near( _near_clip[time] );
> _nukeCamera->Far( _far_clip[time] );
> _nukeCamera->matrix( _matrix[time] );
>
> _nukeCamera->validate(true)
>
> _nukeCamera->build_handles(ctx) // ctx is a ViewerContext
>
>
> Validate is derived from Op but it doesn't seem to call AxisOp::_validate()
> and nothing happen with that call... Actually, as CameraOp as a _validate()
> public, I call directly call this function but it erase the matrix previously
> set.. I cannot do the same and directly call AxisOp::_validate().
>
> How can I properly call AxisOp::_validate() from a CameraOp ? This is
> probably obvious but I cannot figure out how to get through that... :s
>
>
>
> Jeremy
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev