Seems like I need more help.
I tried to explore the concept of callbacks.
The first test was to add a custom rollout upon object creation. I failed already, but it works almost
cus = attributes testdef (
rollout customRoll "Custom Rollout" (
button removeMe "remove" width:150
button website1 "http://remusjuncu.com/" width:150
button website2 "remusjuncu.com/rappatools" width:150
on removeMe pressed do ( custAttributes.delete (Modpanel.getcurrentObject()) 1 )
on website1 pressed do ( shellLaunch "http://remusjuncu.com/" "" )
on website2 pressed do ( shellLaunch "http://remusjuncu.com/rappatools/" "" )
fn custAdd = (
for o in getCurrentSelection() do ( -- o = selection
if o.modifiers.count == 0 then ( custAttributes.add o cus ) else (
custAttributes.add o.modifiers cus -- o.modifiers.count
callbacks.addScript #sceneNodeAdded "custAdd()" id:#addCustomRollout;
Problem so far: When I create an object, it seems like nothing is added to it. If I create another object, a custom rollout is added to the previous one.
Like said, this is just a test but I wonder why it adds the rollout after a second object is made.
If you can help me to modify this script to give me an example of a callback that reacts with a certain modifier creation.