View Full Version : Commands or Object Model???
Photon
03-08-2008, 11:40 PM
Hi guys!
I'm new in XSI scripting. I use Jscript, Python and little C/C++. I'm reading in others blogs and forums over XSI SDK over Commands and Object Model.
My question's:
1º - What is the best Commands or Object??
2º - I need information over the Object command.
3º - I will like programming in C/C++, Compiler and Debug for XSI v6.5. which do you prefer?
Thanxs..
Dennis Leong
03-10-2008, 03:35 PM
For scripting:
I prefer commands when I'm writing and debugging scripts because the script history window will log all commands. Once I'm done, I usually change the script to use objects because the object interface is much faster (but won't log what you're doing as you go along.)
The Dictionary object is your friend. It's great for checking whether an object in your scene exists instead of blindly using SetValue.
I haven't used C/C++ with XSI so I can't comment on that.
thiago
03-10-2008, 04:54 PM
I'm way more into the Object model API...
If you know some about object oriented programming, it's gonna be easy to understand the object model.
The command API is much more what other 3d softwares are used to have... and will take you more typing and a lot of Get and Set and all those boring things to access objects.
Access objects in the object model is definitely faster, but it will require you a bit of time to get used to access scene items, collections, get pointers to specific parameters... etc.
There's plenty of information about it on the web and XSI SDK docs... also in the wiki there's some tutorials and deep information about the Object model API.
So I recommend you go the way of Objects... even if take a little while to understand all those concepts, it will be much more fun :)
CiaranM
03-10-2008, 08:11 PM
Hi,
I've gotten into XSI scripting over the last few months (I only had some MEL previously). As an intermediate scripter, I must say that the Object Model feels so much easier and natural to work with and to comprehend than using commands. The SDK is very helpful and well laid out for OM reference. Even if the learning curve might have been rather steep, once I finally got it - the seemingly tangled mess of an SDK was suddenly a clear and essential map around the OM.
To be honest I feel that I have neglected commands and am probably quite ignorant of them in favour of OM. Mostly because the work I do is more oriented towards run-time operators etc., which only work with OM, but also because the commands feel quite unwieldy.
However, even I am aware that there are many, many situations where it would be much easier and efficient to use commands (they usually accept multiple inputs, which can be very handy). The OM is extremely versatile (there are so many useful methods!) and you can really let your imagination run wild with it. But, if you can easily do something with a command then do so.
If you know C/C++ then you should grasp the OM no problem. You'll probably also get a greater understanding of XSI as it will lead you deeper into the SDK.
Object Model = fun!
Photon
03-13-2008, 11:21 PM
Hi, Thanxs for all.
I will use the OM for advanced scripts in Jscript and Phyton or C++, though i will use CM as Macro for simple scripts.
vBulletin® v3.7.0, Copyright ©2000-2008, Jelsoft Enterprises Ltd.