I've been trying to find a way to delete render elements with a certain suffix in the elementname, in my case "mk_" but I cannot seem to find any resources that describe how to do this. There are plenty of resources on adding or deleting all elements but not by the elementname or a ceratin string part.
If you can help in any that that would be super appreciated.
Comments (2)
Comment policy
you can use this Function :
(
fn Delete_rEl_By_String str = (
local reMgr = maxOps.GetCurRenderElementMgr()
local num = reMgr.numrenderelements()
for n = num-1 to 0 by -1 where (findstring (reMgr.getrenderelement n).elementName str) != undefined do (
reMgr.RemoveRenderElement (reMgr.getrenderelement n)
)
)
Delete_rEl_By_String "mk_"
)
Thank you so much for your help. That is very appreciated!