Notifications
Clear all

[Closed] oh, yet another question

The thing I really want to do is this:
I want to set the animation range to correspond with the cameras name; e.g. camera_0100_0350 sets the animation interval to 100 350. does anyone have a clue?

5 Replies

you first have to parse through the name of the camera (search for the String Functions in the reference, i think filterString is what you need here) and then do a
animationRange = (interval StartFrame EndFrame)

thanks a lot cthulhu. I’ll try it right away! It was something like this I was looking for, just didn’t know where to look.

I got a little bit on the way. The help you provided, Cthulhu was extremely useful.
I got this far:
The dropdown corresponds with the cameralist, but I can only get the cameras as array to work as single string. How do I divide it to seperate strings for each camera in the list?

Can not stress the fact that I’m like an infant at these things, but its been great fun so far. Please help. I’, so determined to fix this problem.

/ t

 PEN

try this code on for size

<code>
camName=mycamera.name
nameArr=filterString camName “_”
stTime=(nameArr[2] as integer)
stEnd=(nameArr[3] as integer)
animationRange=(interval stTime stEnd)
</code>

well, mr PEN, you are the sh*t! I really got it now, and I understand it! :bowdown: :bowdown: :bowdown:
to make it work as I wanted, I had to make a button that executed this script:

(
mycamera = viewport.getCamera()
camName = mycamera.name
nameArr = filterString camName “_”
arStart = (nameArr[2] as integer)
arEnd = (nameArr[3] as integer)
animationRange = (interval arStart arEnd)
)

the only flaws is that I have to have the camera viewport active. I really would like it to be connected to a dropdownlist of all the cameras available in the scene.

I’m going to try on my own, but if you got any pointers, I would be greatful. As I said before, I’m having trouble with cameras as array, as it is returned to med as one string, and I want it as a list of strings or something, if you catch my drift.