Page 1 of 2 12 LastLast
Results 1 to 15 of 26

Thread: Help to create script / plugin

  1. #1
    Member Ivan_B's Avatar
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    292

    Help to create script / plugin

    So this is what it looks like in the developers area lol!.

    Hi all,

    I'm not really sure if I'm in the right discussion area

    I have an idea that I was hoping someone could help me with...I'm not sure on the etiquette of how one goes about this, so i'll just tell you what I'd like and then you guys can tell me if its possible etc etc...please bare with me...it sounds good and EASY lol!! in my head.

    I would like to be able to import an object with morphs and or genoma bones with controllers (fk controllers) as per normal (create rig etc) then be able to run some sort of script or plugin and for it to create a small group of nulls with a ball item shape have 90º limit and a label (maybe the names of the morphs or bones) and have those nulls have their respective Heading, Pitch and Bank be linked to individual morphs or bone ctrl's.

    I have done this in the graph editor, by using the expressions builder "morph link" linking the HPB to 3 morphs with this expression "mapRange([BLINK.Rotation.H],0.000,90.000,0.000,1.000)"...works fricken well ( I know morphmixer has slider, and thats how I use it, but try this way and you'll love it) and also having controls for rig bones (face bones). Like I said I can set it up manually, but its a pain in the Ayes!! I would love to be able to run a script..select the morphs or bones or both and hit create controllers and its all done automatically.

    With regards to the bones controllers (this can also be done using the assign tools) maybe if there was a check box next to the object to be selected to make it a "selector or item picker" rather than controlling rotation, in the case of wanting to select IK controllers to then move around manually and select others for FK head rotations etc.

    Maybe something like this already exist, if so PLEASE point me in the right direction...If not, would and or could any of you brilliant code gurus assist in trying to make this (and when I say assist I mean you do it all, cos I got no idea)

    Sorry if I have been rude by just flat out asking for stuff (I can pay you 60 minutes an Hour)... which I think is simple, but may not be the case...I would love to be able to include it in my Genoma tute.

    Here's a visual representation of what I'm asking for.
    Click image for larger version. 

Name:	BoneMorphControlLinker.jpg 
Views:	189 
Size:	459.4 KB 
ID:	124884
    Please be gentle

    IvanB
    Last edited by Ivan_B; 10-10-2014 at 02:21 AM.
    Be careful, you might learn something.

    Multimedia & Tutorial channel
    Showreel - 2013

  2. #2
    Your script is definitely do-able. Not sure who out here is available.

    An alternative would be for you to make the script yourself. We could point you in the direction you need to go.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  3. #3
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,519
    It's not that hard of a script to write, either... I did this back in LW 9.6, because I got tired of typing out all those d**n expressions in RH Rigging 1. Don't know where it is now, though. I didn't give it a descriptive file name, so it's a bit hard to find.

    All the information you need to put it together is on Dodgy's Lscript index page. You've already got the expression, you just want a pick this channel, pick this morph, click and assign automation.
    There might even be a way to list what channels and morphs you've assigned as well.

    Code:
    Done = False
    While !Done{
          Display Requester //Get's Morph, Channel, and status - the Done flag
          Get Values
          Generate Expression String
          Assign Expression
       }
    //Do your clean up here when Done = True
    End
    Not that hard at all...
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  4. #4
    Member Ivan_B's Avatar
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    292
    Hey Thanks people!!!

    Thats really good news, I'm glad its simple...I thought it might be..I was hoping there was something out there already, I wanted to include it in my tute, but it looks like its not going to happen...I can see this is going to take a very long time to make...something new to learn.

    ernpchan: I would LOVE to be able to make it myself, with the little UI, but I have NOOOOO idea when it comes to expressions and coding etc...can it be done in lscript commander, cos thats about as far as I can go...If you think I might be able to do it, please feel free to educate me.

    Kryslin: Oh dont tease me like that...I'll have to check out the index page (If I can find it), see if my head understands it...creating it like you would in commander would be perfect, but if it requires typing stuff, i'm screwed .....If theres anything in more detail that you can provide, please do, Im a pretty quick learner.

    Thanks again
    Ivan.
    Last edited by Ivan_B; 10-10-2014 at 07:01 PM.
    Be careful, you might learn something.

    Multimedia & Tutorial channel
    Showreel - 2013

  5. #5
    I tend to script from scratch so not sure how far you can get with lscommander. I've also for the most part moved to python.

    I'd say start simple first...you're gonna wanna figure out how to get a selected item and then iterate through that. What you could do is do some searching on the lwplugindb to see what scripts aren't compiled. Find the ones that have elements of what you need and then use them as reference to Frankenstein together what you need. It's how I learned. Your script isn't hard to do, it's just gonna be time consuming to make. I'd take a stab at it but I'm already busy with other scripts.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  6. #6
    Axes grinder- Dongle #99
    Join Date
    Jul 2003
    Location
    Seattle
    Posts
    14,732
    We REALLY need a "Python Commander" to help novice scripters along.
    They only call it 'class warfare' when we fight back.
    Praise to Buddha! #resist
    Chard's Credo-"Documentation is PART of the Interface"
    Film the cops. Always FILM THE COPS. Use this app.

  7. #7
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,519
    I found my script, I'll see if it's in working order before posting it. Looking at the code, It's kind of a mess, but at least I commented it.

    And it's not too much different from the block outline I posted earlier.

    Stuff like this pretty much has to be done from scratch, though. lScript's been worth it, because I've managed to write some useful tools. I really should make the move to Python, though...

    And here we go...
    Code:
    //-----------------------------------------
    //Morph Expression Linker v0.1
    //by Steve Pettit, May 2010
    //
    //Links a clamped mapRange expression to a channel
    //for the purpose of driving a morph channel.  
    //Main use is for non-bone and slider animation 
    //controls
    //------------------------------------------
    
    @warnings
    @name "Morph Link"
    
    enum_objects
    {
        //Simple Enough, get all objects in a scene.
        t_objs;
        t_var = getfirstitem(MESH);
        while(t_var)
        {
            t_objs += t_var.name;
            t_var = t_var.next();
        }
        return(t_objs);
    }
    
    enum_morphs
    {
        //Get the names of VMMORPH maps.
        t_mrfs;
        t_vmap = VMap(VMMORPH);
        while(t_vmap)
        {
            if (t_vmap.type == VMMORPH) t_mrfs += t_vmap.name;
            t_vmap = t_vmap.next();
        }
        return(t_mrfs);
    }
    
    enum_channels
    {
        //Only the Default 9 Channels, common to every object
        t_chan;
        t_chan += "Position.X";
        t_chan += "Position.Y";
        t_chan += "Position.Z";
        t_chan += "Rotation.H";
        t_chan += "Rotation.P";
        t_chan += "Rotation.B";
        t_chan += "Scale.X";
        t_chan += "Scale.Y";
        t_chan += "Scale.Z";
        return(t_chan);    
    }
    
    
    generic
    {
        //Set this to true to debug the script.
        debug_flg = false;
        if (debug_flg) debug();
    
        myscene = Scene();
        myobjs = myscene.getSelect();
        myobj = myobjs[1];
        objs = enum_objects(); 
        mrfs = enum_morphs();
        chan = enum_channels();
    
        drv_obj = 1;
        tar_morph = 1;
        in_min = 0;
        in_max = 1.0;
        out_min = 0;
        out_max = 1.0;
        drv_chan = 1;
        flg_end = false;
    
        while (!flg_end)
        {
            reqbegin("Morph Linker");
            reqsize(360,180);
    
            c1 = ctlpopup("Driving Object",drv_obj,objs);
            ctlposition(c1,3,4);
    
            c2 = ctlpopup("Driven Morph",tar_morph,mrfs);
            ctlposition(c2,2,93);
    
            c3 = ctlnumber("Input Min.",in_min);
            ctlposition(c3,32,47);
    
            c4 = ctlnumber("Input Max.",in_max);
            ctlposition(c4,32,70);
    
            c5 = ctlnumber("Output Min.",out_min);
            ctlposition(c5,202,47);
    
            c6 = ctlnumber("Output Max.",out_max);
            ctlposition(c6,198,70);
    
            c7 = ctlpopup("Channel",drv_chan,chan);
            ctlposition(c7,3,27);
    
            c8 = ctlcheckbox("Done!",flg_end);
            ctlposition(c8,276,113);
    
            return if !reqpost();
    
            drv_obj = getvalue(c1);
            tar_morph = getvalue(c2);
            in_min = getvalue(c3);
            in_max = getvalue(c4);
            out_min = getvalue(c5);
            out_max = getvalue(c6);
            drv_chan = getvalue(c7);
            flg_end = getvalue(c8);
                    
            out_min2 = out_min;
            out_max2 = out_max;
            
            if(abs(in_min) > in_max)
            {
                out_min2 = out_max;
                out_max2 = out_min;
            }
            c_str = format("\"clamp(mapRange([$1.$2],$3,$4,$5,$6),$7,$8)\"",
                            objs[drv_obj],
                            chan[drv_chan],
                            in_min,
                            in_max,
                            out_min,
                            out_max,
                            out_min2,
                            out_max2);
            d_str = format("\"$1\.$2\"",myobj.name,mrfs[tar_morph]);
            e_str = format("\"$1_ctrl\"",mrfs[tar_morph]);
            e_str ~= r~\.~_~;
            if(debug_flg)
            {
                info(d_str);
                info(c_str);
                info(e_str);  
            } else {
                com = string("GE_CreateExpression ",e_str," ",c_str);
                CommandInput(com);
                com = string("GE_AttachExpression ",d_str," ",e_str);
                CommandInput(com);         
            }
        }
        //info("Script is finished.");
    }
    How to use : Copy and Paste into a text file on your computer, and save it as <something>.ls Have the model that you want to attach expressions to morphs selected in layout. Run script. Select Item that is driving the morph, and what channel it is using. Give it your min and max values for input and output, the morph you are driving, and check the Done checkbox if you don't want to add anymore. Script should run, and automatically set up the expression and attach it. If it didn't attach the morph, you probably had the wrong item selected before running the script.
    Last edited by Kryslin; 10-11-2014 at 02:13 PM.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  8. #8
    Interesting. Never thought of putting a ui inside a loop. Thanks for sharing.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  9. #9
    Member Ivan_B's Avatar
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    292
    Thanks People..

    Kryslin: Thank you so much for organizing that for me..unfortunately I can't get it to work...here's what I did, let me know where I might have gone wrong please.

    1. Copied the script..New text doc, pasted script, named it Morph Link.ls..installed it (1 plugin successfully installed).
    2. Loaded head with morphs into layout.
    3. I run a ls commander script that I made which creates 6 nulls named 1-5 with a null named move that the 5 are parented to...theses are my controllers (I was hoping for that to be added to your script, preferably with coloured item shape ball and rot limited to 90 or 100 ) I think I'll start my script learning on creating a null with limits item shapes and colours etc..something simple (I imagine) but useful
    4. Selected the head with the morphs.
    5. Ran your script..UI pops up.
    6. Selected null 1 as driving object.
    7. Channel Rotation B
    8. In min = 0.0, In max = 100 (I imagine that would be 100º rotation of the bank channel)
    9. Out min = 0.0, Out max = 1.0 (1.0 being the morph at 100% ..I did try 100 as well)
    So for every 1º of rotation you get 1% morph...(100º max rotation of bank = 100% morph.)
    10. selected morph from dropdown.
    11. check "done" hit ok...and nothing happened.
    If I understand it correctly, you should be able to repeat the selection process choosing the respective ctrl's and morphs, then when done hit done to accept ALL the selection and hit ok..Is that correct?
    I tried both , but still nothing happens.

    I must of stuffed something up

    Ivan.
    Last edited by Ivan_B; 10-11-2014 at 08:19 PM.
    Be careful, you might learn something.

    Multimedia & Tutorial channel
    Showreel - 2013

  10. #10
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,519
    Checking "Done" terminates the script. Leaving it unchecked allows you to do multiple morphs/expressions.
    You won't see anything happen until after the script is done.

    All the script does is create and add an expression to a channel. It does nothing to control them directly.

    Moving your controllers does nothing after the script runs?

    Bring up your morph mixer, find the morph you linked the expression to, and click on the "E" button on the right.
    This brings up your Graph Editor for this morph channel. There should be a tab labelled "Expressions". Click on that. Look for an expression named similarly to the morph it should be connected to. The right hand column is labelled "Attached". Is there a number there, or a dash?
    Last edited by Kryslin; 10-11-2014 at 09:50 PM.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  11. #11
    Member Ivan_B's Avatar
    Join Date
    Jan 2006
    Location
    Australia
    Posts
    292
    Hey Kryslin,

    Oh I see now it makes sense, and yes I did work exactly like that...thats pretty much how I set mine up manually, I used the builder in the graph editor which spat out ... mapRange([Null.Rotation.B],0.000,100.000,0.000,1.000) and yours is clamp(mapRange([Blink.Rotation.B],0,100,0,1),0,1) which stops the morph at 100% even though the controller continues to rotate or move etc... and no, the expression were not attached there was a dash, but when I applied it to the morph, it worked, I actually attached 3 morphs to one controller, is it supposed to attached the expressions automatically??? if it does attach automatically that would be brilliant (sorry if I keep harping on about it) but I would love to be able to include a button on the ui that makes my ctrl null rig...or better still, a master null and the ctrl nulls that were chosen during the morph link..one link made one ctrl null made.

    Could someone steer me to where I might be able to find info on how to create nulls with item shapes, text as well as a colour...
    like this image...you have to imagine all the names on the nulls would be different, as well as possibly having 3 names for (come to think of it, you could have 9 morphs being controlled by one null Rotation.HPB Position.XYZ Scale.XYZ etc...not sure you would use scale too often)..I was just lazy to rename them all....oh and they would have 90º or 100º limits...I guess thet would be set by the parameter chosen in the setup.

    Click image for larger version. 

Name:	CTRL-Nulls.jpg 
Views:	113 
Size:	180.2 KB 
ID:	124950
    Click image for larger version. 

Name:	CTRL-Nulls_Limits.jpg 
Views:	113 
Size:	57.6 KB 
ID:	124951
    I actually prefer the boxes as you get a good visualization of the rotations.
    Click image for larger version. 

Name:	CTRL-Nulls_boxes.jpg 
Views:	112 
Size:	30.5 KB 
ID:	124952

    Thanks again for helping with this!!!

    Ivan.
    Last edited by Ivan_B; 10-12-2014 at 02:28 AM.
    Be careful, you might learn something.

    Multimedia & Tutorial channel
    Showreel - 2013

  12. #12
    These are the lscript docs.
    http://www.mikegreen.name/Lscript/Lscript%20Index.html

    My guess is it involves the apply server and edit server commands since you have to add the item shape plugin. If RebelHill finds this thread he probably knows as I believe he's doing it for RHiggit. I'd be interested in knowing the answer as well.

    I'm also guessing that comring needs to used as well as that let's lscript talk to plugins.
    Last edited by ernpchan; 10-12-2014 at 10:27 AM.
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  13. #13
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,519
    Creating Nulls? Are you wanting to do it Manuallyu, because the Add Null button allows you to make a null and add an item shape to it, along with text...

    Doing it within a script... Been there, done that...

    To Add a null, and give it an item shape, in lscript:
    Code:
    //Fragment of Code...
    //NullName is a string containing the name of the Null
    //NullItemShape is a boolean; if true, you want to assign an item shape to the null.
    PIP = Scene().generalopts[3];
    AddNull(NullName);
    tmp_i = Scene().firstSelect();
    SelectItem(tmp_i.id);
    if (PIP) ParentInPlace();
    Position(0,0,0);
    Rotation(0,0,0);
    if(NullItemShape){
       ApplyServer("CustomObjHandler","LW_ItemShape");
       customshape(tmp_i, nullShape, nullScale, nullAxis, nil);
    }
    
    customshape: whatItem, shape, whatScale, axis, linkto
    {
        //Variable Declarations
        var fmt = @ "p",                    //ctxt
                    "p", "p",                   //self, LinkTo
                    "d", "d", "d",              //time, level, scale
                    "i", "i", "i", "i", "i",    //axis, fill, xray, shape, flags,
                    "f", "f", "f",              //ColorA
                    "f", "f", "f",              //ColorB
                    "f", "f", "f",              //ColorT
                    "d", "d", "d",              //linkPos
                    "s:120",                    //Label
                    "s:120",                    //New in 11.6!  Label_UTF8
                    "s:100",                    //Desc
                    "p",                        //alreadylist
                    "s:256",                    //selfname
                    "s:256",                    //linktoname
                    "i"@;                       //justify
    
        var datablob;
        var itemshape;
        var returndata;
        var cr = false;
        var tv;
        
        //Code Starts Here
        //fmt = ItemShapeData3; 
    
        SelectItem(whatItem.id);
     
        tv = whatItem.server(SERVER_CUSTOMOBJ_H);
        if (tv[1] == "LW_ItemShape") cr = true;
        
        if (cr){
            comringattach("ItemShapeComRing", "shapecomring");
            datablob = comringencode(fmt,
                                        0, 
                                        whatItem.id, 0, 
                                        0.0, 0.0, 0.0,
                                        0, 0, 0, 0, 0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0,
                                        "", 
                                        "",
                                        "", 
                                        0, 
                                        "", 
                                        "",
                                        0 );
            comringmsg("ItemShapeComRing", 100, datablob);
            itemshape = comringdecode(fmt, datablob);
            //if(linkto != nil) itemshape[3] = linkto.id;   // linkto
            itemshape[6] = whatScale;   // scale
            itemshape[7] = axis;    // axis
            itemshape[10] = shape;  // shape
            //if(linkto != nil) itemshape[27] = linkto.name;    // linktoname
            datablob = comringencode(fmt,
                                        itemshape[1],
                                        itemshape[2], itemshape[3],
                                        itemshape[4],itemshape[5],itemshape[6],
                                        itemshape[7], itemshape[8],itemshape[9],itemshape[10],itemshape[11],
                                        itemshape[12],itemshape[13],itemshape[14],
                                        itemshape[15],itemshape[16],itemshape[17],
                                        itemshape[18],itemshape[19],itemshape[20],
                                        itemshape[21],itemshape[22],itemshape[23],
                                        itemshape[24],
                                        itemshape[25],
                                        itemshape[26],
                                        itemshape[27],
                                        itemshape[28],
                                        itemshape[29],
                                        itemshape[30]);
            comringmsg("ItemShapeComRing", 200, datablob);
            comringdetach("ItemShapeComRing");
        }
    }
    
    // A do-nothing function for the comring to hook up to
    shapecomring: code, data
    {
    }
    Never said this would be easy! This code was written before the itemshapedata(); lscript function was added, which would make customshape() a little less wordy. What the code does is create a null, zero out it's position and rotation in relation to it's parent object, and if you've set a flag to add an item shape, applies the CustomObjHandler needed, and attaches to the com ring to set the options for LW_ItemShape. It also makes sure that there is a server of type SERVER_CUSTOMOBJ_H attached to the null before proceeding. It does work, and work wonderfully - this is from my AddChildNull lScript. When one get's tired of setting parents via motion options or scene editor, this is what get's written:

    Code:
    //Add Child Null
    //Version 2.0
    //Adds a child null item to a selected item.
    //Based on ideas on the Newtek forums.
    //Now with Item Shapes!
    //By Steven Pettit 04-Dec-2011
    //Updated 9 Sept 2013
    
    @warnings
    @script generic
    @name Add Child Null 2.0
    
    generic
    {
        var pipon;
        var selectedItem;
        var MyParent;
        var nullName;
        var nullAxis;
        var nullScale;
        var nullItemShape;
        var nullShape;    
        var tmpi_i;
    
        if (hostVersion() != 11.6) error("This script works with version 11.6 or higher!");
    
        pipon = Scene().generalopts[3];
        selectedItem = Scene().firstSelect();
        if(!selectedItem) error("Please select an item!");
        MyParent = selectedItem.id;
        
        nullName = selectedItem.name + "_child";
        nullAxis = 1;
        nullScale = 1.0;
        nullItemShape = false;
        nullShape = 1;
    
        reqbegin("Add Child Null");
        reqsize(317,201);
    
        c1 = ctlstring("Item Name",nullName);
        ctlposition(c1,3,2,310,19);
    
    	c2 = ctlcheckbox("Add Item Shape",nullItemShape);
        ctlposition(c2,95,34,115,22);
    	
        c3 = ctlchoice("Axis",nullAxis,@"X","Y","Z"@);
        ctlposition(c3,74,69);
    	ctlactive(c2,"additemshapeactive",c3);
    	
        c4 = ctldistance("Size",nullScale);
        ctlposition(c4,73,101);
    	ctlactive(c2,"additemshapeactive",c4);
    
        c5 = ctlpopup("Shape",nullShape,@"Standard","Box","Ball","Pyramid","Diamond","Tetra","Ring","Grid","None"@);
        ctlposition(c5,73,136);
    	ctlactive(c2,"additemshapeactive",c5);
    	
        return if !reqpost();
    
        nullName = getvalue(c1);
    	nullItemShape = getvalue(c2);
        nullAxis = getvalue(c3);
        nullScale = getvalue(c4);
        nullShape = getvalue(c5);
    
        //debug();
    
        //Zero Based indices for LW_ItemShape!
        nullAxis -= 1;
        nullShape -= 1;
    
        reqend();
       
        if (pipon) ParentInPlace();
        AddNull(nullName);
        tmp_i = Scene().firstSelect();
        SelectItem(tmp_i.id);
        ParentItem(MyParent);   
        if (pipon) ParentInPlace();
        Position(0,0,0);
        Rotation(0,0,0);
        if (nullItemShape)
        {
            ApplyServer("CustomObjHandler","LW_ItemShape");
            customshape(tmp_i,nullShape,nullScale,nullAxis,nil);
        }
    }
    
    customshape: whatItem, shape, whatScale, axis, linkto
    {
        //Variable Declarations
        var fmt = @ "p",                    //ctxt
                    "p", "p",                   //self, LinkTo
                    "d", "d", "d",              //time, level, scale
                    "i", "i", "i", "i", "i",    //axis, fill, xray, shape, flags,
                    "f", "f", "f",              //ColorA
                    "f", "f", "f",              //ColorB
                    "f", "f", "f",              //ColorT
                    "d", "d", "d",              //linkPos
                    "s:120",                    //Label
                    "s:120",                    //New in 11.6!  Label_UTF8
                    "s:100",                    //Desc
                    "p",                        //alreadylist
                    "s:256",                    //selfname
                    "s:256",                    //linktoname
                    "i"@;                       //justify
    
        var datablob;
        var itemshape;
        var returndata;
        var cr = false;
        var tv;
        
        //Code Starts Here
        //fmt = ItemShapeData3; 
    
        SelectItem(whatItem.id);
     
        tv = whatItem.server(SERVER_CUSTOMOBJ_H);
        if (tv[1] == "LW_ItemShape") cr = true;
        
        if (cr){
            comringattach("ItemShapeComRing", "shapecomring");
            datablob = comringencode(fmt,
                                        0, 
                                        whatItem.id, 0, 
                                        0.0, 0.0, 0.0,
                                        0, 0, 0, 0, 0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0, 
                                        0.0, 0.0, 0.0,
                                        "", 
                                        "",
                                        "", 
                                        0, 
                                        "", 
                                        "",
                                        0 );
            comringmsg("ItemShapeComRing", 100, datablob);
            itemshape = comringdecode(fmt, datablob);
            //if(linkto != nil) itemshape[3] = linkto.id;   // linkto
            itemshape[6] = whatScale;   // scale
            itemshape[7] = axis;    // axis
            itemshape[10] = shape;  // shape
            //if(linkto != nil) itemshape[27] = linkto.name;    // linktoname
            datablob = comringencode(fmt,
                                        itemshape[1],
                                        itemshape[2], itemshape[3],
                                        itemshape[4],itemshape[5],itemshape[6],
                                        itemshape[7], itemshape[8],itemshape[9],itemshape[10],itemshape[11],
                                        itemshape[12],itemshape[13],itemshape[14],
                                        itemshape[15],itemshape[16],itemshape[17],
                                        itemshape[18],itemshape[19],itemshape[20],
                                        itemshape[21],itemshape[22],itemshape[23],
                                        itemshape[24],
                                        itemshape[25],
                                        itemshape[26],
                                        itemshape[27],
                                        itemshape[28],
                                        itemshape[29],
                                        itemshape[30]);
            comringmsg("ItemShapeComRing", 200, datablob);
            comringdetach("ItemShapeComRing");
        }
    }
    
    // A do-nothing function for the comring to hook up to
    shapecomring: code, data
    {
    }
    
    //Attempt to use ctlactive to hide or activate other controls...
    additemshapeactive : value
    {
    	//Since control is a checkbox, this should do.
    	return(value);
    }
    Last edited by Kryslin; 10-12-2014 at 04:28 PM.
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

  14. #14
    Kryslin,

    Where did you find info about the itemshapedata function?
    My opinions and comments do not represent those of my employer.
    www.ernestpchan.com
    www.zazzle.com/gopuggo

  15. #15
    Super Member Kryslin's Avatar
    Join Date
    Feb 2009
    Location
    Prescott, IA
    Posts
    1,519
    I'm the one who had the bug that prompted it's creation.

    In the 9.6 scripts, there is the old Make Joint Chain script, which had the data structure for the Item Shape plugin embedded in it. They added an x-ray flag in 10.x, which I managed to figure out, and then added a string field for UTF Strings in 11.6. Then, the gentleman who handles scriptin dev decided to make an lScript and python function that returned the proper data structure for the Item Shape plugin, so one needn't experiment and crash their computer all the time.

    Go Here: http://forums.newtek.com/showthread....s-with-Comring
    --------
    My Scripts for Lightwave
    Intel Core i7 960 @3.20 Ghz, 24 GB ram, EVGA 6GB GTX980Ti "Classified" driving 2 x HP LA2405.

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •