View Full Version : GetNext(); Plugin programming
Manwich 06-14-2003, 01:02 PM I'm working on a plugin that needs to count how many objects there are in the scene.
I can get the first object using GetFirstObject()
but when i try to use GetNext() to return the next object it returns it as nil even though there are more than one object present.
my segments of code are:
var Obj = doc->GetFirstObject();
println(Obj);
Obj = doc->GetNext();
println(Obj);
All lines are valid as C4D doesn't give any errors when compling.
Anybody had this trouble?
i'm using Cinema 4D XL6.3
Thanks
Manwich
|
|
tilo.kuehn
06-14-2003, 02:07 PM
Originally posted by Manwich
var Obj = doc->GetFirstObject();
println(Obj);
if (Obj)
{
Obj = Obj->GetNext();
println(Obj);
}
try this version ... you need to call the next function from the first object ... not from the document ...
cheers
tilo
ps: please post all programming questions to plugincafe
Manwich
06-14-2003, 02:17 PM
Yes that worked perfectly You Da Man!!
This has been bothering me for so long!!!
I think the 6.3 SDk has a few errors in it i've noticed just little things like the fact that there is a close() command within a basefile that is not mentioned.
and the fact that to add to a filename you have to use the AddLast() command instead of the Add() command used in the example.
Thanks a lot!!
Manwich
nhytro
06-14-2003, 02:35 PM
Hi Tilo!
Is there a logic behind this? I for one would have tried to do it exactly the way Manwich did; from the Document Object. Isīnt the Document Object the Container of all objects?
Thanks
Originally posted by tilo.kuehn
Originally posted by Manwich
var Obj = doc->GetFirstObject();
println(Obj);
if (Obj)
{
Obj = Obj->GetNext();
println(Obj);
}
try this version ... you need to call the next function from the first object ... not from the document ...
cheers
tilo
ps: please post all programming questions to plugincafe
Manwich
06-14-2003, 03:08 PM
Looking back i can see now that it would make sense to describe the position of next and previous objects from the current active object. other wise where would you know where to go!
Also looking at the baseobject page in the SDK i can see that it can be derived from the BaseList4D and thus BaseList2D classes.
thanks again!
Manwich
P.S i think that maybe we should have a seperate forum dedicated to posting plugin development problems rather than just resources and completed plugins what does everyone think?
I think they have something like that already at plugin cafe.
Katachi
06-14-2003, 09:24 PM
Originally posted by Manwich
P.S i think that maybe we should have a seperate forum dedicated to posting plugin development problems rather than just resources and completed plugins what does everyone think?
http://www.plugincafe.com = official Developer forum. Everybody is welcome to post plugin or Cinema 4D programming (or scripting) specific questions.
CGTalk Moderation
01-15-2006, 10:00 AM
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.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.