Cleanup: Move blend file path utilities out of blenloader module #105825

Closed
Julian Eisel wants to merge 1 commits from JulianEisel:temp-bke-blend-file-utils into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Member

These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to BKE_blendfile.h now, in agreement with Bastien.

These are not really about reading or writing .blend files, they are general utilities for file-names/paths. Having to link to the blendloader library just for these utilities is annoying. Moved them to `BKE_blendfile.h` now, in agreement with Bastien.
Julian Eisel added 1 commit 2023-03-16 12:15:52 +01:00
buildbot/vexp-code-patch-coordinator Build done. Details
cfbd3476b2
Cleanup: Move blend file path utilities out of blenloader module
These are not really about reading or writing .blend files, they are
general utilities for file-names/paths. Having to link to the
blendloader library just for these utilities is annoying.
Moved them to `BKE_blendfile.h` now, in agreement with Bastien.
Author
Member

@blender-bot build

@blender-bot build
Julian Eisel added the
Module
Core
label 2023-03-16 12:16:29 +01:00
Julian Eisel requested review from Bastien Montagne 2023-03-16 12:19:57 +01:00
Bastien Montagne approved these changes 2023-03-16 12:43:45 +01:00
Bastien Montagne left a comment
Owner

LGTM, comments below are more suggestions of improvements that can be committed separately.

LGTM, comments below are more suggestions of improvements that can be committed separately.
@ -22,0 +33,4 @@
*
* \param path: the full path to explode.
* \param r_dir: the string that'll contain path up to blend file itself ('library' path).
* WARNING! Must be #FILE_MAX_LIBEXTRA long (it also stores group and name strings)!

Must be at least #FILE_MAX_LIBEXTRA long

Must be at least #FILE_MAX_LIBEXTRA long
@ -22,0 +35,4 @@
* \param r_dir: the string that'll contain path up to blend file itself ('library' path).
* WARNING! Must be #FILE_MAX_LIBEXTRA long (it also stores group and name strings)!
* \param r_group: the string that'll contain 'group' part of the path, if any. May be NULL.
* \param r_name: the string that'll contain data's name part of the path, if any. May be NULL.

Should also document that r_group and r_name, if set, will point to sub-strings in r_dir.

Should also document that `r_group` and `r_name`, if set, will point to sub-strings in `r_dir`.
@ -65,0 +92,4 @@
return false;
}
strcpy(r_dir, path);

Should use BLI_strncpy instead, since we expect r_dir to be FILE_MAX_LIBEXTRA long.

Should use `BLI_strncpy` instead, since we expect `r_dir` to be `FILE_MAX_LIBEXTRA` long.
Author
Member

Committed with 48814c25fd (and the suggested changes as followups).

Committed with 48814c25fd (and the suggested changes as followups).
Julian Eisel closed this pull request 2023-03-16 15:21:21 +01:00
Julian Eisel deleted branch temp-bke-blend-file-utils 2023-03-16 15:21:28 +01:00
All checks were successful
buildbot/vexp-code-patch-coordinator Build done.

Pull request closed

Sign in to join this conversation.
No reviewers
No Label
Interest
Alembic
Interest
Animation & Rigging
Interest
Asset Browser
Interest
Asset Browser Project Overview
Interest
Audio
Interest
Automated Testing
Interest
Blender Asset Bundle
Interest
BlendFile
Interest
Collada
Interest
Compatibility
Interest
Compositing
Interest
Core
Interest
Cycles
Interest
Dependency Graph
Interest
Development Management
Interest
EEVEE
Interest
EEVEE & Viewport
Interest
Freestyle
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
ID Management
Interest
Images & Movies
Interest
Import Export
Interest
Line Art
Interest
Masking
Interest
Metal
Interest
Modeling
Interest
Modifiers
Interest
Motion Tracking
Interest
Nodes & Physics
Interest
OpenGL
Interest
Overlay
Interest
Overrides
Interest
Performance
Interest
Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds & Tests
Interest
Python API
Interest
Render & Cycles
Interest
Render Pipeline
Interest
Sculpt, Paint & Texture
Interest
Text Editor
Interest
Translations
Interest
Triaging
Interest
Undo
Interest
USD
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Interest
Video Sequencer
Interest
Virtual Reality
Interest
Vulkan
Interest
Wayland
Interest
Workbench
Interest: X11
Legacy
Blender 2.8 Project
Legacy
Milestone 1: Basic, Local Asset Browser
Legacy
OpenGL Error
Meta
Good First Issue
Meta
Papercut
Meta
Retrospective
Meta
Security
Module
Animation & Rigging
Module
Core
Module
Development Management
Module
EEVEE & Viewport
Module
Grease Pencil
Module
Modeling
Module
Nodes & Physics
Module
Pipeline, Assets & IO
Module
Platforms, Builds & Tests
Module
Python API
Module
Render & Cycles
Module
Sculpt, Paint & Texture
Module
Triaging
Module
User Interface
Module
VFX & Video
Platform
FreeBSD
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender#105825
No description provided.