New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using representation config instead of parents when formatting template in loader #351
Comments
What are your thoughts on the issue of updating old assets when a parent is modified? |
Not sure what exactly you mean. Can you give example? |
Sorry ignore that comment. I misunderstood the issue. |
On top of this we would actually also save the template that was originally used to format the path. This is to prevent mismatch during the import in case the publish template had to be tweaked during the production. (No it shouldn't happen, Yes it might happen on longer productions) So the representation itself would hold all the data needed to format the right path, and still allow for overriding some keys if the project is for example moved to a different root. |
I think allowing to make it more arbitrary is perfect! It should allow formatting with custom data or other required keys a studio might introduce in their configuration so that they take more control over their template. However, we should choose a simple interface for doing so that will remain consistent. That could be @mottosso might have some good input on keeping this lean and mean and where to put it. Also especially since he originally created #121. |
Thanks for pinging me on this issue, I think @mkolar is right about storing By traversing the hierarchy each time, things would always remain up-to-date, even as things change. However, I think it's fairly safe to say at this point that most things don't need to change, and in fact is encouraged not to, as there are lots more benefits of having a fixed hierarchy, such as keeping tabs on history and dependencies between asset-to-asset and shot-to-asset (some of which we aren't doing yet, but I expect we will). For the things that do need to change, such as the nice names of things or icons or artist assignments and what not, that simply won't be stored in multiple places like this. With this in mind, there are two kinds of data
Static being things like the identifier of assets and projects, such as Does that sound ok to everyone? |
|
If we can write out what the difference is between @mottosso do you think there's a better way to describe the differences? |
@mkolar I believe you guys are using this, right? Would you happen to be able to set up a PR? |
Hey. Yes we are using this, but we've actually added another piece of data to There we multiple reasons for that, most importantly that we quickly needed the system to support out hierarchical asset structures and this was a good way to do it that doesn't really break anything. Our fort of core is currently contains a few connected features that we need to clean to be able to send PRs for discussion. But I'll try doing it this week. |
If this is the unformatted path with just the keys and the keys to format them are actually included (and some based on the live environment), e.g. the
Great! |
This is what we are saving currently to DB. So we can use the full path, or reconstruct it from the template and context keys (which can be replaced dynamically if needed of course)
|
Sorry for a delayed response to this one. I like the ideas presented here, but still can't wrap my head around when it is OK to include the Could we remove both the |
we're actually ignoring the root in the context when filling the path to do exactly what you said, but having it there keeps the record of the exact way it was published for later if needed. dropping Dropping it from path certainly would work, as that data is not useful from a different platform that where it was published, but again we saw this key more as a fallback and way to check how exactly it was published to be able to solve possible import issues in the future. Say someone screws up the DB templates, or something similar. Having explicit path allow to do post validation on where the newly resolved path matches originaly published and so on. Id hope that 99.9% of representations would get loaded with
|
If needed for what, though? It doesn't tell you anything if the one reading it is on a different OS or mount setup. Seems to just open up room for confusion - e.g. "should I use it?". We could call it
Yes, we still need it in the
Though if you aren't using the |
Yep it is mostly for visual inspection and knowing exactly what the path was originaly when published. We find this kind of data very useful after project is archived for example and we need to go back to it. It's comparable to maya referenced files for example and paths can be easily fixed. The point is that I'm not keen on throwing away information about exact published path at the time od publishing. If I never need it than perfect but we have occasions in the past where a simple absolute path saved our neck. (not in avalon :) ), however dropping the root section is fine I think. With the root in context I agree. That could be dropped |
Mm, storing all relevant state relative a publish is a good idea in any case I think. But I wonder whether that type of "historical" or "statistics" data is better suited as contents of the actual publish, rather than in the schema of the database. Could it be stored in the |
You mean stored on the parent asset? Or in a data member asset['data']. the second one makes sense I think. For us its more about having the data, than where it's stored. |
I mean in Anything part of an objects schema (i.e. at the root level) is meant to be asserted against, guaranteed to exist and follow a strict convention, such that tools and things can rely on it. Anything in |
Right. If you look at the example that's exactly where we store it. In which case the question might be the opposite. Shouldn't |
…udini Houdini: Import error in 2.x
This is directly related to #121
We have more complex templates than what is expected by default. That means our paths are not formatted correctly when trying to load a representation.
The issue seems to be here
core/avalon/pipeline.py
Lines 161 to 167 in 79ea85a
We are storing context in the db, but the data used to format the publish template is explicitly set to be only made up of parents. That results in technically hardcoding how we can work with templates and is not very flexible.
I suggest using
data = context['representation']['context']
instead to make this more arbitrary and open to customisation in different studios.I've done a quick test and it seems to solve all our issues and shouldn't break any backwards compatibility (we might have to do it via condition though in case old db data doesn't have the
context
field in the representation)The text was updated successfully, but these errors were encountered: