vertex color channel randomly black for random faces

As I scrub the timeline or go back and forth in the stack I see that genome gets confused about the number of verts in the vertex color channel. So the remainder end up black. I can sometimes trigger a refresh by enabling or disabling a vertex color modifier below. The topology doesn’t change so I don’t know why the results are different on every frame. A parallel race condition?

I’m just evaluating a object xyz texture and assigning to vertex color channel.
version 0.9.2.47031
max 2012 64bit.

(side issue, why is it re-evaluating on every frame? Is genome smart enough to see if the channels used are invalidated (TOPO_CHANNEL, GEOM_CHANNEL, SELECT_CHANNEL, TM_CHANNEL, VERTCOLOR_CHANNEL, etc))

Do I need to provide more info on this?

What is an “object xyz texture”? I don’t have one of those.

Genome uses the intersection of all the validity intervals of objects used in the flow to determine the validity. Any caching beyond the InputGeometry node is left to the 3ds Max geometry pipeline. If your texmap you are evaluating reports a instant validity interval, Genome cannot do any better. One caveat is the InputScript node which will immediately force Genome to use a instant validity since we cannot determine the validity interval of an evaluated MXS expression.

That being said, each channel is assigned the same validity. No attempt is currently made to determine different intervals for geometry vs. selection vs. texture channel etc.

I can’t reproduce this. I created a teapot with a Genome modifier on top. The genome flow was this:

[code](–MAGMAFLOW2–
global MagmaFlowEditor_EditBLOPHistory = #()
global MagmaFlowEditor_Genome_Properties = #(#(#removeDegenerateFaces, false), #(#clampVertexSelection, true))
global MagmaFlowEditor_Genome_MeshIterationMode = #facevertex
node0 = magmaNode.createNode “Output”
magmaNode.setNumNodeInputs node0 1
magmaNode.setNumNodeOutputs node0 0
magmaNode.setNodeProperty node0 “channelName” “Color”
magmaNode.setNodeProperty node0 “channelType” “float32[3]”
magmaNode.DeclareExtensionProperty node0 “Position”
magmaNode.SetNodeProperty node0 “Position” [670,180]
magmaNode.DeclareExtensionProperty node0 “Selected”
magmaNode.SetNodeProperty node0 “Selected” true

node1 = magmaNode.createNode “TexmapEval”
magmaNode.setNumNodeInputs node1 6
magmaNode.setNumNodeOutputs node1 1
magmaNode.setNodeInputDefaultValue node1 1 [0,0,0]
magmaNode.setNodeInputDefaultValue node1 2 [0,0,0]
magmaNode.setNodeInputDefaultValue node1 3 [0,0,0]
magmaNode.setNodeInputDefaultValue node1 4 [0,0,0]
magmaNode.setNodeInputDefaultValue node1 5 0
magmaNode.setNodeInputDefaultValue node1 6 1.0
try(theMaps = getClassInstances Cellular
for m in theMaps where m.name == “Map #1” do magmaNode.setNodeProperty node1 “texmap” m)catch()
magmaNode.setNodeProperty node1 “mapChannels” #()
magmaNode.setNodeProperty node1 “resultType” “Color”
magmaNode.DeclareExtensionProperty node1 “Position”
magmaNode.SetNodeProperty node1 “Position” [330,140]
magmaNode.DeclareExtensionProperty node1 “Selected”
magmaNode.SetNodeProperty node1 “Selected” true

node2 = magmaNode.createNode “InputChannel”
magmaNode.setNumNodeInputs node2 0
magmaNode.setNumNodeOutputs node2 1
magmaNode.setNodeProperty node2 “channelName” “Position”
magmaNode.setNodeProperty node2 “channelType” “”
magmaNode.DeclareExtensionProperty node2 “Position”
magmaNode.SetNodeProperty node2 “Position” [10,190]
magmaNode.DeclareExtensionProperty node2 “Selected”
magmaNode.SetNodeProperty node2 “Selected” true

node3 = magmaNode.createNode “InputChannel”
magmaNode.setNumNodeInputs node3 0
magmaNode.setNumNodeOutputs node3 1
magmaNode.setNodeProperty node3 “channelName” “TextureCoord”
magmaNode.setNodeProperty node3 “channelType” “”
magmaNode.DeclareExtensionProperty node3 “Position”
magmaNode.SetNodeProperty node3 “Position” [0,310]
magmaNode.DeclareExtensionProperty node3 “Selected”
magmaNode.SetNodeProperty node3 “Selected” true

try(magmaNode.setNodeInput node0 1 node1 1)catch()
try(magmaNode.setNodeInput node1 1 node2 1)catch()
magmaNode.setNodeInput node1 2 -1 1
try(magmaNode.setNodeInput node1 3 node3 1)catch()
magmaNode.setNodeInput node1 4 -1 1
magmaNode.setNodeInput node1 5 -1 1
magmaNode.setNodeInput node1 6 -1 1

)[/code]

Here’s a screenshot:
[attachment=0]vertex_color_work_fine_silly.png[/attachment]

I used a cellular map with a checker map in the Cell Color slot so that it would be obvious when it was updating. The Bend on there is to add a keyframe that does nothing so it updates every frame like you claimed. Otherwise I was only having Genome evaluate once and the result was cached. During playback( ie. hitting the play button) nothing flickered or acted funny at all. I have 2 physical cores and hyperthreading enabled. This was Genome 0.9.2.47031 & 1.0.1 both on Max 2012 64-bit.

I’m not sure how to reproduce this because it works at first but then i stops working the more I worked on the scene. It could be having multiple genomes in the scene causes the problem. But you have the general idea. I just meant a texmap that uses object xyz coords instead of uvw1.

Attached is a mesh with no animation, the map has no animation. As you can see the results when I scrub the time are different even when I land on the same frame.

Do you get any messages in the listener? There were previously race conditions when it came to assigning selection due to the use of a BitArray which obviously can’t have multiple threads writing to it at the same time. When operating on vertex colors there is never any overlap on the same faces assigned to the same thread so I don’t think its a threading problem. I have seen similar results when an exception prevents the completion of the loops. Usually its just garbage data all around though, and not partial data.

I don’t see anything in the listener. My theory currently is having an instanced genome or multiple genomes on multiple object. This bug is very shy and tends to go away when someone is watching. I tried to repro when Bobo was here but I think his aura scared away the problem. I will try to get this to fail in a scene I can send.

Attached is a simple file of a plane rotating in space with vertex colors coming from a cellular map. On my machine you see discontinuities in the VC channel after scrubbing the time.
genome_problem.rar (37 KB)

Thanks Ben! That scene reproduces the problem on my machine too.

any chance for a fix?

Hopefully in an upcoming build that is ~2 weeks out. :slight_smile:

any word? I think its a race condition for world and local coords.