Community
3ds Max Programming
Welcome to Autodesk’s 3ds Max Forums. Share your knowledge, ask questions, and explore popular 3ds Max SDK, Maxscript and Python topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Noob question on how to same custom data

7 REPLIES 7
SOLVED
Reply
Message 1 of 8
elpie89
844 Views, 7 Replies

Noob question on how to same custom data

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

7 REPLIES 7
Message 2 of 8
denisT.MaxDoctor
in reply to: elpie89


@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?

 

Message 3 of 8
elpie89
in reply to: denisT.MaxDoctor

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++ 

Message 4 of 8
denisT.MaxDoctor
in reply to: elpie89


@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

 

 

Message 5 of 8
elpie89
in reply to: denisT.MaxDoctor

Message 6 of 8
denisT.MaxDoctor
in reply to: elpie89

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

Message 7 of 8
elpie89
in reply to: denisT.MaxDoctor

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?

Message 8 of 8
elpie89
in reply to: denisT.MaxDoctor

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 

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

Autodesk Design & Make Report