2020 Tree Loader Change Question

528
2
06-09-2020 01:10 PM
by Anonymous User
Not applicable

Just downloaded the CityEngine 2020 and was giving it the paces.   One thing I noticed is that when I updated the ESRI library including the vegetation rules,  is that that the new tree loader is run differently:

@Order(1) @Enum(valuesAttr=_nameEnumValues)
attr Name 		  = "Orange Tree" ‍‍

and the old one had all the trees listed under @Range:

@Order(1) @Range("Alder Buckthorn","Amazon Sword Plant",...,...,...)
attr Name 				= "Orange Tree" ‍‍‍‍

From reading the notes in the new CGA version, I understand that the change was done for file lookup speed/performance, and a shorter code to boot.  

However,  some of the rules that I created using Plant.Loader.Generate now are slightly less flexible.  When I look at the Plant.Loader in the inspector tab, under the Plant.Loader selector attributes, I only see the current tree species and none of the other trees.   I figured out that if I parameterize the tree name when I call into my code:   e.g.  Plant.Loader.Generate("Red Hickory")  -  I can change it.   But I don't know ~100 tree species by memory so this is a little inconvenient when I am just trying to get the best "look".

Picture of what is happening in new Plant_Loader cga when called into my other codes (only Orange Tree, no others):

Also, I don't quite understand what is happening now, maybe there is some new documentation on this?   

The new code also has a hidden attribute:

@Hidden
attr _nameEnumValues = _getNameEnumValues

‍‍‍

And I am getting a yellow caution error from this:  "unused attribute_ str array _nameEnumValues()", which seems to drive a bunch of others warnings.

How do I fix this?  

Thanks!

Brian

0 Kudos
2 Replies
CherylLau
Esri Regular Contributor

Sorry, this is a bug.  All the plant names should have been visible in the drop down box, but due to the bug, you don't see the other options.  We hope to fix this soon.

With regards to the unused attribute warning, this is expected behavior.  The code will still compile and run.  I understand that it doesn't seem right, but this is just how it is for now.

0 Kudos
CherylLau
Esri Regular Contributor

Thanks to your post, we have updated the Plant_Loader so that you can hopefully see the plant names in the drop down box again.  To get the new version (v125), go to File -> Manage ESRI.lib, select ESRI.lib, and click Update.