CGTalk > Software Specific Forums > Autodesk 3ds max > 3dsMax SDK and MaxScript
Login register
Thread Closed share thread « Previous Thread | Next Thread »
 
Thread Tools Search this Thread Display Modes
Old 09-04-2007, 10:54 PM   #1
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Lightbulb C++ developer needed quickly for small controller / plugin

Hi everyone,

I'm in a need of a C++ plugin developer within the next few days for a project I'm working on next week. I know development on a compiled plugin is significantly longer than a scripted plugin, but depending on the estimate I'm hoping my client will budget for this.

Essentially, I need a recompile / extension of the path controller to take a real world distance input, as opposed to a percentage input. I've done some scripted-controller tests and it works well, but I need the stability / ease of use of a compiled plugin.

I don't need multiple weighted splines supported, just the first one in the list if that makes it any easier.

Any takers, please reply to the thread!

Many thanks,
Dave
 
Old 09-05-2007, 11:24 AM   #2
Gravey
3D Dude
Joel Hewitt
Sydney, Australia
 
Join Date: Dec 2005
Posts: 879
I know you've asked for a plugin but do you really need one?

I have a script that should do what you need via a floating dialog. A video demo can be downloaded from here: Download Link (only 5.5 meg)
The video demo is in swf format. I strongly recommend using Swiff player to watch it as it works best. Swiff player is free and can be downloaded from here: Link
 
Old 09-05-2007, 11:44 AM   #3
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Hi Joel,

The key thing here is not the units of measurement; it's the distance along the spline as units not a percentage.

By having everything relative to 0 - 100 % ratio (as it is now), changing a spline's length results in an object's derived position changing. Not good when making adjustments to a spline on which there is an object that has already been animated!

If, however, the object's position along the path is calculated with regards to units along a path, the animator (me, in this case!) is free to adjust the spline's points after the object's current position along the spline and NOT have the object move.

Does that make what I want clear?

As I said, I already have a max scene with some wired CAs etc that proves this point - I just want it wrapped in a plugin to make animating easier.

Cheers,
Dave
 
Old 09-05-2007, 01:00 PM   #4
Gravey
3D Dude
Joel Hewitt
Sydney, Australia
 
Join Date: Dec 2005
Posts: 879
ah I see. Your idea would be quite useful. Unfortunatly i'm not a C++ dude at this stage though. Best of luck finding someone to help you out
 
Old 09-05-2007, 01:16 PM   #5
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
Hi Dave

I"m looking at the code right now. Luckily for you the code is in the public SDK, so anyone can modify it use it. i.e.

...\maxsdk\samples\controllers\path_cnstrnt.cpp

Anyhow, it looks like the underlying SDK already exposes some methods that I'll need, i.e. getting the Spline Length, interpolated poistions etc... So perhaps what is needed is a radio button that switches from percentage to absolute position along spline. And when switched to absolute position along spline, I think the weighting calculations should be left out.

I'll have to work on it tonight, since I have to go to work right now. PM me if you want to chat on IM during the day.

Chris Johnson.
 
Old 09-05-2007, 01:58 PM   #6
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Hey Chris,
Nice to hear from ya!

I was doing some ideas-crunching before and supposed that the toggle thing may not work, as in the track view, the vertical scale would need to to go up as high as there were units in the spline.

Essentially (with regards to percentage) the fcurve is scaled inversely in the vertical axis as the spline is lengthened. Suppose you start with a 100 unit spline and an animation from end to end:

  • Spline length = 100
  • fcurve values = 0 - 100
Then if you changed the spline length to 200 units:
  • Spline length = 200
  • fcurve values = 0 - 50
Does that make sense?


I don't know if you would/could dynamically scale the values with the radio toggle, or if you'd need a separate track (I suspect you would).

Anyway, I really appreciate you taking a look at it, and I can't wait to see what you come up with!

Cheers,
Dave

Last edited by davestewart : 09-05-2007 at 02:06 PM.
 
Old 09-05-2007, 02:49 PM   #7
eek
Fixer
 
eek's Avatar
portfolio
Charles Looker
Snr Technical Artist
Electronic Arts
Vancouver, Canada
 
Join Date: Feb 2002
Posts: 4,221
With curve math, your basically asking for a value along the curve to stay at that value even if it changes. This is remarkably easy to do, you take the value you want and divide it by curvelength() of the curve. So:

10/100 = 0.1
10/200 = 0.05

Then take this value and multiply it by 100 - The 10 value could be animated.
__________________
Disclaimer: My opinions are not those of my employer.


 
Old 09-05-2007, 07:35 PM   #8
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Yeah, as I said the maths is pretty straightforward. It's just the SDK dependancies I'm hoping won't throw a spanner in the works.

Nice site BTW
 
Old 09-06-2007, 02:12 PM   #9
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
Ok, here is the progress so far. I got back pretty late last night, so I had to work on it this morning. I have hooked up the UI, and plugged the options into the parameter block. I have attached an image showing the results. I'll have to work on it tonight when I get home again, I just have really limited time, but I'll see if I can't finish it up tonight again.


Chris J.
Attached Images
File Type: jpg path_constraint_1.jpg (95.4 KB, 46 views)
 
Old 09-06-2007, 03:00 PM   #10
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Very exciting results Chris!

How does it look in the track view? I'm looking forward to actually editing that fcurve in real units!

One thing I would say is how does it work with a freehand spline when you edit one of the points? Does the object's position update on the fly, or do you need to scrub the timeslider or such like?

Looking great so far though! Your efforts will be very much appreciated,

Cheers,
Dave
 
Old 09-07-2007, 07:40 AM   #11
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
Well, it looks like it's finished. However there is a pesky little hurdle I have to overcome to finish implementing it. More tomorrow, I'm tired.

Chris J.
 
Old 09-07-2007, 08:20 AM   #12
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
Argh! There's always pesky hurdles to overcome, aren't there?
If you want to ping me the dlc I'll PM you with my email.
All good Robin Hood.
 
Old 09-08-2007, 02:53 AM   #13
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
Ok, I have implemented the distance parameter, and it works well. Pesky little snag was easily overcome. So... peruse the attached picture for the new layout. The controller now has both a percentage and distance parameter that work at the same time.

However... (suprised huh? )

It's integration into trackview is not complete. More tomorrow then.

[edit] Ok, after a little more testing, it looks like integration into the trackview is more complete than I thought. See other attached picture.

Chris Johnson
Attached Images
File Type: jpg path_constraint_2.jpg (86.6 KB, 27 views)
File Type: gif path_constraint_3.gif (83.6 KB, 29 views)

Last edited by AlpineMan : 09-08-2007 at 04:31 AM.
 
Old 09-08-2007, 10:16 AM   #14
davestewart
Repeat-customer
 
davestewart's Avatar
Dave Stewart
Animator / scripter
United Kingdom
 
Join Date: Sep 2004
Posts: 488
You're going to have a seriously useful little controller here when you're done, Chris... I'm really looking forward to it.

Damn I wish I had the time to learn C++. There's so many things I'd like to make!

Things never "just take an evening" do they!?
 
Old 09-11-2007, 11:38 AM   #15
AlpineMan
Frequenter
 
AlpineMan's Avatar
Chris Johnson
USA
 
Join Date: Aug 2003
Posts: 283
Dave, I'm still figuring out issues in the track view. Hopefully I'm almost there.

Send me and I.M. anytime you get back online, and I'll give you more details.

Chris J.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:41 AM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.