THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED
On 25/09/2003 at 23:59, xxxxxxxx wrote:
User Information:
Cinema 4D Version: 8.207
Platform: Windows ; Mac OSX ;
Language(s) : C++ ;
---------
Hi,
QUESTION:
I'm having some trouble getting two parameters in an object generator
to stay consistent with each other when the generator is cloned.
What I need is one of the following:
- a different way to maintain consistency between two parameters
- a way to make a clone which uses the original's BaseContainer
- a way to set the original's BaseContainer from a clone
- a way to propagate changes to a clone to the original
BACKGROUND:
You may recall my earlier post about Generated Objects Not Scaling,
where the scaling tools weren't working on my generator because it
didn't have any parameters that were Lengths.
Mikael Sterner:
> C4D looks for metric description values in generators and scales
> those linearly
me:
> As my "generator" has no natural linear measurement to scale, I've put
> in a hidden size vector linked to a visible scaling vector, then apply
> SetScale() to the root of the loaded objects, which works fine.
Now I'm having trouble if my generator is an input to an "input
generator" (eg Array), and I scale using the scaling tools.
The salient parameters are:
VECTOR TRUE_SCALE { UNIT REAL; }
VECTOR NOMINAL_SIZE { HIDDEN; UNIT METER; }
I'm cloning using the following flags:
static const LONG CLONE_FLAGS =
COPY_NO_ANIMATION | COPY_NO_INTERNALS;
What normally happens is this:
- the object's NOMINAL_SIZE parameter is changed by the scaling tool
- in GetVirtualObjects(), detect the change in NOMINAL_SIZE and apply
the appropriate change to TRUE_SCALE
if (op->IsDirty(DIRTY_DATA))
{
BaseContainer* bc = op->GetDataInstance();
Vector new_scale = op->GetVector(NOMINAL_SIZE) / DFLT_NOMINAL_SIZE;
if (old_scale != new_scale)
{
bc->SetVector(TRUE_SCALE, new_scale);
old_scale = new_scale;
}
}
All of the above happens in a clone, *however* the BaseContainer is a
clone of the original, so when I apply changes to it, they don't
effect the original, and the changes are lost, and the original ends
up in an inconsistent state.
Thanks.
.angus.