Creative Communities of the World Forums

The peer to peer support community for media production professionals.

Forums Maxon Cinema 4D link object to polygon in another

  • link object to polygon in another

     Alan Lacey updated 7 years, 7 months ago 2 Members · 7 Posts
  • Alan Lacey

    August 3, 2015 at 7:06 am

    I have a polygon object that I’m trying to attach (position & rotation) to a specific polygon’s orientation in another (deformed : animated bend) object. I thoght about trying to do this with expresso but can’t see how to get to the position and rotation details of the correct polygon. Is this possible?

    I’m using c4d R13.5

    With many thanks

    Alan

    XdcamEx & HD, C300, DSLRs, all sorts of production & post gear and a very untidy desk. On the East Coast of the UK

  • Adam Trachtenberg

    August 3, 2015 at 8:21 pm

    It’s a little complicated, but here goes.

    * select the polygon you want to use as a reference and then find out what it’s index number is by looking in the structure manager (be sure it’s in polygon mode);

    * Create an xpresso tag and drag both objects into it;

    * Create an Object out port for the reference object;

    * Add an Xpresso>General>Polygon node and connect the previously-created object out port to the polygon node’s object in port;

    * Select the polygon node and set the index to your polygon index in the attributes manager;

    * Create “polygon center” and “polygon normal” out ports for the polygon node;

    * Add an Xpresso>Adapter>Vectors2Matrix node and connect the polygon normal out port to V1, V2, and V3;

    * Add an Xpresso>Calculate>Matrix2HPB node and connect the previous node’s Matrix out port to the Matrix in port;

    * Create the following in ports for the object that will be moved: Global Position, Rotation.H, Rotation.P, and Rotation.B;

    * Attach the polygon node’s “polygon center” out port to the moving object’s global position port;

    * Attach the Matrix2HPB node’s H, P, and B out nodes to the corresponding in ports on the moving object.

    That should do it, with one caveat. The above assumes that your object it’s Z axis pointing up. If it doesn’t, disable the Xpresso tag for a moment and fix that. Then reenable and you should be good to go.

    Example: 9109_stickobject2polygon.c4d.zip

  • Alan Lacey

    August 4, 2015 at 1:18 pm

    Thanks Adam,

    It works perfectly when I attach the controlled object to the reference object, however the reference object has a bend deformer on it and I’m after the controlled object moving with the bend result. The reference object’s hierarchy is ‘hypernurbs/polygons/bend’ and when I create the xpresso list as given it works perfectly with the object but not with the bent object. It’s the bend deformer that’s animated. I tried making the reference object the hypernurbs, the polygon object and the bend but none worked as hoped.

    Do you think this is possible in xpresso? If not is there a way of creating a frame by frame PLA polygon sequence of the bend (it’s animated over about 4 sec.) thus getting rid of the deformer?

    Thanks for taking the time to help.

    Alan

    XdcamEx & HD, C300, DSLRs, all sorts of production & post gear and a very untidy desk. On the East Coast of the UK

  • Alan Lacey

    August 4, 2015 at 8:48 pm

    Making progress now with this Adam. I found a 2010 posting of yours telling to use the point cache tag and then the bake object in the timeline to convert the animated deformed object to PLA.

    Haven’t got it working perfectly yet but think I’m on the way now.

    Many thanks

    Alan

    XdcamEx & HD, C300, DSLRs, all sorts of production & post gear and a very untidy desk. On the East Coast of the UK

  • Adam Trachtenberg

    August 4, 2015 at 10:35 pm

    Should have thought of this sooner, but the easiest way to do this is to use MoGraph. 9113_stickobject2facemogrph.c4d.zip

    But if you want to use the Xpresso method all you have to do is check the “use deformed points” option in the Polygon node properties.

  • Alan Lacey

    August 5, 2015 at 10:09 am

    Thanks again Adam. I nearly got there with the original method, baking the polygon’s bend deformer, but have hit another problem. The bend deformer takes the relevant controlling polygon over the top and I’m now having issues with the gimbal effect. Presuamably the polygon’s normal rotates 180 degree as it flips over, so my controlled object does too.

    Just as a little background, I’m working on a surgical animation and have a (hyperhurbs>polygons) tissue flap that a suture ties itself into. The flap then deforms with the bend deformer and I’m trying to get the suture to move with the flap. The suture tying itself is a sweep nurbs following a spline. At the frame the suture is in place and stops moving, the sweep nurbs converts to a polygon object that then needs to follow the flap as it is brought over.

    I’ve not tried your mograph method yet but, as I’m sure you must have become aware, I’m not a big or regular user of C4D so usually try and steer clear of mograph – far too complicated for me!

    Alan

    XdcamEx & HD, C300, DSLRs, all sorts of production & post gear and a very untidy desk. On the East Coast of the UK

  • Alan Lacey

    August 5, 2015 at 1:32 pm

    Adam. Mograph method works perfectly. No idea what or how it’s doing it but just right with no gimbal lock problems.

    Thank you so much

    A

    XdcamEx & HD, C300, DSLRs, all sorts of production & post gear and a very untidy desk. On the East Coast of the UK

Viewing 1 - 7 of 7 posts

Log in to reply.

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy