cgl.plugins.blender package¶
Subpackages¶
- cgl.plugins.blender.tasks package
- Submodules
- cgl.plugins.blender.tasks.anim module
- cgl.plugins.blender.tasks.bndl module
- cgl.plugins.blender.tasks.cam module
- cgl.plugins.blender.tasks.lay module
- cgl.plugins.blender.tasks.light module
- cgl.plugins.blender.tasks.mdl module
- cgl.plugins.blender.tasks.prev module
- cgl.plugins.blender.tasks.rig module
- cgl.plugins.blender.tasks.shd module
- cgl.plugins.blender.tasks.smart_task module
- cgl.plugins.blender.tasks.tex module
- Module contents
Submodules¶
cgl.plugins.blender.alchemy module¶
cgl.plugins.blender.alchemy_legacy module¶
cgl.plugins.blender.cgl_browser_widget module¶
cgl.plugins.blender.gui module¶
cgl.plugins.blender.lumbermill module¶
cgl.plugins.blender.magic_scene_description module¶
cgl.plugins.blender.main_window module¶
cgl.plugins.blender.msd module¶
cgl.plugins.blender.name_tests module¶
cgl.plugins.blender.utils module¶
adds buttons from a cgl menu config file to a blender menu
- Parameters:
menu_name (str) – name of the menu to add buttons to
cfg
- cgl.plugins.blender.utils.basic_playblast(path_object=None, appearance='smoothShaded', cam=None, audio=False)[source]¶
Creates a playblast of the scene.
- Parameters:
path_object
appearance
cam
audio
- Returns:
None
- cgl.plugins.blender.utils.build_default_structure(group, default_list=['FG', 'CAM', 'RIG'], namespace=None)[source]¶
- cgl.plugins.blender.utils.check_child_naming(selected=None, children=None)[source]¶
checks the naming of children of a selected node
- Parameters:
selected – the selected node
children – the children of the selected node
- Returns:
True if the naming is correct, False otherwise
- Return type:
bool
- cgl.plugins.blender.utils.clean_tt(task=None)[source]¶
Cleans up the turntable by deleting the camera and group node.
- Parameters:
task
- Returns:
None
- cgl.plugins.blender.utils.cleanup_file(task='mdl')[source]¶
finds the given task group and deletes everythin ecept for that locator
- Parameters:
task – task to keep in scene
keep_task
asset
- cgl.plugins.blender.utils.cleanup_scene_data(data_type)[source]¶
Deletes data that’s not currently linked to any object in scene , takes in bpy.data.type ie bpy.data.materials
- Parameters:
data_type – bpy.data.type ie bpy.data.materials
- cgl.plugins.blender.utils.confirm_prompt(title='title', message='message', button='Ok')[source]¶
standard confirm prompt, this is an easy wrapper that allows us to do confirm prompts in the native language of the application while keeping conventions
- Parameters:
title
message
button – single button is created with a string, multiple buttons created with array
- cgl.plugins.blender.utils.create_button_file(class_name, label, menu_name, cfg)[source]¶
Creates a Blender Button File on Disk.
- Parameters:
class_name (str) – name of the class
label (str) – label to appear on the button
menu_name (str) – name of the parent menu (CamelCase)
cfg
- cgl.plugins.blender.utils.create_collection(collection_name, parent=None)[source]¶
Creates a collection in current scene
- Parameters:
collection_name (str) – name of the collection to create
parent (str) – name of the parent collection
- cgl.plugins.blender.utils.create_env_light(tex_name)[source]¶
Creates an environment light with the specified texture.
- Parameters:
tex_name
- Returns:
None
- cgl.plugins.blender.utils.create_folders(path_object)[source]¶
Creates the folders for the given path object
- Parameters:
path_object – path object to create folders for
Creates a Menu File on Disk
- Parameters:
class_name (str) – name of the class
- cgl.plugins.blender.utils.create_object(name, type=None, parent=None, collection=None, namespace=None)[source]¶
- cgl.plugins.blender.utils.create_task_on_asset(task, path_object=None, version_up=False)[source]¶
Creates a task on disk based on path object
- Parameters:
task
path_object
type – type of task, mdl, shdr, rig, etc
- cgl.plugins.blender.utils.create_thumb(path_object, camera=None)[source]¶
Creates a thumbnail of the scene.
- Parameters:
path_object
camera
- Returns:
None
- cgl.plugins.blender.utils.create_tt(length, tt_object)[source]¶
Creates a turntable with frame range of 0-length, around the selected object.
- Parameters:
length
tt_object
- Returns:
None
- cgl.plugins.blender.utils.get_button_path(software, menu_name, button_name, menu_type='menus', cfg=None)[source]¶
- Parameters:
software (str) – software as it appears in cookbook designer.
menu_name (str) – CamelCase menu name
button_name (str) – CamelCase button name
menu_type (str) – menus, publish, shelves, context-menus
cfg
- cgl.plugins.blender.utils.get_current_camera()[source]¶
Returns the name of the current camera in the scene.
- Returns:
The name of the current camera.
- Return type:
str
- cgl.plugins.blender.utils.get_formatted_list(elements, first_item)[source]¶
Formats list for blender search mode
- cgl.plugins.blender.utils.get_frame_end()[source]¶
gets end frame from render frame range
- Returns:
end frame
- Return type:
int
- cgl.plugins.blender.utils.get_frame_range()[source]¶
gets the frame range of the scene
- Returns:
dictionary of frame range values
- Return type:
dict
- cgl.plugins.blender.utils.get_frame_start()[source]¶
gets starting frame from render frame range
- Returns:
start frame
- Return type:
int
- cgl.plugins.blender.utils.get_handle_end()[source]¶
gets the handle after the animation ends.
- Returns:
handle end
- Return type:
int
- cgl.plugins.blender.utils.get_handle_start()[source]¶
gets the handle before the animation starts
- Returns:
handle start
- Return type:
int
- cgl.plugins.blender.utils.get_materials_dictionary()[source]¶
creates a dictionary of the objects and the faces associated with that object
- Returns:
dictionary of the objects and the faces associated with that object
- Return type:
materials (dict)
- cgl.plugins.blender.utils.get_matrix(obj, query=False)[source]¶
Returns a matrix of values relating to translate, scale, rotate.
- Parameters:
obj
query
returns the menu path for a menu with the given name
- Parameters:
software (str) – software as it appears in cookbook designer
menu_name (str) – CamelCase menu name
menu_file (bool) – if True returns a menu path with a menu_name.py file
menu_type (str) – menus, publish, shelves, context-menus
cfg
- cgl.plugins.blender.utils.get_namespace(filepath)[source]¶
gets the namespace when creating a namespace
- Parameters:
filepath
current
- Returns:
namespace
- cgl.plugins.blender.utils.get_reference_meshes()[source]¶
- Returns:
a list of all top nodes of references in the scene
- cgl.plugins.blender.utils.get_selected_reference() list[source]¶
This function returns a list of reference nodes based on the currently selected objects in the scene.
- Returns:
a list of reference nodes that correspond to the selected objects in the scene. If no objects are selected, it returns None. If the selected objects do not belong to any references, it logs an error message and returns an empty list.
- Return type:
list
- cgl.plugins.blender.utils.get_top_nodes()[source]¶
Get the top nodes in blender that are not defaults
- cgl.plugins.blender.utils.hdri_widget()[source]¶
Creates a widget for selecting an HDRI map.
- Returns:
None
- cgl.plugins.blender.utils.keep_single_collections(obj, collection_name)[source]¶
Unlink object from all collections except the one specified
- Parameters:
obj – object to adjust
collection_name – name of the collection to keep
- cgl.plugins.blender.utils.load_plugin(plugin_name)[source]¶
Loads a plugin by name.
- Parameters:
plugin_name – The name of the plugin to load.
- Returns:
None
- cgl.plugins.blender.utils.parent_to_collection(obj, collection_name, replace=False)[source]¶
Parents object to collection
- Parameters:
obj – blender object
collection_name – name of the collection to parent to
replace – if True, replaces the object in the collection
- cgl.plugins.blender.utils.purge_unused_data()[source]¶
Deletes all the uneused data, ie data that’s not currently linked to any scene
- cgl.plugins.blender.utils.read_layout(outFile=None, linked=False, append=False)[source]¶
Reads layout from json file
- Parameters:
outFile (str) – path to json file
linked (bool) – if True, links the assets
append (bool) – if True, appends the assets
- cgl.plugins.blender.utils.read_materials(path_object=None)[source]¶
Reads the materials on the shdr task from defined from a json file
- cgl.plugins.blender.utils.rename_materials(selection=None, material_name=None)[source]¶
Sequentially renames materials from given object name if empty , renamed from selected object
- Parameters:
selection (list) – list of objects to rename materials from
material_name (str) – name of the material to rename to
- cgl.plugins.blender.utils.render(preview=False, audio=False)[source]¶
Renders the current scene.
Based on the task we can derive what kind of render and specific render settings.
- Parameters:
preview – determines if exr is used or not
audio – if True renders an mov and setups the audio settings
- cgl.plugins.blender.utils.reorder_list(items, arg='')[source]¶
Reorders list in order of importance, putting rig
- Parameters:
items – list of items to reorder
arg – item to put at the top of the list
- cgl.plugins.blender.utils.return_linked_library(collection)[source]¶
retrieves the linked libraries manually
- cgl.plugins.blender.utils.save_to_task(task)[source]¶
Saves a copy of the current file into a new version of the given task
- Parameters:
task
- cgl.plugins.blender.utils.select_reference(collection_name)[source]¶
Selects all objects in the specified collection.
Parameters: collection_name (str): The name of the collection to select objects from.
- cgl.plugins.blender.utils.set_subdivs(iterations=1, type_=1)[source]¶
- Parameters:
iterations – default is 1
type – 1: catclark, 0: None
Returns:
- cgl.plugins.blender.utils.setup_preview_viewport_display(object)[source]¶
set up the default viewport display color diffuse_color on materials
- Parameters:
color – Value of the color of the parent menu FloatProperty 4
selection