Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Noob question on how to same custom data

Noob question on how to same custom data

elpie89
Advocate Advocate
1,107 Views
7 Replies
Message 1 of 8

Noob question on how to same custom data

elpie89
Advocate
Advocate

Hi all, I'm writing a c++ plugin for 3dsmax using Qt. The plugin is a custom modifier
Inside my modifier, I show a QListView where I display some custom data
I would like to be able to store those data with the modifier of course, but I do not understand if there is a way to save it with the parameter block.
a sort of way to store a custom object as a parameter
Right now I'm using the load/save method to write my data in the file

But I'm not sure if this is the right way to work

What do you think?

Thanks in advance

0 Likes
Accepted solutions (2)
1,108 Views
7 Replies
Replies (7)
Message 2 of 8

denisT.MaxDoctor
Advisor
Advisor

@elpie89 wrote:

I'm writing a c++ plugin for 3dsmax using Qt. The plugin is a custom modifier
Inside my modifier, I show a QListView where I display some custom data


you have chosen a serious task for a noob 😶

 

a sort of way to store a custom object as a parameter


what kind of the custom object and the parameter of what do you have?

 

0 Likes
Message 3 of 8

elpie89
Advocate
Advocate

I have a custom class that contains a bunch of float used to draw a collision gizmo in max,

So an artist will be able to add a modifier to a node, create a series of collision object drawn by the viewport and, these collisions objects are selectable inside the qlistview of the modifier

So at the and I will have to save a structure where a collision data list is associated with a node.

I hope it is clearer.

Just to give some context, in my company we have a custom engine, where collision data for the mesh are specified on exported data, and not in the editor as in unity or unreal

For many years we used custom gizmos, children of the node and exported in our custom format.

It works, but this is a huge mess when you have to export a huge scene with many nodes and you end up increasing exponentially the number of node inside the scene.

That is why I'm moving this data inside a modifier

 

And of course its noob from max sdk  c++ point of view 😁

I'm quite comfortable with maxplus and qt but I think I needed more control that why I'm going with c++ 

0 Likes
Message 4 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

@elpie89 wrote:

I have a custom class that contains a bunch of float used to draw a collision gizmo in max,

 


There are two built-in MAX API places where you can store (save and load) data of this kind:

#1 - custom attribute

#2 - application data

 

I would probably stick with AppData

 

 

0 Likes
Message 5 of 8

elpie89
Advocate
Advocate
0 Likes
Message 6 of 8

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

Yes. This is it. I use the AppData in many tools I made.

0 Likes
Message 7 of 8

elpie89
Advocate
Advocate

I wonder what is the best way to communicate between my data filled inside the qt widget class

and the actual modifier class

In a more standard case parameter block works as a sort of already implemented observer pattern.

At least if I understood what I'm doing

What if the display function of the modifier should read from a qt view/model object?

In my case seems like I should implement a custom observer pattern, am I right?

What do you think?

0 Likes
Message 8 of 8

elpie89
Advocate
Advocate

I finally achieved to do my task.

I struggled a little bit and speaking of "structured code" it is not perfect for sure.

But for anyone of Autodesk who will ever read this post, I would like just to suggest to add an example on the SDK, on how to implement a view/model based plugin in QT

thanks for your help 

0 Likes