Itoo Software Forum

Author Topic: Forest "Cleaner"  (Read 934 times)

Pixelab

  • Jr. Member
  • **
  • Posts: 78
  • Suave mari magno
    • pixelab.be
Forest "Cleaner"
« on: January 25, 2016, 09:52:09 PM »
What would be the simplest way to clean a file where a lot of forest objects have been modified, simplified, permuted, and where we have a lot of orphaned objects imported but not used anymore (via the library or not) ?

At first, it would already help to automatically select the objects in the forest "hidden-frozen" layer,  (or a custom layer where we put our objects) not used by any forest object, and not templates (those are recreated anyway)

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3359
    • iToo Software
Re: Forest "Cleaner"
« Reply #1 on: January 26, 2016, 09:00:37 AM »
The "forest_templates" layer is cleaned automatically, removing all imported models that are not used by any Forest object. This doesn't include the 2D templates, which never are deleted (are necessary for the plugin's operation).
The cleaning process is triggered by two events: when scene is saved, or importing some item from the Library. This process occurs only if there is some Forest object in the scene. If not, you can delete manually the templates layer, because it's not used.

Unfortunately orphan objects not stored in the templates layer cannot be deleted automatically, because Forest doesn't keep any reference to them.

I hope that helps. If not, please don't hesitate to ask.
Carlos Quintero
iToo Software

Pixelab

  • Jr. Member
  • **
  • Posts: 78
  • Suave mari magno
    • pixelab.be
Re: Forest "Cleaner"
« Reply #2 on: January 26, 2016, 01:18:02 PM »
The "forest_templates" layer is cleaned automatically, removing all imported models that are not used by any Forest object. This doesn't include the 2D templates, which never are deleted (are necessary for the plugin's operation).
The cleaning process is triggered by two events: when scene is saved, or importing some item from the Library. This process occurs only if there is some Forest object in the scene. If not, you can delete manually the templates layer, because it's not used.

Unfortunately orphan objects not stored in the templates layer cannot be deleted automatically, because Forest doesn't keep any reference to them.

I hope that helps. If not, please don't hesitate to ask.

Thank you, I wasn't aware of that.

We often customize objects for a scene (mat and/or geometry), so I guess I'll have to find them and move them to another dedicated layer ?  If we use the library objects without modification, an xref is enough.

What happen if we modify the material or the geometry of "merged into scene" objects, is there a chance that it will be overwritten at some point if we leave them in the forest ref layer?

As a wish, would it be possible to have more meaningful names instead of _forest_library_QL6D5IQ or _forest_library_OKTPHTQ. Where do those names come from ? (those are maxtree objects)

Thanks a lot for you help.


iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3359
    • iToo Software
Re: Forest "Cleaner"
« Reply #3 on: January 27, 2016, 08:59:05 AM »
Quote
We often customize objects for a scene (mat and/or geometry), so I guess I'll have to find them and move them to another dedicated layer ?  If we use the library objects without modification, an xref is enough.

Yes, in this case i suggest to use a separate layer. You can use a temporary Forest object to import the models in the scene, move (and rename) them to the new layer, and once modified, assign to the production Forest objects.

Quote
What happen if we modify the material or the geometry of "merged into scene" objects, is there a chance that it will be overwritten at some point if we leave them in the forest ref layer?

Yes, depending of the option selected in "On duplicate Material", in the Library browser: "Use scene material", "Replace from Library, "Ask to user".
To avoid that, just use the first option or rename the material in the imported object.

Quote
As a wish, would it be possible to have more meaningful names instead of _forest_library_QL6D5IQ or _forest_library_OKTPHTQ. Where do those names come from ? (those are maxtree objects)

Those names are generated as an unique identifier for each item of the Library. In this way, we can check easily if the items are already imported in the scene (to avoid duplicates) and assign them.
Ufortunately there is not a simple way to change that. We cannot use directly the name of the object, because there is not guarantee that it's unique.

Carlos Quintero
iToo Software

Pixelab

  • Jr. Member
  • **
  • Posts: 78
  • Suave mari magno
    • pixelab.be
Re: Forest "Cleaner"
« Reply #4 on: January 27, 2016, 03:30:13 PM »
Thx for the detailled explanation Carlos !

Those names are generated as an unique identifier for each item of the Library. In this way, we can check easily if the items are already imported in the scene (to avoid duplicates) and assign them.
Ufortunately there is not a simple way to change that. We cannot use directly the name of the object, because there is not guarantee that it's unique.

Or maybe you could append both. But I understand that it would produce loooong names...

I had some sort of "bug" when importing the same Library object in 2 scenes, one being in xref in tho other. The xrefed scene forest object had the same name and the master was unable to load the item because it was "duplicated". The  Forest object geometry slot was then "emptied" and the object disappeard. Renaming the imported object solved the issue.

 Maybe the QOHFOQHF names are not "random" enough ?

iToo

  • Administrator
  • Hero Member
  • *****
  • Posts: 3359
    • iToo Software
Re: Forest "Cleaner"
« Reply #5 on: January 28, 2016, 09:13:45 AM »
Quote
Or maybe you could append both. But I understand that it would produce loooong names...

I will think if we can improve that, but really the unique name is generated from the library item's description, not from the Max object.

In some cases, the object name is not known or doesn't exist. For example, in Evermotion libraries the plants are stored as a group of separated elements (leaves, branch, etc.) which must be attached in Forest as a new mesh object. This process is done on the fly by the Library browser.

Quote
I had some sort of "bug" when importing the same Library object in 2 scenes, one being in xref in tho other. The xrefed scene forest object had the same name and the master was unable to load the item because it was "duplicated". The  Forest object geometry slot was then "emptied" and the object disappeard. Renaming the imported object solved the issue.

Maybe the QOHFOQHF names are not "random" enough ?

It's difficult to know without checking the scene. I tried to reproduce this issue, but at least in Max 2016 everything seems correct.
The attached image shows a same object (HQ Plants 1->Acacia 1) used both in the main and XRef'd scene. The object is duplicated, but doesn't seem to cause problems.


Carlos Quintero
iToo Software

Pierre

  • Jr. Member
  • **
  • Posts: 85
    • Studiosezz
Re: Forest "Cleaner"
« Reply #6 on: October 03, 2018, 10:38:48 AM »
Hello,
I open this message again because I have a similar problem. When I delete a forest, the geometrys are always present in the templates folder. I tried to save, exit and open but it does not change anything.
Is this normal? Do I have to manually delete the references?
Best
Pierre
Studiosezz PARIS
www.studiosezz.com

Rokas

  • iToo Software
  • Hero Member
  • *****
  • Posts: 1178
    • iToo
Re: Forest "Cleaner"
« Reply #7 on: October 03, 2018, 10:48:46 AM »
Hi I just highlighted important part You might have missed:
Rokas
iToo Software

Pierre

  • Jr. Member
  • **
  • Posts: 85
    • Studiosezz
Re: Forest "Cleaner"
« Reply #8 on: October 03, 2018, 10:53:50 AM »
Thank you for your answer !
I might not understand. I still have multiple forest in my scene
 I found a way to remove the forest with the dependences. I use the tool "select all forest dependences" and the delete it.
Best
Studiosezz PARIS
www.studiosezz.com