cam.operators.chain_ops#

Fabex ‘ops.py’ © 2012 Vilem Novak

Blender Operator definitions are in this file. They mostly call the functions from ‘utils.py’

Classes#

CamChainAdd

Add New CAM Chain

CamChainRemove

Remove CAM Chain

CamChainOperationAdd

Add Operation to Chain

CamChainOperationUp

Add Operation to Chain

CamChainOperationDown

Add Operation to Chain

CamChainOperationRemove

Remove Operation from Chain

Module Contents#

class CamChainAdd[source]#

Bases: bpy.types.Operator

Add New CAM Chain

bl_idname = 'scene.cam_chain_add'[source]#
bl_label = 'Add New CAM Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera chain creation in the given context.

This function adds a new camera chain to the current scene in Blender. It updates the active camera chain index and assigns a name and filename to the newly created chain. The function is intended to be called within a Blender operator context.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the operation’s completion status,

specifically returning {‘FINISHED’} upon successful execution.

Return type:

dict

class CamChainRemove[source]#

Bases: bpy.types.Operator

Remove CAM Chain

bl_idname = 'scene.cam_chain_remove'[source]#
bl_label = 'Remove CAM Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the camera chain removal process.

This function removes the currently active camera chain from the scene and decrements the active camera chain index if it is greater than zero. It modifies the Blender context to reflect these changes.

Parameters:

context – The context in which the function is executed.

Returns:

A dictionary indicating the status of the operation,

specifically {‘FINISHED’} upon successful execution.

Return type:

dict

class CamChainOperationAdd[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_add'[source]#
bl_label = 'Add Operation to Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute an operation in the active camera chain.

This function retrieves the active camera chain from the current scene and adds a new operation to it. It increments the active operation index and assigns the name of the currently selected camera operation to the newly added operation. This is typically used in the context of managing camera operations in a 3D environment.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the execution status, typically {‘FINISHED’}.

Return type:

dict

class CamChainOperationUp[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_up'[source]#
bl_label = 'Add Operation to Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to move the active camera operation in the chain.

This function retrieves the current scene and the active camera chain. If there is an active operation (i.e., its index is greater than 0), it moves the operation one step up in the chain by adjusting the indices accordingly. After moving the operation, it updates the active operation index to reflect the change.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the result of the operation,

specifically returning {‘FINISHED’} upon successful execution.

Return type:

dict

class CamChainOperationDown[source]#

Bases: bpy.types.Operator

Add Operation to Chain

bl_idname = 'scene.cam_chain_operation_down'[source]#
bl_label = 'Add Operation to Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to move the active camera operation in the chain.

This function retrieves the current scene and the active camera chain. It checks if the active operation can be moved down in the list of operations. If so, it moves the active operation one position down and updates the active operation index accordingly.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the result of the operation,

specifically {‘FINISHED’} when the operation completes successfully.

Return type:

dict

class CamChainOperationRemove[source]#

Bases: bpy.types.Operator

Remove Operation from Chain

bl_idname = 'scene.cam_chain_operation_remove'[source]#
bl_label = 'Remove Operation from Chain'[source]#
bl_options[source]#
classmethod poll(context)[source]#
execute(context)[source]#

Execute the operation to remove the active operation from the camera chain.

This method accesses the current scene and retrieves the active camera chain. It then removes the currently active operation from that chain and adjusts the index of the active operation accordingly. If the active operation index becomes negative, it resets it to zero to ensure it remains within valid bounds.

Parameters:

context – The context in which the operation is executed.

Returns:

A dictionary indicating the execution status, typically

containing {‘FINISHED’} upon successful completion.

Return type:

dict