appleseedhq / appleseed-max

appleseed plugin for Autodesk® 3ds Max®
https://appleseedhq.net/
MIT License
33 stars 16 forks source link

Import of scene which uses Forest Pack causes scene building exception #276

Closed Mango-3 closed 5 years ago

Mango-3 commented 5 years ago

This issue was reported in discord by @rbrune: https://discordapp.com/channels/430063582777049089/430067119963504641/559685855229509672

When trying to use appleseed with a scene that uses forest pack appleseed will run into an exception during scene building: "foundation::Exception" when parsing the scene objects 'XYZforestlibrary[]' or 'XYZforesttemplate[]'. I assume scene building tries to access some property that might not exist. XYZ__forest_library_[] XYZ__forest_template_[]

Deleting the template solved the problem.

Mango-3 commented 5 years ago

Opening a scene file with Forest Pack content leads to an exception in the Max scripting system.

########################################################################
-- MAXScript Callback script Exception:
-- Known system exception
-- ########################################################################
-- Address: 0x1e3f6fa7; nCode: 0x00000000C0000005
-- Desc: EXCEPTION_ACCESS_VIOLATION The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
--       Read of Address: 0x0000000000000000
-- ########################################################################

The reason is that the MassFX plugin tries to establish if the objects from the Forest Pack templates are rigid bodies and fails doing so. The function call to

PxIsRB: Global:PxIsRB : PxIsRB()
--          owner: undefined

gives an error.

Nonetheless, the scene renders without issues in appleseed (see screenshot below) and switching the render engine to Arnold does not change the exception being thrown on scene loading.

Test render of scattered stones from a Forest Pack template forrest_pack_test_Perspective_cr

dictoon commented 5 years ago

Thanks for testing @Mango-3. I guess we can close this issue then?

Mango-3 commented 5 years ago

Agree, seems like this is not something on appleseed's side which needs to be fixed now. For engines which natively support Forest Pack this issue may not show up. Hence, Rafael's observation that Corona does not show an error with his scene. On the long term we may be able to add support for Forest Pack, which would need additions/changes to the mesh export routine and having access to their SDK.