Bonsai_Tutorials/122000_20250520_1011 - Creating a custom property with a property template/122000_20250520_1011 - Creating a custom property with a property template.srt

304 lines
8.2 KiB
Text

1
00:00:00,000 --> 00:00:06,000
So as you probably saw, IFC comes with a lot of standard property sets that you can use.
2
00:00:06,000 --> 00:00:11,000
And each property set has a bunch of properties underneath it.
3
00:00:11,000 --> 00:00:17,000
But sometimes you'll get to a point where you need a certain property that's not in the standard list.
4
00:00:17,000 --> 00:00:20,000
And you can ultimately create your own if you'd like.
5
00:00:20,000 --> 00:00:28,000
And to do that, it's under the Project tab here and go down to Property Set Templates.
6
00:00:29,000 --> 00:00:38,000
So to create a new one then, you click on this plus button here.
7
00:00:38,000 --> 00:00:49,000
And we're going to call this one OD Property Template.
8
00:00:49,000 --> 00:00:52,000
And say OK.
9
00:00:52,000 --> 00:00:57,000
So we're going to name then the property set.
10
00:00:57,000 --> 00:01:01,000
And for this we're going to do just OD Generic.
11
00:01:01,000 --> 00:01:05,000
And description, you can add description if you want. I'm not going to do that.
12
00:01:05,000 --> 00:01:20,000
So this template type then tells you how this particular property set applies to either the instance of an object or the type of an object.
13
00:01:20,000 --> 00:01:29,000
So if we do this IFC object then, the properties will only apply to the instance and not the type.
14
00:01:29,000 --> 00:01:36,000
If we do this Pset IFC Type Object, it means they will only apply to the type.
15
00:01:36,000 --> 00:01:43,000
But if we do this IFC Type Object Override, it applies both to the instance and the type.
16
00:01:43,000 --> 00:01:52,000
So if you assign a property at the instance level, then it will override whatever is applied at the type level.
17
00:01:52,000 --> 00:01:56,000
So for this particular example, that's the one I'm going to use.
18
00:01:56,000 --> 00:02:01,000
I won't cover these other ones. They apply to quantity sets.
19
00:02:01,000 --> 00:02:11,000
The applicable entity kind of infers what class that this property set will apply to.
20
00:02:11,000 --> 00:02:17,000
So you could put just IFC Wall in there if you wanted to and just have it specific to that.
21
00:02:17,000 --> 00:02:24,000
But I'm going to use this to fall here where it's going to apply to all the types and all the instances.
22
00:02:24,000 --> 00:02:27,000
Basically in the entire schema.
23
00:02:27,000 --> 00:02:31,000
So it creates kind of a starter property here.
24
00:02:31,000 --> 00:02:36,000
And if I edit that, you can name the property.
25
00:02:36,000 --> 00:02:43,000
I'm just going to do comments instance.
26
00:02:43,000 --> 00:02:49,000
And then the second field is the description. I'm just going to keep that blank.
27
00:02:49,000 --> 00:02:55,000
So this next one then is the kind of primary measure type.
28
00:02:55,000 --> 00:03:00,000
And I'll open it here. You can see all the available options.
29
00:03:00,000 --> 00:03:07,000
You can measure for mass or power ratio or any number of measurements.
30
00:03:07,000 --> 00:03:13,000
But for this example, I'm just going to do a simple IFC text.
31
00:03:13,000 --> 00:03:18,000
And then under here, we're just going to do a single value.
32
00:03:18,000 --> 00:03:38,000
But know that you can have a numerated list of preset values or bounded where maybe a temperature is going to be between five degrees or thirty five degrees or structural loading maybe.
33
00:03:38,000 --> 00:03:46,000
So I won't get into the rest of these, but know that there's just other ways to formulate your data.
34
00:03:46,000 --> 00:03:50,000
So we'll say OK there.
35
00:03:50,000 --> 00:03:57,000
So to figure out where this was saved.
36
00:03:57,000 --> 00:04:02,000
So you can use it later as you click on that folder there.
37
00:04:02,000 --> 00:04:10,000
And you can see that it's located at this path right there.
38
00:04:10,000 --> 00:04:22,000
So every time you start a Bonsai session or start Blender, it will look in this folder for this pset here or whatever number of psets you have.
39
00:04:22,000 --> 00:04:29,000
And they will be made available to the project that you're working on currently.
40
00:04:29,000 --> 00:04:39,000
But if you're working with multiple people, you then have to share this file with them to place in their corresponding location.
41
00:04:39,000 --> 00:04:47,000
The one approach I like to do is actually put this pset in the project folder itself.
42
00:04:47,000 --> 00:04:55,000
And so when you sync the entire repo, that pset is made available to that person.
43
00:04:55,000 --> 00:05:00,000
So I'm going to cut this or copy it.
44
00:05:00,000 --> 00:05:03,000
And I'm going to place it in the project folder.
45
00:05:04,000 --> 00:05:11,000
And we're going to create a new folder called psets.
46
00:05:21,000 --> 00:05:24,000
And we're going to paste it in there.
47
00:05:24,000 --> 00:05:29,000
So we removed it from here and then we added it here.
48
00:05:29,000 --> 00:05:35,000
So if you then open this file anew,
49
00:05:40,000 --> 00:05:46,000
and go down to your project templates here, it should be listed here.
50
00:05:51,000 --> 00:05:53,000
Listed here.
51
00:06:00,000 --> 00:06:12,000
What we found with using these custom psets is that they are useful enough to be used across projects, not just specific projects.
52
00:06:12,000 --> 00:06:20,000
So what we like to do is create a Git submodule with our psets that we use a lot,
53
00:06:20,000 --> 00:06:26,000
and sync them into our individual project repros so that they're available to the actual project.
54
00:06:26,000 --> 00:06:38,000
So similar to how we created that OD texture repo, and we pulled it into the project, we do that same thing with psets.
55
00:06:38,000 --> 00:06:50,000
And so we've created a pset repo here with some of the property sets that we find useful for our projects.
56
00:06:50,000 --> 00:07:00,000
So let's actually just sync this repo as a Git module into our project folder.
57
00:07:00,000 --> 00:07:08,000
So as kind of a recap, we did this with OD textures, but as a recap, copy that path there,
58
00:07:08,000 --> 00:07:11,000
and then go to your Git client.
59
00:07:11,000 --> 00:07:17,000
And we are going to add a new submodule.
60
00:07:18,000 --> 00:07:30,000
Paste the path there, and the directory we want, we want that directory, but before we actually do that,
61
00:07:30,000 --> 00:07:43,000
let's go back to our folder here, and we're going to just delete this that we just created.
62
00:07:44,000 --> 00:07:51,000
And so now we're going to create the submodule.
63
00:07:54,000 --> 00:08:02,000
So it automatically stages in the pset submodule there, and then we'll just write a little commit message,
64
00:08:02,000 --> 00:08:09,000
added psets, Git submodule, and so we can commit that locally.
65
00:08:10,000 --> 00:08:21,000
So now if we go back to Bonsai and reload the file, and go to property templates here,
66
00:08:21,000 --> 00:08:35,000
and switch this to property template, so you'll see there's a number of psets that we've created in the past.
67
00:08:35,000 --> 00:08:43,000
And here you can see the comments instance is the one property that we created just a few minutes ago.
68
00:08:43,000 --> 00:08:47,000
And there's some other ones that we find useful as well.
69
00:08:47,000 --> 00:08:56,000
So we then can apply that property to the space, one of these spaces, just to test it out.
70
00:08:56,000 --> 00:09:09,000
Select the space, select all the same class, and then isolate it, and let's pick that primary bedroom again.
71
00:09:10,000 --> 00:09:24,000
Then go to the objects property, and we are going to add the OD generic pset, generic pset.
72
00:09:30,000 --> 00:09:35,000
And say testing, instant comment testing, ok.
73
00:09:36,000 --> 00:09:46,000
So then we can go back to our room finish schedule that we did the last video, and load that.
74
00:09:46,000 --> 00:10:05,000
We can add another field here, where's the OD generic pset, and then the comments instance there, the property.
75
00:10:05,000 --> 00:10:24,000
And just say, oops, comments, and we'll open it with the web there, and hopefully it adds that comment to the table.
76
00:10:24,000 --> 00:10:27,000
So there, it added it right there.