Set sub-object selection for VertexPaint modifier

Set sub-object selection for VertexPaint modifier

e_bustaty3ATQ5
Participant Participant
368 Views
8 Replies
Message 1 of 9

Set sub-object selection for VertexPaint modifier

e_bustaty3ATQ5
Participant
Participant

Hi,

 

The VertexPaint modifier has sub-object selection functionality, where the sub-object level can be vertex, face, or element.

 

I'm using MaxScript, and I want to be able to save and restore the sub-object selection, I can read and write what sub-object level is selected using subObjectLevel, and I can read the actual BitArray of what's selected using getVertSelection and getFaceSelection (which only works if the selected object had a mesh base).

 

But what I cannot do, is write the BitArray of the current selection. Calls to setVertSelection / setFaceSelection will either have no effect or will complain of "Mesh operation on non-mesh".

 

I am aware of other methods that can set the selection for and editable poly or a node with e.g. Edit_Poly modifier, but what I need is to set the vertex selection for the VertexPaint modifier itself.

 

Any way this can be done?

 

Thanks

0 Likes
Accepted solutions (1)
369 Views
8 Replies
Replies (8)
Message 2 of 9

e_bustaty3ATQ5
Participant
Participant

I also checked interface methods for IVertexPaint but these don't seem to help.

0 Likes
Message 3 of 9

denisT.MaxDoctor
Advisor
Advisor
Accepted solution

Autodesk developers may correct me, since they have access to the source code. But as far as I know, the Vertex Paint modifier does not expose a real sub-object selection interface.

Whether vertices or faces are currently "selected" appears to be an internal state of the modifier rather than an actual sub-object selection exposed through the standard interface.

Since there is no exposed sub-object selection interface, there is simply no workaround available.

0 Likes
Message 4 of 9

spacefrog_
Advisor
Advisor

i did'nt look up the details regarding exposure of subselection, but Vertex Paint modifier source is part of the sample folder of the 3ds Max SDK


Josef Wienerroither
Software Developer & 3d Artist Hybrid
0 Likes
Message 5 of 9

e_bustaty3ATQ5
Participant
Participant

Thanks spacefrog_,

 

Unfortunately, the VertexPaint modifier that's in the samples is the legacy one that's been deprecated in 2003, it's hidden so so you cannot add it to an object, but it will be loaded if you open a max file that's using VertexPaint from before 2003.

 

class VertexPaintClassDesc:public ClassDesc {
   public:
   // MAB - 5/23/03 - Original Vertex Paint is retired and removed from the UI;
   // Class name changed to OldVertexPaint to avoid maxscript name conflict with the newer modifier
   int         IsPublic()              {
      return 0;
   }

 

Message 6 of 9

e_bustaty3ATQ5
Participant
Participant

Thanks Denis,

 

I think that's right, I think that the modifier will sync the sub-selection that max reads when the user changes the sub-selection (because you can add vertex paint, do a sub-selection, then if you add a modifier on top of it it will be restricted to the selected faces),

 

But it doesn't sync in-reverse, because if I use setFaceSelection, the actual selection that VertexPaint is working with doesn't change. 

 

So how does one go about requesting a feature in Max to expose the sub-selection of VertexPaint?  🙂

0 Likes
Message 7 of 9

denisT.MaxDoctor
Advisor
Advisor

So how does one go about requesting a feature in Max to expose the sub-selection of VertexPaint?  

 


First of all, we should ask Autodesk to include the source code of the new VertexPaint modifier in the SDK samples.

The old source code is only useful if someone is writing the history of Autodesk 3ds Max. 😁

0 Likes
Message 8 of 9

spacefrog_
Advisor
Advisor

@e_bustaty3ATQ5 wrote:

Unfortunately, the VertexPaint modifier that's in the samples is the legacy one that's been deprecated in 2003, it's hidden so so you cannot add it to an object, but it will be loaded if you open a max file that's using VertexPaint from before 2003.


Indeed, sorry for the dead end hint

What a sneaky, nasty thing to do, misleading me like that ...  😏

 


Josef Wienerroither
Software Developer & 3d Artist Hybrid
0 Likes
Message 9 of 9

denisT.MaxDoctor
Advisor
Advisor

What a sneaky, nasty thing to do, misleading me like that ...  😏

 


Haha... I fall for that trick every 3–4 years. 

0 Likes