Wings 3D Development Forum
wings_shape:delete(WeID, #st{}) - Printable Version

+- Wings 3D Development Forum (https://www.wings3d.com/forum)
+-- Forum: Wings 3D (https://www.wings3d.com/forum/forumdisplay.php?fid=1)
+--- Forum: Programming (https://www.wings3d.com/forum/forumdisplay.php?fid=7)
+--- Thread: wings_shape:delete(WeID, #st{}) (/showthread.php?tid=87)



wings_shape:delete(WeID, #st{}) - ggaliens - 12-04-2012

wings_shape:delete(WeID, #st{}) when is_integer(WeID) ->


Guys ... dont' you think we should have one of these functions done right ? And inside it if some folder info needs to be massaged (optigon) ... this is the place for it ?

I call a folder reorg routine in about 10-20 places in my plugins and this seems wrong.


RE: wings_shape:delete(WeID, #st{}) - ggaliens - 12-12-2012

I retract this concern of mine. I think I have a good enough work-around.

Many of my calls could be collected into one call, and some were not needed anyway. My bad.


RE: wings_shape:delete(WeID, #st{}) - optigon - 12-12-2012

No worries.
I seached the wings source and found 15 instances. I think I did it this way due to the save_state atom and changing the folders is the last thing to happen. An object can be deleted and then later the command could fail. So the folders are accessed aftert he command has completed successfully.


RE: wings_shape:delete(WeID, #st{}) - ggaliens - 12-12-2012

Which of these should I be calling after a #we delete. Currently it is the former, I thing from
old conversation with you.

recreate_folder_system/1,update_folders/1


RE: wings_shape:delete(WeID, #st{}) - optigon - 12-12-2012

Pretty sure it's update_folders/1

Take a look at wings_body.erl commands/2 for examples.