Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    Current stereo channel on VP

    SDK Help
    0
    4
    316
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      Helper
      last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • H
        Helper
        last edited by

        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

        1 Reply Last reply Reply Quote 0
        • H
          Helper
          last edited by

          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());
          			}
          		}
          	}
          
          1 Reply Last reply Reply Quote 0
          • H
            Helper
            last edited by

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

            Hello,

            the id is really not handed over.

            Best wishes,
            Sebastian

            1 Reply Last reply Reply Quote 0
            • First post
              Last post