Using non activable properties in a constraint?


#1

Hi,

I’m trying to find a way to access non activable properties in a relation constraint. By “non activable” I mean properties that don’t have the “A” button that you click on so you can then use them in a RC.
In my case, the property I’m trying to access is the “specific distance” property in the depth of field tab of a camera. It seems odd that I wouldn’t be able to use it as it is easily changed in the properties window.
And if I have to get my hands dirty and use a Python script, could you point me in the right direction?

Thanks,

Julie


#2

that A button is for Animateable and is the only way to expose the property to the relations.

you could have a python script that is triggered in the relation that sets that cam proerty but that is the only way that I know of.

check out the-area.com motionbuilder python forum for help.


#3

Brad,

I’ve put together something that does what I want:

Vcamera = FBFindModelByName(“camera”)
Vctrl = FBFindModelByName(“ctrl”)
lProp = Vctrl.PropertyList.Find(“ctrl_prop”)
Vcamera.FocusSpecificDistance = lProp.Data

So, all this does is set the value of the non animatable property I want to control to the value of a custom attribute placed on a null object . So by changing my custom property to say “30”, and then executing the script, the non camera property gets its value changed to “30” as well.

Now my problem is that the script needs to be executed everytime my custom property changes value. I’ve tried many things but no luck. My custom property has only 127 integer values (midi controlled) so I wouldn’t need to call the script 10 times per millisecond as if I were dealing with floats.

Could you give me a hand? I feel like I’m really close…

j.


#4

Hi julie.jenkinson,

here is the beta build of driven property constraint, that will connect property of one object to property of another object. This operation gives possibility to make a null object and drive with them any property of another object

download and try this plug-in U can here:
http://webfile.ru/placed.php?id=1506207#

Just open testScene, and in driven constrain’s setup tab fill the fuilds like on picture. After that U can move box along X axis, that will change camera’s focus distance according to box translation X value.


#5

Hi Sorry I am not able to be much help on this right now but did that plugin do the trick?


#6

Hi, this plugin does the trick as U could see if you download this one.

This plugin is very easy to install, U should copy driven_constraint.dll file to MotionBuilder\bin\plugins, then open testScene.fbx and adjust constraint settings in the scene as you can see on the picture attached

enjoy it


#7

Neill,

Sorry I haven’t replied any sooner. I was away for a few days.

I’ve tried your plugin and it does exactly what I needed. Thank you so much for sharing it!

I just came across 3 problems/bugs. If you don’t mind I’ll say what I found:

  • once two properties are connected, simply clicking on the constraint in the navigator breaks the connections in the “settings” tab of the constraint.
  • I could create more than one constraint, it worked fine but when I save the scene and reopen it, it is back to just one.
  • even with just one constraint, when I close the scene and reopen it, I have to redo the connections.

I can just be more careful so that the first problem doesn’t happen, but regarding the two others, I would really really like to not encounter them. I intend to use the constraint in a live scenario (performance), so I simply cannot redo the linking everytime I open the scene.
Let me know if you have the time to fix these problems…
Also, have you made other plugins? If you have other things as valuable as this one I sure am interested :).


#8

Hi julie,

I have solve two of three bugs that your encount. I really don’t know, why more than two constraints don’t properly reopen in scene. But I will try to find the way out…

By the words, I make constraint more easy to setup and to use.


#9

Hi Neil,

Hey, this works almost perfectly now! Actually, with the new version of your plugin, I can add a few constraints to the scene, save it and when I open it again they’re still there and connected.
The only thing I’ve noticed (apart from a couple of bugs which are quite harmless) is that when I open my scene again, I have to double click on each constaint in the navigator to “reactivate it”. I don’t need to click on the “Activate” checkbox, just need to double click on the constraint itself. Any idea why it’s doing this?
Oh and by the way, do you know if the plugin is compatible with MB Extension 2? I was thinking of maybe updating…

Thanks again for your help.

j.


#10

Hi Julie,

here is a new version of the property driven constraint. Now there is not any reason to double click on constraint after scene loading :slight_smile:

> Oh and by the way, do you know if the plugin is compatible with MB Extension 2?
I don’t try the extension 2 yet, so I really don’t know how my constraint will behave in the new version of builder

> Also, have you made other plugins?
yap… there is some others helpfull things that I made. In “valuable” a can count just spring constraint…


#11

Hey Neil,

This is amazing! It works perfectly now! It’s definitely going to be one of my favorite constraints…

I would be really interested in trying out that spring constraint, do you mind sharing it?

Julie


#12

Hi Julie,

I’m really glad that U like driven constraint :slight_smile:
I share spring constraint (this is box for relation constraint) with a little sample, enjoy


#13

Cheers for that, Neil.
Really handy plugin too. It works well even in real time!

Thanks again for everything.

j.


#14

Hi Neill,

Your DrivenProperty Constraint is really cool! Thanks a lot for posting. :thumbsup:

Some minor bugs I’ve encountered in MB7.5sp2
1.) sometimes Relation-constraints are getting invisible (blank screen) if the driven property constraint is present
2.) when adding the constraint, it is necessary to deselect it and re-select it before one can edit the Setup parameters
3.) if a constraint property is a custom-property and it is changed or deleted in the custom property setup while being constraint, it will crash MB.
4.) if the constraint is setup and deselected the next time it is selected the Source and Constraint Model are not visible and therefore not editable in the Setup-tab anymore, but the constraint keeps working, also after saving and reopening the scene.

Suggestions for the next version:
What would be really cool is to get a “driven key” just like in Maya for MB - maybe it will be in the new 2009 version anyway, not sure.
The way I understand it would be the same link with some weighting between in/output and subsequently an editable relation curve between the input and output parameters.

Well - just a few thoughts and some feedback.

But again - you rock! Really great plugin!! Thanks so much.

Cheers,
Leander.


#15

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.