Blender V5.3
usd_asset_utils.cc
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 NVIDIA Corporation. All rights reserved.
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#include "usd_asset_utils.hh"
6#include "usd.hh"
7
8#include <pxr/usd/ar/asset.h>
9#include <pxr/usd/ar/packageUtils.h>
10#include <pxr/usd/ar/resolver.h>
11#include <pxr/usd/ar/writableAsset.h>
12#include <pxr/usd/usd/common.h>
13#include <pxr/usd/usd/stage.h>
14
15#include "BKE_appdir.hh"
16#include "BKE_idprop.hh"
17#include "BKE_main.hh"
18#include "BKE_report.hh"
19
20#include "BLI_fileops.hh"
21#include "BLI_path_utils.hh"
22#include "BLI_string.hh"
23
24#include "WM_api.hh"
25
26#include <string_view>
27
28namespace blender::io::usd {
29
30constexpr char UDIM_PATTERN[] = "<UDIM>";
31constexpr char UDIM_PATTERN2[] = "%3CUDIM%3E";
32
33/* Maximum range of UDIM tiles, per the
34 * UsdPreviewSurface specifications. See
35 * https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html#texture-reader
36 */
37constexpr int UDIM_START_TILE = 1001;
38constexpr int UDIM_END_TILE = 1100;
39
46static std::pair<std::string, std::string> split_udim_pattern(const std::string &path)
47{
48 std::string_view patterns[]{UDIM_PATTERN, UDIM_PATTERN2};
49 for (const std::string_view pattern : patterns) {
50 const std::string::size_type pos = path.find(pattern);
51 if (pos != std::string::npos) {
52 return {path.substr(0, pos), path.substr(pos + pattern.size())};
53 }
54 }
55
56 return {};
57}
58
59/* Return the asset file base name, with special handling of
60 * package relative paths. */
61static std::string get_asset_base_name(const std::string &src_path, ReportList *reports)
62{
63 char base_name[FILE_MAXFILE];
64
65 if (pxr::ArIsPackageRelativePath(src_path)) {
66 std::pair<std::string, std::string> split = pxr::ArSplitPackageRelativePathInner(src_path);
67 if (split.second.empty()) {
68 BKE_reportf(reports,
70 "%s: Couldn't determine package-relative file name from path %s",
71 __func__,
72 src_path.c_str());
73 return src_path;
74 }
75 BLI_path_split_file_part(split.second.c_str(), base_name, sizeof(base_name));
76 }
77 else {
78 BLI_path_split_file_part(src_path.c_str(), base_name, sizeof(base_name));
79 }
80
81 return base_name;
82}
83
84/* Copy an asset to a destination directory. */
85static std::string copy_asset_to_directory(const std::string &src_path,
86 const char *dest_dir_path,
87 TexNameCollisionMode name_collision_mode,
88 ReportList *reports)
89{
90 std::string base_name = get_asset_base_name(src_path, reports);
91
92 char dest_file_path[FILE_MAX];
93 BLI_path_join(dest_file_path, sizeof(dest_file_path), dest_dir_path, base_name.c_str());
94 BLI_path_normalize(dest_file_path);
95
96 if (name_collision_mode == TexNameCollisionMode::UseExisting && BLI_is_file(dest_file_path)) {
97 return dest_file_path;
98 }
99
100 if (!copy_asset(src_path, dest_file_path, name_collision_mode, reports)) {
101 BKE_reportf(reports,
103 "%s: Couldn't copy file %s to %s",
104 __func__,
105 src_path.c_str(),
106 dest_file_path);
107 return src_path;
108 }
109
110 return dest_file_path;
111}
112
113static std::string copy_udim_asset_to_directory(const std::string &src_path,
114 const char *dest_dir_path,
115 TexNameCollisionMode name_collision_mode,
116 ReportList *reports)
117{
118 /* Get prefix and suffix from udim pattern. */
119 std::pair<std::string, std::string> splitPath = split_udim_pattern(src_path);
120 if (splitPath.first.empty() || splitPath.second.empty()) {
122 reports, RPT_ERROR, "%s: Couldn't split UDIM pattern %s", __func__, src_path.c_str());
123 return src_path;
124 }
125
126 /* Copy the individual UDIM tiles. Since there is currently no way to query the contents
127 * of a directory using the USD resolver, we must take a brute force approach. We iterate
128 * over the allowed range of tile indices and copy any tiles that exist. The USDPreviewSurface
129 * specification stipulates "a maximum of ten tiles in the U direction" and that
130 * "the tiles must be within the range [1001, 1100] (as of specification version 2.5)". See
131 * https://graphics.pixar.com/usd/release/spec_usdpreviewsurface.html#texture-reader
132 */
133 for (int i = UDIM_START_TILE; i <= UDIM_END_TILE; ++i) {
134 const std::string src_udim = splitPath.first + std::to_string(i) + splitPath.second;
135 if (asset_exists(src_udim)) {
136 copy_asset_to_directory(src_udim, dest_dir_path, name_collision_mode, reports);
137 }
138 }
139
140 const std::string src_file_name = get_asset_base_name(src_path, reports);
141 char ret_udim_path[FILE_MAX];
142 BLI_path_join(ret_udim_path, sizeof(ret_udim_path), dest_dir_path, src_file_name.c_str());
143
144 /* Blender only recognizes the <UDIM> pattern, not the
145 * alternative UDIM_PATTERN2, so we make sure the returned
146 * path has the former. */
147 splitPath = split_udim_pattern(ret_udim_path);
148 if (splitPath.first.empty() || splitPath.second.empty()) {
149 BKE_reportf(reports, RPT_ERROR, "%s: Couldn't split UDIM pattern %s", __func__, ret_udim_path);
150 return ret_udim_path;
151 }
152
153 return splitPath.first + UDIM_PATTERN + splitPath.second;
154}
155
156bool copy_asset(const std::string &src,
157 const std::string &dst,
158 TexNameCollisionMode name_collision_mode,
159 ReportList *reports)
160{
161 const pxr::ArResolver &ar = pxr::ArGetResolver();
162
163 if (name_collision_mode != TexNameCollisionMode::Overwrite) {
164 if (!ar.Resolve(dst).IsEmpty()) {
165 /* The asset exists, so this is a no-op. */
167 reports, RPT_INFO, "%s: Will not overwrite existing asset %s", __func__, dst.c_str());
168 return true;
169 }
170 }
171
172 pxr::ArResolvedPath src_path = ar.Resolve(src);
173
174 if (src_path.IsEmpty()) {
175 BKE_reportf(reports, RPT_ERROR, "%s: Cannot resolve path %s", __func__, src.c_str());
176 return false;
177 }
178
179 pxr::ArResolvedPath dst_path = ar.ResolveForNewAsset(dst);
180
181 if (dst_path.IsEmpty()) {
183 reports, RPT_ERROR, "%s: Cannot resolve path %s for writing", __func__, dst.c_str());
184 return false;
185 }
186
187 if (src_path == dst_path) {
188 BKE_reportf(reports,
189 RPT_ERROR,
190 "%s: Cannot copy %s. The source and destination paths are the same",
191 __func__,
192 src_path.GetPathString().c_str());
193 return false;
194 }
195
196 std::string why_not;
197 if (!ar.CanWriteAssetToPath(dst_path, &why_not)) {
198 BKE_reportf(reports,
199 RPT_ERROR,
200 "%s: Cannot write to asset %s: %s",
201 __func__,
202 dst_path.GetPathString().c_str(),
203 why_not.c_str());
204 return false;
205 }
206
207 std::shared_ptr<pxr::ArAsset> src_asset = ar.OpenAsset(src_path);
208 if (!src_asset) {
209 BKE_reportf(reports,
210 RPT_ERROR,
211 "%s: Cannot open source asset %s",
212 __func__,
213 src_path.GetPathString().c_str());
214 return false;
215 }
216
217 const size_t size = src_asset->GetSize();
218
219 if (size == 0) {
220 BKE_reportf(reports,
222 "%s: Will not copy zero size source asset %s",
223 __func__,
224 src_path.GetPathString().c_str());
225 return false;
226 }
227
228 std::shared_ptr<const char> buf = src_asset->GetBuffer();
229
230 if (!buf) {
231 BKE_reportf(reports,
232 RPT_ERROR,
233 "%s: Null buffer for source asset %s",
234 __func__,
235 src_path.GetPathString().c_str());
236 return false;
237 }
238
239 std::shared_ptr<pxr::ArWritableAsset> dst_asset = ar.OpenAssetForWrite(
240 dst_path, pxr::ArResolver::WriteMode::Replace);
241 if (!dst_asset) {
242 BKE_reportf(reports,
243 RPT_ERROR,
244 "%s: Cannot open destination asset %s for writing",
245 __func__,
246 src_path.GetPathString().c_str());
247 return false;
248 }
249
250 size_t bytes_written = dst_asset->Write(src_asset->GetBuffer().get(), src_asset->GetSize(), 0);
251
252 if (bytes_written == 0) {
253 BKE_reportf(reports,
254 RPT_ERROR,
255 "%s: Error writing to destination asset %s",
256 __func__,
257 dst_path.GetPathString().c_str());
258 }
259
260 if (!dst_asset->Close()) {
261 BKE_reportf(reports,
262 RPT_ERROR,
263 "%s: Couldn't close destination asset %s",
264 __func__,
265 dst_path.GetPathString().c_str());
266 return false;
267 }
268
269 return bytes_written > 0;
270}
271
272bool asset_exists(const std::string &path)
273{
274 return !pxr::ArGetResolver().Resolve(path).IsEmpty();
275}
276
277std::string import_asset(const std::string &src,
278 const char *import_dir,
279 TexNameCollisionMode name_collision_mode,
280 ReportList *reports)
281{
282 if (import_dir[0] == '\0') {
283 BKE_reportf(reports,
284 RPT_ERROR,
285 "%s: Texture import directory path empty, couldn't import %s",
286 __func__,
287 src.c_str());
288 return src;
289 }
290
291 char dest_dir_path[FILE_MAXDIR];
292 STRNCPY(dest_dir_path, import_dir);
293
294 if (BLI_path_is_rel(import_dir)) {
295 const char *basepath = BKE_main_blendfile_path_from_global();
296 if (basepath[0] == '\0') {
297 BKE_reportf(reports,
298 RPT_ERROR,
299 "%s: import directory is relative "
300 "but the blend file path is empty. "
301 "Please save the blend file before importing the USD "
302 "or provide an absolute import directory path. "
303 "Cannot import %s",
304 __func__,
305 src.c_str());
306 return src;
307 }
308 char path_temp[FILE_MAX];
309 STRNCPY(path_temp, dest_dir_path);
310 BLI_path_abs(path_temp, basepath);
311 STRNCPY(dest_dir_path, path_temp);
312 }
313
314 BLI_path_normalize(dest_dir_path);
315
316 if (!BLI_dir_create_recursive(dest_dir_path)) {
317 BKE_reportf(reports,
318 RPT_ERROR,
319 "%s: Couldn't create texture import directory %s",
320 __func__,
321 dest_dir_path);
322 return src;
323 }
324
325 if (is_udim_path(src)) {
326 return copy_udim_asset_to_directory(src, dest_dir_path, name_collision_mode, reports);
327 }
328
329 return copy_asset_to_directory(src, dest_dir_path, name_collision_mode, reports);
330}
331
339static bool parent_dir_exists_on_file_system(const std::string &path)
340{
341 char dir_path[FILE_MAX];
342 BLI_path_split_dir_part(path.c_str(), dir_path, FILE_MAX);
343 return BLI_is_dir(dir_path);
344}
345
346bool is_udim_path(const std::string &path)
347{
348 return path.find(UDIM_PATTERN) != std::string::npos ||
349 path.find(UDIM_PATTERN2) != std::string::npos;
350}
351
352std::string get_export_textures_dir(const pxr::UsdStageRefPtr stage)
353{
354 pxr::SdfLayerHandle layer = stage->GetRootLayer();
355
356 if (layer->IsAnonymous()) {
358 "%s: Cannot generate a textures directory path for anonymous stage",
359 __func__);
360 return "";
361 }
362
363 const pxr::ArResolvedPath &stage_path = layer->GetResolvedPath();
364
365 if (stage_path.empty()) {
366 WM_global_reportf(RPT_WARNING, "%s: Cannot get resolved path for stage", __func__);
367 return "";
368 }
369
370 const pxr::ArResolver &ar = pxr::ArGetResolver();
371
372 /* Resolve the `./textures` relative path, with the stage path as an anchor. */
373 std::string textures_dir = ar.CreateIdentifierForNewAsset("./textures", stage_path);
374
375 /* If parent of the stage path exists as a file system directory, try to create the
376 * textures directory. */
377 if (parent_dir_exists_on_file_system(stage_path.GetPathString())) {
378 BLI_dir_create_recursive(textures_dir.c_str());
379 }
380
381 return textures_dir;
382}
383
384bool should_import_asset(const std::string &path)
385{
386 if (path.empty()) {
387 return false;
388 }
389
390 if (BLI_path_is_rel(path.c_str())) {
391 return false;
392 }
393
394 if (pxr::ArIsPackageRelativePath(path)) {
395 return true;
396 }
397
399 return false;
400 }
401
402 return !BLI_is_file(path.c_str()) && asset_exists(path);
403}
404
405bool paths_equal(const std::string &path1, const std::string &path2)
406{
407 BLI_assert_msg(!BLI_path_is_rel(path1.c_str()) && !BLI_path_is_rel(path2.c_str()),
408 "Paths arguments must be absolute");
409
410 const pxr::ArResolver &ar = pxr::ArGetResolver();
411 return ar.ResolveForNewAsset(path1) == ar.ResolveForNewAsset(path2);
412}
413
414const char *temp_textures_dir()
415{
416 static bool inited = false;
417
418 static char temp_dir[FILE_MAXDIR] = {'\0'};
419
420 if (!inited) {
421 BLI_path_join(temp_dir, sizeof(temp_dir), BKE_tempdir_session(), "usd_textures_tmp", SEP_STR);
422 inited = true;
423 }
424
425 return temp_dir;
426}
427
428bool write_to_path(const void *data, size_t size, const std::string &path, ReportList *reports)
429{
431 if (size == 0) {
432 return false;
433 }
434
435 const pxr::ArResolver &ar = pxr::ArGetResolver();
436 pxr::ArResolvedPath resolved_path = ar.ResolveForNewAsset(path);
437
438 if (resolved_path.IsEmpty()) {
439 BKE_reportf(reports, RPT_ERROR, "Cannot resolve path %s for writing", path.c_str());
440 return false;
441 }
442
443 std::string why_not;
444 if (!ar.CanWriteAssetToPath(resolved_path, &why_not)) {
445 BKE_reportf(reports,
446 RPT_ERROR,
447 "Cannot write to asset %s: %s",
448 resolved_path.GetPathString().c_str(),
449 why_not.c_str());
450 return false;
451 }
452
453 std::shared_ptr<pxr::ArWritableAsset> dst_asset = ar.OpenAssetForWrite(
454 resolved_path, pxr::ArResolver::WriteMode::Replace);
455 if (!dst_asset) {
456 BKE_reportf(reports,
457 RPT_ERROR,
458 "Cannot open destination asset %s for writing",
459 resolved_path.GetPathString().c_str());
460 return false;
461 }
462
463 size_t bytes_written = dst_asset->Write(data, size, 0);
464
465 if (bytes_written == 0) {
466 BKE_reportf(reports,
467 RPT_ERROR,
468 "Error writing to destination asset %s",
469 resolved_path.GetPathString().c_str());
470 }
471
472 if (!dst_asset->Close()) {
473 BKE_reportf(reports,
474 RPT_ERROR,
475 "Couldn't close destination asset %s",
476 resolved_path.GetPathString().c_str());
477 return false;
478 }
479
480 return bytes_written > 0;
481}
482
483void ensure_usd_source_path_prop(const std::string &path, ID *id)
484{
485 if (!id || path.empty()) {
486 return;
487 }
488
489 if (pxr::ArIsPackageRelativePath(path)) {
490 /* Don't record package-relative paths (e.g., images in USDZ
491 * archives). */
492 return;
493 }
494
495 IDProperty *idgroup = IDP_EnsureProperties(id);
496
497 if (!idgroup) {
498 return;
499 }
500
501 const StringRef prop_name = "usd_source_path";
502
503 if (IDP_GetPropertyFromGroup(idgroup, prop_name)) {
504 return;
505 }
506
507 IDPropertyTemplate val = {0};
508 val.string.str = path.c_str();
509 /* Note length includes null terminator. */
510 val.string.len = path.size() + 1;
511 val.string.subtype = IDP_STRING_SUB_UTF8;
512
513 IDProperty *prop = IDP_New(IDP_STRING, &val, prop_name);
514
515 IDP_AddToGroup(idgroup, prop);
516}
517
518std::string get_usd_source_path(ID *id)
519{
520 if (!id) {
521 return "";
522 }
523
524 const IDProperty *idgroup = IDP_EnsureProperties(id);
525 if (!idgroup) {
526 return "";
527 }
528
529 const StringRef prop_name = "usd_source_path";
530 const IDProperty *prop = IDP_GetPropertyFromGroup(idgroup, prop_name);
531 if (!prop) {
532 return "";
533 }
534
535 return static_cast<const char *>(prop->data.pointer);
536}
537
538std::string get_relative_path(const std::string &path, const std::string &anchor)
539{
540 if (path.empty() || anchor.empty()) {
541 return path;
542 }
543
544 if (path == anchor) {
545 return path;
546 }
547
548 if (BLI_path_is_rel(path.c_str())) {
549 return path;
550 }
551
552 if (pxr::ArIsPackageRelativePath(path)) {
553 return path;
554 }
555
556 if (BLI_is_file(path.c_str()) && BLI_is_file(anchor.c_str())) {
557 /* Treat the paths as standard files. */
558 char anchor_dir[FILE_MAX];
559 BLI_path_split_dir_part(anchor.c_str(), anchor_dir, sizeof(anchor_dir));
560
561 const bool walk_up = true;
562 char rel_path[FILE_MAX];
563 if (!BLI_path_relative_to(path.c_str(), anchor_dir, walk_up, rel_path, sizeof(rel_path))) {
564 return path;
565 }
567 return rel_path;
568 }
569
570 /* If we got here, the paths may be URIs or files on the file system. */
571
572 /* We don't have a library to compute relative paths for URIs
573 * so we use the standard file-system calls to do so. This
574 * may not work for all URIs in theory, but is probably sufficient
575 * for the subset of URIs we are likely to encounter in practice
576 * currently.
577 * TODO(makowalski): provide better utilities for this. */
578
579 const pxr::ArResolver &ar = pxr::ArGetResolver();
580
581 std::string resolved_path = ar.Resolve(path);
582 std::string resolved_anchor = ar.Resolve(anchor);
583
584 if (resolved_path.empty() || resolved_anchor.empty()) {
585 return path;
586 }
587
588 std::string prefix = pxr::TfStringGetCommonPrefix(path, anchor);
589 if (prefix.empty()) {
590 return path;
591 }
592
593 std::replace(prefix.begin(), prefix.end(), '\\', '/');
594
595 size_t last_slash_pos = prefix.find_last_of('/');
596 if (last_slash_pos == std::string::npos) {
597 /* Unexpected: The prefix doesn't contain a slash,
598 * so this was not an absolute path. */
599 return path;
600 }
601
602 /* Replace the common prefix up to the last slash with
603 * a fake root directory to allow computing the relative path
604 * excluding the URI. We omit the URI because it might not
605 * be handled correctly by the standard file-system path computations. */
606 resolved_path = "/root" + resolved_path.substr(last_slash_pos);
607 resolved_anchor = "/root" + resolved_anchor.substr(last_slash_pos);
608
609 char anchor_parent_dir[FILE_MAX];
610 BLI_path_split_dir_part(resolved_anchor.c_str(), anchor_parent_dir, FILE_MAX);
611
612 if (anchor_parent_dir[0] == '\0') {
613 return path;
614 }
615
616 const bool walk_up = true;
617 char result_path[FILE_MAX];
619 resolved_path.c_str(), anchor_parent_dir, walk_up, result_path, sizeof(result_path)))
620 {
621 return path;
622 }
623
624 /* Set paths to Unix-style. */
626 return std::string(result_path);
627}
628
629void USD_path_abs(char *path, const char *basepath, bool for_import)
630{
631 if (!BLI_path_is_rel(path)) {
632 pxr::ArResolvedPath resolved_path = for_import ? pxr::ArGetResolver().Resolve(path) :
633 pxr::ArGetResolver().ResolveForNewAsset(path);
634
635 const std::string &path_str = resolved_path.GetPathString();
636
637 if (!path_str.empty()) {
638 if (path_str.length() < FILE_MAX) {
639 BLI_strncpy(path, path_str.c_str(), FILE_MAX);
640 return;
641 }
643 "In %s: resolved path %s exceeds path buffer length.",
644 __func__,
645 path_str.c_str());
646 }
647 }
648
649 /* If we got here, the path couldn't be resolved by the ArResolver, so we
650 * fall back on the standard Blender absolute path resolution. */
651 BLI_path_abs(path, basepath);
652}
653
654} // namespace blender::io::usd
File and directory operations.
#define FILE_MAXFILE
#define FILE_MAX
#define BLI_path_join(...)
#define FILE_MAXDIR
#define BLI_assert_msg(a, msg)
#define layer
void split(const std::string &s, const char delim, std::vector< std::string > &tokens)
Definition abc_util.cc:68
static std::string copy_udim_asset_to_directory(const std::string &src_path, const char *dest_dir_path, TexNameCollisionMode name_collision_mode, ReportList *reports)
const char * temp_textures_dir()
bool should_import_asset(const std::string &path)
bool asset_exists(const std::string &path)
bool is_udim_path(const std::string &path)
std::string get_relative_path(const std::string &path, const std::string &anchor)
static std::string get_asset_base_name(const std::string &src_path, ReportList *reports)
bool write_to_path(const void *data, size_t size, const std::string &path, ReportList *reports)
bool paths_equal(const std::string &path1, const std::string &path2)
static std::string copy_asset_to_directory(const std::string &src_path, const char *dest_dir_path, TexNameCollisionMode name_collision_mode, ReportList *reports)
constexpr int UDIM_START_TILE
constexpr char UDIM_PATTERN[]
void USD_path_abs(char *path, const char *basepath, bool for_import)
std::string get_export_textures_dir(const pxr::UsdStageRefPtr stage)
std::string import_asset(const std::string &src, const char *import_dir, TexNameCollisionMode name_collision_mode, ReportList *reports)
static std::pair< std::string, std::string > split_udim_pattern(const std::string &path)
constexpr int UDIM_END_TILE
std::string get_usd_source_path(ID *id)
void ensure_usd_source_path_prop(const std::string &path, ID *id)
constexpr char UDIM_PATTERN2[]
static bool parent_dir_exists_on_file_system(const std::string &path)
bool copy_asset(const std::string &src, const std::string &dst, TexNameCollisionMode name_collision_mode, ReportList *reports)
BLI_assert(slot->slot_subtype.map==BMO_OP_SLOT_SUBTYPE_MAP_FLT)
void WM_global_reportf(eReportType type, const char *format,...)
char * STRNCPY(char(&dst)[N], const char *src)
@ RPT_WARNING
Definition BKE_report.hh:40
void BLI_path_slash_forward_from_native(char *path) ATTR_NONNULL(1)
bool BLI_path_abs(char path[FILE_MAX], const char *basepath) ATTR_NONNULL(1
bool BLI_dir_create_recursive(const char *dirname) ATTR_NONNULL()
Definition fileops_c.cc:416
bool IDP_AddToGroup(IDProperty *group, IDProperty *prop) ATTR_NONNULL()
Definition idprop.cc:788
IDProperty * IDP_GetPropertyFromGroup(const IDProperty *prop, StringRef name) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition idprop.cc:818
const char * BKE_main_blendfile_path_from_global()
Definition main.cc:1063
const char * BKE_tempdir_session() ATTR_WARN_UNUSED_RESULT ATTR_RETURNS_NONNULL
Definition appdir.cc:1283
bool BLI_path_relative_to(const char *path, const char *base_dir, bool walk_up, char *r_path_relative, size_t r_path_relative_maxncpy) ATTR_NONNULL(1
char * BLI_strncpy(char *__restrict dst, const char *__restrict src, size_t dst_maxncpy) ATTR_NONNULL(1
void void BLI_path_split_dir_part(const char *filepath, char *dir, size_t dir_maxncpy) ATTR_NONNULL(1
BMesh const char void * data
int BLI_path_normalize(char *path) ATTR_NONNULL(1)
@ IDP_STRING_SUB_UTF8
bool BLI_is_dir(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:457
void void void BLI_path_split_file_part(const char *filepath, char *file, size_t file_maxncpy) ATTR_NONNULL(1
void BKE_reportf(ReportList *reports, eReportType type, const char *format,...) ATTR_PRINTF_FORMAT(3
Definition report.cc:191
bool BLI_path_is_rel(const char *path) ATTR_NONNULL(1) ATTR_WARN_UNUSED_RESULT
IDProperty * IDP_EnsureProperties(ID *id) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition idprop.cc:1005
IDProperty * IDP_New(char type, const IDPropertyTemplate *val, StringRef name, eIDPropertyFlag flags={}) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition idprop.cc:1132
bool BLI_is_file(const char *path) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL()
Definition storage.cc:469
IDPropertyData data
Definition DNA_ID.h:157
struct blender::IDPropertyTemplate::@116303142222164257205355242364302075230051143265 string
#define SEP_STR
Definition unit.cc:41