Hi Hugh,

Since all the script/expression parsing is done in Nuke and not DDImage it's 
probably easier to do this via TCL or Python in Nuke and not though the DDImage 
plugin interface.

I think the problem you'll run into is that creating a Node via the script 
interface won't return you an Op* and the 'Node' class in DDImage is an opaque 
pointer into the Nuke class.  To my knowledge, even if you do create the Nodes 
via the script interface there's no way to get their Ops via DDImage.

So I think you'll need to write your own parser the break the script text down 
into Op/Knob sets and instantiate/set them that way.  If there's split knobs or 
expression bindings you'll still need to use the Knob::script_command() 
interface to parse that text.

Cheers,
-jonathan


On Mar 31, 2013, at 11:45 AM, Hugh Macdonald wrote:

> Hi,
> 
> I've dealt with embedding standard Nuke nodes inside a plugin in order to do 
> some kind of pre-processing, but I'm wanting to do the same, but with a 
> predefined group.
> 
> I have the group definition as a string (let's say something like the below, 
> although this is a simplified example, that could very easily be implemented 
> without the group)
> 
> Right now, I can create nodes using:
> 
> Iop *transform = dynamic_cast<Iop*>(Iop::create("Transform"));
> 
> But what I'm trying to do is something along the lines of:
> 
> Iop *myGroup = dynamic_cast<Iop*>(Iop::createGroup(groupDefinition));
> 
> Where 'groupDefinition' is the string below. I would then have access to the 
> inputs, result and knobs defined in the group.
> 
> 
> Any ideas?
> 
> Thanks
> 
> Hugh
> 
> 
> Group {
>  name Group1
>  selected true
>  xpos -868
>  ypos 361
>  addUserKnob {20 User}
>  addUserKnob {41 multiply T Grade3.multiply}
>  addUserKnob {41 size T Blur3.size}
> }
>  Input {
>   inputs 0
>   name Input1
>   xpos -445
>   ypos 459
>  }
>  Grade {
>   name Grade3
>   xpos -445
>   ypos 499
>  }
>  Blur {
>   name Blur3
>   xpos -445
>   ypos 525
>  }
>  Output {
>   name Output1
>   xpos -445
>   ypos 625
>  }
> end_group
> 
> _______________________________________________
> 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