benles wrote:
Otis wrote:
The GUI templates use this scheme as well: in the filename you've to specify [elementName] to get the current element name in the filename. In the .lpt template, you obviously know the current element, so you can obtain the name from that object and thus emit it into the class, as I've done in the GUI templates.
Do you mean something else instead?
This is a simplified example, but suppose I wanted to use your GUI templates to generate two copies per entity instead of just one. Instead of just [elementName], I would want [elementName]Copy1 and [elementName]Copy2. I want to somehow pass "Copy1" and "Copy2" into the lpt so it can add it to the class.
Ideally I would specify this in the preset, so it would become [elementName][suffix] where [suffix] is "Copy1" or "Copy2" depending on the parameter value I pass from the preset.
At the moment that's not how templates work. You should see a template as a template for a file. So if you want 2 files, you have to execute 2 tasks which thus generate a file each.
It's now a pretty simple process: all entities get passed into the task performer, the task performer checks what the emit type is, and either generates one file (generic) or one file per element, and there's no logic possible where you can select a subset per task for example.
Is it solvable that you add 2 tasks, which both generate a copy? e.g. the first generates copy1 and the other generates copy2, or will you then get too many files? (I.e. also the files for entities you didn't want to be used by that particular task.)
I will probably need this selection process for v2.1, so I will come up with something though at the moment it's straightforward.