translate environment variables in library paths #18581

Closed
opened 2009-04-21 14:21:45 +02:00 by Lorenzo Pierfederici · 13 comments

%%%A small patch to allow environment variables in paths for linked libraries.

For example with MY_PROJECT=dummy and MODEL_RESOLUTION=lowres the path:
/projects/$MY_PROJECT/character_${MODEL_RESOLUTION}_v001.blend
will be translated to:
/projects/dummy/character_lowres_v001.blend

note:
I've left in a printf to show translated paths in the console, I think it could be useful to see the real destination when loading a library at startup or when changing a path in the outliner...%%%

%%%A small patch to allow environment variables in paths for linked libraries. For example with MY_PROJECT=dummy and MODEL_RESOLUTION=lowres the path: /projects/$MY_PROJECT/character_${MODEL_RESOLUTION}_v001.blend will be translated to: /projects/dummy/character_lowres_v001.blend note: I've left in a printf to show translated paths in the console, I think it could be useful to see the real destination when loading a library at startup or when changing a path in the outliner...%%%

Changed status to: 'Open'

Changed status to: 'Open'
Member

%%%Assigning to ton.

At a glance, this seems ok, but I'd suggest making a set of .blends that fully test this, in as many different path situations as possible.%%%

%%%Assigning to ton. At a glance, this seems ok, but I'd suggest making a set of .blends that fully test this, in as many different path situations as possible.%%%

Changed status from 'Open' to: 'Archived'

Changed status from 'Open' to: 'Archived'

Added subscriber: @mont29

Added subscriber: @mont29

Time to archive that one.

Time to archive that one.

Added subscriber: @maximd

Added subscriber: @maximd

Hi!
There is a lot of value to be able to use env vars in paths, most particularly for the scene's output file (because sometimes you don't control how blender is launched and cannot add a "--render-output" parameter, for example) . AFAIK some studios are using this (old but working) patch in production without problem.
How can we help to reevaluate the inclusion of this patch?

Hi! There is a lot of value to be able to use env vars in paths, most particularly for the scene's output file (because sometimes you don't control how blender is launched and cannot add a "--render-output" parameter, for example) . AFAIK some studios are using this (old but working) patch in production without problem. How can we help to reevaluate the inclusion of this patch?

Added subscriber: @g-lul

Added subscriber: @g-lul

Hi !
I can confirm what @maximd said.
We use this old patch for years without any problem.
Maybe, it's a good thing to have this feature in official blender versions.

Hi ! I can confirm what @maximd said. We use this old patch for years without any problem. Maybe, it's a good thing to have this feature in official blender versions.

Added subscribers: @kyraneth, @ThomasDinges

Added subscribers: @kyraneth, @ThomasDinges

I have been contacted by @kyraneth about this patch being a topic that came up several times at the Blender conference and a wanted feature by some studios. @mont29 Do you think this would be something worth adding?

I updated it for current master (though not 100% sure the change in readfile.cc is correct).
env_vars_in_paths-v04.diff

I have been contacted by @kyraneth about this patch being a topic that came up several times at the Blender conference and a wanted feature by some studios. @mont29 Do you think this would be something worth adding? I updated it for current master (though not 100% sure the change in readfile.cc is correct). [env_vars_in_paths-v04.diff](https://archive.blender.org/developer/F13820057/env_vars_in_paths-v04.diff)

Added subscriber: @Viop-3

Added subscriber: @Viop-3

For thoses who need env var to be kept in 3.3(.2) LTS, here is another patch based on this one -> https://developer.blender.org/D16760 .
It support browsing in blender UI with env var in path.

For thoses who need env var to be kept in 3.3(.2) LTS, here is another patch based on this one -> https://developer.blender.org/D16760 . It support browsing in blender UI with env var in path.
Sign in to join this conversation.
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
7 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#18581
No description provided.