Re: Updating clusters inside an operator
| Date : Wed, 12 Dec 2007 09:13:57 +0100 |
| To : XSI(at)Softimage.COM |
| From : Michele <michele.xsi(at)gmail.com> |
| Subject : Re: Updating clusters inside an operator |
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
2007/12/11, kim aldis <xsi(at)kim-aldis.co.uk>:
I went through this with TinyTHickness. Short answer, it can't be done.
There's also issues around texturing if your operator changes its poly count
as a result of changes in its inputs. You can flag parameters that may
change the geometry's poly or point counts and texture projections
subsequent to your op will update but if one of the inputs affects it you're
in trouble. It'll cope if the poly count falls from what it was when the
projection was applied but if the poly count increases then a whole section
of your geometry won't get textured. Better, it'll crash the texture editor.
So the short of it is, your generator op will be fine so long as you don't
need to texture it. This is a huge shortcoming in my view, what models does
anyone build that don't need texturing? I've shelved a whole bunch of
plugins as a result.
> -----Original Message-----
> From: owner-xsi(at)Softimage.COM [mailto:owner-xsi(at)Softimage.COM] On
> Behalf Of Abdo Haji-Ali
> Sent: 11 December 2007 19:17
> To: XSI(at)Softimage.COM
> Subject: Updating clusters inside an operator
>
> I'm writing a generator operator that generates a polymesh based on a
> connected NurbsCurveList (something like CurveListToMesh). I would
> like to create several clusters in the generated polymesh based on
> some criteria.
> The problem arises when animating the curve. In that case the topology
> of the generated polymesh may change accordingly (new polygons may be
> added or old ones may be removed) and the clusters become invalid.
> My question is: Is there a way to update the clusters inside the
> operator? According to the documentation of PolygonMesh::Set() in the
> XSI SDK: "If this function is used on a polygon mesh with some
> clusters and a topology change is performed, the caller is responsible
> for updating the clusters", however the SDK doesn't mention a method
> to do so.
>
> Any help is appreciated,
> Abdo Haji-Ali
> Programmer
> In|Framez
> ---
> Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in
> body:
> unsubscribe xsi
---
Unsubscribe? Mail Majordomo(at)Softimage.COM with the following text in body:
unsubscribe xsi
- Follow-Ups:
- RE: Updating clusters inside an operator
- From: "kim aldis" <xsi(at)kim-aldis.co.uk>
- Re: Updating clusters inside an operator
- From: "Abdo Haji-Ali" <abdo.haji.ali(at)gmail.com>
- RE: Updating clusters inside an operator
- References:
- Updating clusters inside an operator
- From: "Abdo Haji-Ali" <abdo.haji.ali(at)gmail.com>
- RE: Updating clusters inside an operator
- From: "kim aldis" <xsi(at)kim-aldis.co.uk>
- Updating clusters inside an operator
| DATE: | << | >> | THREAD: | << | >> | INDEX: | Main | Thread |
|---|
- Previous by Date: Re: Scripting for XSI books, any?
- Next by Date: Re: Scripting for XSI books, any?
- Previous by Thread: Re: Scripting for XSI books, any?
- Next by Thread: Re: Scripting for XSI books, any?
- Index(es):
| Search the XSI List archives here or use the advanced search form to search across mailing lists. Searching help is available. |