Chad
March 30, 2012, 4:50pm
1
I was trying to double check the results of a “ToCamera” but I was getting some odd results. Not sure if this is Genome or just the way max works… If it’s the latter, then there might be a need to put this into the FAQ, as it means that the vertex colors might not be terribly useful for debugging.
I couldn’t double check the results in the debugger, since that’s still not working for me.
(--MAGMAFLOW2--
global MagmaFlowEditor_EditBLOPHistory = #()
global MagmaFlowEditor_Genome_Properties = #(#(#meshIterationPattern, "CUSTOM FACE VERTEX"), #(#removeDegenerateFaces, true), #(#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" [640,400]
magmaNode.DeclareExtensionProperty node0 "Selected"
magmaNode.SetNodeProperty node0 "Selected" true
--------------------------------------------
node1 = magmaNode.createNode "InputChannel"
magmaNode.setNumNodeInputs node1 0
magmaNode.setNumNodeOutputs node1 1
magmaNode.setNodeProperty node1 "channelName" "Position"
magmaNode.setNodeProperty node1 "channelType" ""
magmaNode.DeclareExtensionProperty node1 "Position"
magmaNode.SetNodeProperty node1 "Position" [110,180]
magmaNode.DeclareExtensionProperty node1 "Selected"
magmaNode.SetNodeProperty node1 "Selected" true
--------------------------------------------
node2 = magmaNode.createNode "InputObject"
magmaNode.setNumNodeInputs node2 0
magmaNode.setNumNodeOutputs node2 1
magmaNode.setNodeProperty node2 "object" (getNodeByName "Camera001")
magmaNode.DeclareExtensionProperty node2 "Position"
magmaNode.SetNodeProperty node2 "Position" [130,490]
magmaNode.DeclareExtensionProperty node2 "Selected"
magmaNode.SetNodeProperty node2 "Selected" true
--------------------------------------------
node8 = magmaNode.createNode "ToSpace"
magmaNode.setNumNodeInputs node8 2
magmaNode.setNumNodeOutputs node8 1
magmaNode.setNodeInputDefaultValue node8 1 [0,0,0]
magmaNode.setNodeProperty node8 "inputType" "Point"
magmaNode.setNodeProperty node8 "node" (getNodeByName "Camera001")
magmaNode.DeclareExtensionProperty node8 "Position"
magmaNode.SetNodeProperty node8 "Position" [440,480]
magmaNode.DeclareExtensionProperty node8 "Selected"
magmaNode.SetNodeProperty node8 "Selected" true
--------------------------------------------
node9 = magmaNode.createNode "Multiply"
magmaNode.setNumNodeInputs node9 2
magmaNode.setNumNodeOutputs node9 1
magmaNode.setNodeInputDefaultValue node9 1 1.0
magmaNode.setNodeInputDefaultValue node9 2 0.1
magmaNode.DeclareExtensionProperty node9 "Position"
magmaNode.SetNodeProperty node9 "Position" [740,300]
magmaNode.DeclareExtensionProperty node9 "Selected"
magmaNode.SetNodeProperty node9 "Selected" true
--------------------------------------------
node5 = magmaNode.createNode "ToWorld"
magmaNode.setNumNodeInputs node5 1
magmaNode.setNumNodeOutputs node5 1
magmaNode.setNodeProperty node5 "inputType" "Point"
magmaNode.DeclareExtensionProperty node5 "Position"
magmaNode.SetNodeProperty node5 "Position" [270,180]
magmaNode.DeclareExtensionProperty node5 "Selected"
magmaNode.SetNodeProperty node5 "Selected" true
--------------------------------------------
try(magmaNode.setNodeInput node0 1 node9 1)catch()
try(magmaNode.setNodeInput node8 1 node5 1)catch()
try(magmaNode.setNodeInput node8 2 node2 1)catch()
try(magmaNode.setNodeInput node9 1 node8 1)catch()
magmaNode.setNodeInput node9 2 -1 1
try(magmaNode.setNodeInput node5 1 node1 1)catch()
--------------------------------------------
)
But the colors in the viewport are inverted compared to what they are in the render.
If I clamp the colors, it’s fine, but scaling it (by a positive amount) is not.
The viewport seems to do weird stuff when your vertex colors are not in the [0,1] range. I noticed that negative numbers or larger positive numbers made the viewport appear to use some sort of modulo effect on the displayed color. I assume its running afoul of something like this:
color = (int)(uvw[0].x * 255.f) & 0xFF;
The summary of my story is that Max is weird and I didn’t do it.
Bobo
March 30, 2012, 5:09pm
3
We should figure that out.
Is it crashing? Is it coming up empty? Is it coming up with an ERROR displayed in it?
Please explain, we have a very short time to fix this
Chad
March 30, 2012, 5:17pm
4
Ok. Max 2012 sp2
If I have the Debug window open, and change the wiring of a the flow, add a node, hit Update, etc., then I get this…
MAXScript Garbage Collection Error
An unknown error occurred while MAXScript was
performing garbage collection.
If you get this error multiple times, recommend restarting max
OK
And then after that it’s a continuous series of…
MAXScript Rollout Handler Exception
– Unknown system exception
OK
And it points me to Genome_Magmaflow.ms…
fn prepareDepotForDragAndDrop =
(
if MagmaFlowSettings.DepotPlacement == #off do return false
for i = 1 to DepotNodes.count do
(
hc.activeNode = editorNodeCount+i
DepotNodes[i][4] = hc.activeNodePos
)
)
And if I manage to close the Debug window, I get…
MAXScript Garbage Collection Error
An unknown error occurred while MAXScript was
performing garbage collection.
If you get this error multiple times, recommend restarting max
OK
Chad
March 30, 2012, 5:21pm
5
I get this if I start max, make a Box, add Genome, and load the Bend preset then hit Debug.
And if I try to open one of the autobackups where I had the Debug window open, I get this…
MAXScript Garbage Collection Error
An unknown error occurred while MAXScript was
performing garbage collection.
If you get this error multiple times, recommend restarting max
OK
And nothing happens when I hit Open Magma Editor.
Bobo
March 30, 2012, 5:25pm
6
Out if curiosity, what is your
heapSize
Also, can you open the Genome_MagmaFlow.ms, locate the line
gc light:true
and remark it, then save the file.
I am not getting the Unknown System Exception, but I have seen the GC warning.
Chad
March 30, 2012, 5:46pm
7
heapsize = 34603008L
gc light:true
Found one, commented out, saved, restarted, made box, added genome bend preset, opened editor, turned on debug, hit update…
-- Error occurred in i loop; filename: C:\Program Files\Thinkbox\Genome MX\Scripts\Genome_MagmaFlow.ms; position: 15324; line: 387
-- Frame:
-- i: 2
-- li: undefined
-- called in populateDataListView(); filename: C:\Program Files\Thinkbox\Genome MX\Scripts\Genome_MagmaFlow.ms; position: 16441; line: 423
-- Frame:
-- theRange: #(dotNetObject:System.Windows.Forms.ListViewItem, dotNetObject:System.Windows.Forms.ListViewItem, dotNetObject:System.Windows.Forms.ListViewItem, dotNetObject:System.Windows.Forms.ListViewItem)
-- cnt: 0
-- lv: dotNetControl:dnc_datalistview:System.Windows.Forms.ListView
-- li: dotNetObject:System.Windows.Forms.ListViewItem
-- called in updateDialog(); filename: C:\Program Files\Thinkbox\Genome MX\Scripts\Genome_MagmaFlow.ms; position: 17763; line: 480
-- Frame:
-- forceUpdate: true
-- called in btn_updateme.pressed(); filename: C:\Program Files\Thinkbox\Genome MX\Scripts\Genome_MagmaFlow.ms; position: 18364; line: 499
-- Frame:
>> MAXScript Rollout Handler Exception:
-- Runtime error: dotNet runtime exception: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. <<
-- Error occurred in hc.mouseMoved(); filename: C:\Program Files\Thinkbox\Genome MX\Scripts\Genome_MagmaFlow.ms; position: 400490; line: 9419
-- Frame:
-- theNotes: undefined
-- lastNodeOver: 18
-- showTooltips: true
-- theMouse: [321,343]
-- theIndex: undefined
-- theText: ""
>> MAXScript Rollout Handler Exception:
-- Unknown system exception <<
Bobo
March 30, 2012, 5:50pm
8
I am not sure what to do about this, but we will try to figure it out. I wish I could reproduce this here, but I have never seen it.
Will install on my laptop and try there…