View Full Version : Owner of Custom Attributes...

U.S.S. Speed
01-05-2008, 07:51 PM
Weird question, I know...

But how can the script of a custom attributes can access the object who owns it?

Exemple, I would like to had a custom attributes that would be a spinner that would change the size of the object.

I cannot assing a variable of the node owner at the creation because it give me a dependency loop error, so I take there is a fix variable containing the owner of the attributes somewhere....

01-06-2008, 01:41 PM
I'm trying to figure out why you need a custom attribute to scale an object.

Why not just wire a (manipulator) slider's value to your object's scale?

U.S.S. Speed
01-06-2008, 05:48 PM
How would you wire a spinner to an unknown entity?

Anyway, I found a webpage about weak reference.
But didn't allowed me to do what I want. But I found another way. :)
Thanks anyway.

(Really sad we cannot delete a thread once we found a solution)

01-06-2008, 06:02 PM
How would you wire a spinner to an unknown entity?
on button pressed do
name it
wire by name

Anyway, I found a webpage about weak reference.
Have a link?

(Really sad we cannot delete a thread once we found a solution)
On the contrary. It's fortunate for us you can share the solution.:thumbsup:

01-06-2008, 06:56 PM
I'm guessing the weak reference tut was on my site. Can I ask why it didn't work for you and what you are really trying to do and why. I might have other solutions for you.

U.S.S. Speed
01-06-2008, 08:52 PM
In the case of a "button pressed" it doesn't get which entity is the Cust Att on.
So imagine a create a Cust Att button that say "Turn into a chicken", while I can run the script from it, I dunno on which object to apply the transformation. (Circular reference and such)

(Ex.: o.turnChick.Chick(o) wouldn't work as the function try to target it's own root.)

For that weak reference works like a charm and it follows correctly from one object to another.

However, my goal was to create a watch dog for the watermark I've been creating.

With a few twist, I manage to block a serie of function on watermarked object, like copying, instancing, snapshoting, changing edition sublevel and applying modificator. For that, so far, it works like a charm. However, even if you are at sublevel 0, you can still do modification on the object like... "Attach" which is a real pain in the rear as you can create a small cube, attach the watermarked object to it and poof! The mark is gone.

But Attach is only a small part of the problem as there is like a douzen function of sublevel 0 that doesn't appear to return anything when used and distrupt quite nicely the geometry, the properties and a lot of other thing.

CGTalk Moderation
01-06-2008, 08:52 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.