Resource
The base class for resources managed across Disguise sessions.
Resources are synchronised between machines in a session, and saved and loaded as part of a .d3 project file.
Category: Resources
Base class: _BlipValue
Subclasses: ActiveIPVideoInGroup, ActiveScreenRegion, AlignmentCoordinate, AlignmentData, AlignmentPoint, AlignmentPointToCoordinates, AnimationAxisSettings, Arrow, AudioFile, AudioFileHeader, AudioLine, AudioLink, AudioOutDevice, AudioOutDeviceMap2, AudioOutputs, AudioTrack, AutoSoftEdgeProfile, AutomationAxisValue, CDL, CDLContainer, CalibratedPoint, CalibrationLutMapping, CameraBookmark, CameraBookmarkState, CameraCalibration, CameraCalibrationObservation, CameraCommand, CameraPosition, CaptureViewSettings, ClusterAssigner, ClusterPool, ColourProfile, ColourShift, ColourWheel, ControlPatch, ControlString, Cue, CustomTiming, D3NetManager, D3SSIAxis, D3State, DVIMatrixCommand, DeformStack, DeformStackItem, Device, DeviceManager, DeviceMap, DeviceMapping, DfxFile, DisplayImageSourceMapping, DmxAssignRule, DmxBank, DmxCommand, DmxDriverSpecificOptions, DmxDummyPersonality, DmxLibrary, DmxObjectSet, DmxPatchSet, DmxString, DxTexture, EngineSettingsResource, EventTransport, Expression, FeedHeadConfig, FeedRect, FeedScene, FieldSequence, FifoDataSeries, Fixture, FixtureAssigner, FixtureDriver, FixtureDriverInfo, FixtureRotation, FixtureTarget, GraphDescriptor, GraphThreshold, HardwareIdentifier, HttpControlHeader, HttpControlRequest, IndirectionController, KeyContainer, LampController, LampTester, LayerColourRule, LayerColourRuleSet, LayerStack, LedModule, LocalState, LogicalDevice, LutFile, Machine, MachineMediaFile, MachineMediaRegistry, ManualAlignmentPlan, MediaFileHeader, MetaField, MetricMonitor, MidiControlSet, MidiControlSetEntry, MobileCameraReference, Module, ModuleConfig, MultiChannelClusterAssignerBase, MultiEventTransport, Node, NotchObjectArray, Note, OSCSender, Object, ObjectTrackingSource, OcioConfig, OptiCalStagePlan, OptiCalStepResult, OpticalCalibrator, OscArgument, OscCommand, PanTiltController, ParameterCollection, PersistentIPVideoIn, PlayHead, PlaybackStatusDriver, PlaybackStatusMonitor, PrefetchLookaheads, Primary, PrivateState, Product, Projection, ProjectorConfig, ProjectorControlCommand, ProjectorControlCommands, ProjectorControlPreset, ProjectorPreset, ProjectorPresets, ProxyMakerSettings, ProxySettings, QuickAlignViewSettings, QuickSelectSlots, RecordingFile, RecordingTake, ReferencePointSet, RemoteStream, RenameTableSetting, RenderStreamAsset, RenderStreamClusterBase, RenderStreamMachine, RenderStreamMachinesList, ScreenAxisExpression, ScreenConfiguration, ScreenPositionAxis, ScreenPositionDriver, ScreenPositionDriverDistributor, SequenceGroup, SerialCommand, SetList, SinglePoseCalibratedPoint, SockpuppetPersonality, SockpuppetPersonalityRegistry, SockpuppetPersonalitySet, SockpuppetProperty, SockpuppetPropertyOption, SoftEdgePoint, Space, SpatialCalibrationConfig, StageRenderSettings, SuperLayer, SuperTrack, SuperTransportManager, Table, TextFont, TimecodeTransport, TrackPlayer, TrackingItem, TransportJumpCommand, TwoPoint5DFile, UnusedMediaList, VFCDevice, VFCDeviceMap, VFCIPNetConfig, VFCPortConfig, VFCTxIPDestination, VRSettings, VideoAsset, VideoClip, VideoFile, VideoFileHeader, VideoFragment, VideoInCaptureProcess, VideoInFormat, VideoRegionSet, WebBookmark, WebCommand
Properties
description : str (Read-Only)
A string describing the resource. This is the filename from the path, if it is not empty, otherwise the type name of the class. Derived resource classes can override the behaviour to return more appropriate information.
descriptionExtended : str (Read-Only)
A more detailed description of the Resource, including its status.
extFileSize : int (Read-Only)
The size of the external file in bytes.
isBad : bool (Read-Only)
Whether the resource is bad. This can be for various reasons, such as the resource not existing or failing to activate.
isBeingEdited : bool
Whether the resource is currently being edited.
isDirty : bool (Read-Only)
Whether the resource has been modified since it was last saved.
isInError : bool (Read-Only)
Whether the resource is in error. Resources which are bad, incomplete or not found locally are considered “in error”.
isIncomplete : bool (Read-Only)
Whether the resource is incomplete. This could happen if a resource is only partially loaded, for example.
isNotFoundLocal : bool (Read-Only)
Whether the resource is not found on the local machine.
locked : bool (Read-Only)
Whether the resource is currently locked.
path : Path
The path of the resource.
This may be a relative path to a file which exists on-disk in the project folder, or a path to an internal resource within the project.
Paths to internal resources are generally of the form objects/[class]/[name].apx, e.g. objects/camera/cam1.apx.
tags : List[ResourceTag] (Read-Only)
uid : int (Read-Only)
The unique identifier for the resource.
userInfoPath : str (Read-Only)
The relative path of this resource, suitable for displaying to the user.
writeDateStamp : DateStamp (Read-Only)
The date stamp of when the resource was last written to.
Constructors
__init__(self)
Methods
activate(self) -> bool
Activates the resource.
This method performs any initialisation required for a resource.
It is called when the resource first loads, and when its values are updated across a session via Resource Transport.
addTag(self, tag: ResourceTag)
Adds a tag to the resource.
Parameters:
- tag: The tag to add.
copy(self) -> Resource
Deep copy the resource.
Creates a resource of the same type, copies into it, and returns the copy.
Note that this does not set the path of the new Resource - in general the “duplicate” function is a safer way to copy resources.
Returns A new resource instance with the same data as this one.
duplicate(self, p: Path) -> Resource
Duplicates the resource.
Performs a deep copy of the original resource and returns a new resource with the same data as the original, at the given path.
Parameters:
- p: The path of the duplicated resource. If this parameter is empty or already exists in the resource manager, an exception is thrown.
Returns A new instance of the resource with the same properties as the original and path p.
findResourcesPointingToThis(self, type: Type) -> List[Resource]
Finds resources that point to this resource.
This method finds all resources of a particular type that have a reference to this resource.
Parameters:
- type: The type of resources to find.
Returns A vector of the found resources which reference this resource.
hasTag(self, name: str) -> bool
Checks whether the resource has a specific tag.
Parameters:
- name: The name of the tag to check for.
Returns True if the resource has the specified tag, false otherwise.
lock(self)
Locks the resource.
This method locks the resource, preventing users from editing its properties.
moveToTrash(self)
Move the resource to the trash.
notifyChange(self, field) -> Any
Notify the resource that a property has changed.
This method is called when a property has changed that might require some further computation.
Parameters:
- field: The info of the field for the property which has changed.
notifyCreate(self)
Notify creation of a resource.
This method runs when the resource is first created, but not when it is loaded from disk subsequently.
reloadExternal(self)
Reload the external resource metadata and data from disk.
removeTag(self, tag: ResourceTag)
Remove a tag from the resource.
Parameters:
- tag: The tag to remove.
rename(self, p: Path)
Renames the resource.
Parameters:
- p: The new path for the resource.
save(self)
Save the resource to disk immediately.
saveOnDelete(self)
Mark the resource to save to disk on deletion of the resource.
saveOnDeleteLocal(self, onOff: bool)
Sets whether this resource is saved locally to disk on deletion.
Parameters:
- onOff: Whether this resource should save to disk when it is deleted.
setIncomplete(self, onOff: bool)
Sets a resource to be incomplete which puts it in error
setLock(self, locked: bool)
Set the lock state of the resource.
Parameters:
- locked: The new lock state of the resource. If
true, the resource will be locked, otherwise it will be unlocked.
status(self) -> str
The current status of the resource.
unlock(self)
Unlocks the resource.
This method unlocks the resource, allowing users to edit its properties.