[:arrow_left:](/WQum2tYYSXGaBjnU2wMxzQ)To Pirata Dashboard
[:arrow_left:](/FQqugZ49RLOLDOdm0Z1GlQ?both)To TD Dashboard
# **Libraries** TD_Pirata
###### tags: `TD` `to-do` `Roadmap TD`
## ELTS
:::warning
**elts_read**
:::info
- [x]**get_file_informations(filePath=None)**
:::spoiler
Get the file path, file name, raw name and extension of current maya file / or the file you've specified
:return: filePath, fileName, rawName, extension
:rtype: 4 strings
:::
- [x]**list_broken_paths(pathList)**
:::spoiler
WIP: The script should work without pathList by listing filepath, abcpath, proxypath etc. itself. Use existing methods to get them
:return a list with all broken path in pathList
:param: a list of path
:rtype: list
:::
- [ ]**get_shot(myScenePath=None)**
:::spoiler
:return shot
:if myScenePath=None: use path, else: use current scene name
:rtype: string
:::
- [ ]**get_episode(myScenePath=None)**
:::spoiler
:return episode
:if myScenePath=None: use path, else: use current scene name
:rtype: string
:::
- [ ]**get_shotname(myScenePath=None)**
:::spoiler
:return: shotName = episode + '_' + shot
:if myScenePath=None: use path, else: use current scene name
:rtype: string
:::
- [x]**get_timeline_framerange()**
:::spoiler
:return startFrame and endFrame
:rtype: 2 integers
:::
- [x]**get_render_framerange(shotName=None)**
:::spoiler
WIP: if shotName: get framerange from shot(shotgun?), else: get render framerange from current scene
:return startFrame and endFrame
:rtype: 2 integers
:::
- [x]**list_namespaces()**
:::spoiler
:return a list of all non default namespaces
:rtype: list
:::
- [x]**list_references()**
:::spoiler
:return a list ref in scene
:rtype: list
:::
- [x]**get_reference_path(myReference)**
:::spoiler
:return the path from myReference
:rtype: string
:::
- [x]**is_reference_exists(referencePath)**
:::spoiler
:return True or False if file exists or not
:rtype: bool
:::
- [x]**get_reference_infos()**
:::spoiler
Return all ref with their path and check if file exists or not
:return a dictionary {reference:[referencePath, bool]}
:rtype: dict
:::
- [x]**list_dag_assets(maya_type=None)**
:::spoiler
Return a list of dag assets from maya_type
:rtype: list
- [x]**list_non_dag_assets()**
:::spoiler
Return non dag assets list
:rtype: list
:::
- [x]**non_default_nodes_only(list_nodes)**
:::spoiler
Return non default nodes in list
:rtype: list
:::
- [x]**list_default_nodes()**
:::spoiler
:return default nodes
Some default nodes in our scene are not listed by dn, see defaultHardcodeNodes + list_default_cams_maya()
:rtype: list
:::
- [x]**list_nurbs()**
:::spoiler
:return a list of all nurbs in scene
:rtype: list
:::
- [x]**get_shortname(longName)**
:::spoiler
:return : shortname
:rtype: string
:::
- [x]**list_unknown_nodes()**
:::spoiler
:return a list of all unknown nodes
:rtype: list
:::
- [x]**list_all_shapes(nodeList=None)**
:::spoiler
:return all_shapes: list of shapes longname found in nodeList / found in scene
:rtype : list
:::
- [x]**list_all_meshes(nodeList=None)**
:::spoiler
:return all_meshes: list of meshes longname found in nodeList / found in scene
:rtype: list
:::
- [x]**list_wrong_mesh_names()**
:::spoiler
Get the meshes with the name doesnt end with _Msh
:rtype: list
:::
- [x]**get_shape_or_transform(element)**
:::spoiler
Tip: if return = shapes: you should check if return is a string or a list to avoid error
:if element = shape: return transform: parentFound
:if element = transform: return shape: shapeFound/listOfShapes
:if more than one shape found: return a list of shapes [myShape,myShapeOrig...]
:rtype: string or list
:::
- [x]**get_renderstats(myElementList, #args)**
:::spoiler
#args=>*args (hackmd syntax issue)
WIP: Return a dict of specified statements *args/kwargs
Get renderstats of each mesh from myElementList
Allowws the user to get all renderstats from one object or all objects with a specific renderstat value
:param myElementList: must be a list of shapes
:return statementsDictToReturn: a dictionary of all the boolean values of render stats from myElementList {myMesh:{stat1:bool, stat2:bool}, }
:rtype: dict
:::
- [x]**get_transform_info(myObjectList)**
:::spoiler
:param: myObjectList: must be a list of shapes transforms
:return a dict of myObject x/y/z translate/rotate/scale
{element: {t: [x,y,z],r:[x,y,z],s[x,y,z]}}
:::
- [x]**is_displacement(shape)**
:::spoiler
Return True or False if displacementShader connected to shadingEngine
It does not work with initialShadingGroup connection
:rtype: bool
:::
- [x]**get_bbs_displacement(shape)**
:::spoiler
:return a list of Bounding Box Scale displacement of a shape
:rtype: list
:::
- [x]**get_nb_of_component_of_mesh(meshElement, co_type)**
:::spoiler
Get co_type polycount of meshElement
:param co_type: vtx, edge, face, uv
:return nb_of_elmt
:rtype: integer value
:::
- [x]**get_nb_of_component(meshesList, co_type)**
:::spoiler
Get co_type polycount of meshesList
:param co_type: vtx, edge, face, uv
:return compon_of_obj {meshName:vertexNumber, meshName2:vertexNumber2}
:rtype: dict
:::
- [x]**get_meshes_polycount_dict(meshesList)**
:::spoiler
WIP: Using *args should be a better idea (When done, remove get_nb_of_component_of_mesh from this script)
Get vertex/edgesz/faces/uvs polycount of each mesh from meshesList
:param meshesList: should be a list of mesh transforms
:return dictToReturn: a dict of meshes polycount {mesh01:{vtx:999,edge:999,face:999,uv:999}...}
:rtype: dict
:::
- [x]**get_top_node()**
:::spoiler
Get top node of scene
:rtype: list
:::
- [x]**list_all_groups()**
:::spoiler
Get groups in scene, except top node.
:return groups
:rtype: list
:::
- [x]**is_group()**
:::spoiler
Check if node is a group
:rtype: Bool
:::
- [x]**get_empty_transf()**
:::spoiler
Get empty transform/grp.
:return empty_grp
:rtype: list
:::
- [x]**list_shading_groups()**
:::spoiler
Get all shading groups / shading engine
:rtype: list
:::
- [x]**get_shader_from_shape(myShape)**
:::spoiler
:return a list a the shader(s) connected to myShape
:logging: if more than 1 shader found: logging.error
:rtype: list
:::
- [x]**list_materials(shapeSelection=None)**
:::spoiler
This function lists all non default materials
Or non default materials connected to shapeSelection
:param: shapeSelection can be a list or unique element
:rtype: list
:::
- [x]**get_assigned_materials()**
:::spoiler
Get assigned materials on mesh
:rtype: list
:::
- [x]**get_file_texture_infos(shader=False, filesList=None)**
:::spoiler
Get the path of the file texture in scene or filesList
Get the shaders connections if needed
:param: shader: boolean, True: if you want the name of connected shaders
:param: filesList: list of files nodes,
:return dictToReturn {u'myTextureNode': [u'myTexturePath/myTexture.tx', [u'myShader1, myShader2']]}
:return: if shader=False: {u'myTextureNode': [u'myTexturePath/myTexture.tx']}
:rtype: dict
:::
- [x]**list_default_cams_maya()**
:::spoiler
:return default camera
:rtype: list
:::
- [x]**list_non_default_cameras()**
:::spoiler
:return: all non default camera in scene
:rtype: list
:::
- [ ]**list_anim_layers()**
:::spoiler
:return a list of all anim layers
:rtype: list
:::
- [ ]**list_abc_info()**
:::spoiler
WIP: should return a dict {nodeName: filePath, ...}
:rtype: dict
:::
- [x]**list_animated_nodes()**
:::spoiler
:return: all nodes connected to animCurves
:rtype: list
:::
- [ ]**list_non_animated_nodes()**
:::spoiler
:return a list of all non animated element
:rtype: list
:::
- [x]**list_set_members(sel_set)**
:::spoiler
List object in selection set.
Check if not none, and exists, and return long name of objects.
:return obj_in_set : Return obj (long names) in sets.
:rtype : list
:::
- [ ]**get_proxy_infos()**
:::spoiler
WIP: Depends of render engine
:return a dict with of proxy nodes name, path and a bool
:rtype: dict
:::
- [ ]**list_render_engine_light(renderEngine)**
:::spoiler
:return: renderEngineLightsType
:rtype: list
:::
- [ ]**list_light()**
:::spoiler
WIP: It will depend of render engine / lghtshapes have different names from one engine to another
Nedd to list renderengine lights type with list_render_engine_light()
:return a list of all lights in scene
:rtype: list
:::
- [ ]**get_shadowlink_lightlink(myLight,myObj)**
:::spoiler
:return 2 booleans: lightLink and shadowLink
:param: myObj: unique element or set
:::
- [x]**get_current_renderer()**
:::spoiler
Get the current renderer and those who are available.
:return current_render, avail_renderers
:rtype: string, list
:::
- [x]**list_display_layers()**
:::spoiler
:return a list of all display layers
:rtype: list
:::
- [x]**list_render_layers()**
:::spoiler
:return a list of all render layers
:rtype: list
:::
- [x]**list_aovs()**
:::spoiler
WIP: Depends of the render engine
:return a list of aovs
:rtype: list
:::
:::
## Utils
:::warning
**manage_Utils**
:::info
- [ ]**load_plugin(pluginFile)**
:::spoiler
WIP: find a way to load plugin with name part if endswith!=".mll", need to get all loaded/unloaded plugins from maya
WIP: if pluginFile="abc", load plugin with "abc" in their name: "AbcExport.mll" and "AbcImport.mll"
WIP: if pluginFile="a", should load all plugin with "a" in their file name
:param: pluginFile: string, exact plugin name, eg 'AbcExport.mll'
WIP: find a way to load plugin with name part if endswith!=".mll", need to get all loaded/unloaded plugins from maya
WIP: if pluginFile="abc", load plugin with "abc" in their name: "AbcExport.mll" and "AbcImport.mll"
WIP: if pluginFile="a", should load all plugin with "a" in their file name
:param: pluginFile: string, exact plugin name, eg 'AbcExport.mll'
:::
- [ ]**unload_plugin(pluginFile)**
:::spoiler
WIP: same way as load_plugin
:param: pluginFile: string, exact plugin name, eg 'AbcExport.mll'
:::
- [ ]**viewport_off()**
:::spoiler
Disable viewport
:::
- [ ]**viewport_on()**
:::spoiler
Enable viewport
:::
- [ ]**manage_viewportpanels()**
:::spoiler
Manage viewport panels
:::
- [ ]**unlock_display_layers()**
:::spoiler
Unlock non default display layers
:::
- [ ]**unlock_transform(transformList=None)**
:::spoiler
Unlock attr of transformList, if None: unlock attr from current selection
:::
- [ ]**unsmooth_meshes(meshes, state)**
:::spoiler
Disable or enable smooth mesh preview.
:::
- [ ]**calcultate_bbs_displacement(shape, override=False)**
:::spoiler
WIP: should check if shape has displace before
Calculate bounding box scale for displacement
:::
- [ ]**set_renderer(myRenderer)**
:::spoiler
WIP: edit=>if myRenderer=None, set the renderer to a default one, redshift? mayasoftware?
Specify the exact name of your renderer
:::
- [ ] **restore_render_settings(renderer='mayaSoftware')**
:::spoiler
Set currentRenderer to renderer
Restore Render Settings UI
:::
- [ ] **clean_render_layers()**
:::spoiler
Delete non default renderLayer setup and legacy
:::
- [ ] **store_into_set(meshes, set_name)**
:::spoiler
Store the meshes in a selection set if it's more than a mesh.
:::
- [ ] **add_to_set(elementList, setName)**
:::spoiler
Add a list of object to specified set
:::
- [ ] **delete_sets(setsList=None)**
:::spoiler
Delete selected sets arg: cmds.ls(sl=True, set=True)
:::
- [ ] **remove_from_sets(elementList, setName)**
:::spoiler
Remove elementList from a set
:::
- [ ] **delete_objects(shapesList)**
:::spoiler
Delete shapesList (shapes and transforms)
:param: shapesList must be shapes list
:::
- [ ] **delete_unused_nodes()**
:::spoiler
Delete unused shading nodes
:::
- [ ] **delete_unknown_nodes()**
:::spoiler
Check for unknown nodes, delete them
:return: None if unknown nodes has been successfully deleted.
:return: the list of undeletable unkown nodes
:::
- [ ] **rename_top_node()**
:::spoiler
Rename top group with scene name.
Eg: {ASSET_NAME}_MDL_Grp
:::
- [ ] **increment_name()**
:::spoiler
Create a new name for clashing names and return it.
Based on pattern: _\d\d\d_
:param name: name of mesh who need to be checked.
:type: string
:return: final_name
:rtype: string
:::
- [ ] **rename_obj()**
:::spoiler
Rename the object with increment if exists
Must be SHORT NAME
:::
- [ ] **get_prefix()**
:::spoiler
Return prefix of string or None
:::
:::