Skip to content

Commit

Permalink
Merge pull request #189 from TrevisanGMW/dev
Browse files Browse the repository at this point in the history
release <- dev (3.2.0)
  • Loading branch information
TrevisanGMW committed Sep 15, 2023
2 parents ab60ccf + d383c2e commit 11d7b6d
Show file tree
Hide file tree
Showing 146 changed files with 37,196 additions and 346 deletions.
Binary file modified docs/media/gt_utilities.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion gt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import sys

# Package Variables
__version_tuple__ = (3, 1, 11)
__version_tuple__ = (3, 2, 0)
__version_suffix__ = ''
__version__ = '.'.join(str(n) for n in __version_tuple__) + __version_suffix__
__authors__ = ['Guilherme Trevisan']
Expand Down
2 changes: 1 addition & 1 deletion gt/tools/attributes_to_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from gt.tools.attributes_to_python import attributes_to_python_view
from gt.ui import qt_utils

__version_tuple__ = (2, 0, 1)
__version_tuple__ = (2, 0, 2)
__version_suffix__ = ''
__version__ = '.'.join(str(n) for n in __version_tuple__) + __version_suffix__

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ def run_python_code(self):
Attempts to run the code found in the "Python Output" box.
"""
_code = self.view.get_python_output_text()
execute_python_code(code=_code, user_maya_warning=True)
execute_python_code(code=_code, use_maya_warning=True, import_cmds=True)

def save_python_to_shelf(self):
"""
Expand Down
51 changes: 0 additions & 51 deletions gt/tools/create_sphere_types/__init__.py

This file was deleted.

120 changes: 0 additions & 120 deletions gt/tools/create_sphere_types/create_sphere_types.py

This file was deleted.

4 changes: 2 additions & 2 deletions gt/tools/curve_library/curve_library_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ def open_parameter_editor(self):
message=control.get_docstrings(),
window_title=f'Parameters for "{item_name}"',
image=resource_library.Icon.curve_library_control,
window_icon=resource_library.Icon.curve_library_parameters,
window_icon=resource_library.Icon.library_parameters,
image_scale_pct=10,
is_python_code=True)
param_win.set_confirm_button_text("Build")
Expand Down Expand Up @@ -284,7 +284,7 @@ def get_custom_curve_preview_image(self):
if os.path.exists(preview_image):
return preview_image
else:
return resource_library.Icon.curve_library_missing_file
return resource_library.Icon.library_missing_file


if __name__ == "__main__":
Expand Down
2 changes: 1 addition & 1 deletion gt/tools/curve_library/curve_library_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ def get_preview_image(self, object_name):
if preview_image:
return preview_image
else:
return resource_library.Icon.curve_library_missing_file
return resource_library.Icon.library_missing_file

@staticmethod
def build_control_with_custom_parameters(parameters, target_control):
Expand Down
16 changes: 6 additions & 10 deletions gt/tools/curve_library/curve_library_view.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ def __init__(self, parent=None, controller=None, version=None):
QtCore.Qt.WindowMaximizeButtonHint |
QtCore.Qt.WindowMinimizeButtonHint)
self.setWindowIcon(QIcon(resource_library.Icon.tool_crv_library))
# from PySide2.QtGui import QScreen
# primary_screen = QScreen.primaryScreen()
# dpi = primary_screen.physicalDotsPerInch()
# print(dpi)

stylesheet = resource_library.Stylesheet.scroll_bar_dark
stylesheet += resource_library.Stylesheet.maya_basic_dialog
Expand All @@ -75,7 +71,7 @@ def update_preview_image(self, new_image_path=None):
if new_image_path:
self.preview_image.set_pixmap(QPixmap(new_image_path))
else:
self.preview_image.set_pixmap(QPixmap(resource_library.Icon.curve_library_missing_file))
self.preview_image.set_pixmap(QPixmap(resource_library.Icon.library_missing_file))

def create_widgets(self):
"""Create the widgets for the window."""
Expand All @@ -84,7 +80,7 @@ def create_widgets(self):
self.item_list = QListWidget()
self.item_list.setFont(font)
self.build_button = QPushButton("Build")
self.build_button.setIcon(QIcon(resource_library.Icon.curve_library_build))
self.build_button.setIcon(QIcon(resource_library.Icon.library_build))
self.build_button.setStyleSheet(resource_library.Stylesheet.push_button_bright)
self.search_bar = QLineEdit(self)
self.search_bar.setFont(font)
Expand All @@ -94,20 +90,20 @@ def create_widgets(self):
self.add_custom_button = QPushButton("Save Curve")
add_custom_tooltip = "Saves a Maya selected Nurbs/Bezier element as a user-defined curve in the Curve Library"
self.add_custom_button.setToolTip(add_custom_tooltip)
self.add_custom_button.setIcon(QIcon(resource_library.Icon.curve_library_add))
self.add_custom_button.setIcon(QIcon(resource_library.Icon.library_add))
self.delete_custom_button = QPushButton("Delete Curve")
self.delete_custom_button.setEnabled(False)
self.delete_custom_button.setIcon(QIcon(resource_library.Icon.curve_library_remove))
self.delete_custom_button.setIcon(QIcon(resource_library.Icon.library_remove))
self.description = QLabel("<description>")
self.description.setFont(font)

self.description.setAlignment(Qt.AlignCenter)
self.snapshot_button = QPushButton("Create Snapshot")
self.snapshot_button.setEnabled(False)
self.snapshot_button.setIcon(QIcon(resource_library.Icon.curve_library_snapshot))
self.snapshot_button.setIcon(QIcon(resource_library.Icon.library_snapshot))
self.parameters_button = QPushButton("Edit Parameters")
self.parameters_button.setEnabled(False)
self.parameters_button.setIcon(QIcon(resource_library.Icon.curve_library_edit))
self.parameters_button.setIcon(QIcon(resource_library.Icon.library_edit))
# Initial Image Update
self.update_preview_image()

Expand Down
2 changes: 1 addition & 1 deletion gt/tools/curve_to_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
from gt.ui import qt_utils

# Tool Version
__version_tuple__ = (2, 0, 0)
__version_tuple__ = (2, 0, 1)
__version_suffix__ = ''
__version__ = '.'.join(str(n) for n in __version_tuple__) + __version_suffix__

Expand Down
2 changes: 1 addition & 1 deletion gt/tools/curve_to_python/curve_to_python_controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def run_python_code(self):
Attempts to run the code found in the "Python Output" box.
"""
_code = self.view.get_python_output_text()
execute_python_code(code=_code, user_maya_warning=True)
execute_python_code(code=_code, use_maya_warning=True, import_cmds=True)

def save_python_to_shelf(self):
"""
Expand Down
2 changes: 1 addition & 1 deletion gt/tools/influences_to_python/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


# Tool Version
__version_tuple__ = (2, 0, 1)
__version_tuple__ = (2, 0, 2)
__version_suffix__ = ''
__version__ = '.'.join(str(n) for n in __version_tuple__) + __version_suffix__

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def run_python_code(self):
Attempts to run the code found in the "Python Output" box.
"""
_code = self.view.get_python_output_text()
execute_python_code(code=_code, user_maya_warning=True)
execute_python_code(code=_code, use_maya_warning=True, import_cmds=True)

def save_python_to_shelf(self):
"""
Expand Down
35 changes: 35 additions & 0 deletions gt/tools/mesh_library/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
"""
Mesh Library
github.com/TrevisanGMW/gt-tools - 2023-09-08 (converted from Sphere Types - 2020-11-04)
"""
from gt.tools.mesh_library import mesh_library_controller
from gt.tools.mesh_library import mesh_library_model
from gt.tools.mesh_library import mesh_library_view
from gt.ui import qt_utils
import logging

# Logging Setup
logging.basicConfig()
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)

# Tool Version
__version_tuple__ = (1, 0, 0)
__version_suffix__ = ''
__version__ = '.'.join(str(n) for n in __version_tuple__) + __version_suffix__


def launch_tool():
"""
Launch user interface and create any necessary connections for the tool to function.
Entry point for when using this tool.
Creates Model, View and Controller and uses QtApplicationContext to determine context (inside of Maya or not?)
"""
with qt_utils.QtApplicationContext() as context:
_view = mesh_library_view.MeshLibraryView(parent=context.get_parent(), version=__version__)
_model = mesh_library_model.MeshLibraryModel()
_controller = mesh_library_controller.MeshLibraryController(model=_model, view=_view)


if __name__ == "__main__":
launch_tool()
Loading

0 comments on commit 11d7b6d

Please sign in to comment.