diff options
author | Lukas Stockner <lukasstockner97> | 2020-02-15 03:49:50 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2020-02-15 05:37:20 +0300 |
commit | f6aafd5186bd921637df755797c7ff6f3036a361 (patch) | |
tree | 8a09a244cb18e926907cfeb9df7674063b702ae0 /source/blender/blenloader/intern | |
parent | fa4ab69abf5750857e0b79295b13efa73aef0766 (diff) |
Modifiers: Add option to directly specify a 2D transform for UVWarp
Currently the only option is to warp based on the transform of other
objects, which is inconvenient if you want to e.g. control it through
a driver - you need to set up a dummy object and go through that,
which is clunky and should be unneccessary.
Reviewed By: brecht
Differential Revision: https://developer.blender.org/D6690
Diffstat (limited to 'source/blender/blenloader/intern')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 886c7195d9e..8baea5c8c4b 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -4482,5 +4482,17 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + /* Add 2D transform to UV Warp modifier. */ + if (!DNA_struct_elem_find(fd->filesdna, "UVWarpModifierData", "float", "scale[2]")) { + for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { + for (ModifierData *md = ob->modifiers.first; md; md = md->next) { + if (md->type == eModifierType_UVWarp) { + UVWarpModifierData *umd = (UVWarpModifierData *)md; + copy_v2_fl(umd->scale, 1.0f); + } + } + } + } } } |