View Full Version : Scripted Plug-In Extends:Edit_Poly "Delegate" Broken?

11 November 2010, 08: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"
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

11 November 2010, 11:30 PM
i didn't read your code but at least wrong event used i see. you should use attachedToNode event

11 November 2010, 11:47 PM
Thanks for the tip; I'll go back to that lead. I tried that event too (and update) but delegate still doesn't work...

CGTalk Moderation
11 November 2010, 11:47 PM
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.