Skip to content

Commit

Permalink
Merge pull request #5117 from ChengduLittleA/svg_sequence_loading
Browse files Browse the repository at this point in the history
Fix SVG sequence file loading
  • Loading branch information
RodneyBaker authored Oct 3, 2023
2 parents ede1646 + 3a580bc commit 394690d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
5 changes: 3 additions & 2 deletions toonz/sources/image/tiio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,8 @@
#include "./mov/tiio_movM.h"
#include "./3gp/tiio_3gpM.h"

#elif defined(LINUX) || defined(FREEBSD) || defined(HAIKU) // No more supported by the way...
#elif defined(LINUX) || defined(FREEBSD) || \
defined(HAIKU) // No more supported by the way...
// #include "./mov/tiio_movL.h"
#include "./mov/tiio_mov_proxy.h"
#include "./3gp/tiio_3gp_proxy.h"
Expand All @@ -99,7 +100,7 @@ void initImageIo(bool lightVersion) {
TFileType::declare("pli", TFileType::VECTOR_LEVEL);

TLevelReader::define("svg", 0, TLevelReaderSvg::create);
TFileType::declare("svg", TFileType::VECTOR_LEVEL);
TFileType::declare("svg", TFileType::VECTOR_IMAGE);
TLevelWriter::define("svg", TLevelWriterSvg::create, false);
Tiio::defineWriterProperties("svg", new Tiio::SvgWriterProperties());

Expand Down
3 changes: 3 additions & 0 deletions toonz/sources/include/tlevel_io.h
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,9 @@ inline bool isMultipleFrameType(const TFilePath &fp) {

inline bool doesSupportRandomAccess(const TFilePath &fp,
bool isToonzOutput = false) {
const std::string &type = fp.getType();
if (type == "pli") return false;

return (fp.getDots() == "..") || (isToonzOutput && fp.getType() == "mov");
}

Expand Down
3 changes: 3 additions & 0 deletions toonz/sources/toonzlib/levelupdater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ namespace {

inline bool supportsRandomAccess(const TFilePath &fp) {
const std::string &type = fp.getType();

if (type == "pli") return false;

return type == "tlv" || // TLVs do support random access
// type == "pli" || // PLIs... I thought they would -
// but no :( type == "mov" || // MOVs are 'on the
Expand Down
3 changes: 2 additions & 1 deletion toonz/sources/toonzlib/toonzscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -999,6 +999,7 @@ static LevelType getLevelType(const TFilePath &fp) {
ret.m_ltype = OVL_XSHLEVEL;
break;

case TFileType::VECTOR_IMAGE:
case TFileType::VECTOR_LEVEL:
if (format == "svg") {
ret.m_vectorNotPli = true;
Expand Down Expand Up @@ -1194,7 +1195,7 @@ TXshLevel *ToonzScene::loadLevel(const TFilePath &actualPath,
else {
const Preferences &prefs = *Preferences::instance();
int formatIdx = prefs.matchLevelFormat(
levelPath); // Should I use actualPath here? It's mostly
levelPath); // Should I use actualPath here? It's mostly
// irrelevant anyway, it's for old tzp/tzu...
if (formatIdx >= 0) {
lp->options() = prefs.levelFormat(formatIdx).m_options;
Expand Down

0 comments on commit 394690d

Please sign in to comment.