ScriptJobs?

ScriptJobs?

Anonymous
Not applicable
340 Views
5 Replies
Message 1 of 6

ScriptJobs?

Anonymous
Not applicable
Guys I am stuck !

I have a massive problem trying to do camera script-job. I want to get a callback everytime I move the camera using the alt+right / left button aka rotating or zooming.

I simple cmds.scriptJob(attributeChange=) does not do the trick as the camera attributes does not change unless you release the mouse button.

The built in may lodsystem uses some form of callback from the camera so it must excist !!

Any one got any ideas ?

Thanks

// Krister - Ava Studios
0 Likes
341 Views
5 Replies
Replies (5)
Message 2 of 6

lee.dunham
Collaborator
Collaborator
Hi Krister,

I've always had some difficulty using the attribute change trigger in scriptJobs, with unexpected results.
Would it be possible to use an expression and conditions instead?
0 Likes
Message 3 of 6

Anonymous
Not applicable
basically i need to trigger a function every time I move my camera or to be more specific every time the camera distance to a target changes.
0 Likes
Message 4 of 6

Anonymous
Not applicable
further information: I am doing my own lod system based on screenspace size =P
0 Likes
Message 5 of 6

lee.dunham
Collaborator
Collaborator
hmm you might be better off using a distanceBetween node instead of going by the attributes on a camera.

The script Job should be able to pick up the distanceBetween.distance attr and run from that?
I'm unable to test atm but give that ago.
0 Likes
Message 6 of 6

Anonymous
Not applicable
sorry no go

made a destancebetween node, connected camera and a sphere as input and runs

mc.scriptJob(attributeChange= )

unfortunate this still does not trigger the callback until I have let go of the mouse button.

If I only had a way of getting regular callbacks =(

I am starting to think that an evil while loop that runs every x frame is the option,, but its going to add a constant lag to maya =(
0 Likes