diff options
author | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-03 18:32:35 +0400 |
---|---|---|
committer | Brecht Van Lommel <brechtvanlommel@pandora.be> | 2012-11-03 18:32:35 +0400 |
commit | eb87529e23cdc744ed52b00f3de25e208b29d7f1 (patch) | |
tree | a0579a1bfb292d8908c8e704a6d82f4dc3f47ecb /intern/cycles/util/util_path.cpp | |
parent | e02b23b81ab05579c0ee11ee3a1acb283643e528 (diff) |
Cycles OSL: shader script node
Documentation here:
http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/OSL
http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.65/Cycles
These changes require an OSL build from this repository:
https://github.com/DingTo/OpenShadingLanguage
The lib/ OSL has not been updated yet, so you might want to keep OSL disabled
until that is done.
Still todo:
* Auto update for external .osl files not working currently, press update manually
* Node could indicate better when a refresh is needed
* Attributes like UV or generated coordinates may be missing when requested from
an OSL shader, need a way to request them to be loaded by cycles
* Expose string, enum and other non-socket parameters
* Scons build support
Thanks to Thomas, Lukas and Dalai for the implementation.
Diffstat (limited to 'intern/cycles/util/util_path.cpp')
-rw-r--r-- | intern/cycles/util/util_path.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/intern/cycles/util/util_path.cpp b/intern/cycles/util/util_path.cpp index a571fe81118..8cf23bc6a76 100644 --- a/intern/cycles/util/util_path.cpp +++ b/intern/cycles/util/util_path.cpp @@ -170,7 +170,7 @@ bool path_read_binary(const string& path, vector<uint8_t>& binary) return true; } -static bool path_read_text(const string& path, string& text) +bool path_read_text(const string& path, string& text) { vector<uint8_t> binary; @@ -184,6 +184,14 @@ static bool path_read_text(const string& path, string& text) return true; } +uint64_t path_modified_time(const string& path) +{ + if(boost::filesystem::exists(path)) + return (uint64_t)boost::filesystem::last_write_time(path); + + return 0; +} + string path_source_replace_includes(const string& source_, const string& path) { /* our own little c preprocessor that replaces #includes with the file |