diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-01-02 18:01:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-01-02 18:13:00 +0300 |
commit | ae50a7df037e63863815b54ca53b4dbf3cda2799 (patch) | |
tree | 1236d43cce43d3c529c916744d2405751e149225 /source/blender | |
parent | 72e2a0cfb6f8e4d21b33982bbd572f10c20e947c (diff) |
Fixes and edits to studio light operators
- Remove pathlib use
(was converting to/from string with no real advantage).
- Use user_resource(..., create=True) to ensure the path exists.
- Pass full path to BKE_studiolight_create, don't add extension after.
- Fix 'sl' filtering glob and move from ui code to operator.
- Fix string copy length.
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/blenkernel/intern/studiolight.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index a52ade025af..ca02fcef746 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -1391,8 +1391,8 @@ StudioLight *BKE_studiolight_create(const char *path, const SolidLight light[4], char filename[FILE_MAXFILE]; BLI_split_file_part(path, filename, FILE_MAXFILE); - BLI_snprintf(sl->path, FILE_MAXFILE, "%s%s", path, ".sl"); - BLI_snprintf(sl->name, FILE_MAXFILE, "%s%s", filename, ".sl"); + STRNCPY(sl->path, path); + STRNCPY(sl->name, filename); memcpy(sl->light, light, sizeof(*light) * 4); memcpy(sl->light_ambient, light_ambient, sizeof(*light_ambient) * 3); |