In my render plugin, I always need to know the model units, since it is a physically-based renderer, and requires to know the real sizes of things. However, in PlugIn.CreatePreview we have no document, just an environment, viewport, and lists of objects/lights.
So I am looking to be able to get the scale I need from here:
I am guessing I might get this value from RenderMaterial.DefaultPreviewSize, but the sdk says I don’t need to know the material for which I’m rendering a preview:
Maybe I can find out by looping the provided SceneObjects and finding one that matches CreatePreviewArgs.ContentTypeId, but besides this seeming quite a hack, there could be more than one that matches. And that is assuming that RenderMaterial.DefaultPreviewSize is really what I’m after, in the first place.
So I figure I must be missing something, and will appreciate any direction.
[edit: it occurs to me now, I target v6 and something more could have been added in the v7 sdk, I’ll take a look]