From 5672b3c1cd4043eadde6258f3c399a22050a3dc8 Mon Sep 17 00:00:00 2001 From: Guilherme Trevisan Date: Wed, 27 Sep 2023 16:20:11 -0700 Subject: [PATCH 1/4] Added studio background --- gt/utils/mesh_utils.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/gt/utils/mesh_utils.py b/gt/utils/mesh_utils.py index 662f129e..38302278 100644 --- a/gt/utils/mesh_utils.py +++ b/gt/utils/mesh_utils.py @@ -2,8 +2,8 @@ Mesh (Geometry) Utilities github.com/TrevisanGMW/gt-tools """ +from gt.utils.data.py_meshes import scale_volume, scene_setup from gt.utils import system_utils, iterable_utils -from gt.utils.data.py_meshes import scale_volume from gt.utils.data_utils import DataDirConstants from collections import namedtuple import maya.cmds as cmds @@ -665,6 +665,7 @@ def __init__(self): # Creatures/Bipeds scale_human_male = ParametricMesh(build_function=scale_volume.create_scale_human_male) scale_human_female = ParametricMesh(build_function=scale_volume.create_scale_human_female) + studio_background = ParametricMesh(build_function=scene_setup.create_studio_background) def print_code_for_obj_files(target_dir=None, ignore_private=True, use_output_window=False): From 968e90ea41e23097740b7669cd25f8f9f2034a72 Mon Sep 17 00:00:00 2001 From: Guilherme Trevisan Date: Wed, 27 Sep 2023 16:20:29 -0700 Subject: [PATCH 2/4] Created thumbnail for studio background parametric mesh --- .../preview_images/studio_background.jpg | Bin 0 -> 12153 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 gt/utils/data/py_meshes/preview_images/studio_background.jpg diff --git a/gt/utils/data/py_meshes/preview_images/studio_background.jpg b/gt/utils/data/py_meshes/preview_images/studio_background.jpg new file mode 100644 index 0000000000000000000000000000000000000000..8c7c93c640b36588581802e099d3010175f9b348 GIT binary patch literal 12153 zcmeHtcUY6%w&xoHMp3{5N{<45AP9&^6-ZENq5>+tDX26Nk=_yz1wkNEMFfH(0#YKq zHz`2`0t5-2kVx-6gpf=;=bo86GvAzh?tSk3_pK)@PqN?r?!DJuzg2c&3^Ito(d*i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-PUtr34sg0C1C`bS#)nSKJ`c< z)vK*xTWpU}UYnG!Iy5gyGJqEPCBg&6;ajm;aJMI?RL0c4D4UV_9{GF={#0aqq`6-M zN;^#{*wg%eAny>mv4Qgmd#9Rpo<+ro*PvN0Y)J7zSi;3}lj)mZJrbR+Ct!M4UQB@N zg#u6E&lauPL{H71YR|M>)A&p_T+?~Q2XD5ve#1E${f+nel^1cbg}2}u*Y}ef?iWBO zY31mn^>Sz5zOEPTlHE=#jFy+lVn!|Y&hFy;!j@xR{`rUG1zQE;r@|#m(7lp>o@e|^ zap^xB<37chi@5gcu2p=Iv+DOWWZkf~>iEQmcpS9oRj6~PVjx+rB3eeB<%Xy|^Tgzy zseu;Yt6kzonn>08=zKgK+28gDH0%&Y@+b2ShpeH!Q22{2bN*Z0oxSGSq(0RULKV;U zLvGM2d_Nr_P07M;f6mLGXmo4t4WxJz6m&gMHLPOS24`Rmf*}MI;R2%Vkkq8Zie}MKY!WC|3?gf8AJaAaYC`w literal 0 HcmV?d00001 From a4a26221152f1215a9b208b589cd19cd8ef11036 Mon Sep 17 00:00:00 2001 From: Guilherme Trevisan Date: Wed, 27 Sep 2023 16:20:39 -0700 Subject: [PATCH 3/4] Updated docstrings --- gt/utils/data/py_meshes/scale_volume.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gt/utils/data/py_meshes/scale_volume.py b/gt/utils/data/py_meshes/scale_volume.py index cf6693c4..5293f5ca 100644 --- a/gt/utils/data/py_meshes/scale_volume.py +++ b/gt/utils/data/py_meshes/scale_volume.py @@ -1,5 +1,5 @@ """ -Parametric Mesh Creation Scripts (Meshes with Logic or extra components) +Parametric Mesh Creation functions for Scale and Volume meshes (Meshes with Logic or extra components) """ from gt.utils.iterable_utils import round_numbers_in_list from gt.utils.data.py_meshes.mesh_data import MeshData From 93d0378a460e70f612740112b031899b105696af Mon Sep 17 00:00:00 2001 From: Guilherme Trevisan Date: Wed, 27 Sep 2023 16:20:47 -0700 Subject: [PATCH 4/4] Created studio background --- gt/utils/data/py_meshes/scene_setup.py | 74 ++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 gt/utils/data/py_meshes/scene_setup.py diff --git a/gt/utils/data/py_meshes/scene_setup.py b/gt/utils/data/py_meshes/scene_setup.py new file mode 100644 index 00000000..824893de --- /dev/null +++ b/gt/utils/data/py_meshes/scene_setup.py @@ -0,0 +1,74 @@ +""" +Parametric Mesh Creation for Scene Setup +""" +from gt.utils.data.py_meshes.mesh_data import MeshData +import maya.cmds as cmds +import logging + +# Logging Setup +logging.basicConfig() +logger = logging.getLogger(__name__) +logger.setLevel(logging.INFO) + + +def create_studio_background(name="studio_background", initial_scale=1): + """ + Creates a studio background mesh + Args: + name (str, optional): The name for the created mesh. + initial_scale (int, float, optional): Sets the initial scale of the mesh object + """ + selection = cmds.ls(selection=True) + plane_transform, poly_plane_node = cmds.polyPlane(name=name, w=1, h=1, sx=10, sy=10, ax=(0, 1, 0), cuv=2, ch=1) + + # Set attributes for the poly plane + cmds.setAttr(f"{poly_plane_node}.height", 40) + cmds.setAttr(f"{poly_plane_node}.width", 40) + cmds.setAttr(f"{poly_plane_node}.subdivisionsHeight", 50) + cmds.setAttr(f"{poly_plane_node}.subdivisionsWidth", 50) + + cmds.rename(poly_plane_node, f'{name}_polyPlane') + + # Create a bend deformer and set its attributes + bend_node_one, bend_handle_one = cmds.nonLinear(plane_transform, name=f'{name}_bendY', typ="bend", + lowBound=0, highBound=1, curvature=90) + + cmds.rotate(0, -90, 0, bend_handle_one, r=True, os=True, fo=True) + cmds.rotate(0, 0, 90, bend_handle_one, r=True, os=True, fo=True) + + bend_node_two, bend_handle_two = cmds.nonLinear(plane_transform, name=f'{name}_bendZ', typ="bend", + lowBound=-1, highBound=1, curvature=110) + + bend_handles = [bend_handle_one, bend_handle_two] + + cmds.rotate(0, -90, 0, bend_handle_two, r=True, os=True, fo=True) + cmds.rotate(-90, 0, 0, bend_handle_two, r=True, os=True, fo=True) + cmds.move(0, 0, 7, bend_handle_two, r=True) + + cmds.parent([bend_handle_one, bend_handle_two], plane_transform) + + cmds.move(0, 0, -10, plane_transform, r=True) + cmds.xform(plane_transform, piv=(0, 0, 11), ws=True) + cmds.move(0, 0, 0, plane_transform, a=True, rpr=True) # rpr flag moves it according to the pivot + + for handle in bend_handles: + cmds.setAttr(f'{handle}.v', 0) + + cmds.setAttr(f'{plane_transform}.sx', initial_scale) + cmds.setAttr(f'{plane_transform}.sy', initial_scale) + cmds.setAttr(f'{plane_transform}.sz', initial_scale) + + cmds.select(clear=True) + if selection: + try: + cmds.select(selection) + except Exception as e: + logger.debug(f'Unable to recover selection. Issue: {str(e)}') + + return MeshData(name=plane_transform, setup=bend_handles) + + +if __name__ == "__main__": + logger.setLevel(logging.DEBUG) + cmds.file(new=True, force=True) + create_studio_background()