We've Moved


The blog has been retired - it's up for legacy reasons, but these days I'm blogging at blog.theodox.com. All of the content from this site has been replicated there, and that's where all of the new content will be posted. The new feed is here . I'm experimenting with crossposting from the live site, but if you want to keep up to date use blog.theodox.com or just theodox.com

Friday, January 29, 2016

Some fixups for sfx

I've posted a couple of fixes to the code for the shaderfx module I posted a little while ago.  +Sophie Brennan spotted a problem with the way that module handled some kinds of nodes -- which I had assumed were just plain old objects but which were in fact buttoned-up group nodes.  Since they didn't use the same method to report their outputs as the rest of shaderfx they could not easily be created or connected using the module.

Luckily  +Kees Rijnen, the main author of shaderfx, noticed the blog post and helpfully  pointed me at the source of the problem which I've included in a fix.

If you are using the original version of the code this may be a breaking change.  To unify the way that individual nodes and groups are connected,  I changed the connect() and disconnect() methods to take only two arguments where they previously took 4.  In the first pass you would write

network.connect( node1, node1.outputs.xyz, node2, node2.inputs.rgb)

which was needlessly wordy.  So connect() and disconnect() now sport the cleaner, simpler syntax

network.connect(node1.outputs.xyz,   node2.inputs.rgb)

As always, comments and pulls are encouraged!

No comments:

Post a Comment