Hello everyone and happy new year !
I am trying to write a script that will remove all the polygons that the camera can’t see inside my playing area.
I found on the internet a snippet a code that select all the polygons visible in the active view.
view = omUI.M3dView.active3dView()
om.MGlobal.selectFromScreen( 0, 0, view.portWidth(), view.portHeight(), om.MGlobal. kAddToList)
All I have to do is create playing area then a camera that will move inside this playing area to add the polygon inside its view.
As the title of my topic says, the script doesn’t work but will work if I run manually.
I don’t really know how to explain what’s wrong exactly.
Here is a link to my script: https://www.paste.org/102188
If you want to try it manually, you have to put yourself in face mode then you can click on the button “Manually add faces”
If your tring the automatic way, you’ll have to select the object before clicking on the 2nd button (“2. Delete Invisible Face”)
I don’t know why it is behaving the way it does. But it’s frustrating
Sorry for the confusing title. But I didn’t know what to write because everything is confusing ^^