ERC Property Control, terms and use

thoromyrthoromyr Posts: 452
edited October 2012 in Carrara Discussion

Still ERC, but it is a different issue so I figured a different thread. I think I've figured out some of this, but...

In the Assembly room, create an object, in the Modifiers tab add Behaviors/ERC. First, some questions about the information presented.

1. Expand the "Basic" section, the last item is "Controler Object" which has a button to select the controller object and a checkbox for "use FRA". Similarly, under the "Advanced" section there are check boxes for "Use Group". Clicking the "Select" button I've noticed that the type (e.g., bool) is listed after an entry. Some entries "GROU" -- I suspect that is short for "group"? but what is FRA? And what does "Use Group" really mean?

2. Some of the types I can figure ("in32" is probably a 32-bit integer?), but what is "re32"? A floating point number? Are all of these numbers signed? Or are some non-negative?

3. Another type is listed as "vec2" which expands into two components, X and Y. So I'm guessing it stands for "vector" but here is what I would normally think of as a tuple -- or is it truly a vector (direction and distance)? Either way it represents two values so I'm not sure how that works with the ERC setting a value...

4. In the above question neither X nor Y have a type listed?

Now, I was just kicking myself for doing something a hard way when the ERC would have provided a much easier way to do things. I think. So I started trying to do it and I can't get my approach to work. More on that in a minute, but even if the approach is flawed for this objective (which I think it is), I would still like to know why I'm not seeing things because it helps me better understand what can and cannot be done with the ERC.

So, the basic idea is to have a bunch of duplicated objects using a single shader to give them differing color such that an object is colored differently depending on its position in space. IIRC, when I actually did a scene with this what I did was to use a noise shader shader with global space to change the hue of the color (Color Balance is easily the extension I use the most, great extension!). It was a royal pain to tweak the scaling of the noise to get an effect appoximating what I wanted.

My thought was to replicate that by driving the hue value of the color balance shader using the ERC. But drive it how? Well, just for testing purposes anyway I thought I'd use a global noise shader. I set the alpha channel on object's shader as "Max" of the global space noise shader and 100% -- so the alpha was always 100% but I'd pick the noise component.

First thing I noticed was that "Max" (a Digital Carvers Guild extension) was not listed, but no matter -- I wanted the first subcomponent anway. But when I select it nothing happens. That is, I move the object anywhere I want in space and nothing happens. It is possible that I wasn't moving it enough, but changing the scaling in the noise shader had no effect. Incidentally, I know the ERC is working here because if I change the controller to something else (say, the Z coordinate) moving it changes the color.

So, question: what is going on with using the subcomponent. I can think of three possibilities

1. It is changing the hue, I'm just not moving the object enough or changing the scale enough to see it.

2. It isn't changing the hue because of how the noise works in an alpha channel

3. It isn't changing the hue because of noise being a subcomponent of another extension

For what its worth, the effect I *wanted* to get for the scene I mentioned would have been achievable by using ERC if I could use the three component (XYZ) position in space to drive parameters in some fashion. Preferrably not just distance (to orderly), perhaps distance times angle and azimuth, or just X+Y+Z.

Anyway, I have great plans for ERC. I think that if I can come to grips with it, even for non-animated work it might be the most useful extension I have and beat out Color Balance (maybe :) )

(Not to knock Digital Carvers Guild -- Fake Fresnel, Min/Max, Intersect, Shader Ops light mangling, etc., etc., etc., he has some great extensions as well).

slight edit for accuracy

Post edited by thoromyr on

Comments

  • thoromyrthoromyr Posts: 452
    edited December 1969

    so... its a guess, but guessing is all I've got at present, but I think that the "group" checkbox is to select all members of the group so that group can then be applied to another group. That doesn't make much sense to me -- it'd make more sense for the plugin to behave intelligently in such situations. After all, it knows what is and is not a group and what a groups members are. Regardless, I cannot get a shader "group" (e.g., noise factory) to drive another shader group (another noise factory and hence identical in terms of components). As for most things with the ERC there's no indication as to why nothing is happening -- its just a consequence of the configuration.

    It is pretty clear that the warning about the ERC exposing Carrara's internals so types may not have the values you expect is certainly the case. Two different components can be of type 're32' and ostensibly have different ranges, but actually be identical. There are also components that are not visible in the GUI. I think it was the noise factory that has two different components named brightness (with different four letter tags). I'm not sure what the first one is, but the second does with the Brightness slider in the GUI.

    And although I have a guess about the meaning of the "use group" checkbox, the "use FRA" is still opaque. I have no idea what it does. Checked or not hasn't made any difference yet. Of course, that is symptomatic of a general "issue" with the ERC. It can't tell you what the data ranges for a given component are, just the type, and some items are "invisible" to it, so it is easy to have a "no action situation" such that you can adjust different settings and it'll never make any difference. Perusing the SDK might be informative. Might.

    Where I have found the ERC easiest to use is on simple and straightforward things, like working with an object's coordinates or a slider value setting in a shader. It is really powerful because it allows directly driving Carrara internals. It is really opaque for the same reason. It all depends on what you are trying to do -- and with experimentation I don't always have a directed goal, I'm just trying to explore the possibilities.

    One other thing I will say about the ERC is this: despite it poking into Carrara internals the worst that I've had happen is "no effect". It has not caused Carrara to crash once, even with impossible settings. I really like that.

  • FenricFenric Posts: 351
    edited December 1969

    Ah, you have some good questions, and I have very little time right now.

    re32 is "real, 32-bit". So, a number with a decimal point: 1.23 or -66.75 or similar

    ERC does not handle vectors, matrices, or quaternions: the only complex type it understands are colors. If you really need to control one of the sub-parts of a vector, use the tweener form of ERC instead of the modifier form. (Always keep that in mind, too - there are some things that are SOOOOOO much easier with the tweener than with the modifier)

    "Use Group". This one takes a bit more explaining, but basically it controlls what the list in the dialog box that you pick the parameter from is filled with. Normally, ERC looks at the item you selected to try to find parameters. If you select "use group", then ERC looks at the Animation Group. The Animation Group is the top-level entry for a figure - it's direct children when first created are generally "model" and "hip". There are a number of parameters that only exist at the group level, such as shaders.

    So, in general, try to find the parameter you are looking for without the group checkbox. If you can't find it, or if it doesn't work, then try with the group checkbox.

    "Use FRA". This is a semi-functional workaround to a serious Carrara limitiation. It activates "Field Relative Addressing" for storing the paths to objects.

    A Carrara scene is much like your filesystem: each and every item has a path:

    SCENE\My Figure\hip\abdomen\chest\neck\left eye

    Generally, Carrara saves that entire path as the reference for every item. This means that ERC does, too.

    SCENE\My Figure\hip\abdomen\chest\neck\left eye\rotation\x

    But if you duplicate that item, you have a problem, because the path is now

    SCENE\My Figure 2\hip\abdomen\chest\neck\left eye

    but ERC has no way to know that, and so will keep using the original one, causing a mess. With FRA, any reference from the eye to something else will keep track with "dots". So, a reference to the chest would be:

    ..\..\chest

    instead. This works reasonably well for figures. It does not work very well for more complex setups.

  • thoromyrthoromyr Posts: 452
    edited December 1969

    Thanks very much for the explanations! That definitely helps.

Sign In or Register to comment.