Select to view content in your preferred language

Adding a new .png to an existing rule package

255
2
Jump to solution
11-15-2024 09:29 AM
Kayleigh_T
New Contributor

I am attempting to add a new .png file to an existing rule package made up of .png files.

My current process: I make a copy of the existing rule package and then I create a new folder and put the copied rule package there. I then extract this using 7-zip in order to have access to the assets. After, I copy the .png into the textures folder. Next, I copy the CGA code into a new CGA rule file within the folder and right click, share as, and select the assets file with the new .png under additional files and share it. When I try to assign the new rule package to a feature it will not load and only displays "unknown texture."

In summary: I am attempting to add a .png to an existing rule package. How do I go about doing this? 

0 Kudos
1 Solution

Accepted Solutions
ThomasFuchs
Esri Regular Contributor

Hello @Kayleigh_T 

Thanks for your interesting question! As you described, a rule package (*.rpk) has assets bundled into a file. Those assets are the ones referenced in the compiled rule (*.cgb). Optionally, the source rule files (*.cga) can also be included.

However, the references in the rule are relative to the CityEngine workspace. To resolve those asset file references to the bundled ones, a file named .resolvemap.xml is included in every RPK. So if you are re-using CGA code from an RPK, make sure that all assets are correctly referenced relative to your workspace first. Then create a new RPK.

To facilitate the task it makes sense to create a new project in the workspace and copy the content of the RPK into the folder structure of this projects. This should correctly reference rules and assets that were residing in the original project. Files from other projects are collected in the ".ws" folder. Those file references still need to be updated.

ThomasFuchs_0-1731940426714.png

I hope this lets you successfully customize the rule package.

View solution in original post

2 Replies
ThomasFuchs
Esri Regular Contributor

Hello @Kayleigh_T 

Thanks for your interesting question! As you described, a rule package (*.rpk) has assets bundled into a file. Those assets are the ones referenced in the compiled rule (*.cgb). Optionally, the source rule files (*.cga) can also be included.

However, the references in the rule are relative to the CityEngine workspace. To resolve those asset file references to the bundled ones, a file named .resolvemap.xml is included in every RPK. So if you are re-using CGA code from an RPK, make sure that all assets are correctly referenced relative to your workspace first. Then create a new RPK.

To facilitate the task it makes sense to create a new project in the workspace and copy the content of the RPK into the folder structure of this projects. This should correctly reference rules and assets that were residing in the original project. Files from other projects are collected in the ".ws" folder. Those file references still need to be updated.

ThomasFuchs_0-1731940426714.png

I hope this lets you successfully customize the rule package.

Kayleigh_T
New Contributor

Thank you! This allowed me to customize the rule package. I appreciate it! 

0 Kudos