Nested components, groups and instancing

Forums: Nested components, groups and instancing
SketchUp Integrated Plugin (Integrated Plugin maintained by OTOY)

Nested components, groups and instancing

Postby smicha » Sat Feb 09, 2013 11:49 am

smicha Sat Feb 09, 2013 11:49 am
TIG,

When I use the plugin for exporting components data into scatter data I encounter a problem when components are grouped. Namely, I have a component copied 10 times. Then a group is created. The groups is copied twice. A single copy of a component is created at the project origin. I run the plugin. The data that are exported are for 10 components only (from the first group) and they are all displaced (because - I suspect - the exported obj is at 0,0,0).

So my question to you is - is it possible to export the data for components that are in all groups without a need to explode them. This is so important to me. If this problem is solvable we can create nested components and use connected consecutive scatter nodes for multiplying instances.

Kind regards,

Sebastian
Attachments
nested instances.rar
(57.2 KiB) Downloaded 203 times
2a.jpg
1a.jpg
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby TIG » Sat Feb 09, 2013 1:40 pm

TIG Sat Feb 09, 2013 1:40 pm
I'm not sure...
The related thread was driven by smicha...
I think you still need to place an instance of the 'collection' to get a 'zeroed' version.
Can you not make a component of the sub-parts and use that ?
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Nested components, groups and instancing

Postby smicha » Sat Feb 09, 2013 3:54 pm

smicha Sat Feb 09, 2013 3:54 pm
TIG wrote:I'm not sure...
The related thread was driven by smicha...
I think you still need to place an instance of the 'collection' to get a 'zeroed' version.
Can you not make a component of the sub-parts and use that ?


Smicha - that's me :) I've started new thread to improve the plugin.

If I make a components of sub-parts it is still displaced by the distance from origin. The problem of setting the component exes to origin goes back.
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby smicha » Sat Feb 09, 2013 4:02 pm

smicha Sat Feb 09, 2013 4:02 pm
TIG,

My idea is to add some code that would do the following:

1. User selects a component.
2. Plugin creates an auxiliary copy of entire project.
3. It deletes everything apart from the component and its copies.
4. It exports data for a scatter node.
5. It deletes the auxiliary file.

This way of thinking does not allow to use nested components but it allows exporting all of the copies of the components into scatter data. Is it possible to code it?
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby TIG » Sun Feb 10, 2013 4:46 pm

TIG Sun Feb 10, 2013 4:46 pm
The first steps are easily done by hand.
And perhaps with the assistance of a simple tool like my 'InvertSelection'...

Copy the SKP.
Open the Component Browser.
Find the Component in the Model-tab and use context menu 'Select All Instances'.
Now use 'InvertSelection' and press Delete.
Only the Instances remain.
Do the Export as OBJ.
Only visible objects get Exported so anything that's on an off layer or hidden will be ignored.
Erase all Instances.
Place an Instance at the origin.
Export another OBJ for the one.
Now you have what you want ?
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Nested components, groups and instancing

Postby smicha » Sun Feb 10, 2013 4:52 pm

smicha Sun Feb 10, 2013 4:52 pm
Yes TIG. That's the way I do it manually.

Now I am experimenting with nested components, and still have a problem with additional displacement when I export (scatter data) a component inside a group or a inside another component. If you find some time to play with the file I previously uploaded I could come up with a solution to the problem I'd be grateful.
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby smicha » Sun Feb 10, 2013 8:56 pm

smicha Sun Feb 10, 2013 8:56 pm
TIG,

Is there a ruby code/function that sets component axes or group axes to 0,0,0 (to the same origin as entire project origin)?
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby TIG » Sun Feb 10, 2013 11:01 pm

TIG Sun Feb 10, 2013 11:01 pm
It you have nested collections you must 'combine' their transformations [perhaps using .inverse at the end ?]
tr = (group.transformation * subgroup.transformation).inverse
TIG
User avatar
TIG
Licensed Customer
Licensed Customer
 
Posts: 536
Joined: Wed May 12, 2010 1:25 pm

Re: Nested components, groups and instancing

Postby smicha » Mon Feb 18, 2013 1:34 pm

smicha Mon Feb 18, 2013 1:34 pm
TUTORIAL - nested components and instancing.

Download the tutorial and the plugin (the plugin was written by TIG, I added some changes to rotation matrix. TIG - thank you so much again).
Attachments
octane_scatter_beta2.rar
(569 Bytes) Downloaded 532 times
TUTORIAL nested components.rar
(4.55 MiB) Downloaded 333 times
Win7, Modo 10.1, Octane for Modo and Sketchup, nVidia latest, TITAN+3x780 6GB, 2600K, P8P67WS, 32GB, 1350W
SMH10, EK, Airplex_480, SR1_560, 20xNB_PL2, 2xD5, Aquaero 6XT
build-log http://render.otoy.com/forum/viewtopic.php?f=9&t=42540
User avatar
smicha
Licensed Customer
Licensed Customer
 
Posts: 3145
Joined: Wed Sep 21, 2011 4:13 pm
Location: Warsaw, Poland

Re: Nested components, groups and instancing

Postby FractalBuddha » Sat Mar 09, 2013 4:35 pm

FractalBuddha Sat Mar 09, 2013 4:35 pm
Thank you Smicha :)
Imagine reality

2 x GTX 560 | i7 | windows 7
User avatar
FractalBuddha
Licensed Customer
Licensed Customer
 
Posts: 73
Joined: Sat Oct 22, 2011 2:26 am
Next

Return to SketchUp


Who is online

Users browsing this forum: No registered users and 2 guests

Sun Oct 20, 2019 10:03 pm [ UTC ]