Current stereo channel on VP



  • On 20/09/2015 at 16:48, xxxxxxxx wrote:

    User Information:
    Cinema 4D Version:   R13-R16 
    Platform:    Mac  ;  
    Language(s) :     C++  ;

    ---------
    Hi!

    I need to know which stereo channel is being rendered on my VideoPost plugin.

    I know I can use StereoGetCameraCount() and StereoGetCameraInfo() to iterate the stereo cameras, but I need to pass the actual channel being rendered to StereoGetCameraInfo() and I can't find where this information is.



  • On 21/09/2015 at 02:04, xxxxxxxx wrote:

    Hello,

    I'm afraid the the id of the currently rendered stereo channel is not handed over to video post plugins.

    Best wishes,
    Sebastian



  • On 22/09/2015 at 06:49, xxxxxxxx wrote:

    Really?
    So I had to reproduce this from RenderData....

    RENDERRESULT Blendy360CamVP::Execute(BaseVideoPost *node, VideoPostStruct *vps)
    {
    	// For each RENDER
    	if (vps->vp==VIDEOPOSTCALL_FRAMESEQUENCE && vps->open)
    	{
    		//mStChannelCount = node->StereoGetCameraCountRenderer( doc, rd );
    		mStChannelCount = mCamera->StereoGetCameraCount( doc, bd, rd, 0 );
    		bStereoEnabled = ( mStChannelCount > 0 );
    		mStChannelOrder[0] = -1;
    		mStChannelOrder[1] = -1;
    		mStChannelSequential = -1;
    		mStCurrentChannel = -1;
    		BlendyDebug("StereoGetCameraCount = %d\n",mStChannelCount);
    		if ( bStereoEnabled )
    		{
    			bStereoEnabled			= ! renderData.GetBool( RDATA_STEREO_CALCULATE_ORIGINAL );
    			mStMode					= renderData.GetLong( RDATA_STEREO_MODE );
    			mStCalcResult			= renderData.GetLong( RDATA_STEREO_CALCRESULT );
    			bStAlignmentHorizontal	= ( renderData.GetBool( RDATA_STEREO_SBS_ALIGN ) == RDATA_STEREO_SBS_ALIGN_HORIZONTAL );
    			bStAlignmentVertical	= ( renderData.GetBool( RDATA_STEREO_SBS_ALIGN ) == RDATA_STEREO_SBS_ALIGN_VERTICAL );
    			mStPixelParallax		= renderData.GetLong( RDATA_STEREO_PARALLAX );
    			
    			if ( bStereoEnabled )
    			{
    				if ( mStCalcResult == RDATA_STEREO_CALCRESULT_SINGLE )
    				{
    					mStChannelCount = 1;
    					mStChannelOrder[0] = renderData.GetLong( RDATA_STEREO_SINGLECHANNEL ) - 1;
    				}
    				// C4D will swap when merging
    //				else if ( renderData.GetLong( RDATA_STEREO_SWAP ) )
    //				{
    //					mStChannelOrder[0] = 1;
    //					mStChannelOrder[1] = 0;
    //				}
    				else
    				{
    					mStChannelOrder[0] = 0;
    					mStChannelOrder[1] = 1;
    				}
    			}
    		}
    	}
    	//
    	// Before each FRAME
    	else if (vps->vp==VIDEOPOSTCALL_RENDER && vps->open)
    	{
    		if ( bStereoEnabled && ! bPreviewRender )
    		{
    			mStChannelSequential = ( mStChannelSequential + 1 ) % mStChannelCount;
    			mStCurrentChannel = ( mStChannelSequential < 2 ? mStChannelOrder[ mStChannelSequential ] : -1 );
    			if ( mStCurrentChannel >= 0 )
    			{
    				mCamera->StereoGetCameraInfo( doc, bd, rd, mStCurrentChannel, mStCameraInfo, 0 );
    				BlendyDebug("stereo channel [%d] off [%.2f,%.2f] name [%s]",mStCurrentChannel,(float)mStCameraInfo.off_x,(float)mStCameraInfo.off_y,mStCameraInfo.strName.GetCStringCopy());
    			}
    		}
    	}
    


  • On 22/09/2015 at 10:22, xxxxxxxx wrote:

    Hello,

    the id is really not handed over.

    Best wishes,
    Sebastian


Log in to reply