RE: [CPP] Customdata to Property_Define.
| Date : Mon, 19 Dec 2005 10:15:51 -0500 |
| To : <XSI(at)Softimage.COM> |
| From : "Andrew Skowronski" <askowron(at)Softimage.COM> |
| Subject : RE: [CPP] Customdata to Property_Define. |
Adding
parameters at the time of rebuilding the layout is a good
approach.
Another possibility is to create the parameters in the code that creates
the property.
E.g.
you could leave the _Define callback empty, and then in the code that calls
AddProperty() you can call AddParameter on the returned property. _Define
is a convenient place to put those calls for a typical custom property but you
have flexibility to go beyond that if it suits your needs.
-Andrew
-----Original Message-----Hi Daniel,
From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM]On Behalf Of Aloys Baillet
Posted At: Sunday, December 18, 2005 4:04 PM
Posted To: xsi
Conversation: [CPP] Customdata to Property_Define.
Subject: Re: [CPP] Customdata to Property_Define.
What I did for that is a kind of a hack, but works really well: I use the dynamic Layout way of doing things, (with a _RebuildLayout that gets called in _OnInit) and I create the additionnal parameters just before adding them to the layout, in _RebuildLayout (and only if they don't exists). It's really easier to create a lot of different Custom Properties based on the exact same code.
That way you can create the custom property and set one of its parameter to a certain value that will define which parameters to add and how they should look like, across the entire life of the scene. Then when you inspect it for the first time, the parameters are created and added to the layout automatically.
If I'm not clear enough, just ask more question:-)
Aloys
On 18/12/05, Daniel Collin <emoon(at)home.se> wrote:Hi,
I have a bit complex problem. I want to attach a Property to a Null
object and depending on diffrent things the Parametres that will be
created in the Property will differ from one object to another (its
specified from the "outside" how the gui should look like).
My problem is that I have no good way to send customdata to to the
MyProperty_Define(XSI::CRef& ref) function.
One way I have come up with so far is to attach a "UserDataBlob"
Property to the object first. Then do
XSI::Application app;
XSI::Selection selection = app.GetSelection();
selection.Clear();
selection.Add(myObject);
then inside the MyProperty_Define(..) i find the selected object and get
the properties for the object and finds my UserDataBlob object that I
use for the gui creation.
I wonder if there is a better way because this semms a bit "flanky"
Daniel
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
--
Aloys Baillet - XSI Technical Director
Character Dpt - Animal Logic
--
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: FlexLm anyone
- Next by Date: FlexLm anyone
- Previous by Thread: FlexLm anyone
- Next by Thread: FlexLm anyone
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |