CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 02-21-2013, 08:26 PM   #1
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
How to get vertex color between vertexes?

Hi, I've got a problem here with getting a vertex color from vertex color map between vertexes. What I mean is I want to sample a vertex color but not in it's exact position like that:

Code:
polyColorPerVertex -q -rgb pPlane1.vtx[507]


but with its UV coordinate between vertexes. Could anyone tell me how to do it?

Cheers,
M.
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 02-21-2013, 10:47 PM   #2
depakeen
Veteran
portfolio
Jerome Pourcel
Paris, FR
 
Join Date: Sep 2011
Posts: 45
You just can't. As its name sounds like, vertex color is a color you set on a vertex, and not between two vertices...
The color between two vertices will be the blend of the two vertex colors...
 
Old 02-22-2013, 07:29 AM   #3
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
Quote:
Originally Posted by depakeen
...The color between two vertices will be the blend of the two vertex colors...


Yes, you are probably right. The thing is I could write expression to get face-vertex Id, get their vertexes array and calculate the color by blending colors (as you said) with color weight being normalized distance to particles divided by their number. Nevertheless, Maya has to have the function built in as it can draw blended colors in viewport with no problem. I know this is probably Direct Draw function rather then Maya's, but it should be out there accessable. Therefore I thought maybe someone knows a way (maybe using API) to get that info?
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 02-22-2013, 08:18 AM   #4
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
colorAtPoint will sample a texture at UVs.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 02-22-2013, 08:47 AM   #5
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
Quote:
Originally Posted by Aikiman
colorAtPoint will sample a texture at UVs.


Yeah colorAtPoint would suit me but it does not update shading network realtime while painting, so when I try to control object parameters with it I need to update scene manually every time I paint a value. If only colorAtPoint could sample color at point but vertex color values instead textures, it would exactly be what I need.
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 02-22-2013, 09:41 AM   #6
Aikiman
Pixel Collisions
 
Aikiman's Avatar
portfolio
Jeremy Raven
Wellington, New Zealand
 
Join Date: Jun 2005
Posts: 3,582
mmm maybe you'll have to access OpenGL API.
__________________
www.jeremyraven.co.nz
Vimeo
 
Old 02-22-2013, 10:10 AM   #7
benio33
.
portfolio
Maciej Benczarski
Lead FX TD
Platige Image
Poland
 
Join Date: Oct 2005
Posts: 324
Quote:
Originally Posted by Aikiman
mmm maybe you'll have to access OpenGL API.


yeah ... probably so ... unless you know a way to force attribute update, eg. pCube1.scaleX, every time file1 is saved ... scriptJob would be the easiest maybe, but that would become extremely slow :( I need it to work on 10k+ objects (ex. pCubes) :(
__________________
Beauty Pass - 3D apps vendors' jest of a lifetime - most of the time it has nothing to do with beauty, and it isn't a pass anyway.
 
Old 02-22-2013, 02:29 PM   #8
animatedfox
what the ?!?!
 
animatedfox's Avatar
portfolio
Benjamin Fox
Seat 43
USA
 
Join Date: Feb 2010
Posts: 891
This is a bit off the beaten path...and not sure of the details...but maybe someone else can pick up the ball and run with it.
What about using the polySubdivideFacet command. Its essentially a basic smooth that doesn't affect point positions. Even if it goes on the stack after adding the color per vertex it gives the new points the correct rgb values.
Not sure if that is enough to go on...but it seems to have potential.
 
Old 02-22-2013, 02:29 PM   #9
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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 12:20 AM.


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