More trouble with xgen api

More trouble with xgen api

tim-bot
Advocate Advocate
831 Views
3 Replies
Message 1 of 4

More trouble with xgen api

tim-bot
Advocate
Advocate

So i have my ProceduralCallbacks setup and running, and i'm able to export the splines with everything just fine. But i'm getting a number of errors out of xgen, even though i'm certain i'm settings the settings properly.

 

I've got all my settings setup referencing this page: https://knowledge.autodesk.com/support/maya/learn-explore/caas/CloudHelp/cloudhelp/2016/ENU/Maya/fil...

 

however, i get theses errors:

// Error: XGen: No Camera FOV attribute found in rib. //
// Error: XGen: No Camera Ratio attribute found in rib. // 

 

I get those for each flush iteration, so it's really killing my performance on large hair descriptions. i was getting the error with the camera attribute as well, but i finally figured out to use "true,1.0,0.0,0.0", which appears to resolve that one. but the other errors persist, even though i'm certain i've got the settings set the same as the page above dictates.

 

My code is returning as follows

const char * MyProcedural::get(EStringAttribute in_attr) const
{
	std::string result = "";
	switch (in_attr)
	{
		...
		case XGenRenderAPI::ProceduralCallbacks::RenderCam:
			result = "true,1.0,0.0,0.0";
			break;

		case XGenRenderAPI::ProceduralCallbacks::RenderCamFOV:
			result = "90.0,90.0";
			break;

		case XGenRenderAPI::ProceduralCallbacks::RenderCamRatio:
			result = "1.0";
			break;

		case XGenRenderAPI::ProceduralCallbacks::RenderCamXform:
			result = "1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1";
			break;
		...
	}
	return result.c_str();
}

but the errors persist. Funny thing is, if optimizations are enabled, i don't get these errors. however, it also doesn't produce any difference in the sub-frame samples, so i don't get my motion blur. 

 

Any help with this would be greatly appreciated, really need to get this going and this is kind of the last thing holding me up. thanks!

0 Likes
Accepted solutions (1)
832 Views
3 Replies
Replies (3)
Message 2 of 4

cheng_xi_li
Autodesk Support
Autodesk Support
Accepted solution

Hi,

For the first question, I think you may need to use a static string instead of a normal string. 

 

For motion blur, you'll need to provide proper parameters. The following parameters are from an ass file exported with animated 19-21 frames.

-debug 1 -warning 1 -stats 1  -frame 20.000000  -file /Users/lich/Documents/maya/projects/default/scenes/aaa__collection1.xgen -palette collection1 -geom /Users/lich/Documents/maya/projects/default/scenes/aaa__collection1.abc -patch pSphere1 -description description1 -fps 24.000000  -motionSamplesLookup -0.250000 -0.125000 0.000000 0.125000 0.250000  -motionSamplesPlacement -0.250000 -0.125000 0.000000 0.125000 0.250000  -world 1;0;0;0;0;1;0;0;0;0;1;0;0;0;0;1

In above case, there are three key parameters. The -geom provide geom cache exported from xgen for the motion blur(e.g. export patches for motion blur) when initializing the PatchRender, the motionSamplesLookup and -motionSamplesPlacement. You can find the details here.

 

Hope it helps.

 

Yours,

Li

 

 

0 Likes
Message 3 of 4

tim-bot
Advocate
Advocate

Thanks for that. Yeah, late in the day on Friday, in an attempt to clean up some code, i did move all those settings into a static struct instance, and suddenly it started working! so inadvertently i got to that Friday, but thank you for confirming that's what to do. haven't run across that before. 

 

Thanks for the example, i think i have the command string set up right now. did a few days ago have trouble with the right formatting for the motion sample lookup strings, but after realizing it's just space delimited, that's all working now.

 

Though it's not a problem, as it still works, i do still, when the compiler optimization is disabled for debugging, i still get the constant error messages with the camera FOV and camera ratio using the strings above, even with them in the static struct instance. though, when optimization is enabled, i am not getting those. can you confirm the formatting for those options? perhaps the renderman renderer is dumping invalid error messages? only a problem because it makes it even slower when debugging.

0 Likes
Message 4 of 4

cheng_xi_li
Autodesk Support
Autodesk Support

Hi tim,

 

I've encountered an issue before when using debug version dll with release version of XGen. The multithreading library XGen using is release thus it won't work with debug version. 

 

I am not sure if this is the cause of your problem; if it was, there isn't a workaround for it. 

 

Yours,

Li

0 Likes