PDA

View Full Version : Changing HPB motion limits for a bone



zreedee
10-27-2009, 03:39 PM
Hi, I'm trying to access the "Heading limits" of a bone and change it (in Layout), through this code:


MyObj=Mesh(); // first object will do
MyBone=MyObj.bone(); // first bone will do
MyArray=MyBone.limits(ROTATION); // returns 6 element array with HPB limits
MyArray[1]=-90; // for example, set H lower limit
MyBone.limits(ROTATION)=MyArray; // hahaha! too easy to be true...


Last line makes Lightwave crash painfuly.
Any help to modify HPB motion limits of a bone?
Thanks!

evenflcw
10-27-2009, 04:32 PM
This is why CORE is object oriented! LW Classic however is mostly procedural and command based with structs. To change this particular property, select the item and execute the appropriate command! What command? Run LScript Commander master plugin and observe what command is issued when you change this property manually.

zreedee
10-28-2009, 03:27 AM
Great! Now I see the command can be something like:


HLimits(-90,180);

But, why isn't there any info about this command (HLimits) neither in "LSCRIPT REFERENCE MANUAL" nor in "LSCRIPT USER MANUAL"? Is there any other manual I am missing?

Perhaps my question should be: Where can I find all this information without having to disturb you with rookie questions like this? If the answer is CORE, don't answer me, I'm checking it right now.

Thx again!


EDIT:
Now I know what is Core, but it can't solve anything at this moment. It is under development and I don't know if I will purchase it or not. So I beg you for an answer that could apply to Lightwave 9 or previous. The question can be: Is there any updated documentation for LScript, supporting commands like HLimits?

evenflcw
10-28-2009, 05:41 AM
Can't say why, but try this: http://www.mikegreen.name/Lscript/Lscript%20Index.html

It's the most complete reference around.

zreedee
10-28-2009, 08:05 AM
I saw some scripts about Mike before, he's great expert.

However, I start thinking if scripting is the right way to customize tasks in Lightwave.

LScript documentation is old, even in the Newtek web page, it doesn't mention many new commands since 2002, if I'm not wrong... I even wonder how can anybody -as Mike- become an expert when reference manuals are so few and obsolete. After many years of genius and :bangwall: , I suppose...

Do you advise developing plugins with some SDK, instead of fighting with Lscript? Is there better doc to develop plugins?

Thanks again

Castius
10-28-2009, 09:07 AM
http://www.steelronin.com/plugins.htm
http://www.steelronin.com/plugins.htm#SetLimits

Take a look at set limits. It should help.

zreedee
10-28-2009, 11:36 AM
It helps a lot! Thanks Castius and evenflcw.

PD:
Anyway, a good question to answer for all beginner LScript developers still is: "Where can I find complete documentation for all current LScript commands?", remembering that actual newtek documentation don't say a word about HLimits() command, for example, or LimitH() command, as if they never existed, along with other commands. What's the explanation?

evenflcw
10-28-2009, 12:48 PM
The pdfs are old and have never been updated. Changes and additions to LScript are published through release notes. These can be found within the SDK documentation.

Mikes online reference is mostly made up of the original documentation (the two pdfs), release notes and undocumented features discovered by various developers. In addition to that, there is the Newtek LScript list archives (http://lists.newtek.com/mailman/private/lscript/) and the lw-plugin yahoo list (which is acctually for sdk but every once in a while lscript questions have been asked) and this forum of course. :)

You can issue all commands from lscript that you can from SDK! You do not even need a specific lscript function implemented to do it. Just use CommandInput()! I would actually recommend to use this method always! (1) Once a command is implemented in the SDK, it will be immediately available to you through this method. (2) It supposedly issues the command the same way the sdk does with less potential for errors because whoever implemented a specific lscript function messed up the arguments. (3) It allows variable functions*, sortof, which help you write better code with less conditional statements. There are probably more benefits. The drawbacks is less readable code and possibly slower performance because of all the string concatenations and command lookups. There's plenty of posts on CommandInput() here.

*http://php.net/manual/en/functions.variable-functions.php

zreedee
10-29-2009, 06:43 AM
Evenflcw, thank you very much for your attention and very useful help! :bowdown: