Copy to Points
Visit the Node Bible
Copy to Points
This node will spawn objects onto points.
For anyone new to Houdini, this will absolutely become an area of struggle at first, and it requires patience to learn everything properly. To make things more complicated, this is also an area of constant change with each release of Houdini, and some of the videos out there may be utilizing old workflows. In this node bible entry, we are going to simplify the process while providing a simple and practical glimpse at the latest workflows.
In order to understand instancing better, however, it is required that you understand what packed geometry is. This is a topic which I cover extensively in Destruction I, so please visit the link if you do not understand what "packed primitives" are.
In addition, I would recommend obtaining some basic skills in vex before studying the topic of instancing. Much of what we will learn here deal with the attributes which are being understood by the copy to points. So, it's worth visiting Vex Foundations I for a base understanding of that as well. If you are an absolute beginner at Houdini and are unfamiliar with what attributes are, then you'll want to visit Houdini for The New Artist I and Houdini for The New Artist II before studying this topic.
Assuming that you are caught up on all these topics, let's check it out.
Main Parameters:
-------------------------
-------------------------
Source Group:
-- The first input on the copy to points will contain the geometry that you would like to copy over. The source group allows you to specify a group of points or primitives which belong to the geometry that's connected to the first input.
Source Group Type:
-- Be sure that you specify the correct group type. When using the Source Group parameter above
Target Points:
-- The second input on the copy to points node contains the points that you would like to copy geo to. The "Target Points" allows you to specify a point group which belongs to the second input. Only points in that group will be candidates for receiving geometry.
Piece Attribute:
-- This parameter is very useful when instancing. Let's say that you have three different trees and you want to copy over one of the three trees randomly to a point. The "Piece Attribute" allows you to do this. To make this work you need to match an attribute on your points with an attribute on the geo that you're copying over. So, if a point has an attribute called "variant" and it's = 1, it's going to look for a tree with an attribute called "variant" that also equals 1. If it finds a match, then that's the tree which gets copied over.
To make the most of this parameter, it's best to use this in combination with the Attribute Randomize node set to either Uniform (Discrete) or Custom (Discrete) on your points. Also keep in mind that the copy to points expects this attribute to be an integer or a string. This will not work if your attribute is a float. This is important to keep in mind because the attribute randomize will offer you a float attribute, and you'll need to convert that into an integer for this to work. The easiest way to do that is by using a point wrangle after the attribute randomize and saying something like:
i@variant = f@randoVariant;
With @randoVariant being the attribute that you generated with the attribute randomize sop.
In addition, you'll need to have a variant attribute set to the primitives that you'll be copying over. An easy way of doing this is by using the Connectivity SOP and changing the "class" attribute to "variant". It does not matter whether or not the attribute is set to primitive or point on the geo that you wish to copy over. The copy to points will understand both attribute types.
Pack and Instance:
-- This will convert the copied geometry into packed primitives. NOTE: These packed primitives do not include a @path attribute and it requires more memory than simply packing your geo with the pack node before copying it to points... That being said, it is generally advised to pack your geometry before copying them over to points while leaving this box unchecked. In addition to a lower memory footprint, the @path attribute is preserved.
Transform Using Target Point Orientations:
-- This tells the Copy to Points node to rotate the copied geometry to face the target point normals. NOTE: If a normal is facing upwards in the y-direction, then the geometry will look in the y direction as well. It will NOT sit on top of the normal. Please see the image below:
For now, also know that the "Transform using point orientations" allows you to use other attributes to control how the pigs are spawned to the points. These attributes live on the points and it includes: @orient, @pscale, @rot, @up, @v, @scale, @P, @trans, @pivot, @transform, @shop_materialpath, and @material_override. More on what these attributes do are described in the below section...
Back to the question of: "How do I get the pigs to sit on top?" One way to do this is by simply rotating the pig head as you can see below:
Transform Using Implicit Target Point Normals if No Point N Attribute:
-- If there is no N attribute present, then this tells the copy to points to use the "implicit" target normals. It's basically like setting down a normal sop if this node doesn't find any @N attribute.
------------------------------
The attributes from target section deals with the transfer of attributes from the points to the geo. If, you want the geo to adopt or combine with any attributes from the points, then this is where you can do that.
----------------------------
Reset Attributes from Target:
-- This reverts the attributes from target to its default settings.
Attributes from Target:
-- How many operations would you like to do?
-- Apply to: is asking you what kind of attribute you would like to affect on the geo.
-- by: Allows you to copy, do nothing, multiply, add, or subtract.
Additional Attributes:
------------
This section describes additional attributes that the copy to points understands when "Transform Using Target Point Orientations" is checked on. For a list of these attributes, please visit:
https://www.sidefx.com/docs/houdini/copy/instanceattrs
After you understand how to use @N and @up, the next thing to figure out is how to rotate objects that are spawned to these points using attributes. There's two ways to do it - you can use Euler rotations or Quaternion rotations. This part is really important --- IF you are using @orient, then you are using the quaternion method. While @orient is present, N, up, and v are ignored. Otherwise, those attributes, along with any additional Euler rotations, are used to determine where the geo is facing and/or rotated. For a better explanation between the two, please visit the course - Quaternions & Matrices.
------------
@orient
-- The @orient attribute is a vec 4 (quaternion) attribute. In vex, you can use p@orient to write out the vec4 attribute. This @orient attribute will override any Euler rotations which may be present. This means that N, up, and v are ignored as soon as you use this attribute.
This attribute often gets used along with the quaternion() function to build out this vector 4 attribute.
For most situations, this is what you want to do if you're using the quaternion method...
1. Orient the instances properly
* The best way to do this is by using the old @N and @up attributes to create a rotational matrix that then informs the @orient where to go.
* In vex, you'll write out... p@orient = quaternion(maketransform(@N,@up));
* This is like saying... "Hey I want to use quaternions to orient my instances (p@orient).... I want to create vec4 data using the quaternion() function... and I'm going to tell that ve4 information where to go using by using a matrix whose X,Y,Z axis is determined by @N and @up that I've already figured out.... (maketransform(@N,@up)
As you can see by the pig head sphere below, we're now exactly where we were before when we did the @N and @up example! But now we're in quaternion land. Once you're in quaternion land, you can no longer use N, up, or v...
@rot
-- This attribute adds an additional rotation to the geometry after the @orient attribute has been applied.
-- This attribute also expects a vec4 and is best used with the quaternion() function
-- In this case, you'll want to say...
@rot = quaternion(chf("Angle"),@up);
@pscale
-- Float attribute that adjusts the overall scale of your instances
@scale
-- Vector attribute that adjusts the scale of your instances, but this option gives you the option to do so in x,y,z
@normal
-- See above sections
@up
-- By default, this is a vector which points in the y-direction and you ought to set this perpendicular to the N in almost all situations. See the above sections on how to do that.
@v
-- If @N is not present, then @v will be used instead. This might be useful when, say, you're trying to instance objects onto a pop simulation.
@P
-- Tells the copied geo where to go
@trans
-- Vector attribute which adds an additional transformation in x,y,z to the instanced geo.
@pivot
-- In most situations, it's ideal to make sure that your geometry is being instanced from the origin while sitting on top of the y-axis. This is because otherwise, when you go to copy over to the points, any translation away from the origin will result in an additional translation away from the point that you're trying to copy to.
When it comes to the @pivot attribute - imagine that, by default, this is set to {0,0,0} If you were to set this to something like {0,-3,0}, then the instances will hover above the surface like so...
@transform
-- This can exist as a 3x3 or 4x4 matrix. This is a transformation matrix which will translate your instances. To apply a rotational matrix, you'll want to multiply a rotational matrix against @P. For more information, please visit Quaternions and Matrices
@shop_materialpath
-- This is the path to a shader and can be applied to the instanced geometry as it's copied over to the point. If, for example, you want the geometry to adopt the material path which is specified on the point, then this attribute is what you'll want to specify on the points. This, in combination with the Attribute Randomize node set to custom discrete, could allow you to randomly assign shaders to each point if you'd like.
@material_override
-- "A serialized Python dictionary mapping parameter names to values. You can add this attribute to points using the "override" controls on the Material surface node. When you instance an object onto a point with this attribute, the instanced object applies the given overrides to its material.
Attribute/Transform Priority
---------------------
In addition to what we discussed above, there was a great post by wolfwood on the SideFX forums which describes attribute priority really well. See below for what wolfwood has to say:
--------------------
"If the orient attribute exists, N, v, and up are ignored.
Construction of the transform matrix is as follows:
** The alignment matrix (L) is defined by N or v and up.
IF N exists AND up exists and isn't {0,0,0}:
IF orient exists:
For additional examples, it's also worth checking out the Joy of Vex:
https://www.tokeru.com/cgwiki/index.php?title=JoyOfVex17
Featured links
About Mentorship Calls
To book a call, just visit https://www.cgforge.com/book-consultation
Study Plan Call
Look at the welcome email for further instructions on how to schedule a call if you are a Premium Subscriber.
Premium Member Discord
Unlike the standard discord server, the Premium Member server receives faster replies, feedback on projects outside CG Forge courses, and exclusive discounts on mentorship calls that aren't offered anywhere else.
Houdini Education License
In summary, the educational license of Houdini acts much like Houdini Indie - but at a discounted price. The main difference between Indie and Education is that this version of Houdini cannot be used for commercial projects. It's great, however, for learning and preparing a demo reel without the limitations of Houdini Apprentice.
Unlock Resources
One of the best examples of this is the Node Bible. This resource acts like an encyclopedia of Houdini knowledge. Each entry features a node, goes through all the parameters, and offers video quick tips on how to use each node. The Node Bible goes beyond the native Houdini documentation because it's easier to understand, offers practical examples, and links up to nodes that get used in the courses.
In the resource sections, you'll also find quick tips that cover a variety of miscellaneous topics along with The Weekly Wrangle - which is a series dedicated to advice and real-world conversations surrounding career success.
Redshift Discount
https://www.maxon.net/redshift
Aug 28th, 2024 Changelog
General Changes:
• New, simplified website design is now live!
◦ All new particle banner is featured on the home and after login pages
◦ The after-login page now features courses that are sorted by ones that you have recently watched. This makes it easier to continue watching whatever you’ve been working on without scrolling through all the courses to find what you’re looking for.
◦ There is also a new “resources” section that can be found beneath the “Browse Courses” on the after-login page. This makes it easier to bring up the Node Bible, the “Tips + Tricks,” or Weekly wrangle in a new tab
◦ “CG Forge Academy” has been replaced with a “Mentorship Calls” at the top menu (see below for more details)
◦ The resources dropdown now features “Tips + Tricks” (see below for details)
◦ Certification requirements have been slightly re-written to be easier to understand
◦ Subscriptions have been re-designed from the ground up (see below for details)
Subscription Changes:
• Subscriptions have changed to include a "Basic Subscription" and a "Premium Subscription" option. The Basic Subscription renews monthly, and the “Premium Subscription” renews every 4 months. Yearly subscriptions have been removed.
◦ These changes only affect new subscribers. Existing subscribers will not see anything change with their auto-renewal amount.
◦ 10% off a Redshift yearly subscription is now included with the Premium Subscription. (If you are currently a 4 or 12 month subscriber, then just email support@cgforge.com for this)
◦ A new “Study Plan” call has been added to the Premium Subscription. (If you are currently a 4 or 12 month subscriber, then just email support@cgforge.com for this)
◦ A Houdini education license is now available for “Premium” subscribers. (If you are currently a 4 or 12 month subscriber, then just email support@cgforge.com for this)
◦ For more information, visit the subscriptions page.
• CG Forge Academy has been redesigned to be easier to use.
◦ 45 minute calls have been removed. Existing coupons are still valid and can be used towards 90 minute sessions for the amount listed on each coupon.
◦ 8 week mentorships have been removed - Instead, you can book as many 90 minute calls as you’d like.
◦ Free onboarding calls have been removed - Instead, premium subscribers now receive a complimentary “Study Plan Call” that establishes a personalized curriculum moving forward.
◦ The “CG Forge Academy” top menu is now replaced with “Mentorship Calls” and only allows for booking 90 minute calls.
All new “Tips and Tricks” resource page:
• “Tips and Tricks” is now a resource page that holds all quick tips, Houdini update videos, and other miscellaneous videos in one place. If you’re looking for “Quicktips Season One and Two” or "Houdini 19 Updates" they have now migrated over to the “Tips and Tricks” resource section.
Discord changes:
• The CG Forge Discord channel will now be divided into two categories: “Basic Members” and “Premium Members.” The premium member channel will be invite-only to premium subscribers or those who are currently enrolled in a 4 or 12 month subscription. If you eligible to join the premium discord channel, email support@cgforge.com for an invitation.
◦ Basic Discord members will no longer receive support for projects that are outside the topic of CG Forge courses.
◦ Premium Discord members will receive support for projects outside of CG Forge content
◦ Premium members will receive discounts on mentorship calls, and basic members will not.
◦ Premium members will have their questions / posts answered before basic members
◦ Early access to courses will now be exclusively provided to premium members via the discord channel.
If you have any further questions about these changes, feel free to email support@cgforge.com
Cheers,
- Tyler
1:1 Support and Feedback
Unlock ALL Courses
Instead of paying lots of money for ONE course, you can pay less for a library of courses.
With CG Forge, you can also count on highly refined content that's conveniently found in one place. This makes it easy to cut through the clutter of Houdini tutorials out there and make the most of your time while you learn.