Skip to content

Commit

Permalink
Update utils.py
Browse files Browse the repository at this point in the history
  • Loading branch information
hisprofile authored Jun 13, 2024
1 parent 99aafb8 commit 019cfbe
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion plumber/asset/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from base64 import urlsafe_b64encode
from posixpath import split, splitext
from typing import Optional
import bpy
import bpy, os

_HASH_LEN = 6
_B64_LEN = 8
Expand All @@ -13,6 +13,16 @@ def _hashed(s: str) -> str:
:_B64_LEN
].decode("ascii")

def three(a):
counter = 0
pos = -1
for i in a:
if a == "/":
counter += 1
pos += 1
if counter == 3:
return pos
return None

def truncate_name(name: str, maxlen: int = 59) -> str:
name = name.replace("\\", "/").strip("/")
Expand Down

0 comments on commit 019cfbe

Please sign in to comment.