Re: Updating clusters inside an operator

Date : Wed, 12 Dec 2007 11:41:23 +0200
To : XSI(at)Softimage.COM
From : "Abdo Haji-Ali" <abdo.haji.ali(at)gmail.com>
Subject : Re: Updating clusters inside an operator
On Dec 12, 2007 10:13 AM, Michele <michele.xsi(at)gmail.com> wrote:
>
> I had this problem before, and I recently found a workaround.
>
> First, add an animatable, siInt4 "null_parameter_update" parameter in your
> operator.
> Then create an exact copy of the original operator, called
> "your_operator_topology_fix" - the only difference should be it's outputport
> type, which will be connected to "null_parameter_update".
> Set the siClassifTopo classification to all parameters on both operators.
> Connect "your_operator_topology_fix" to "null_parameter_update".
> To enforce changes, the dummy parameter's should change its value all the
> time, so here's the Update that does it.
>
> XSIPLUGINCALLBACK CStatus your_operator_topology_fix_Update( CRef& in_ctxt )
> {
>     OperatorContext oOp_ctxt( in_ctxt );
>
>     long lUpdate = oOp_ctxt.GetInputValue( L"In_null_parameter_update",
> L"Group_update", 0 );
>     lUpdate++;
>     if (lUpdate > 99999998)
>         lUpdate = 0;
>     OutputPort oUpdate_parameter_out = oOp_ctxt.GetOutputPort();
>     oUpdate_parameter_out.PutValue( lUpdate );
>
>     return CStatus::OK;
> }
>
> This should work with multi-cluster-property-instance operators and will
> take care of updating any complete clusters on the object. Complete clusters
> need to be applied to the object after the operators have been connected,
> for some unknown reasons that's a requirement.
>
> The only obvious limitation is that everytime you want to connect a new
> input, you need to add it to both operators, so portgroups and inputports
> will be evaluated properly.
>
> Hope it helps,
>
> Michele
Mmm... I must be missing something obvious here. How can this help me
update my clusters?
What I'm trying to do is to create a cluster for each plane in my
polymesh containing the polygons in that plane. The problem is when
the polygon count varies after applying the operator. How can I update
my clusters to contain the new polygons (or remove the old ones)?
Note that I'm not using complete clusters...

Thanks,
Abdo Haji-Ali
Programmer
In|Framez
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi


Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available.
This site supposedly brought to you by Benjamin Grosser and the Imaging Technology Group.