I'm using the image plugin samples as an example to make a plugin for my custom file type. The plugin works and I can load it to 3ds Max with no errors. But when I open a file dialog, through bitmap selection, I don't see my custom file type extension under the file type selection. What virtual functions of BitmapIO class should I be overriding? What other functionality from BitmapIO is essential? Maybe that's what I am missing. I have already overridden Ext() and ExtCount().
Solved! Go to Solution.
Solved by klvnk. Go to Solution.
Then why isn't it working? It doesn't add the custom file type to the file type selection list on the dialog. Should I expect this to happen?
have you implemented
int Capability ( )
?
to honest without any code it's just pure guess work.
Here is the source and header file. I haven't implemented "int Capability()". How should I do it, what should be on it's body?
Let me know if you need something like the DllEntry.cpp or a resource file.
Capability() is implemented
nothing jumps out what does your .def file look like ?
also not sure why CanAutoDefer() isnt in Dllentry.cpp
ClassDesc2* GetFDRSImageIODesc()
{
static FDRSImageIOClassDesc FDRSImageIOClassDesc;
return &FDRSImageIOClassDesc;
}
this is wrong you can't use a class name as a Variable name.... would have thought the compiler would have complained 🙁
try something like....
ClassDesc2* GetFDRSImageIODesc()
{
static FDRSImageIOClassDesc FDRSImageDesc;
return &FDRSImageDesc;
}
I corrected the variable's name, thanks for pointing it out.
.def looks like this:
LIBRARY FDRSImageIO.bmi
EXPORTS
LibDescription @1 PRIVATE
LibNumberClasses @2 PRIVATE
LibClassDesc @3 PRIVATE
LibVersion @4 PRIVATE
LibInitialize @6 PRIVATE
LibShutdown @7 PRIVATE
SECTIONS
.data READ WRITE
DllEntry.cpp is automatically generated by the Wizard so I couldn't know either, am I supposed to include CanAutoDefer() manually?
move CanAutoDefer() to dllentry.cpp
and add
CanAutoDefer @5 PRIVATE
to your def file
also you could remove LibInitialize & LibShutdown and delete the functions from dllentry.cpp if they exist.
Deleted those two without issues, but adding CanAutoDefer() gave me the link error LNK2005 saying that CanAutoDefer() is already defined in .obj.
Oh yes of course, I should've just ctrl F from the start.
It builds fine, but I still don't get the file type in the drop list.
is your plugin listed in the plugin manager ?
if it is, you could try running under the debugger with a breakpoint in Ext() or something
try changing Capability()
to
int Capability ( ) { return BMMIO_READER |
BMMIO_WRITER |
BMMIO_INFODLG |
BMMIO_EXTENSION |
BMMIO_CONTROLWRITE; }
think you may need the extension flag set, delete the BMMIO_CONTROLWRITE flag if you don't have a custom control panel for write ops
I get this when I use a breakpoint in Ext(): the breakpoint will not currently be hit no symbols have been loaded for this document.
Is this normal? Does the breakpoint hit if I try to select a bitmap?
Edit: It doesn't hit when I select a bitmap, I'm not sure what's wrong here.
My bad, I was confused, give me a second.
Edit: Well that did it, thank you so much. How can I find more information about this?
glad we got there in the end 😁
3ds Max 2022 Developer Help | 3ds Max C++ API Reference: BitmapIO Capability Flags | Autodesk
having the flag and ExtCount() function is kind of belt and braces programming 😏
Can't find what you're looking for? Ask the community or share your knowledge.