{"id":1745,"date":"2020-10-09T00:41:31","date_gmt":"2020-10-09T00:41:31","guid":{"rendered":"https:\/\/castle-engine.io\/wp\/?p=1745"},"modified":"2020-10-09T00:41:31","modified_gmt":"2020-10-09T00:41:31","slug":"attach-objects-to-animated-bones-like-weapon-in-characters-hand-by-exposetransforms","status":"publish","type":"post","link":"https:\/\/castle-engine.io\/wp\/2020\/10\/09\/attach-objects-to-animated-bones-like-weapon-in-characters-hand-by-exposetransforms\/","title":{"rendered":"Attach objects to (animated) bones, like weapon in character&#8217;s hand, by ExposeTransforms"},"content":{"rendered":"<table class=\"thumbnails thumbnails-align-right\"><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-00-47-16.png\"\n             class=\"screenshot\"\n             title=\"Zrzut ekranu z 2020-10-09 00-47-16\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-00-47-16-200x114.png\"\n             width=\"200\" height=\"114\" \n            alt=\"Zrzut ekranu z 2020-10-09 00-47-16\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-00-46-42.png\"\n             class=\"screenshot\"\n             title=\"Zrzut ekranu z 2020-10-09 00-46-42\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-00-46-42-200x114.png\"\n             width=\"200\" height=\"114\" \n            alt=\"Zrzut ekranu z 2020-10-09 00-46-42\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-02-02-42-19.png\"\n             class=\"screenshot\"\n             title=\"Zrzut ekranu z 2020-10-02 02-42-19\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-02-02-42-19-200x114.png\"\n             width=\"200\" height=\"114\" \n            alt=\"Zrzut ekranu z 2020-10-02 02-42-19\"\n          ><\/a><\/td><\/tr><tr><td>\n          <a href=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-02-17-05.png\"\n             class=\"screenshot\"\n             title=\"Zrzut ekranu z 2020-10-09 02-17-05\"><img loading=\"lazy\" decoding=\"async\"\n            style=\"float: right\"\n            src=\"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-02-17-05-200x114.png\"\n             width=\"200\" height=\"114\" \n            alt=\"Zrzut ekranu z 2020-10-09 02-17-05\"\n          ><\/a><\/td><\/tr><\/table>\n<p>You can now easily attach objects to (animated) bones in your models, e.g. to attach a weapon to animated character&#8217;s hand.<\/p>\n<p>This is performed by setting the <a href=\"https:\/\/castle-engine.io\/apidoc-unstable\/html\/CastleSceneCore.TCastleSceneCore.html#ExposeTransforms\">TCastleSceneCore.ExposeTransforms<\/a> property. It allows to &#8220;expose&#8221; transform nodes within a <code>TCastleScene<\/code>. Transform node is <code>TTransformNode<\/code>, which in particular represents &#8220;bones&#8221; animated by glTF and Spine. &#8220;Expose&#8221; means that we create children TCastleTransform instances, which follow these bones. Subsequently, you can place new scenes inside these children, e.g. add weapons to the hand bone.<\/p>\n<p>It is all nicely visual, <a href=\"https:\/\/castle-engine.io\/apidoc-unstable\/html\/CastleSceneCore.TCastleSceneCore.html#ExposeTransforms\">ExposeTransforms<\/a> can be set in the CGE editor using a comfortable dialog box. The children transforms are automatically created and named.<\/p>\n<p>You can also use <a href=\"https:\/\/castle-engine.io\/apidoc-unstable\/html\/CastleSceneCore.TCastleSceneCore.html#ExposeTransformsPrefix\">ExposeTransformsPrefix<\/a> to avoid name collisions.<\/p>\n<p>See the example application <a href=\"https:\/\/github.com\/castle-engine\/castle-engine\/tree\/master\/examples\/animations\/expose_transformations_to_animate_children\">examples\/animations\/expose_transformations_to_animate_children<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can now easily attach objects to (animated) bones in your models, e.g. to attach a weapon to animated character&#8217;s hand. This is performed by setting the TCastleSceneCore.ExposeTransforms property. It allows to &#8220;expose&#8221; transform nodes within a TCastleScene. Transform node is TTransformNode, which in particular represents &#8220;bones&#8221; animated by glTF and Spine. &#8220;Expose&#8221; means that &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/castle-engine.io\/wp\/2020\/10\/09\/attach-objects-to-animated-bones-like-weapon-in-characters-hand-by-exposetransforms\/\" class=\"more-link\">Continue reading  \u27a4<span class=\"screen-reader-text\"> &#8220;Attach objects to (animated) bones, like weapon in character&#8217;s hand, by ExposeTransforms&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":1748,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"publish_to_discourse":"1","publish_post_category":"9","wpdc_auto_publish_overridden":"","wpdc_topic_tags":"","wpdc_pin_topic":"","wpdc_pin_until":"","discourse_post_id":"670","discourse_permalink":"https:\/\/forum.castle-engine.io\/t\/attach-objects-to-animated-bones-like-weapon-in-characters-hand-by-exposetransforms\/233","wpdc_publishing_response":"","wpdc_publishing_error":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[1],"tags":[],"class_list":["post-1745","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"https:\/\/castle-engine.io\/wp\/wp-content\/uploads\/2020\/10\/Zrzut-ekranu-z-2020-10-09-00-47-16.png","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p9IgYW-s9","jetpack_likes_enabled":false,"_links":{"self":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1745","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/comments?post=1745"}],"version-history":[{"count":2,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1745\/revisions"}],"predecessor-version":[{"id":1751,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/posts\/1745\/revisions\/1751"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media\/1748"}],"wp:attachment":[{"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/media?parent=1745"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/categories?post=1745"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/castle-engine.io\/wp\/wp-json\/wp\/v2\/tags?post=1745"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}