Parameters not being enable when they should

Sensei

TrueArt Support
That's weird but this plug-in works fine here..

I changed code in ui_get() to return inst->v#### and ui_set() to always return LWXPRC_DFLT (remarked whole switch to speed up).. And just because of compilation problem added type-casting in xpanel->describe() and nodeinputfuncs->create()..

And I can't reproduce either disabling controls nor crashing..
 

hstewarth

New member
Ok with changes mention, I got no disabled control initially or crash, but if I save and load it back in I get the same results that I original get.

I also debug the evaluation routine and got zero for all parameters - even if I replace the set routines commented out.

I have a feeling its related to the set routine. Not sure how its should be done with envolopes.

On the compilation problem, what compiler are you using, I am useion Visual Studio 2005.
 

Sensei

TrueArt Support
For plug-in development I am using Borland C++ v5.5 command line.. But compilation problems were because I like code strict like in C++, which is my favourite language..
 

hstewarth

New member
Sensei said:
Sounds like you need to surrender each vparmf->load() and vparmf->save() by chunk..

I assume you mean like example in specular_node.c, I will try that out and see what happens.

FYI: I got email from NewTek about this thread ( my main concern is crashes ) and they past it on to development.
 

hstewarth

New member
Sensei said:
For plug-in development I am using Borland C++ v5.5 command line.. But compilation problems were because I like code strict like in C++, which is my favourite language..

I one time attempted making a personal library of plugin code that had my own C++ wrapper ( mainly for learning purposes ).

Visual Studio is what I uses - last 11+ years and before that a lot of assembler. I did notice that the sdk was done with Visual Studio 2005.

When I get my Dual Xeon 5160 system, I planned to recompile teh plugin for 64 bit Lightwave.
 

Sensei

TrueArt Support
hstewarth said:
I assume you mean like example in specular_node.c, I will try that out and see what happens.

Yes! Exactly LWLOAD_FIND() for loading and LWSAVE_BEGIN()/END() for saving.. I didn't know that it had be done this way, because didn't see this source code.. From my experience, any code dealing with LW I/O should use this way, otherwise it'll cause a lot of troubles, if not immediately, in future when you will be adding new features and plug-in won't work correctly with older/newer versions - different structure is loaded than saved..
 

hstewarth

New member
Ok I did this way and it appears to save the seen with control in ..

Here is some interesting facts now..

1. if I save a scene with value panel control and reload it, it no longer appears in the panel when I reload it.
2. If I use a node attach to imput it works find.

So with this in mind - I believe the problem now is related to pulling the value out the panel input - which has envolope on it.

I have place the current source file in new zip ( other one demostrates crash )

http://home.puffinsoft.com/hstewarth/lwplug/multirand2.zip
 

Sensei

TrueArt Support
First of all get ride off switch() in ui_set()! It's not longer used, LW for setting enveloped control calls ui_get() to obtain VParmID and uses VParmFuncs to set value, instead of using ui_set(), but having it in current form can harm..

And Load() and Save() are still bad implemented.. You should pass control to VParmFuncs->load()/save() instead of writing double value.. Whole envelope must be saved, not single current value..
 

hstewarth

New member
Sensei said:
First of all get ride off switch() in ui_set()! It's not longer used, LW for setting enveloped control calls ui_get() to obtain VParmID and uses VParmFuncs to set value, instead of using ui_set(), but having it in current form can harm..

And Load() and Save() are still bad implemented.. You should pass control to VParmFuncs->load()/save() instead of writing double value.. Whole envelope must be saved, not single current value..

I am confused - what do you mean by top paragraph.. can you show example.

Also I took a lot of this from the specular_node.c ( only node source in Newtek SDK ), is there a better example. I would really like to see a good example. I guess there is not much out that - especially ones that support the VParam. If there is an good example, please by all means point me in the right direction.

Right now I am learning by experimently and this thread. There has got to be better way.
 

Sensei

TrueArt Support
I am confused - what do you mean by top paragraph.. can you show example.

Change this:

Code:
int ui_set(iMultiRand *inst, unsigned long vid, void *value)
{

  double  *d = (double*)value; 
	
	if( !inst )
     return LWXPRC_NONE;



  switch (vid) 
  {
    case ID_SEED1:
      inst->dblSeed1 = *d;
      break;      
    case ID_SEED2:      
      inst->dblSeed2 = *d;
      break;      
    case ID_SEEDINT:    
      inst->dblSeedInt = *d;
      break;      
    case ID_SEEDFACTOR:    
      inst->dblSeedFactor = *d;
      break;      
    case ID_LOWRANGE1:  
      inst->dblLowRange1 = *d;
      break;      
    case ID_HIGHRANGE1: 
      inst->dblHighRange1 = *d;
      break;      
    case ID_LOWRANGE2:  
      inst->dblLowRange2 = *d;
      break;      
    case ID_HIGHRANGE2: 
      inst->dblHighRange2 = *d;
      break;      
    case ID_LOWRANGE3:  
      inst->dblLowRange3 = *d;
      break;      
    case ID_HIGHRANGE3: 
      inst->dblHighRange3 = *d;
      break;      
    case ID_LOWRANGE4:  
      inst->dblLowRange4 = *d;
      break;      
    case ID_HIGHRANGE4: 
      inst->dblHighRange3 = *d;
      break;      


    default:
        return LWXPRC_NONE;
  }


  return LWXPRC_DFLT;
}

to this:

Code:
int ui_set(iMultiRand *inst, unsigned long vid, void *value)
{
	if( !inst )
     return LWXPRC_NONE;

  return LWXPRC_DFLT;
}

When panel control has "-env" in type, set call-back does nothing for such control..

Also I took a lot of this from the specular_node.c ( only node source in Newtek SDK ), is there a better example. I would really like to see a good example. I guess there is not much out that - especially ones that support the VParam. If there is an good example, please by all means point me in the right direction.

Sorry, I don't have such examples.. I am writing my plug-ins from memory without using 3rd party examples.. And I like experimenting and researching..

Code:
Right now I am learning by experimently and this thread. There has got to be better way.

Well, after a few years you will have a lot of experience in writing LW plug-ins, and would write such node from memory too, without taking look at LW SDK at all.. ;) I am writing LW plug-ins since 2002, and wrote around 80-100 separete tools..
 
Last edited:

hstewarth

New member
Thanks I will try it tommorrow.. I assume with Load and saves you mean calling the Load function with in VParams..

It is better to use the VParams ? I have not seen much documentation on it.
 
Top Bottom