Take a look at my example of this on Nukepedia:
http://www.nukepedia.com/gizmos/plugins/other/dynamicknobs/

Caveat: I haven't tested this under 6.3, only in 6.2...

-jonathan


On Feb 14, 2012, at 12:01 AM, Chishing Yip wrote:

> Hi all,
> 
> I have a plugin uses replace_knobs() to create knobs dynamically:
> 
>     replace_knobs( knob( "my_knob" ), num_of_dyn_knobs, ( 
> &createKnobsCallback ) )
> 
> Nuke crashes when replace_knobs() returns, even the createKnobsCallback() 
> does nothing:
>     void createKnobsCallback( ... )
>     {
>         /// nothing to do
>         return;
>     }
> 
> here is the stack trace:
> #1  0x000000000068447c in ?? ()
> #2  0x00007ffff73135eb in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaac08, n=2) 
> at msort.c:84
> #3  0x00007ffff7313458 in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaabf8, n=4) 
> at msort.c:55
> #4  0x00007ffff7313448 in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaabf8, n=9) 
> at msort.c:54
> #5  0x00007ffff7313458 in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaabb8, 
> n=17) at msort.c:55
> #6  0x00007ffff7313458 in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaab30, 
> n=34) at msort.c:55
> #7  0x00007ffff7313448 in msort_with_tmp (p=0x7fffffff9f30, b=0x6aaab30, 
> n=69) at msort.c:54
> #8  0x00007ffff73139f0 in qsort_r (b=0x6aaab30, n=69, s=<value optimized 
> out>, cmp=0x684468, arg=0x0) at msort.c:298
> #9  0x0000000000683a88 in ?? ()
> #10 0x0000000000683792 in ?? ()
> #11 0x00000000006833a2 in ?? ()
> #12 0x00007ffff7b39deb in DD::Image::Op::replace_knobs(DD::Image::Knob*, int, 
> void (*)(void*, DD::Image::Knob_Closure&), void*) ()
>    from /usr/local/Nuke6.3v6/libDDImage.so
> 
> If I use the knob pointer instead:
>     Knob* myKnob = knob( "my_knob" );
>     replace_knobs( myKnob, num_of_dyn_knobs, ( &createKnobsCallback ) )
> 
> then the former crash is gone, but Nuke still crashes when calling 
> Knob::set_value() or Knob::set_text() during replace_knobs():
>     void createKnobsCallback( ... )
>     {
>         ...
>         myFloatKnob->set_value( 1.0 );  /// crashes
>         myStringKnob->set_text( "abc" );  /// crashes
>         ...
>     }
> 
> Stack trace:
> #0  0x0000000180000293 in ?? ()
> #1  0x00007fffdc8b62e0 in DD::Image::Knob::set_text (this=0x4a54ff0, 
> v=0xb0c2ea8 "abc")
>     at /usr/local/Nuke6.3v6/include/DDImage/Knob.h:536
> #2  0x00007fffdc8b2404 in MyPlugin::createKnobsCallback (this=0x4abef60, 
> f=...)
>     at MyPlugin.cpp:2087
> #3  0x00007fffdc8b28db in MyPlugin::createKnobsCallback (p=0x4abef60, f=...)
>     at MyPlugin.cpp:2387
> #4  0x0000000000b81727 in ?? ()
> #5  0x0000000000b8151a in ?? ()
> #6  0x00007ffff7813c92 in DD::Image::Op::replace_knobs(DD::Image::Knob*, int, 
> void (*)(void*, DD::Image::Knob_Closure&), void*, char const*) ()
>    from /usr/local/Nuke6.3v6/libDDImage.so
> 
> Is there anything I should be aware to?
> Thanks a lot,
> Shing
> 
> 
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to