Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
blender-addons
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
blender
blender-addons
Commits
48d15df8
Commit
48d15df8
authored
13 years ago
by
Doug Hammond
Browse files
Options
Downloads
Patches
Plain Diff
extensions_framework: add getSequenceTexturePath function to utils module
parent
c18f9bec
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/extensions_framework/util.py
+38
-0
38 additions, 0 deletions
modules/extensions_framework/util.py
with
38 additions
and
0 deletions
modules/extensions_framework/util.py
+
38
−
0
View file @
48d15df8
...
...
@@ -230,3 +230,41 @@ def format_elapsed_time(t):
hrs
=
td
.
days
*
24
+
td
.
seconds
/
3600.0
return
'
%i:%02i:%02i
'
%
(
hrs
,
min
%
60
,
td
.
seconds
%
60
)
def
getSequenceTexturePath
(
it
,
f
):
import
bpy.path
import
os.path
import
string
fd
=
it
.
image_user
.
frame_duration
fs
=
it
.
image_user
.
frame_start
fo
=
it
.
image_user
.
frame_offset
cyclic
=
it
.
image_user
.
use_cyclic
ext
=
os
.
path
.
splitext
(
it
.
image
.
filepath
)[
-
1
]
fb
=
bpy
.
path
.
display_name_from_filepath
(
it
.
image
.
filepath
)
dn
=
os
.
path
.
dirname
(
it
.
image
.
filepath
)
rf
=
fb
[::
-
1
]
nl
=
0
for
i
in
range
(
len
(
fb
)):
if
rf
[
i
]
in
string
.
digits
:
nl
+=
1
else
:
break
head
=
fb
[:
len
(
fb
)
-
nl
]
fnum
=
f
if
fs
!=
1
:
if
f
!=
fs
:
fnum
-=
(
fs
-
1
)
elif
f
==
fs
:
fnum
=
1
if
fnum
<=
0
:
if
cyclic
:
fnum
=
fd
-
abs
(
fnum
)
%
fd
else
:
fnum
=
1
elif
fnum
>
fd
:
if
cyclic
:
fnum
=
fnum
%
fd
else
:
fnum
=
fd
fnum
+=
fo
return
dn
+
"
/
"
+
head
+
str
(
fnum
).
rjust
(
nl
,
"
0
"
)
+
ext
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment