PDA

View Full Version : oh, yet another question


tobe90
03-05-2004, 08:39 AM
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?

Cthulhu
03-05-2004, 03:29 PM
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)

tobe90
03-06-2004, 06:33 AM
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.

tobe90
03-06-2004, 08:35 AM
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
03-08-2004, 07:04 PM
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>

tobe90
03-09-2004, 07:32 AM
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.

CGTalk Moderation
01-17-2006, 04:00 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.