Message 1 of 1
Cannot wrap Plugin call in an IF block
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Sharing this just as general knowledge: You cannot wrap a plugin definition inside an IF block. You can do it, but don't expect that it will only run based on the condition of the IF block. It will run regardless.
This means if you want to use, for example, a simpleSpline plugin object but make it only run in 3ds Max 2016+, you need to define the plugin outside of the file doing the version logic. Why? Because in the example below, Max will have an error if you execute it in 3ds Max 2015 or older (where simpleSpline isn't known).
if ((MaxVersion())[1] >= 18000) then ( -- only load this for Max 2016+ plugin simpleSpline MySimpleSplinePlugin name:"Custom Spline" category:"Custom Shape" classID:#(0x31388d8c, 0x735f4fe9) ( /* code for spline */ ) )
The safe way to do this that is backwards compatible:
if ((MaxVersion())[1] >= 18000) then ( -- only load this for Max 2016+ fileIn "myCustomSpline.ms" )
Shawn Olson
Developer of Wall Worm
3ds Max plugins and Scripts
3ds Max 4/Gmax - 3ds Max 2020
Mudbox 2009-2019
Windows 10 x64
i7 8700K
64GB RAM
Geforce 1080ti