View Full Version : Access Motion Blur Samples in Expresso?
Is there a way that I can access the number of scene motion blur samples in Expresso? I'm using R11 Studio.
|
|
Not that i'm aware of, but maybe some coffee expert can help.
Usualy is simply make expressions time or delta time dependent, that way they get executed correctly with SMB
Cheers
Björn
Darter
10-27-2010, 09:07 AM
I'm no expert but I'm pretty sure this will output the number of SMB samples for the current document from a COFFEE node:
main()
{
var doc = GetActiveDocument();
var rd = doc->GetFirstRenderData();
var rdName = "Render Setting";
while(rd->GetName() != rdName)
{
rd = rd->GetNext();
if(!rd) return;
}
var vp = rd->GetFirstVideoPost();
if(!vp) return;
while(vp->GetName() != "Scene Motion Blur")
{
vp = vp->GetNext();
if(!vp) return;
}
var bc = vp->GetContainer();
var samp = bc->GetInt(VP_SMBSUB);
switch(samp)
{
case 0:
Output1 = 5;
break;
case 1:
Output1 = 9;
break;
case 2:
Output1 = 16;
break;
case 3:
Output1 = 25;
break;
case 4:
Output1 = 36;
break;
case 5:
Output1 = 49;
break;
default:
return;
}
}
I've not used coffee yet. I'll give this a try when I get a chance. Thanks!
Darter
10-28-2010, 01:12 PM
No worries. This is for use in an COFFEE node in XPresso but it can be readily adapted to a COFFEE expression tag.
You can access a different post effect by replacing "Scene Motion Blur" with the effect's name. An effect's parameters can be accessed by dragging from the Render Settings panel into the COFFEE editor and using as the Base Container ID.
Scott Ayers
10-28-2010, 03:59 PM
Darter,
Do you happen know how to change the Render Engine settings with Coffee?
When I use this: var rd = doc->GetFirstRenderData();
rd#RDATA_RENDERENGINE = 2; //Select Hardward Preview mode
I get this error: Parameter access failed.
-ScottA
Darter
10-28-2010, 09:57 PM
The IDs are listed in resource/modules/xtensions/res/description/drendersettings.h
Full Render: RDATA_RENDERENGINE_STANDARD
Software Preview: RDATA_RENDERENGINE_PREVIEWSOFTWARE
Hardware Preview: RDATA_RENDERENGINE_PREVIEWHARDWARE
CineMan isn't listed here and can't be found in the Plugin Cafe archives, so if you want this one you'd need to ask.
Scott Ayers
10-28-2010, 10:20 PM
Thanks. But I still can't get it to work. var rd = doc->GetFirstRenderData();
rd#RDATA_RENDERENGINE_PREVIEWHARDWARE = true; //Select Hardward Preview mode
I'm obviously not writing this in the proper syntax format.
But I can't figure out the exact format it needs to work. :banghead:
Doh!
Never mind. I finally got it. var rd = doc->GetFirstRenderData();
rd#RDATA_RENDERENGINE = RDATA_RENDERENGINE_PREVIEWHARDWARE; //Select Hardward Preview mode
Thanks Darter!
-ScottA
Darter
10-28-2010, 10:39 PM
A very easy mistake to make! Glad you got it working Scott.
CGTalk Moderation
10-28-2010, 10:39 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.