THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 22/02/2007 at 10:52, xxxxxxxx wrote:
Cinema 4D Version: R10
Platform: Mac OSX ;
how do I attach a sound track to an object?
I looked at BaseSound and I should be able to load it, but have no idea on how to do the attachment.
On 22/02/2007 at 11:05, xxxxxxxx wrote:
You'll need to create a sound track for the object for starters:
BaseObject* obj; // object to receive track
BaseDocument* doc; // document that contains obj
// Check for Sound track, create if none
DescID descID = DescLevel(ID_ANIM_SOUND,ID_ANIM_SOUND,0);
CTrack* track = obj->FindCTrack(descID);
track = CTrack::Alloc(obj, descID);
if (!track) return FALSE; // Alloc Error
Then you'll have to look at the resource:modules:newman:res:description:ctsound.res file for information to set the start time and sound file on the track. These will probably require SetParameter().
This method has not been tested, so there are no guarantees that it will work.
On 22/02/2007 at 14:10, xxxxxxxx wrote:
Thanks Robert most of the code worked create track, and SetParameter().
trackRef->SetParameter ( DescID(CID_SOUND_NAME), GeData(fname.GetString()), 0);
CID_SOUND_NAME takes a string as parameter, but does not get evaluated after been set.
there should be a function to set the filename or make it evaluate the sound path.
Maxon engeneers HELP please!!!