PDA

View Full Version : Scripted Helper Plugin - DisplayMesh


Kramsurfer
06-06-2008, 12:42 AM
I've been trying to create a scripted plugin Helper that has custom geometry... The example has it using a primative, but I wish to have it be a text object.. or text in the form of a mesh object....


plugin Helper MatteManBaseObject
name:"MatteMan"
classID:#(0x47db14fe, 0x4e9b5f90)
category:"Standard"
extends:dummy
(
local tnMesh
on getDisplayMesh do
(
if ( meshObj == undefined ) do
(
tnMesh = Mesh vertices:#([-184.5,0,0],[-184.5,54.6,0],[-165.931,0,0],[-158.297,0,0],[-139.6,53.7,0],[-139.6,0,0],[-131.4,0,0],[-131.4,64.1,0],[-142.861,64.1,0],[-158.234,19.525,0],[-161.65,9.25469,0],[-164.73,18.7391,0],[-179.995,64.1,0],[-192.7,64.1,0],[-192.7,0,0],[-86.8,0,0],[-78.7,0,0],[-80.6156,5.62813,0],[-81.1,19.5125,0],[-81.1,29.9813,0],[-81.4937,37.2266,0],[-83.9484,42.5812,0],[-89.4258,46.1008,0],[-99.1094,47.5,0],[-109.671,45.8602,0],[-116.638,41.1813,0],[-120.1,33.2,0],[-112.4,32.2,0],[-108.454,39.0617,0],[-100.187,41,0],[-91.1484,38.3328,0],[-88.9,31.5547,0],[-88.9437,29.5,0],[-103.086,26.7906,0],[-110.134,25.6109,0],[-115.839,23.0328,0],[-119.936,18.5102,0],[-121.5,12.2844,0],[-117.36,2.73594,0],[-105.514,-1,0],[-96.7719,0.535156,0],[-88.4,5.8,0],[-88.9437,20.4312,0],[-90.225,12.6078,0],[-95.4805,7.1875,0],[-103.65,5.2,0],[-110.693,7.28828,0],[-113.1,12.5094,0],[-112.003,16.2297,0],[-108.888,18.775,0],[-102,20.3406,0],[-89.1,23.3,0],[-55.1922,6.7,0],[-57.9102,7.27031,0],[-59.2805,8.80625,0],[-59.7,13.15,0],[-59.7,40.4,0],[-51.7,40.4,0],[-51.7,46.5,0],[-59.7,46.5,0],[-59.7,62.7125,0],[-67.6,57.9938,0],[-67.6,46.5,0],[-73.4,46.5,0],[-73.4,40.4,0],[-67.6,40.4,0],[-67.6,13.6359,0],[-66.6367,4.32813,0],[-63.3094,0.757813,0],[-56.6547,-0.6,0],[-50.7,0.0953125,0],[-51.7,7.04375,0],[-30.2922,6.7,0],[-33.0102,7.27031,0],[-34.3805,8.80625,0],[-34.8,13.15,0],[-34.8,40.4,0],[-26.8,40.4,0],[-26.8,46.5,0],[-34.8,46.5,0],[-34.8,62.7125,0],[-42.7,57.9938,0],[-42.7,46.5,0],[-48.5,46.5,0],[-48.5,40.4,0],[-42.7,40.4,0],[-42.7,13.6359,0],[-41.7367,4.32813,0],[-38.4094,0.757813,0],[-31.7547,-0.6,0],[-25.8,0.0953125,0],[-26.8,7.04375,0],[7.75233,7.76641,0],[0.353119,5.5,0],[-9.36563,9.54453,0],[-13.7,21.2,0],[20.9562,21.2,0],[21,23.3,0],[15.0984,41.1547,0],[-0.115631,47.5,0],[-15.7672,41.0336,0],[-21.8,22.8563,0],[-15.8328,5.27031,0],[0.321869,-1,0],[13.6117,2.93594,0],[20.7375,14,0],[12.6125,15,0],[-9.20001,37.3805,0],[-0.0593872,41,0],[9.71875,36.4656,0],[12.7,27.7,0],[-13.3,27.7,0],[39.5,0,0],[39.5,54.6,0],[58.0688,0,0],[65.7031,0,0],[84.4,53.7,0],[84.4,0,0],[92.6,0,0],[92.6,64.1,0],[81.1391,64.1,0],[65.7656,19.525,0],[62.35,9.25469,0],[59.2703,18.7391,0],[44.0047,64.1,0],[31.3,64.1,0],[31.3,0,0],[137.2,0,0],[145.3,0,0],[143.384,5.62813,0],[142.9,19.5125,0],[142.9,29.9813,0],[142.506,37.2266,0],[140.052,42.5812,0],[134.574,46.1008,0],[124.891,47.5,0],[114.329,45.8602,0],[107.362,41.1813,0],[103.9,33.2,0],[111.6,32.2,0],[115.546,39.0617,0],[123.813,41,0],[132.852,38.3328,0],[135.1,31.5547,0],[135.056,29.5,0],[120.914,26.7906,0],[113.866,25.6109,0],[108.161,23.0328,0],[104.064,18.5102,0],[102.5,12.2844,0],[106.64,2.73594,0],[118.486,-1,0],[127.228,0.535156,0],[135.6,5.8,0],[135.056,20.4312,0],[133.775,12.6078,0],[128.52,7.1875,0],[120.35,5.2,0],[113.307,7.28828,0],[110.9,12.5094,0],[111.997,16.2297,0],[115.112,18.775,0],[122,20.3406,0],[134.9,23.3,0],[162.9,0,0],[162.9,25.3828,0],[166.535,37.5055,0],[175.178,40.7,0],[180.642,39.2773,0],[183.886,35.4703,0],[184.8,28.2719,0],[184.8,0,0],[192.7,0,0],[192.7,28.5609,0],[192.264,36.2156,0],[189.82,42.0328,0],[184.559,45.9914,0],[176.855,47.5,0],[162.1,39.9016,0],[162.1,46.5,0],[155,46.5,0],[155,0,0]) faces:#([14,15,1],[14,1,2],[13,14,2],[12,13,2],[12,2,3],[11,12,3],[11,3,4],[11,4,5],[10,11,5],[9,10,5],[8,9,5],[7,8,5],[7,5,6],[42,16,43],[42,43,44],[42,44,45],[41,42,45],[41,45,46],[40,41,46],[16,17,18],[43,16,18],[43,18,19],[26,27,28],[26,28,29],[25,26,29],[43,19,20],[52,43,20],[25,29,30],[24,25,30],[39,40,46],[39,46,47],[38,39,47],[38,47,48],[37,38,48],[37,48,49],[36,37,49],[36,49,50],[35,36,50],[35,50,51],[34,35,51],[34,51,52],[33,34,52],[33,52,20],[32,33,20],[32,20,21],[31,32,21],[31,21,22],[31,22,23],[31,23,24],[30,31,24],[60,61,62],[60,62,63],[70,71,72],[70,72,53],[69,70,53],[69,53,54],[68,69,54],[68,54,55],[67,68,55],[67,55,56],[67,56,57],[66,67,57],[64,65,66],[63,64,66],[60,63,66],[60,66,57],[59,60,57],[59,57,58],[80,81,82],[80,82,83],[90,91,92],[90,92,73],[89,90,73],[89,73,74],[88,89,74],[88,74,75],[87,88,75],[87,75,76],[87,76,77],[86,87,77],[84,85,86],[83,84,86],[80,83,86],[80,86,77],[79,80,77],[79,77,78],[96,111,112],[111,96,97],[111,97,98],[111,98,99],[110,111,99],[110,99,100],[109,110,100],[105,106,107],[105,107,93],[104,105,93],[104,93,94],[109,100,101],[108,109,101],[103,104,94],[103,94,95],[102,103,95],[102,95,96],[108,101,102],[112,108,102],[112,102,96],[126,127,113],[126,113,114],[125,126,114],[124,125,114],[124,114,115],[123,124,115],[123,115,116],[123,116,117],[122,123,117],[121,122,117],[120,121,117],[119,120,117],[119,117,118],[154,128,155],[154,155,156],[154,156,157],[153,154,157],[153,157,158],[152,153,158],[128,129,130],[155,128,130],[155,130,131],[138,139,140],[138,140,141],[137,138,141],[155,131,132],[164,155,132],[137,141,142],[136,137,142],[151,152,158],[151,158,159],[150,151,159],[150,159,160],[149,150,160],[149,160,161],[148,149,161],[148,161,162],[147,148,162],[147,162,163],[146,147,163],[146,163,164],[145,146,164],[145,164,132],[144,145,132],[144,132,133],[143,144,133],[143,133,134],[143,134,135],[143,135,136],[142,143,136],[181,182,165],[181,165,166],[179,180,181],[179,181,166],[179,166,167],[178,179,167],[178,167,168],[172,173,174],[171,172,174],[171,174,175],[170,171,175],[170,175,176],[169,170,176],[169,176,177],[169,177,178],[169,178,168])
)
tnMesh.mesh
)
Tool create
(
on mousePoint click do
(
nodeTM.translation = gridPoint;#stop
)
)
)

I have this, but it generates an actual mesh in the scene... I just want to create the trimesh and not a node... and not have max quick exit would be good too...

Thanks

ZeBoxx2
06-06-2008, 07:05 AM
You're currently constructing a mesh object; you should use createInstance and then manipulate that mesh.
In addition, you're creating it ever time getDisplayMesh is invoked; I think you meant to say "if (tnMesh == undefined)". 'meshObj' from the help file example is always undefined in your script, so it will create a ton of meshes (and is probably what makes max unhappy).

Here's one example replacement code:

plugin Helper MatteManBaseObject
name:"MatteMan"
classID:#(0x47db14fe, 0x4e9b5f90)
category:"Standard"
extends:dummy (
local tnMesh
on getDisplayMesh do (
if (tnMesh == undefined) then (
tnMesh = (createInstance Plane).mesh
for i = tnMesh.numVerts to 1 do ( deleteVert tnMesh i )
tnVerts = #([-184.5,0,0],[-184.5,54.6,0],[-165.931,0,0],[-158.297,0,0],[-139.6,53.7,0],[-139.6,0,0],[-131.4,0,0],[-131.4,64.1,0],[-142.861,64.1,0],[-158.234,19.525,0],[-161.65,9.25469,0],[-164.73,18.7391,0],[-179.995,64.1,0],[-192.7,64.1,0],[-192.7,0,0],[-86.8,0,0],[-78.7,0,0],[-80.6156,5.62813,0],[-81.1,19.5125,0],[-81.1,29.9813,0],[-81.4937,37.2266,0],[-83.9484,42.5812,0],[-89.4258,46.1008,0],[-99.1094,47.5,0],[-109.671,45.8602,0],[-116.638,41.1813,0],[-120.1,33.2,0],[-112.4,32.2,0],[-108.454,39.0617,0],[-100.187,41,0],[-91.1484,38.3328,0],[-88.9,31.5547,0],[-88.9437,29.5,0],[-103.086,26.7906,0],[-110.134,25.6109,0],[-115.839,23.0328,0],[-119.936,18.5102,0],[-121.5,12.2844,0],[-117.36,2.73594,0],[-105.514,-1,0],[-96.7719,0.535156,0],[-88.4,5.8,0],[-88.9437,20.4312,0],[-90.225,12.6078,0],[-95.4805,7.1875,0],[-103.65,5.2,0],[-110.693,7.28828,0],[-113.1,12.5094,0],[-112.003,16.2297,0],[-108.888,18.775,0],[-102,20.3406,0],[-89.1,23.3,0],[-55.1922,6.7,0],[-57.9102,7.27031,0],[-59.2805,8.80625,0],[-59.7,13.15,0],[-59.7,40.4,0],[-51.7,40.4,0],[-51.7,46.5,0],[-59.7,46.5,0],[-59.7,62.7125,0],[-67.6,57.9938,0],[-67.6,46.5,0],[-73.4,46.5,0],[-73.4,40.4,0],[-67.6,40.4,0],[-67.6,13.6359,0],[-66.6367,4.32813,0],[-63.3094,0.757813,0],[-56.6547,-0.6,0],[-50.7,0.0953125,0],[-51.7,7.04375,0],[-30.2922,6.7,0],[-33.0102,7.27031,0],[-34.3805,8.80625,0],[-34.8,13.15,0],[-34.8,40.4,0],[-26.8,40.4,0],[-26.8,46.5,0],[-34.8,46.5,0],[-34.8,62.7125,0],[-42.7,57.9938,0],[-42.7,46.5,0],[-48.5,46.5,0],[-48.5,40.4,0],[-42.7,40.4,0],[-42.7,13.6359,0],[-41.7367,4.32813,0],[-38.4094,0.757813,0],[-31.7547,-0.6,0],[-25.8,0.0953125,0],[-26.8,7.04375,0],[7.75233,7.76641,0],[0.353119,5.5,0],[-9.36563,9.54453,0],[-13.7,21.2,0],[20.9562,21.2,0],[21,23.3,0],[15.0984,41.1547,0],[-0.115631,47.5,0],[-15.7672,41.0336,0],[-21.8,22.8563,0],[-15.8328,5.27031,0],[0.321869,-1,0],[13.6117,2.93594,0],[20.7375,14,0],[12.6125,15,0],[-9.20001,37.3805,0],[-0.0593872,41,0],[9.71875,36.4656,0],[12.7,27.7,0],[-13.3,27.7,0],[39.5,0,0],[39.5,54.6,0],[58.0688,0,0],[65.7031,0,0],[84.4,53.7,0],[84.4,0,0],[92.6,0,0],[92.6,64.1,0],[81.1391,64.1,0],[65.7656,19.525,0],[62.35,9.25469,0],[59.2703,18.7391,0],[44.0047,64.1,0],[31.3,64.1,0],[31.3,0,0],[137.2,0,0],[145.3,0,0],[143.384,5.62813,0],[142.9,19.5125,0],[142.9,29.9813,0],[142.506,37.2266,0],[140.052,42.5812,0],[134.574,46.1008,0],[124.891,47.5,0],[114.329,45.8602,0],[107.362,41.1813,0],[103.9,33.2,0],[111.6,32.2,0],[115.546,39.0617,0],[123.813,41,0],[132.852,38.3328,0],[135.1,31.5547,0],[135.056,29.5,0],[120.914,26.7906,0],[113.866,25.6109,0],[108.161,23.0328,0],[104.064,18.5102,0],[102.5,12.2844,0],[106.64,2.73594,0],[118.486,-1,0],[127.228,0.535156,0],[135.6,5.8,0],[135.056,20.4312,0],[133.775,12.6078,0],[128.52,7.1875,0],[120.35,5.2,0],[113.307,7.28828,0],[110.9,12.5094,0],[111.997,16.2297,0],[115.112,18.775,0],[122,20.3406,0],[134.9,23.3,0],[162.9,0,0],[162.9,25.3828,0],[166.535,37.5055,0],[175.178,40.7,0],[180.642,39.2773,0],[183.886,35.4703,0],[184.8,28.2719,0],[184.8,0,0],[192.7,0,0],[192.7,28.5609,0],[192.264,36.2156,0],[189.82,42.0328,0],[184.559,45.9914,0],[176.855,47.5,0],[162.1,39.9016,0],[162.1,46.5,0],[155,46.5,0],[155,0,0])
tnFaces = #([14,15,1],[14,1,2],[13,14,2],[12,13,2],[12,2,3],[11,12,3],[11,3,4],[11,4,5],[10,11,5],[9,10,5],[8,9,5],[7,8,5],[7,5,6],[42,16,43],[42,43,44],[42,44,45],[41,42,45],[41,45,46],[40,41,46],[16,17,18],[43,16,18],[43,18,19],[26,27,28],[26,28,29],[25,26,29],[43,19,20],[52,43,20],[25,29,30],[24,25,30],[39,40,46],[39,46,47],[38,39,47],[38,47,48],[37,38,48],[37,48,49],[36,37,49],[36,49,50],[35,36,50],[35,50,51],[34,35,51],[34,51,52],[33,34,52],[33,52,20],[32,33,20],[32,20,21],[31,32,21],[31,21,22],[31,22,23],[31,23,24],[30,31,24],[60,61,62],[60,62,63],[70,71,72],[70,72,53],[69,70,53],[69,53,54],[68,69,54],[68,54,55],[67,68,55],[67,55,56],[67,56,57],[66,67,57],[64,65,66],[63,64,66],[60,63,66],[60,66,57],[59,60,57],[59,57,58],[80,81,82],[80,82,83],[90,91,92],[90,92,73],[89,90,73],[89,73,74],[88,89,74],[88,74,75],[87,88,75],[87,75,76],[87,76,77],[86,87,77],[84,85,86],[83,84,86],[80,83,86],[80,86,77],[79,80,77],[79,77,78],[96,111,112],[111,96,97],[111,97,98],[111,98,99],[110,111,99],[110,99,100],[109,110,100],[105,106,107],[105,107,93],[104,105,93],[104,93,94],[109,100,101],[108,109,101],[103,104,94],[103,94,95],[102,103,95],[102,95,96],[108,101,102],[112,108,102],[112,102,96],[126,127,113],[126,113,114],[125,126,114],[124,125,114],[124,114,115],[123,124,115],[123,115,116],[123,116,117],[122,123,117],[121,122,117],[120,121,117],[119,120,117],[119,117,118],[154,128,155],[154,155,156],[154,156,157],[153,154,157],[153,157,158],[152,153,158],[128,129,130],[155,128,130],[155,130,131],[138,139,140],[138,140,141],[137,138,141],[155,131,132],[164,155,132],[137,141,142],[136,137,142],[151,152,158],[151,158,159],[150,151,159],[150,159,160],[149,150,160],[149,160,161],[148,149,161],[148,161,162],[147,148,162],[147,162,163],[146,147,163],[146,163,164],[145,146,164],[145,164,132],[144,145,132],[144,132,133],[143,144,133],[143,133,134],[143,134,135],[143,135,136],[142,143,136],[181,182,165],[181,165,166],[179,180,181],[179,181,166],[179,166,167],[178,179,167],[178,167,168],[172,173,174],[171,172,174],[171,174,175],[170,171,175],[170,175,176],[169,170,176],[169,176,177],[169,177,178],[169,178,168])
setNumVerts tnMesh tnVerts.count
for i = 1 to tnVerts.count do ( setVert tnMesh i tnVerts[i] )
setNumFaces tnMesh tnFaces.count
for i = 1 to tnFaces.count do (
setFace tnMesh i tnFaces[i]
)
local openEdges = meshOp.getOpenEdges tnMesh.mesh
for i = 1 to tnFaces.count do (
for j = 1 to 3 do (
if (openEdges[((i-1)*3)+j]) then (
setEdgeVis tnMesh i j true
)
)
)

)
tnMesh.mesh
)
tool create (
on mousePoint click do (
nodeTM.translation = gridPoint
#stop
)
)
) -- plugin


Edit: Made the mesh appear a little nicer by only having the open edges set visible.

PEN
06-06-2008, 12:14 PM
You can just use this if you want.

http://www.paulneale.com/scripts/penHelpers/penHelper.htm

Or you can have a look at the code and how I did it. I have three others that I will release soon that are all based on simpleObject instead of helper because of the speed hit with helpers.

Kramsurfer
06-06-2008, 03:38 PM
Ahhh. The old ( createInstance Plane).mesh trick.... It wouldn't let me "createInstance mesh" and I tried ( creatInstance Box ) and took the mesh from that, but didn't appear to work, but shoud have from your example... obviously I did something else wrong... I had a visible edge loop, but didn't think it was important to post in the example.

Thanks again ZeBoxx... Two answers in one morning.... I definitely owe you....

Pen: You've noticed a speed difference between the helper and simpleObject? They both mesh init the same way right? Are simpleObjects collapsable? I'm using a CA, with a weak node reference, on a emptyMod on top of this Helper. So I don't want the user to be able to collapse it and loose the modifier. I guess I should adapt the CA to just be in the helper itself.

Thanks guys!

PEN
06-06-2008, 04:31 PM
Helpers are about 100 times slower then mesh objects, they are not handled in the same way. simpleObject is cached, helpers are constrantly rebuilt. This goes for point helpers as well. Do a test with 1000 point helpers in the viewport then 1000 boxes.

Kramsurfer
06-06-2008, 05:25 PM
Wow...tested that... 100 times slower is a generous estimate (10,000 of the above helper makes your scene impossible to rotate! ) I don't see a scene having more than a few of these helpers, but every little bit helps... I think the best move is to move all my code into a simpleGeometry plugin....

Thanks Again....

ZeBoxx2
06-06-2008, 05:33 PM
Pen: You've noticed a speed difference between the helper and simpleObject?
Not pen, here, but I know I have; shied away from scripted helpers real quick-like for one of our scripts. Unfortunately I think I'll have to use a scripted helper (I'll just leave the icon as original so as not to get the speed hit) for another script as I don't want the darn things ending up in renders (setting the simpleObject's 'renderable' property works, but the next time somebody includes it in a layer and then resets that layer's properties... erk.)


Are simpleObjects collapsable?
Yes

I'm using a CA, with a weak node reference, on a emptyMod on top of this Helper. So I don't want the user to be able to collapse it and loose the modifier.
"Interface: custAttribCollapseManager" might be of use there (not sure, as it's on the modifier), although...

I guess I should adapt the CA to just be in the helper itself.
...absolutely :)

Edit: errr, or in this case, on the simpleObject, of course :)

Kramsurfer
06-06-2008, 10:08 PM
Okay, I have it all working in a SimpleObject, but I collapse it and the UI goes away and I have an editible mesh with the parameters still intact, but no UI... Is there a way I can flag this object to be non-collapsible? Or am I back to making it a helper object?

Thanks

ZeBoxx2
06-07-2008, 12:56 AM
are you talking about losing the parameters/rollout of the scripted simpleObject (makes sense, as collapsing it no longer leaves it as such a plugin), or of the custom attributes?

The CA seems to stay intact here (3ds Max 2009x32) ..


plugin simpleObject test
name:"Test"
classID:#(0xdeadbeef,0xbaadf00d)
invisible:false
version:1
category:"Test" (
tool create (
on mousePoint click do (
case click of (
1: (nodeTM.translation = gridPoint; #stop)
)
)
)

on buildMesh do (
mesh = (createInstance Plane).mesh
)
)
myObj = test()

test_ca = attributes test_ca version:1 attribid:#(0xdeadbeef,0xbaadf00d) (
rollout test_ca_roll "Test" width:168 height:328 (
label lbl_test "test"
)

parameters params rollout:test_ca_roll (
str type:#string default:"test" ui:lbl_test
)
)
custAttributes.add myObj test_ca
myObj.str
collapseStack myObj
myObj.str

Kramsurfer
06-09-2008, 03:47 PM
Yeah, but all the editable properties come up on top of the CA... Could be confusing to the user if it get's collapsed and looks different than when it was made... I think I'll reduce my Icon and go with it being a helper class object, I wouldn't see there being more than a handful of these in a given file...

Thanks

ZeBoxx2
06-09-2008, 04:37 PM
true, true... could also put a little groupbox at the top with a single label "do not collapse me!" ;)

Kramsurfer
06-09-2008, 04:43 PM
ha ha... yeah, it'll fit in well with my, "User Error Not Permitted!" startup screen.... or the "Chair to Keyboard Interface Error." dialogs I use....

ZeBoxx2
06-09-2008, 05:47 PM
ha ha... yeah, it'll fit in well with my, "User Error Not Permitted!" startup screen.... or the "Chair to Keyboard Interface Error." dialogs I use....
I've been looking for those! on your site? scriptspot? give to me the preciousssssesssss!

You could, possibly, mess about with the node event system or older callbacks, and invoke an Edit > Undo.

But yeah, if you absolutely cannot have it collapsed - then a helper it is.

Although... you could, possibly, I have no idea how this works yet as I try and stay away from the craziness usually, have a helper -and- simpleObject mesh and stick them in an assembly. Let the helper (assembly head) deal with parameters and such, and the simpleObject deal with the meshing.
Yeah, I have no idea what that does to performance and the like. But it might be a fun avenue to explore (for twisted interpretations of 'fun').

PEN
06-09-2008, 06:50 PM
Even with simple helper objects I'm seeing problems with UI and speed issues. I have deduced that the only good method is a simpleObject.

ZeBoxx2
06-09-2008, 07:26 PM
out of curiosity, PEN, is that with

A. any helper object, including max's own (e.g. point, dummy, etc.)
B. only scripted helpers, but regardless of whether they implement their own displaymesh
C. only scripted helpers that implement their own displaymesh

?

PEN
06-09-2008, 08:30 PM
Well all helpers are increadibly slow, do that test I suggested. Looks like they spam the viewports as the mesh isn't cached and it is constrantly redrawing. Now one of the problems I'm having is when you have a custom mesh and you are moving it around constantly, at some point it doesn't keep up and it will move away from the mouse. It all gets worse from there. No matter what I used as a mesh this happened. This doesn't happen with a point helper as it is faster I guess then a scripted solution. I don't use Dummies as they have no display properties and I can't color them.

ZeBoxx2
06-09-2008, 09:12 PM
hmm... something to keep in mind, then; I'm only extending the Point helper.. I know I've had scenes with thousands of them and the intended purpose would see maybe 10 at best.

and yes, the dummy ignoring wirecolor is annoying :)

Kramsurfer
06-09-2008, 09:30 PM
Okay, now I feel the need to write a point helper than is really a simpleObject class plugin... Am I sick??? Great point about the wire color and render attributes... no pun intended.. ;-)

Kramsurfer
06-09-2008, 09:47 PM
I've found extending the dummy does respect the wireColor Attribute. That's where I am right now and I can adjust the wireColor no problem...

Here's the end result... We use a Selection Set based workflow here.. I created a helper object that holds render properties, Vray Matte properties, an "Override" Material, and a list of objects and "undoing" post render.... I've a pre and post render callback that looks for this object being visible and reacts accordingly, applying the selected options... You simply place this object is your selection set and our "Scene Setter" enables the callbacks when it is in the selected selection set.

Thanks for all the help guys!

PEN
06-09-2008, 11:09 PM
All helpers have the same speed problem. They are not optimized at all. What is interesting is creating 1000 point helpers and turning off all the display properties still results in a slower FPS. As long as the helpers are un-hidden they are trying to redraw all the time. What I have done now is create a helper out of the simpleObject class. So it has a superClass of geometry but at least I can still search the scene for penHelperObject. The penHelper that I created will not be used in any production that I do now and I'm going to pull it from my site soon. I now have three geometry superClass objects that I do all my rigging with.

Kramsurfer
06-10-2008, 12:05 AM
Do you have a way to stop it from collapsing to a mesh? How do you keep the UI elements if they do?
Thanks

eek
06-10-2008, 04:36 AM
Do you have a way to stop it from collapsing to a mesh? How do you keep the UI elements if they do?
Thanks

Once a geomety object is collapsed to a mesh thats it - you could in theory story its current .baseObject values in a CA internal to itself. Then essentially rebuild itself to revert back.

How fast are splines? against simple objects?

PEN
06-10-2008, 11:49 AM
Splines are only about twice the speed of helpers, was getting in speed tests 250fps for geo and 60 for splines or something. I would have to run the tests again.

CGTalk Moderation
06-10-2008, 11:49 AM
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.