使用 Corona 渲染器在 Autodesk Forge 中渲染模型

Use Corona renderer for rendering models in Autodesk Forge

我们正在尝试使用 forge 渲染家具模型的 360 视图图像。不幸的是,我们需要为此使用 corona 插件。但是像我们在文档中看到的那样附加 dll 文件时 - 我们仍然看到一个问题。

[08/17/2021 15:07:15] 8/17/2021 15:07:15 PM; DLL <t:\aces\applicationsb3e91f490aad59bb1502fc04a07ae97.ngrdh8rpmufavx5peithdvrycazwjxfq.renderall_1629212808[1].package\renderingtools.bundle\content21\CoronaMax2021.dlr> failed to initialize properly - not loading. [08/17/2021 15:07:15] 8/17/2021 15:07:15 PM; DLL <t:\aces\applicationsb3e91f490aad59bb1502fc04a07ae97.ngrdh8rpmufavx5peithdvrycazwjxfq.renderall_1629212808[1].package\renderingtools.bundle\content21\CoronaMaxUtils2021.dlt> failed to initialize properly - not loading. [08/17/2021 15:07:30] 8/17/2021 15:07:30 PM; Initializing Python version: 3.7.6 [08/17/2021 15:07:30] 8/17/2021 15:07:30 PM; WARNING Missing dll: coronamaxutils2021.dlt - CoronaMtl [08/17/2021 15:07:30] 8/17/2021 15:07:30 PM; WARNING Missing dll: coronamaxutils2021.dlt - CoronaLayeredMtl [08/17/2021 15:07:31] 8/17/2021 15:07:31 PM; WARNING Missing dll: coronamaxutils2021.dlt - CoronaColor [08/17/2021 15:07:31] 8/17/2021 15:07:31 PM; WARNING Missing dll: coronamax2021.dlr - CoronaRenderer [08/17/2021 15:07:32] 8/17/2021 15:07:32 PM; MAXScript ExecuteMAXScriptScript Exception: -- Runtime error: Unable to open renderer, possible recursion; Error occurred in anonymous codeblock; filename: t:\aces\applicationsb3e91f490aad59bb1502fc04a07ae97.ngrdh8rpmufavx5peithdvrycazwjxfq.renderall_1629212808[1].package\renderingtools.bundle\content\RenderingTools.ms; position: 442; line: 15

很明显,没有任何渲染。我按照文档中的描述包含了插件文件。

<?xml version="1.0" encoding="utf-8"?>
<ApplicationPackage SchemaVersion="1.0" AutodeskProduct="3ds Max" ProductType="Application" ProductCode="3ds Max Rendering Tools Plugin" UpgradeCode="My UpgradeCode">
    <CompanyDetails />
    <Components Description="post-start-up scripts parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2020" SeriesMax="2023" />
        <ComponentEntry AppName="RenderingTools" Version="1.0.0" ModuleName="./Content/RenderingTools.ms" />
    </Components>
    <Components Description="plugins parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2020" SeriesMax="2021" />
        <ComponentEntry AppName="CoronaRenderer" ModuleName="./Content/2021/CoronaMax2021.dlr" />
        <ComponentEntry AppName="CoronaUtils" ModuleName="./Content/2021/CoronaMaxUtils2021.dlt" />
    </Components>
    <Components Description="light icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2020" SeriesMax="2021" />
        <ComponentEntry ModuleName="./Content/2021/UI/Icons/" />
    </Components>
    <Components Description="dark icon paths parts">
        <RuntimeRequirements OS="Win64" Platform="3ds Max" SeriesMin="2020" SeriesMax="2021" />
        <ComponentEntry ModuleName="./Content/2021/UI/IconsDark/" />
    </Components>

</ApplicationPackage>

Design Automation 不会加载界面插件,即任何带有图标、表单、用户交互的内容。

根据输出,CoronaMax2021.dlr 加载失败。

首先,Corona 是第三方渲染,从许可的角度来看,您可能需要仔细检查这是可接受的用例。特别是如果他们使用某种“在线”许可,因为设计自动化环境将不允许模块通过互联网检查许可。只要它可以自动化(不需要任何 UI 交互)并且许可不是问题,它就可以工作。

接下来,我建议首先尝试使用内置的 3ds Max 渲染器(可能是 ART 或 Arnold)来完成这些步骤。不要担心材料等问题,但要让您的脚本在没有电晕的情况下运行,以确保您已完成自动化。

然后,您可以尝试解决 Corona 问题(并且不能保证它可以工作,因为它又是第三方工具。)这可能是显而易见的,但可以肯定的是......从 ApplicationPackage 看来像应用商店捆绑包一样设置。对于 3ds Max Design Automation,您还需要发送所有必要的模块,并确保路径设置正确,以便在您的应用程序包 zip 中找到它们。这里有一个例子:https://learnforge.autodesk.io/#/designautomation/appbundle/engines/max (see the PackageContents section). Note that similarly the app bundle is setup to load from a "contents" folder, but the modules must also be provided in the app bundle zip in the correct location. Another example is provided here: https://github.com/kevinvandecar/design.automation.3dsmax-csharp-meshoptimizer (use the deploy01 branch). You can find this example's bundle here: https://github.com/kevinvandecar/design.automation.3dsmax-csharp-meshoptimizer/tree/deploy01/forgesample/wwwroot/bundles。请注意,zip 包含文件夹结构和插件所需的所有模块。