Skip to content

Commit

Permalink
Fix nuke containerise with + - characters
Browse files Browse the repository at this point in the history
  • Loading branch information
jackyjacky1307 authored and rebeccaLinx committed Mar 30, 2023
1 parent 05a6855 commit b71e38e
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion avalon/nuke/pipeline.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import re
import sys
import importlib
import logging
Expand All @@ -10,7 +11,7 @@

from . import lib, command
from ..lib import find_submodule
from .. import api
from .. import io, api
from ..pipeline import AVALON_CONTAINER_ID

log = logging.getLogger(__name__)
Expand Down Expand Up @@ -113,6 +114,10 @@ def containerise(name,

container_color = data.pop("color", int("0x7A7A7AFF", 16))
container_name = "%s_%s_%s" % (namespace, name.replace('.', '_'), suffix)
container_name = re.sub("[+-]", "_", container_name)
if re.match("^[0-9]", container_name):
project = io.find_one({"type": "project"})
container_name = "%s_%s" % (project["data"].get("codename", ""), container_name)

lib.reset_selection()
lib.select_nodes(nodes)
Expand Down

0 comments on commit b71e38e

Please sign in to comment.