The error AttributeError: 'NoneType' object has no attribute 'par' indicates that the script is not able to find the replicator1 operator, resulting in a None value when you try to access its parameters.
This can happen if the path to the replicator1 operator is incorrect. Double-check the path and ensure it’s accurate.
Here’s a revised approach with additional debugging to ensure we are getting the correct path:
-
Verify the replicator path: Make sure the path to the replicator1 is correct. You can do this by using the op() function in a Text DAT to see if it returns the replicator operator.
-
Add debugging prints: Add some print statements to the script to debug the issue.
Here’s an updated script with additional debugging:
def onValueChange(channel, sampleIndex, val, prev):
# Debugging: Print the path we're trying to access
print("Trying to access /project1/TYPOGRAPHY_V2/arranging_text/replicator1")
# Get the replicator component
replicator = op('/project1/TYPOGRAPHY_V2/arranging_text/replicator1')
# Debugging: If the replicator is not found, print an error message
print("Error: Could not find replicator at /project1/TYPOGRAPHY_V2/arranging_text/replicator1")
# Pulse the 'Recreate All Operators' parameter
replicator.par.recreatealloperators.pulse()
print("Recreate All Operators pulsed")
If you still encounter issues, ensure that the path /project1/TYPOGRAPHY_V2/arranging_text/replicator1 is correct. You can manually verify the path by navigating through the TouchDesigner network editor.
If the path is correct and the issue persists, consider the following:
- Check for correct network structure: Ensure that the replicator operator is actually placed at the specified path.
- Check operator availability: Make sure the replicator operator exists and is not deleted or renamed during the process.
This script should provide more insights into what is going wrong if the operator cannot be found.