Renderer plugin crashes Material Editor

Renderer plugin crashes Material Editor

Anonymous
Not applicable
951 Views
3 Replies
Message 1 of 4

Renderer plugin crashes Material Editor

Anonymous
Not applicable

Hi guys!
I'm trying to write renderer plugin but I stuck on some problems.
The renderer works fine but when I try to open Material Editor MAX crashes:

An error has occured and the application will now close.
Do you want to attempt to save a copy of the current scene?

Also when I close MAX I receive error message:

"pure virtual function call"

After couple of days of headache I finally commented out all of my code and leave the plugin empty as it was created by 3ds Max Plugin Wizard.
I have commented out ALL of my code. Not just executable but also field declarations, includes, definitions and so on.

 

The idea was to get my code back part by part and identify buggy code.
But when I run 3ds Max with this empty plugin nothing has changed (except my renderer draws black images 🙂 ).

Obviously I miss to implement some functionality.

I have added in every method a code writing in windows log to find out which is the last called method before the crash. The method is CreateParamDialog.

Maybe something is wrong with param dialog. It is emplty for now.

My system is: Windows 8; 3ds Max 2016

Attached is the source code.

Hope someone to help.
Thanks in advance.

0 Likes
952 Views
3 Replies
Replies (3)
Message 2 of 4

Anonymous
Not applicable

Why you do not initialize the pblock with NULL? You do not have any parameter block descriptors yet so MakeAutoParamBlocks(...) do pretty nothing for you.

MaxRendererPlugin::MaxRendererPlugin() 
{
	pblock = NULL;
	GetMaxRendererPluginDesc()->MakeAutoParamBlocks(this);
}

 

 

And when 3ds Max exits it destroys your references and you'll get the crash.

0 Likes
Message 3 of 4

Anonymous
Not applicable

Hi Vlad!

Thank you for the reply!

 

It seems your suggestion fixed the problem with Material Editor.

Thanks again!

 

But "Pure virtual function call" on 3ds Max closing is still here.

 

Best regards

0 Likes
Message 4 of 4

Anonymous
Not applicable

Try to attach debugger and get stack trace.

0 Likes