[X3D-Public] Any way to get 'this' proto instance inside itself?

Dave A dave at realmofconcepts.com
Sun Oct 31 23:49:19 PDT 2010


I need to create a ROUTE to/from 'this' proto instance's node. I know I 
can get at 'this' proto's node's fields with IS, but how would I 
construct a ROUTE on-the-fly?

More specific to my case: I have an external script that I need to ROUTE 
to/from proto instances, and I want the proto to create those routes.

Dave A


On 10/31/2010 11:38 PM, Braden McDaniel wrote:
> On Sun, 2010-10-31 at 22:53 -0700, Dave A wrote:
>> What I ended up doing was adding
>>
>> inputOutput SFNode thisInstance NULL
>>
>> to the proto def, and all instances must reference itself:
>>
>> DEF p1 myproto { thisInstance USE p1 }
>>
>> If there's a better way, I'd like to hear it.
> I think what I suggested is better since it doesn't require any special
> action at the instantiation point.  Why don't you like it?
>
>> If not, would like to
>> request it as a feature for next go-around.
> I'm still not seeing a need for this.  Within the PROTO definition, you
> have access to the PROTO instance interfaces via IS.  inputOutput
> interfaces that aren't IS'd are kind of a special case; but it's easy
> enough to contrive an interface in the definition just for the purpose
> of adding IS, thus making the PROTO interface available to the
> definition.
>



More information about the X3D-Public mailing list