Notifications
Clear all
[Closed] Scripted Plug-In Extends:Edit_Poly "Delegate" Broken?
Nov 30, 2010 8:04 am
Hey all,
Can I get a cross-check? I’m trying to make a scripted plug-in that extends the Edit_Poly modifier and it seems like delegate.<anything> is busted.
Run this on an editable_poly sphere…
plugin modifier NonQuadSelect
name:"Select Non-Quads"
classID:#(685399,452285)
extends:Edit_Poly version:2
(
on postCreate do
(
local face_selection = #{}
-- Notice this doesn't need the delegate prefix. X(
local num_faces = getNumFaces $
for f = 1 to num_faces do
(
local num_face_verts = delegate.GetFaceDegree $ f
print num_face_verts -- Yields 0.
num_face_verts = polyop.getfacedeg $ f
print num_face_verts -- Yields the right value.
if num_face_verts != 4 do face_selection[f] = true
)
print num_faces
delegate.SetSelection #Face face_selection
delegate.SetEPolySelLevel #Face
)
)--end script
2 Replies
Nov 30, 2010 8:04 am
i didn’t read your code but at least wrong event used i see. you should use attachedToNode event
Nov 30, 2010 8:04 am
Thanks for the tip; I’ll go back to that lead. I tried that event too (and update) but delegate still doesn’t work…