Fixed 'Optional Texture Embedding' feature #196
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
It seems that commit 68edd8f broke the 'Optional texture embedding' (see PR #172) feature, so that vsgb/vsgt files created using vsgconv will (at best) not work and (at worst) lead to the loading code to crash.
For example it happened to me that I had a top-level CullNode.. the vsg::External object referenced an external texture, but its path was not set/saved (that is the actual bug introduced in the merge), so the StartID_EndID_Filename values were incorrect (an empty object with the ID=3 was created on loading), which means the the vsg::MatrixTransform node was not loaded (since the empty object with ID=3 already cached), so I ended up with a CullNode without child node, which leads to an access violation on traversal (CullNode on purpose does not check for this due to performance considerations)
For reference, after the fix, the file looks like this
Fixes #195
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
I converted some test models using vsgconvd.exe, using the command line
then loaded the resulting files into the vsgViewer example
Test Configuration:
Windows 10, VS2022
Checklist: