I guess I'm not sure how you intend on getting the texture to assign to your
mesh properly. The renderer needs to know what pixel to assign to which
vertex eventually, so there needs to be some sort of mapping.
What you could try is to create a plugin node that would mimic what
polyColorPerVertex<http://download.autodesk.com/us/maya/2011help/Nodes/polyColorPerVertex.html>
does
(or plug into it). You node would load the 1d texture information and assign
it to each vertex.

O(n) is unavoidable - whatever the process is eventually at each frame each
vertex gets assigned a new color; the only difference is how much code
*you* have
to write to get that to happen, and how much code already exists in maya
that you can take advantage of.

- Ofer
www.mrbroken.com


On Tue, Sep 7, 2010 at 10:41 AM, Omar Agudo <[email protected]> wrote:

> Thank you for your responses,
>
> I have looked into those solutions before. The problems I have found are:
>
>
>    - If I use Vertex Colors I must calculate and load the colors for each
>    frame.
>
>
>    - and if I use a ramp texture I have to modify the u or v coordinates
>    for each frame.
>
> All the previous solutions require an execution time of O(n) where n is the
> number of vertices. (The scene contains lot of vertices).
>
> Using a 1d texture I only have to change the texture.  (The u or v
> coordinates do not change)
>
>
> Thank you,
>
> Omar.
>
>
>
> On 7 September 2010 19:24, Ofer Koren <[email protected]> wrote:
>
>> You should look into these:
>> - 'Ramp' texture (creates 1d or 2d color ramps in various ways)
>> - Vertex Colors: you can assign specific color values per vertex or per
>> face-vertex. This might work better that using a shading network, and you'd
>> easily be able to see those results directly in the viewport.
>>
>> - Ofer
>> www.mrbroken.com
>>
>>
>>
>> On Tue, Sep 7, 2010 at 10:18 AM, Omar Agudo <[email protected]> wrote:
>>
>>> The scenario is the following:
>>>
>>>
>>>    - I have some meshes loaded into maya.
>>>    - All vertex of these meshes have a "voltage" value, which I must
>>>    render using a specific color (which is calculated from the voltage).
>>>    -  These voltage values change from one frame to another, therefore,
>>>    in the next frame, all voltages are different. It is worthwhile to 
>>> mention
>>>    that I have access to an array which contains the voltage value for each
>>>    vertex (index of the array).
>>>
>>> My purpose is the following:
>>>
>>>    - Create a 1d texture with the voltage values. (Using the mentioned
>>>    array).
>>>    - Use the u or v coordinate of each vertex to point at its voltage
>>>    value.
>>>    - Programme a shader (modify the lambert shader) to convert the
>>>    voltage value to a color.
>>>
>>>
>>> Using this approach, I only need to reload the buffer (1d texture) which
>>> contains the voltages (It is not needed to change the uv coordinates).
>>>
>>> Thank you again,
>>>
>>> Omar.
>>>
>>>
>>> On 7 September 2010 19:07, Ofer Koren <[email protected]> wrote:
>>>
>>>> I think we need more details...
>>>>
>>>> - Ofer
>>>> www.mrbroken.com
>>>>
>>>>
>>>> On Tue, Sep 7, 2010 at 9:02 AM, Omar Agudo <[email protected]>wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> I have recently started using maya for my project at the university.
>>>>>
>>>>> I am using the maya-python API as well as the OpenMaya API to create
>>>>> and render the scene.
>>>>>
>>>>> Do you know how can I implement a 1d texture in maya?
>>>>>
>>>>> Thank you in advance,
>>>>>
>>>>> best regards,
>>>>>
>>>>> Omar.
>>>>>
>>>>> --
>>>>> http://groups.google.com/group/python_inside_maya
>>>>>
>>>>
>>>>  --
>>>> http://groups.google.com/group/python_inside_maya
>>>>
>>>
>>>  --
>>> http://groups.google.com/group/python_inside_maya
>>>
>>
>>  --
>> http://groups.google.com/group/python_inside_maya
>>
>
>  --
> http://groups.google.com/group/python_inside_maya
>

-- 
http://groups.google.com/group/python_inside_maya

Reply via email to