get and set Color-Per-Vertex for custom map chanels?

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

 
Thread Tools Display Modes
  03 March 2018
get and set Color-Per-Vertex for custom map chanels?

In maxscript there are function to set Color-Per-Vertex values for map chanel 0, but I would like to have the posibility to do the same for other map chanels. I am talking about something like this:

getVertColor <mesh> -2 <CPVvert_index_integer>
setVertColor <mesh> -2 <CPVvert_index_integer> <color>

The functions should get/set Color-Per-Vertex value from map chanel -2. Is there something like that avaible in maxscript?
 
  03 March 2018
Sure, just use meshop.get/setMapVert instead.
__________________
Scripts :: linkedin
 
  03 March 2018
Originally Posted by Swordslayer: Sure, just use meshop.get/setMapVert instead.
I know about that, but setMapVert acept not colour and getMapVert return no colour, so complicated convertions have to be done for both. At the moment I am already using the solution, you mentioned, but I really would like to avoid that convertions if posible.
However thanks.
 
  03 March 2018
What's so complicated about  (result * 255) as color  and  (color / 255) as point3?
__________________
Scripts :: linkedin
 
  03 March 2018
Originally Posted by Swordslayer: What's so complicated about  (result * 255) as color  and  (color / 255) as point3?
Please don´t get me wrong, the solution you mentioned, an I have to use at the moment is not really hard, but I see no reason why at least for map chanels -1 and -2 it is not posible to set Color-Per-Vertex values the same easy way as for chanel 0.
 
  03 March 2018
Because getVertColor is a method that predates meshop methods, back then mapchannels were supposed to do one thing and there were only two mapping channels. This changed later and so now you have an universal method to use.
__________________
Scripts :: linkedin
 
  03 March 2018
Originally Posted by Swordslayer: Because getVertColor is a method that predates meshop methods, back then mapchannels were supposed to do one thing and there were only two mapping channels. This changed later and so now you have an universal method to use.
I am using older max versions and there are at least 4 chanels avaibble from -2 to 1. However the oldest version I used was 6.
 
  03 March 2018
Sure, this was the case in max 2,  basically very little changed in this area since max 4.
__________________
Scripts :: linkedin
 
  03 March 2018
I have seen this:
.vertexColorType and .vertexColorMapChannel
but there is no reall explanation abot that, so I thought it posibly could be helpfull to do what I wanted to do, am I wrong?
 
  03 March 2018
Those are node-specific properties that are only related to how it will be displayed in the viewport, and it's explained quite well in the docs.
__________________
Scripts :: linkedin
 
  07 July 2018
Just noticed there is:

meshop.setVertColor <Mesh mesh> <int mapChannel> <vertlist> <color color>

for seting color, unfortunatelly there is no corresponding geter function.
 
  07 July 2018
Originally Posted by Swordslayer: What's so complicated about  (result * 255) as color  and  (color / 255) as point3?
it's just a trick:

<color> as point4
<point4> as color

most of mesh/poly methods that take a point3 as an argument takes a point4 instead as well  
 
  07 July 2018
Originally Posted by denisT: it's just a trick:

<color> as point4
<point4> as color

most of mesh/poly methods that take a point3 as an argument takes a point4 instead as well  
So if I do this:


c=(meshop.getMapVert  msh -1 1) as color


c will contain the color of the first mapVert from chanel -1, right?
 
  4 Weeks Ago
Originally Posted by denisT: it's just a trick:

<color> as point4
<point4> as color

most of mesh/poly methods that take a point3 as an argument takes a point4 instead as well  
Sorry, but that <point4> as color is not really usefull, the point4 values are converted to int values.
 
reply share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright ©2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:40 AM.


Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.