"Error Loading ParamBlock2" after adding to ParamBlockDesc2


Hey all,

I have a few material plugins that I’m having an issue with.

Originally I released a version of a material that had some parameters in a ParamBlockDesc2, lets say these are:

  • Test1 - Param ID 0
  • Test2 - Param ID 1

Later I released a new version that Included a new parameter and changed the id of an old one, now it is:

  • Test1 - Param ID 0
  • Test3 - Param ID 1
  • Test2 - Param ID 2

Users using the new plugin cannot load scenes that use the old one, attempting to load a scene causes a “Error Loading ParamBlock2” dialog to display and the scene fails to load.

I am now trying to update my plugin so that it can load both the old and new versions of the material, but I’m not sure how.

I saw an article in the 3ds Max Help about versioning (here), and that suggests adding a P_VERSION flag to the ParamBlockDesc2 and setting a post-load callback to migrate from the old IDs to the new IDs. The problem I’m seeing with this approach is that my material’s Load function is never called, so the post-load callback can never run. The “Error Loading ParamBlock2” problem happens before that.

Is there anything I can do in this situation to let my plugin load old versions of the material?