Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
107 commits
Select commit Hold shift + click to select a range
a0487b8
Remove QSplitter border
BigRoy Sep 21, 2018
70e445a
Correctly set index without changing selection (fixes losing selection)
BigRoy Sep 28, 2018
82a671a
Merge pull request #32 from aardschok/PLN-171
aardschok Oct 2, 2018
33aadf8
Merge pull request #31 from getavalon/master
BigRoy Oct 2, 2018
8f8f177
Merge pull request #30 from BigRoy/master
BigRoy Oct 2, 2018
a300992
improved callbacks
aardschok Oct 11, 2018
80c7718
Merge pull request #34 from aardschok/PLN-177
aardschok Oct 11, 2018
7dfb4f5
Updated containerize logic, use subnetwork instead of object network
aardschok Oct 17, 2018
b04dbb5
Merge pull request #35 from aardschok/PLN-181
aardschok Oct 17, 2018
b4e949a
Fix `lsattr` actually returning nodes in namespaces
BigRoy Oct 18, 2018
6084d46
Use new style exception
BigRoy Oct 18, 2018
5275a63
Fix docstring
BigRoy Oct 18, 2018
df46687
Fix returning only node name (without attribute) when no value provided
BigRoy Oct 18, 2018
746bb81
Merge branch 'master' into PLN-171
aardschok Oct 24, 2018
68c4f26
Wrapped logic of process in undo chunk
aardschok Oct 24, 2018
95060fb
Added undo_chunk contextmanager function
aardschok Oct 24, 2018
26a3bee
Update some docstrings
aardschok Oct 24, 2018
43cdefb
Merge pull request #36 from aardschok/PLN-25
BigRoy Oct 29, 2018
1b4ec67
Merge branch 'master' of https://github.com/Colorbleed/core
BigRoy Nov 4, 2018
79f5475
Sort the work files by name
BigRoy Nov 4, 2018
df8b9d3
Simplify code for selecting latest modified file
BigRoy Nov 4, 2018
e573713
Avoid the need for temporary file to get value from NameWindow
BigRoy Nov 4, 2018
5c9cf14
Workfiles, use api.Session instead of os.environ
BigRoy Nov 6, 2018
e8bf42b
Increase default size to accomodate more files clearly on show
BigRoy Nov 6, 2018
30009ac
Workfiles: allow double clicking on file to open
BigRoy Nov 6, 2018
cf9352d
Workfiles: on refresh scroll list to selected latest modified file
BigRoy Nov 6, 2018
058627a
Fix #334 workfiles incremental gaps filling + comment messing up vers…
BigRoy Nov 7, 2018
1b59f71
Workfiles: add draft visual for showing current context
BigRoy Nov 7, 2018
f939d63
Merge pull request #37 from BigRoy/workfiles
BigRoy Nov 7, 2018
9a7fb10
Correctly maintain selection
BigRoy Dec 8, 2018
98a8f10
Revert back to absolute path to AVALON_CONTAINERS.
BigRoy Dec 8, 2018
4968fda
Correctly retrieve the avalon containers subnet
BigRoy Dec 8, 2018
3e48875
Reorder so it's similar to imports, purely cosmetics/readability
BigRoy Dec 8, 2018
36f5d6f
Improve docstring, remove wrong documentation
BigRoy Dec 8, 2018
49ef1de
Ensure "/out" is retrieved with absolute path to avoid erroneous results
BigRoy Dec 8, 2018
f46b51b
Use a super() call to parent class
BigRoy Dec 8, 2018
c4fc00a
Simplify code, improve readability
BigRoy Dec 8, 2018
d0f4d45
Merge pull request #33 from aardschok/PLN-171
BigRoy Dec 8, 2018
c9f0539
Echo the creation of the instance in the ui
BigRoy Dec 17, 2018
a0eac8d
Merge branch 'master' of https://github.com/Colorbleed/core
BigRoy Dec 17, 2018
c6fa431
Merge branch 'PLN-171'
BigRoy Dec 17, 2018
f6d874c
Merge pull request #38 from BigRoy/master
BigRoy Dec 17, 2018
a401ee3
Merge branch 'master' of https://github.com/getavalon/core into updat…
BigRoy Jan 16, 2019
9a70667
Merge pull request #39 from BigRoy/update_to_avalon_core
BigRoy Jan 16, 2019
241864f
Support multiple hosts in Work Files tool (add to Houdini + Fusion)
BigRoy Jan 17, 2019
fa3359b
Refactor Work Files api to use avalon host integration (see #365)
BigRoy Jan 17, 2019
333fdab
_get_assets returns only assets that have anything published
iLLiCiTiT Mar 1, 2019
0d162de
added labels under dropdowns
iLLiCiTiT Mar 1, 2019
ce33083
get_document_names was changed so it can query multiple parents
iLLiCiTiT Mar 1, 2019
fafd2a7
get_subsets filter subsets by assets in asset's dropdown
iLLiCiTiT Mar 1, 2019
a826f02
get_representation returns union of all posible representations of al…
iLLiCiTiT Mar 1, 2019
68ab1a1
added validation method that validates entries and enable/disable swi…
iLLiCiTiT Mar 1, 2019
f126b3b
refresh is more specific what should be refreshed
iLLiCiTiT Mar 1, 2019
02deb7b
added on subset, asset, representation change signals
iLLiCiTiT Mar 1, 2019
406c16a
Fix missing import os
BigRoy May 17, 2019
2326e6f
Include workfiles API in __all__ (shush the hound)
BigRoy May 17, 2019
a0cae5f
Merge branch 'master' into workfiles
BigRoy May 17, 2019
da21c45
Hide 'shadow families'
davidlatwe Jun 11, 2019
7364bb6
Change family icon color for visibility in highlight
davidlatwe Jun 11, 2019
7416f54
Enable to opt out '+' silo tab for Loader GUI
davidlatwe Jun 11, 2019
05e8c5a
Disable silo create dialog when it's not creatable
davidlatwe Jun 11, 2019
56b00bf
Opt out '+' silo tab for Context Manager GUI
davidlatwe Jun 11, 2019
0f1e7fc
Cosmetic
davidlatwe Jun 12, 2019
771875a
Implement 'subset grouping' in Loader GUI
davidlatwe Jun 12, 2019
4e438fa
Make group items always on top of the view
davidlatwe Jun 12, 2019
2a3876b
Disable context menu on group
davidlatwe Jun 12, 2019
b7a731f
Disable version delegate on group
davidlatwe Jun 12, 2019
e641d4d
Fix to reset version info on group
davidlatwe Jun 12, 2019
42a874a
Keep group in view when filtering subsets
davidlatwe Jun 12, 2019
1f7b122
Improved group item ordering and customizable icon
davidlatwe Jun 13, 2019
293ae9d
Re-implement groups ordering
davidlatwe Jun 14, 2019
8aaea11
Revert "Change family icon color for visibility in highlight"
davidlatwe Jun 11, 2019
d679dba
Revert "Hide 'shadow families'"
davidlatwe Jun 11, 2019
03117ad
Implement family.hideFilter
davidlatwe Jun 14, 2019
5f5dd6f
Make family filter able to interact with all families in subset
davidlatwe Jun 14, 2019
04193ec
Add property `groups` into project config schema
davidlatwe Jun 14, 2019
148749f
Include `groups` when saving config by `avalon --save`
davidlatwe Jun 17, 2019
ced6ebe
Fix test
davidlatwe Jun 19, 2019
04b2f6a
Do not include hidden filter into calculation
davidlatwe Jul 2, 2019
e67d269
Add Ctrl+G key release event handler for manual subset grouping
davidlatwe Jul 3, 2019
ab96a6d
Re-implement group config collecting mechanism
davidlatwe Jul 3, 2019
096dd01
Implement manual subset grouping dialog
davidlatwe Jul 3, 2019
3df0240
Add placeholder text and set width to dialog
davidlatwe Jul 3, 2019
c8391a9
Add "AVALON_SCENEDIR" to define Scenes directory for Work Files (#387)
BigRoy Jul 4, 2019
68cf622
Merge branch 'workfiles' of https://github.com/BigRoy/core into workf…
BigRoy Jul 4, 2019
112bc5b
Explain AVALON_SCENEDIR in workfiles README.
BigRoy Jul 4, 2019
2be2b08
Add Houdini + Fusion to supported hosts list of Work Files tool.
BigRoy Jul 4, 2019
0eec3db
Merge pull request #387 from BigRoy/workfiles
davidlatwe Jul 4, 2019
447abf1
Merge pull request #376 from pypeclub/cleanup/PYPE-222_switch_asset_GUI
davidlatwe Jul 4, 2019
98d2f85
Hide group when all members have been filtered
davidlatwe Jul 7, 2019
1af5e8d
Fix disorder when filtering multiple groups that having same order
davidlatwe Jul 8, 2019
b9914db
Filtering groups by the acceptance of it's members
davidlatwe Jul 8, 2019
8b868ef
Fixed `Ctrl+G` key event keep passing to parent App
davidlatwe Jul 8, 2019
63ac36a
Make 'Apply' button in `SubsetGroupingDialog` as default button
davidlatwe Jul 8, 2019
093a0d7
Improved commit "Filtering groups by the acceptance of it's members"
davidlatwe Jul 8, 2019
faeb6de
Fix auto columns resizing feature
davidlatwe Jul 8, 2019
65940c3
Enforce all columns resize to content and fixed
davidlatwe Jul 8, 2019
66f678c
Auto expand groups on text filtering
davidlatwe Jul 8, 2019
c8a0468
Add "Enable Grouping" checkbox
davidlatwe Jul 8, 2019
3d23f6e
Ensure `node` is not `None`
davidlatwe Jul 8, 2019
061f240
Cosmetic change
davidlatwe Jul 8, 2019
7842b09
Merge pull request #391 from davidlatwe/loader-subsets
davidlatwe Jul 10, 2019
6e0d38d
Merge pull request #393 from davidlatwe/loader-assets
davidlatwe Jul 10, 2019
74ea7b2
Merge branch 'master' into loader-families
davidlatwe Jul 10, 2019
b14cae0
Cosmetic
davidlatwe Jul 10, 2019
f03c273
Merge pull request #392 from davidlatwe/loader-families
davidlatwe Jul 10, 2019
ff3562f
Merge branch 'master' into fix364
davidlatwe Jul 10, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions avalon/fusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,15 @@
get_current_comp,
comp_lock_and_undo_chunk

)

from .workio import (
open,
save,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)

from .lib import (
Expand All @@ -33,6 +41,14 @@
"get_current_comp",
"comp_lock_and_undo_chunk",

# Workfiles API
"open",
"save",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",

"maintained_selection"

]
50 changes: 50 additions & 0 deletions avalon/fusion/workio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
"""Host API required Work Files tool"""
import sys
import os


def file_extensions():
return [".comp"]


def has_unsaved_changes():
from avalon.fusion.pipeline import get_current_comp

comp = get_current_comp()
return comp.GetAttrs()["COMPB_Modified"]


def save(filepath):
from avalon.fusion.pipeline import get_current_comp

comp = get_current_comp()
comp.Save(filepath)


def open(filepath):
# Hack to get fusion, see avalon.fusion.pipeline.get_current_comp()
fusion = getattr(sys.modules["__main__"], "fusion", None)

return fusion.LoadComp(filepath)


def current_file():
from avalon.fusion.pipeline import get_current_comp

comp = get_current_comp()
current_filepath = comp.GetAttrs()["COMPS_FileName"]
if not current_filepath:
return None

return current_filepath


def work_root():
from avalon import api

work_dir = api.Session["AVALON_WORKDIR"]
scene_dir = api.Session.get("AVALON_SCENEDIR")
if scene_dir:
return os.path.join(work_dir, scene_dir)
else:
return work_dir
21 changes: 19 additions & 2 deletions avalon/houdini/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@

)

from .workio import (
open,
save,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)

from .lib import (
lsattr,
lsattrs,
Expand All @@ -28,11 +37,19 @@
"ls",
"containerise",

# Utility functions
"maintained_selection",
# Workfiles API
"open",
"save",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",

# Utility functions
"lsattr",
"lsattrs",
"read",

"maintained_selection",
"unique_name"
]
8 changes: 5 additions & 3 deletions avalon/houdini/lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,9 +174,11 @@ def maintained_selection():
try:
yield
finally:
# Clear the selection
# todo: does hou.clearAllSelected() do the same?
for node in hou.selectedNodes():
node.setSelected(on=False)

if previous_selection:
for node in previous_selection:
node.setSelected(on=True)
else:
for node in previous_selection:
node.setSelected(on=False)
65 changes: 30 additions & 35 deletions avalon/houdini/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
self._parent = None
self._events = dict()

AVALON_CONTAINERS = "AVALON_CONTAINERS"
AVALON_CONTAINERS = "/obj/AVALON_CONTAINERS"
IS_HEADLESS = not hasattr(hou, "ui")


Expand All @@ -30,6 +30,7 @@ def install(config):

"""

print("Registering callbacks")
_register_callbacks()

pyblish.api.register_host("houdini")
Expand Down Expand Up @@ -151,15 +152,11 @@ def containerise(name,
context,
loader=None,
suffix=""):
"""Bundle `nodes` into an assembly and imprint it with metadata
"""Bundle `nodes` into a subnet and imprint it with metadata

Containerisation enables a tracking of version, author and origin
for loaded assets.

In Houdini it is not possible to next goemetry nodes in geometry nodes
directly. To counter this we place a Object Network node calles ROOT
in the HOUDINI_CONTAINERS node.

Arguments:
name (str): Name of resulting assembly
namespace (str): Namespace under which to host container
Expand All @@ -173,16 +170,18 @@ def containerise(name,

"""

# Get main object network node
obj_network = hou.node("/obj")
# Ensure AVALON_CONTAINERS subnet exists
subnet = hou.node(AVALON_CONTAINERS)
if subnet is None:
obj_network = hou.node("/obj")
subnet = obj_network.createNode("subnet",
node_name="AVALON_CONTAINERS")

# Check if the AVALON_CONTAINERS exists
main_container = obj_network.node(AVALON_CONTAINERS)
if main_container is None:
main_container = obj_network.createNode("subnet",
node_name="AVALON_CONTAINERS")
# Create proper container name
container_name = "{}_{}".format(name, suffix or "CON")
container = hou.node("/obj/{}".format(name))
container.setName(container_name)

container = obj_network.node(name)
data = {
"schema": "avalon-core:container-2.0",
"id": AVALON_CONTAINER_ID,
Expand All @@ -195,10 +194,9 @@ def containerise(name,
lib.imprint(container, data)

# "Parent" the container under the container network
hou.moveNodesTo([container], main_container)
hou.moveNodesTo([container], subnet)

# Get the container and set good position
main_container.node(name).moveToGoodPosition()
subnet.node(container_name).moveToGoodPosition()

return container

Expand Down Expand Up @@ -265,7 +263,7 @@ class Creator(api.Creator):
"""

def __init__(self, *args, **kwargs):
api.Creator.__init__(self, *args, **kwargs)
super(Creator, self).__init__(*args, **kwargs)
self.nodes = list()

def process(self):
Expand Down Expand Up @@ -302,25 +300,24 @@ def process(self):
node_type = "geometry"

# Get out node
out = hou.node("out")
instance = out.createNode(node_type, node_name=self.data["subset"])
out = hou.node("/out")
instance = out.createNode(node_type, node_name=self.name)
instance.moveToGoodPosition()

lib.imprint(instance, self.data)

return instance


def _on_scene_open(*args):
api.emit("open", *[])


def _on_scene_new(*args):
api.emit("new", *[])


def _on_scene_save(*args):
api.emit("save", *[])
def on_file_event_callback(event):
if event == hou.hipFileEventType.AfterLoad:
api.emit("open", [event])
elif event == hou.hipFileEventType.AfterSave:
api.emit("save", [event])
elif event == hou.hipFileEventType.BeforeSave:
api.emit("before_save", [event])
elif event == hou.hipFileEventType.AfterClear:
api.emit("new", [event])


def on_houdini_initialize():
Expand All @@ -340,8 +337,6 @@ def _register_callbacks():
except RuntimeError as e:
logger.info(e)

self._events[_on_scene_save] = hou.hipFile.addEventCallback(_on_scene_save)

self._events[_on_scene_new] = hou.hipFile.addEventCallback(_on_scene_new)

self._events[_on_scene_open] = hou.hipFile.addEventCallback(_on_scene_open)
self._events[on_file_event_callback] = hou.hipFile.addEventCallback(
on_file_event_callback
)
59 changes: 59 additions & 0 deletions avalon/houdini/workio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
"""Host API required Work Files tool"""
import os

import hou


def file_extensions():
return [".hip", ".hiplc", ".hipnc"]


def has_unsaved_changes():
return hou.hipFile.hasUnsavedChanges()


def save(filepath):

# Force forwards slashes to avoid segfault
filepath = filepath.replace("\\", "/")

hou.hipFile.save(file_name=filepath,
save_to_recent_files=True)

return filepath


def open(filepath):

# Force forwards slashes to avoid segfault
filepath = filepath.replace("\\", "/")

hou.hipFile.load(filepath,
suppress_save_prompt=True,
ignore_load_warnings=False)

return filepath


def current_file():

current_filepath = hou.hipFile.path()
if (os.path.basename(current_filepath) == "untitled.hip" and
not os.path.exists(current_filepath)):
# By default a new scene in houdini is saved in the current
# working directory as "untitled.hip" so we need to capture
# that and consider it 'not saved' when it's in that state.
return None

return current_filepath


def work_root():
from avalon import api

work_dir = api.Session["AVALON_WORKDIR"]
scene_dir = api.Session.get("AVALON_SCENEDIR")
if scene_dir:
return os.path.join(work_dir, scene_dir)
else:
return work_dir
1 change: 1 addition & 0 deletions avalon/inventory.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,7 @@ def _save_config_1_0(project_name, data):
config["tasks"] = data.get("tasks", [])
config["template"].update(data.get("template", {}))
config["families"] = data.get("families", [])
config["groups"] = data.get("groups", [])

schema.validate(document)

Expand Down
3 changes: 3 additions & 0 deletions avalon/io.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,9 @@ def _from_environment():
# Path to working directory
("AVALON_WORKDIR", None),

# Optional path to scenes directory (see Work Files API)
("AVALON_SCENEDIR", None),

# Name of current Config
# TODO(marcus): Establish a suitable default config
("AVALON_CONFIG", "no_config"),
Expand Down
18 changes: 18 additions & 0 deletions avalon/maya/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,15 @@

)

from .workio import (
open,
save,
current_file,
has_unsaved_changes,
file_extensions,
work_root
)

from .lib import (
export_alembic,
lsattr,
Expand Down Expand Up @@ -61,6 +70,15 @@
"is_locked",
"lock_ignored",

# Workfiles API
"open",
"save",
"current_file",
"has_unsaved_changes",
"file_extensions",
"work_root",

# Utility functions
"export_alembic",
"lsattr",
"lsattrs",
Expand Down
Loading