Hi! guys! Here's the problem with utils.ViewportSelect()
This is my code:
ViewportSelect = c4d.utils.ViewportSelect()
frame = bd.GetFrame()
left = frame["cl"]
right = frame["cr"]
top = frame["ct"]
bottom = frame["cb"]
width = right - left + 1
height = bottom - top +1
pick_obj = ViewportSelect.PickObject(bd, doc, mx, my, 0, c4d.VIEWPORT_PICK_FLAGS_0)
print pick_obj
ViewportSelect.Init(width, height, bd, pick_obj, c4d.Mpolyedgepoint, True, c4d.VIEWPORTSELECTFLAGS_IGNORE_HIDDEN_SEL)
for obj in pick_obj:
print obj
nearest_poly = ViewportSelect.GetNearestPolygon(obj, mx, my, 0, False)
Cinema 4D giving feedback: RuntimeError: Object is not initialized yet.
How can i fix it?