Notifications
Clear all

[Closed] updating labels in custom attributes

Hey there. I want to have a display on a custom attribute that tells me the length of a spline. In the CA script I have this:
label ‘Path length label’ (“Path length: ” + (curvelength $‘Spline’ as string)) align:#left offset:[0,4]
I keep getting an error when trying to apply it to an object. Can CAs have dynamically updating labels or do they have to be defined in some way?
:¬/

3 Replies

Hi brady I think i label is waiting a string to define the name in the CA , so i been trying
() little lines but it doenst work .

another posibilty should be have the label change by his properties .text when we change any other CA.

in my sample is a button But if the length on the spline is aasociated to a spinner or slider you can use on entered do or on changed do.

on this sample i have the spline call line01

attributes test
(
Parameters main rollout Params
(
)
Rollout Params “Custom Attributes”
(
label test_lb “the value :” align:#left offset:[30,0]
button check_bt “check length” width:70 height:20
on check_bt pressed do (
test_lb.text = “the value :” + (curvelength $Line01 as string)
)
)
)

take care

Hey there Luis!
I found that using a spinner instead of a label means I can use a script controller on it to get the spline’s length. Unfortunately it moves into semi dependency loop territory when I have the script controller use the spline as a node and the CA be on an object controlling the spline’s length. When I say semi dependency loop, I mean it’ll work but the object with the CA on it will only move in some coordinate systems. Weird…
Maybe I should try the old way of doing it and use “dependson” or your update button idea…
It’d still be nice to know how/if you can make dynamically updating labels.
:¬)

 PEN

Brad drop by my site and have a look at weak referencing and this will help with any dependancy loop problems that you might run into. Referencing a node directly will also slow your rig down even if there is no dependancy loop. There is also a bug in curveLength that causes to many reference calls and will also slow things down. If this is for a spline IK setup them just use the length of the bones to calc the length.