Age | Commit message (Collapse) | Author |
|
This commit introduces the first version of an exporter to Pixar's
Universal Scene Description (USD) format.
Reviewed By: sergey, LazyDodo
Differential Revision: https://developer.blender.org/D6287
- The USD libraries are built by `make deps`, but not yet built by
install_deps.sh.
- Only experimental support for instancing; by default all duplicated
objects are made real in the USD file. This is fine for exporting a
linked-in posed character, not so much for thousands of pebbles etc.
- The way materials and UV coordinates and Normals are exported is going
to change soon.
- This patch contains LazyDodo's fixes for building on Windows in D5359.
== Meshes ==
USD seems to support neither per-material nor per-face-group
double-sidedness, so we just use the flag from the first non-empty
material slot. If there is no material we default to double-sidedness.
Each UV map is stored on the mesh in a separate primvar. Materials can
refer to these UV maps, but this is not yet exported by Blender. The
primvar name is the same as the UV Map name. This is to allow the
standard name "st" for texture coordinates by naming the UV Map as such,
without having to guess which UV Map is the "standard" one.
Face-varying mesh normals are written to USD. When the mesh has custom
loop normals those are written. Otherwise the poly flag `ME_SMOOTH` is
inspected to determine the normals.
The UV maps and mesh normals take up a significant amount of space, so
exporting them is optional. They're still enabled by default, though.
For comparison: a shot of Spring (03_035_A) is 1.2 GiB when exported
with UVs and normals, and 262 MiB without. We probably have room for
optimisation of written UVs and normals.
The mesh subdivision scheme isn't using the default value 'Catmull
Clark', but uses 'None', indicating we're exporting a polygonal mesh.
This is necessary for USD to understand our normals; otherwise the mesh
is always rendered smooth. In the future we may want to expose this
choice of subdivision scheme to the user, or auto-detect it when we
actually support exporting pre-subdivision meshes.
A possible optimisation could be to inspect whether all polygons are
smooth or flat, and mark the USD mesh as such. This can be added when
needed.
== Animation ==
Mesh and transform animation are now written when passing
`animation=True` to the export operator. There is no inspection of
whether an object is actually animated or not; USD can handle
deduplication of static values for us.
The administration of which timecode to use for the export is left to
the file-format-specific concrete subclasses of
`AbstractHierarchyIterator`; the abstract iterator itself doesn't know
anything about the passage of time. This will allow subclasses for the
frame-based USD format and time-based Alembic format.
== Support for simple preview materials ==
Very simple versions of the materials are now exported, using only the
viewport diffuse RGB, metallic, and roughness.
When there are multiple materials, the mesh faces are stored as geometry
subset and each material is assigned to the appropriate subset. If there
is only one material this is skipped.
The first material if any) is always applied to the mesh itself
(regardless of the existence of geometry subsets), because the Hydra
viewport doesn't support materials on subsets. See
https://github.com/PixarAnimationStudios/USD/issues/542 for more info.
Note that the geometry subsets are not yet time-sampled, so it may break
when an animated mesh changes topology.
Materials are exported as a flat list under a top-level '/_materials'
namespace. This inhibits instancing of the objects using those
materials, so this is subject to change.
== Hair ==
Only the parent strands are exported, and only with a constant colour.
No UV coordinates, no information about the normals.
== Camera ==
Only perspective cameras are supported for now.
== Particles ==
Particles are only written when they are alive, which means that they
are always visible (there is currently no code that deals with marking
them as invisible outside their lifespan).
Particle-system-instanced objects are exported by suffixing the object
name with the particle's persistent ID, giving each particle XForm a
unique name.
== Instancing/referencing ==
This exporter has experimental support for instancing/referencing.
Dupli-object meshes are now written to USD as references to the original
mesh. This is still very limited in correctness, as there are issues
referencing to materials from a referenced mesh.
I am still committing this, as it gives us a place to start when
continuing the quest for proper instancing in USD.
== Lights ==
USD does not directly support spot lights, so those aren't exported yet.
It's possible to add this in the future via the UsdLuxShapingAPI. The
units used for the light intensity are also still a bit of a mystery.
== Fluid vertex velocities ==
Currently only fluid simulations (not meshes in general) have explicit
vertex velocities. This is the most important case for exporting
velocities, though, as the baked mesh changes topology all the time, and
thus computing the velocities at import time in a post-processing step
is hard.
== The Building Process ==
- USD is built as monolithic library, instead of 25 smaller libraries.
We were linking all of them as 'whole archive' anyway, so this doesn't
affect the final file size. It does, however, make life easier with
respect to linking order, and handling upstream changes.
- The JSON files required by USD are installed into datafiles/usd; they
are required on every platform. Set the `PXR_PATH_DEBUG` to any value
to have the USD library print the paths it uses to find those files.
- USD is patched so that it finds the aforementioned JSON files in a path
that we pass to it from Blender.
- USD is patched to have a `PXR_BUILD_USD_TOOLS` CMake option to disable
building the tools in its `bin` directory. This is sent as a pull
request at https://github.com/PixarAnimationStudios/USD/pull/1048
|
|
Steps to reproduce were:
* Change File Browser display mode to fullscreen in Preferences
* File > Save As (make sure existing .blend is selected)
* File > Open
The file name would still be shown in red and the + and - icons would be
visible, which should only be the case for saving files, not opening.
Note that this change makes all `FileSelectParams.flag` values be reset
on re-opening a File Browser, which *may* in fact cause other issues.
It's easy to fix those though, and I'd prefer properly resetting the
flags and only keeping specific ones in that case.
|
|
Remove direct links to Blender binary,
only link to the window manager and rely on indirect links
for everything else.
|
|
Allows each File Browser list item in Volumes and System to use individual icons.
Differential Revision: https://developer.blender.org/D5802
Reviewed by Julian Eisel
|
|
|
|
Improve laggy performance while moving File Browser by not refreshing fsMenu lists in its init.
Differential Revision: https://developer.blender.org/D6112
Reviewed by Bastien Montagne
|
|
This diff allows to delete directories in the file browser. The commit https://developer.blender.org/rB8825250f5a85c0c16e74ed144dd2b4a7d752042f did not include this feature.
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D6083
|
|
Also correct some outdated symbol references,
add missing 'name' commands.
|
|
|
|
Reviewed By: Severin
Differential Revision: https://developer.blender.org/D6260
|
|
Identifiers for icons representing optical drives should use 'disc', not 'disk'.
Differential Revision: https://developer.blender.org/D6166
Reviewed by Julian Eisel
|
|
Correct source, output, and formatting of prvicons - larger icons used for file browser.
Not Reviewed
|
|
Updated icon set from Andrzej Ambroż.
- Includes new icons for Top Bar, Status Bar, CD/DVD drives, Home, Documents, Temp, Memory, Options.
- Includes small tweaks to many icons throughout Blender
- Also adds a large CD/DVD drive icon for the file browser
This does not add the new icons in the interface yet.
|
|
When opening the file browser as regular editor, the ID filter flags
as stored in FileSelectParams were not set explicitly, so they were 0.
Since 9100982e8097, the value actually passed to the filtering could
differ from that, causing the file list cache to be constantly updated
on every redraw.
Caused by 9100982e8097.
Note that this "accidentially" got fixed in master with b54626364253,
which is why the issue only showed up in the release branch from that
point.
|
|
This adds the ID-Filters visible on append/link to the settings the file
browser remembers, potentially storing them in the Preferences.
Artists in the studio here requested this. They typically have to set up
the same or similar settings every time, so this saves them from that.
|
|
|
|
When the filtering option was disable we should see all the datablock types.
Differential Revision: https://developer.blender.org/D6033
|
|
Stupid mistake in 5edfde58fe60.
|
|
Previously, we used Ctrl+Click for renaming, but since that shortcut is
now consistently used to add items to the selection, we can't use that.
In other cases we switched to F2 now, so it makes sense for the File
Browser too.
Further, AFAIK renaming was only possible through the context menu,
which makes it hard to discover in the right click select keymap (have
to press W).
Note that I had to do some internal changes to ensure the context menu
always acts on the clicked/hovered item, while the shortcut operates on
the active item. William and I agreed that this is likely the behavior
expected by most users.
|
|
In Blender 2.7 delete would permanently delete files, now this function is back
but using more standard behavior.
This patch includes code contributed by Kris (Metricity).
Differential Revision: https://developer.blender.org/D4585
|
|
|
|
This makes it so that some display related properties of the file
browser state are remembered in the Preferences. Otherwise, users often
end up doing the same set up work over and over again, so this is a
nice way to save users some work.
It's typical for other file browsers to remember their state too, so
another benefit is having a more conventional behavior, meeting user
expectations better.
Some points:
* We currently store: Window size, display type, thumbnail size,
enabled details-columns, sort options, "Show Hidden" option. More can
be added easily.
* No changes are stored to the Preferences if "Auto-save Preferences"
is disabled. This is how Quick Favorites behave too and it's a
reasonable way to make this behavior optional.
* The Preferences are only saved to permanent memory upon closing
Blender, following existing convention of Preferences and Quick
Favorites.
* If settings weren't actually changed, Preference saving is skipped.
* Only temporary file browsers save their state (invoked through
actions like open or save), not regular file browser editors. These
are usually used for different purposes and workflows.
* Removes "Show Thumbnails" Preferences option. It would need some
special handling, possibly introducing bugs. For users, this
simplifies behavior and should make things more predictable.
Left in DNA data in case we decide to bring it back.
Reviewers: brecht, #user_interface, billreynish, campbellbarton
Reviewed By: #user_interface, William Reynish, Campbell Barton, Brecht
van Lommel (quick first pass review in person)
Maniphest Tasks: T69460
Differential Revision: https://developer.blender.org/D5893
|
|
Main reason for doing this is that the navigation buttons are very
close to the file list now, making them much faster to reach.
Initially we let the upper bar (the one with the file path, navigation
and display buttons) use full area width, because designs back then had
more horizontal space problems. The designs have changed meanwhile, and
horizontal space is less of an issue.
However, when the file browser is shrunk horizontally, or if it's open
in a small area (e.g. see "Shading" workspace), having the tool region
open brings back the space issues. But even the file list layout becomes
problematic then, and the same issue was present before the new file
browser design, so we've decided this is an acceptable tradeoff.
|
|
E.g. entering the file path field and then pressing enter without any
change would call an unneccesary directory change, causing flickering.
So the main point of this is to avoid flickering.
Without this the text field could also be used to refresh the file list,
but for that we have a proper button.
|
|
The big options button in the lower left is now gone, it's replaced by a
smaller icon toggle button in the upper right.
That means I could also remove code for the region we had just for this
button.
I also added versioning code for the removal, to make sure the region is
removed cleanly when reading old files.
|
|
For the default keymap we were only using the regular toolshelf
operator, doing this for the industry compatible keymap too now (we
could even remove it there, we don't use it in other editors).
Since we "now" have proper operators for toggling regions, this specific
one is totally redundant.
|
|
So far the file browser code had some lazy creation for the tool region,
even though it should always be there. The only reason I can see for
this is compatiblity. So I simply added versioning code to add the
region in case it's not there. Now we should be able to savely assume
the tool region to be there, whithout any unusual lazy-creation.
|
|
This makes it so that regions only needed when the file browser is
invoked as an operation (e.g. Ctrl+O rather than a regular editor) are
lazy created then, and removed if the file browser is changed into a
regular editor then (e.g. Ctrl+O over regular file browser editor ->
Cancel).
That should remove some troublesome assumptions and makes versioning
redundant.
It also fixes the issue of an empty execute region at the bottom after
cancelling a file operation invoked from a regular file browser editor.
|
|
|
|
|
|
This would happen when opening a file browser as regular editor, opening
a temporary file browser from there (e.g. Ctrl+O) and cancelling the
operation.
In some cases this would cause most of the editor to be filled with an
empty operator options region:
* Go to Shading workspace
* File -> Append
* Cancel
|
|
Not exposed to Python API yet, this should get more detailed testing with different
layouts before that happens.
Ref T69652
|
|
As per Brecht's suggestion, use the check_existing property to control
visibility of the '+' and '-' icons. It is typically set for save
operations.
Adds another FileSelectParams flag (to avoid duplicated propertie
lookups) and removes the recently introduced
FileSelectParams.action_type again.
Fixes T69881.
|
|
File Browser Volumes list gets nicer friendly drive names with volume label or device description.
Differential Revision: https://developer.blender.org/D5747
Reviewed by Brecht Van Lommel
|
|
For the default and industry compatible keymap, clicking on empty space
in the file browser will deselect all files.
Also makes selection use same operator description we use for other
select operators.
|
|
Allows file browser folders to be shown in a theme-selectable color, default of manila.
Differential Revision: https://developer.blender.org/D5713
Reviewed by Brecht Van Lommel
|
|
This adds per-platform change so Windows users will see file sizes calculated with a base of 1024.
Differential Revision: https://developer.blender.org/D5714
Reviewed by Brecht Van Lommel
|
|
Brings back + and - icons to the file name button, but now as
superimposed icons.
|
|
|
|
Makes the numpad + and - type of shortcuts to increase/decrease the file
number suffix work in the upper and lower bar of the file browser.
Had to add keymap handlers to the execute region for this to work.
|
|
When the result isn't used, prefer post increment/decrement
(already used nearly everywhere in Blender).
|
|
File Browser image thumbnails get just a contrasting outline and no shadow.
Differential Revision: https://developer.blender.org/D5708
Reviewed by Brecht Van Lommel
|
|
Replaces the large icons used in the File Browser with updated versions by Andrzej Ambroz (jendrzych).
Differential Revision: https://developer.blender.org/D5698
Reviewed by Brecht Van Lommel
|
|
The failing assert was there before the recent file browser design
overhaul. Might have been in there for quite a while in fact.
Auto-creation in this case means that the file path would be created if
a non-existent path was entered in the file browser path button.
|
|
This confirmation prompt was there earlier, we removed the prompts for
creating new directories all together, but in this case it's reasonable.
Without it, it's simply too easy to create new directories by accident.
|
|
Adds back auto-completion and auto-creation (inserting a non-existing
file-path would create it) for the file path button. The second feature
was left out knowingly, but seems there are reasonable use cases for it.
We can't add these features to the button in the Python script, we have
to call into C. So using a template to do that.
Note that this is based on the old file browser code, I've copied over
the TODO comment.
|
|
Differential Revision: https://developer.blender.org/D5683
Reviewers: Brecht
|
|
We moved this to Python too quickly, causing the following regressions:
* No auto completion for file names
* Additional handling not applied on changes, like automatic extension
appending (see file_filename_enter_handle)
* Red highlight missing when the file name already exists
Note that earlier (before the file browser redesign), this didn't use
the panel and layout code at all. So even if it's still not in Python,
at least it's integrated into regular panel management now.
OS-specific ordering of the open and cancel button is kept.
Fixes T69457.
|
|
E.g. box selecting wouldn't allow selecting the first file.
Work selection and shift/ctrl selection had similar issues.
Code assumed that the first item was the '..' parent item and manually
removed it from the selection. I could just remove this special
handling, but instead I made the behavior more dynamic. So the file list
checks if the '..' item is there and only then applies special
treatment.
That way we can easily bring the '..' item back or make it optional if
wanted.
|
|
Code assumed the '..' was there, which isn't the case any more. Just
early exiting for empty directories is fine.
|