PDA

View Full Version : Issue with polyop.setVertColor and map channel 5


OIDA
08-14-2008, 03:06 AM
I have a really simple script that allows me to set the vertex colours on a vertex sub-selection on map channel 5 using a colorpicker dialog.

When dealing with an editable mesh there are no problems (using meshop.setVertColor), however, when dealing with an editable poly I get some strange issues when using my script to set the vertex colours on map channel 5. When I bring up my tool and try to set the vertex colour using the colorpicker interface the verts will only reflect the very first change I make in the colorpicker and then stay at that colour no matter how much I mess about with the colorpicker. The strange thing is that if, after making the colour change, I convert the object into an editable mesh I will suddenly see the changes that I made using my script. What is also strange is that if I set up my script to do the exact same thing but on map channel 0 (vertex colour channel) rather than map channel 5 it works flawlessly.

Anybody have any ideas why polyop.setVertColor would have issues on map channel 5 but work fine for map channel 0?

As a side note doing something like

polyop.setVertColor $ 5 $.selectedVerts green

in the listener window works fine, but when using this same command in my script that is being driven by the colorpicker UI it only accepts the very first click I make and then the vertex colours on the model stop updating. Again, this is only the case when I use map channel 5, which unfortunately is a necessity for me.

Thanks in advance for any suggestions, I hope I expressed my issue clearly enough.

OIDA
08-14-2008, 03:13 AM
So, upon further investigation, the problem seems to be the same for all map channels (from 1 onwards), yet it doesn't happen if I use any of the other channels such as Vertex Color, Vertex Illumination, or Vertex Alpha (0, -1, -2).

Any ideas?

OIDA
08-14-2008, 03:25 AM
I forgot to add that this is in Max2008!


Cheers!

OIDA
08-19-2008, 08:41 PM
Here is a basic version of the script to try, someboday has to have an idea if this is a bug or some form of limitation...

Non working version using map channel 5:


try DestroyDialog VertexTint catch()
rollout VertexTint "Vertex Colour Tinter" width: 140
(

group "Pick Vertex Colour:"
(
colorpicker change_vColour "Colour:" color:[128,128,128] width: 90 align: #center
)

on change_VColour changed color do
(
polyop.setVertColor $ 5 $.selectedVerts change_vColour.color
)

)
CreateDialog VertexTint

Working version using map channel 0:


try DestroyDialog VertexTint catch()
rollout VertexTint "Vertex Colour Tinter" width: 140
(

group "Pick Vertex Colour:"
(
colorpicker change_vColour "Colour:" color:[128,128,128] width: 90 align: #center
)

on change_VColour changed color do
(
polyop.setVertColor $ 0 $.selectedVerts change_vColour.color
)

)
CreateDialog VertexTint

Don't forget to change your vertex color display to the appropriate channel if you do try this.

Any ideas anyone?

CGTalk Moderation
08-19-2008, 08:41 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.