Python flattening stage while preserving relative paths


Using the python API, I’m trying to combine two layers that include relative texture paths. So I’m adding them as sublayers to a new stage and flattening it, but it is evaluating the relative paths and saving them as absolute paths.

How do I flatten a stage while keeping the relative texture paths?


If you are flattening a layerStack, have a look at the documentation here, which explains the subtleties, default behavior, and what you can do to override it. If you are flattening an entire stage and you are not getting the same “default behavior”, then I think that’s a bug to be reported.

We haven’t considered adding the same overriding ability to Flatten/Export, but the bottom line is that in a highly referenced scene, it really doesn’t seem safe to preserve “anchored” paths when flattening. But I guess providing the escape hatch if you really know your environment, as we provide for FlattenLayerStack, might be appropriate.