-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Asset Processor does not reprocess engine dependencies with wildcards if the assets were updated. #17876
Comments
Just some more information here since I have been doing some code diving. There is a builder that is supposed to do this, the XmlBuilderWorker, but it is incapable of doing this correctly, which I'll explain below The XmlBuilderWorker's job is to read XML files and convert them into XML files in the cache while also emitting any dependencies they have. It does this by reading associated .xmlschema files which can be opened and modified in the Asset Editor window int he Editor (Create new / edit existing/ etc).
However, for a file to reprocess a source file into its corresponding output data (including dependencies) one of three things has to happen: Note that there are 2 main kinds of dependencies. Source dependencies, product dependendencies. Source Dependencies are "This source file, for example Product dependencies are "The output of this build job, ie, a crunched asset, will depend, at runtime, on another crunched asset being present on disk or in the pak file.". It has no bearing on build. A material might establish a Product Dependency on a texture file it needs, but it doesn't mean that the material file itself needs to be rebuilt when the artist changes a few pixels in the texture file. The XmlBuilder does not emit any fingerprint information at all, so B is out. You'd expect the dependencies listed in the XmlBuilderWorker's schema parser to function here and satisfy C), since you can actually tell the XML Schema to look for certain elements and emit them as Source Dependencies, not just Product Dependencies... but looking at the code, the XmlBuilderWorker does not inspect that file for source dependencies in CreateJobs, it only looks for product dependencies in ProcessJob. The only source dependency it emits is a single source dependency on any schema file htat matches it. So for example, if you have a schema like CreateJobs - the function where source dependencies should be emitted
ProcessJobs - its too late to emit source deps here. Its where you emit product deps, which do not trigger rebuilds
So the problem here is at no point does CreateJobs actually look inside the actual XML to say what files it depends on. Note that in Asset Processor, it is in fact legal to emit a source dependency as a wildcard during CreateJobs. You can in fact say that this file depends on So a correct short term fix here would be something like
A longer term fix might be to improve the asset system itself, so that you don't need to emit Source Dependencies during CreateJobs and can defer that to ProcessJob. This would vastly improve createjob time in general since a lot of file types do have to read their files during CreateJobs (analysis) in order to properly emit dependencies. Its needless, as most build systems have realized that in general, you either have never processed a file before, in which case you MUST process it, or you have already processed a file before, in which case you have the data from when you processed it. This infers that its not necessary to declare source dependencies up front at all, since they have no bearing on whether or not to process a file if its never been processed before (it will always be processed) and by the time you need to consider whether to process it again, you have the data from the last time you processed it. |
Describe the bug
AssetProcessor won't reprocess dependency xml files with wildcards, if new files were introduced that the wildcard would catch.
Steps to reproduce
<EngineDependencies versionnumber="1.0.0"> <Dependency path="some/path/*" optional="false" /> </EngineDependencies>
and place in your project folder.
--> Note: the dependency list from the dependency xml is updated to reflect all assets in some/path/*
--> Note: The dependency list of the xml file is not updated to contain the additional assets.
--> Error: The bundle will have the assets from (3) but will not have the new ones from (4)
Expected behavior
Given a wildcard dependency, I expect the dependency list to be updated every time I run the Asset Processor, reflecting the changes to the wildcard capture, so that bundles can be created correctly.
Actual behavior
The dependencies are only updated if the xml is modified in some way (changing its signature), triggering the Asset Processor to process it and update its dependency list
The text was updated successfully, but these errors were encountered: