Phong Break Selection
-
Hello PluginCafe
I need to select PHONG BREAK EDGES using python.
In this code, I'm trying to accomplish this task by utilizing MCOMMAND_PHONGTOSELECTIONimport c4d def main(): if op is None: return c4d.utils.SendModelingCommand(command = c4d.MCOMMAND_PHONGTOSELECTION, list = [op], doc = doc) if __name__=='__main__': main() c4d.EventAdd()
I don't know if this is a bug or a limitation, but MCOMMAND_PHONGTOSELECTION selects edges only if their phong is broken manually using MCOMMAND_BREAKPHONG command. I need to select all phong break edges based on actuall phong tag, or by manually defining the angle.
-
Is there any alternative way in C4D's Python SDK?
-
I've done this in the past by going through all edges in the object and comparing the normals of neighboring polygons. A bit ugly, but it works. There are some helper functions in the Neighbor class you might want to look at: https://developers.maxon.net/docs/py/2023_2/modules/c4d.utils/Neighbor/index.html
-
Hi @merkvilson, this is a limitation actually the tool Phong Break selection and the modeling command MCOMMAND_PHONGTOSELECTION are two completely separate things.
So the only solution available to you is to manually break the Phong.I'm sorry we can't help you more on that, Donovan points you to the correct direction with the neighbor class.
Cheers,
Maxime.