ATTENTIONThis FlexSim Community Forum is read-only. Please post any new questions, ideas, or discussions to our new community (we call it Answers) at https://answers.flexsim.com/. Our new Question & Answer site brings a modern, mobile-friendly interface and more focus on getting answers quickly. There are a few differences between how our new Q&A community works vs. a classic, threaded-conversation-style forum like the one below, so be sure to read our Answers Best Practices. |
flexsim.com |
|
Downloads |
Tips and Tricks Share helpful modeling ideas |
#1
|
||||
|
||||
Sketchup Hint: Making parts of a skp file show the Flexsim color
Here are instructions explaining how to prepare a Sketchup file to make parts of the 3d shape use the Flexsim object color.
Note: To simplify the process of removing materials, I use a Material Remover plugin (http://www.smustard.com/script/RemoveMaterials). Put the file in the Sketchup Plugins folder in Windows Explorer, then close and reopen Sketchup to get the menu option Plugins > Remove All Materials. You could alternatively select each surface and assign the default material to its front and back materials manually using the button shown in the image below. 1. Open a skp model. 2. Open the Outliner window (Window > Outliner). This window shows you the organization of your model. Any entities that have been organized into components or groups will appear in this list. 3. In the Outliner window, right-click in whitespace and uncheck “Sort by Name.” 4. Select the entities that you want to change color using the 3d view or the Outliner. 5. Right-click the entities in the 3d view and select Make Component. (If you can't see this option, then your entities are probably already organized into components. If that is the case, then you need to create a new shape, such as a plane or box, turn that shape into a component, and then drag your existing components into that component in the Outliner window. You can then delete the dummy shape that was required to make the ColorChangeables component.) 6. Enter a name for the component (such as ColorChangeables), check the “Replace selection with component” box, and then press Create. 7. Select menu option Edit > Select All (or press Ctrl-A). 8. Hold the Ctrl key and click the ColorChangeables component in the Outliner window to unselect those entities. 9. Cut the selection using menu option Edit > Cut (or press Ctrl-X). 10. Select menu option Edit > Paste in Place. This operation will have moved everything that isn’t color-changeable to the bottom of the file hierarchy without moving its location in the model. 11. Select only the ColorChangeables component and remove its materials manually or by using the plug-in menu option Plugins > Remove All Materials. 12. Save the model. 13. Import the model into Flexsim. It will be color-changeable now. This process could probably be automated by writing a Ruby Script Plugin to do this automatically based on the selection. If anyone feels so inclined to write such a script, I'm sure it would be a welcome addition to this thread. |
The Following 16 Users Say Thank You to Phil BoBo For This Useful Post: | ||
syseo (09-06-2011) |
#2
|
||||
|
||||
Phil,
Thanks very much for this very helpful post. I tested two models downloaded from Google Warehouse. Both worked well. By reading your post, it seems Flexsim will change the color of any default material in the first component of a SketchUp model. Is this understanding right? I do not quite understand the dumy shape operation (Step 5) that you described if the entity is already a component. And if I moved my entity into the dummy shape, and then delete the dummy shape, the entity will be deleted as well. So how can I change the color of a deleted entity? Another question is how to make the shape scaled properly in Flexsim. I noticed one shape was perfectly imported into the yellow box but the other one shrunk and distorted in the yellow box in Flexsim. Should I do something in SketchUp in order to scale it properly like what we used to do with AC3D? Thanks.
__________________
Best, Alan |
#3
|
||||
|
||||
The way OpenGL handles color is a two step process: (1) set the color, (2) draw stuff. The stuff's color will be whatever the last set color was.
The default material skips step 1, which means it will be drawn as whatever color was last set. When an object is drawn in Flexsim, we set the OpenGL color to the Flexsim object's color and then draw the object. So whatever surfaces are drawn first, if they don't set the color themselves, they will be drawn as the object's color. The Outliner window's order isn't exactly representative of the order that the sketchup surfaces will be loaded in and drawn. The component grouping and cut/paste operation make sure that the surfaces you want to be color-changeable are the first ones loaded. As for the dummy operation, you don't delete the entity itself. You delete the surfaces within the entity, which leaves the newly created component intact, although it doesn't have any surfaces. It makes the newly created component just a logical grouping of other components. You only need to do this if the "Make Component" option is grayed out on the entities that you want to be color-changeable. In my tests, I did notice that sometimes the shapes got distorted if I was messing around with the order of objects in the Outliner by dragging things around. This is probably due to surfaces' sizes being relative to their containers. When I followed the steps listed above, then I didn't have this problem. I only noticed this issue when I was doing other stuff. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
AlanZhang (04-16-2011) |
#4
|
||||
|
||||
Hello Phil,
I have done as what you have described above, it was good in Flexsim 5.12(imported in skp format), but when I exported the SketchUp model out as 3DS format, and imported it into Flexsim 4.52, it did not work.Can you give me some suggestions? Thanks. |
#5
|
||||
|
||||
The "3D Media" section of the Flexsim Users Manual explains how to get color to show through a 3DS file.
|
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
Warren Wu (09-30-2011) |
#6
|
|||
|
|||
I'm sorry I'm so late to the game, but I'm trying to learn Flexsim by myself. My company won't front the cash to pay for a trainer. I've pretty much gotten Sketchup down and have created a warehouse model.
What's the best way for me to import my sketchup models into Flexsim. I've done some research and it appears that I'll need to convert my models to vrml for them to work, but I'd like a second opinion. I'm aware that sketchup does VRML importing in the pro version, but is there a VRML plugin for exporting for the non-pro version?? Am I over-looking an easier way to do import object into my model?? Thanks |
#7
|
||||
|
||||
You can import your models directly into Flexsim (from Flexsim 5.2 onwards). No need to convert them. Just double click an object, go to the general tabpage and on the 3DShape option select your sketchup file.
|
#8
|
|||
|
|||
Import a shape directly
I couldn't import it based on what you described. I didn't get any error message or any indication. I used a queue to test the way you described, it didn't work.
|
#9
|
||||
|
||||
If you try to import an skp file but nothing appears, then the Sketchup dll probably failed to register and you ignored the error in the install. Information on how to fix this issue is in this thread:
http://www.flexsim.com/community/for...ead.php?t=1572 |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
George Serhan (06-29-2012) |
#10
|
||||
|
||||
Is there a way to use FlexSim object color for .dae-files (FlexSim 7)?
I've tried it with the solution for .3ds (AC3D) and .skp (Sketchup) and an export to .dae but both ways don't work. Any suggestions or hints? Thanks! |
Thread | Thread Starter | Forum | Replies | Last Post |
Sketchup color | mbaccalaro | Q&A | 7 | 04-11-2011 03:54 PM |
Does Flexsim support Google SketchUp ? | qin tian | Q&A | 10 | 02-05-2011 12:04 PM |
Flexsim doesn't show Sketchup textures | Steven Hamoen | Q&A | 5 | 12-01-2010 01:33 PM |
Why the object’s color can not show in Flexsim 5.02? | Frans Zeng | Q&A | 6 | 07-26-2010 02:41 PM |
making views follow operators | Alex Christensen | Tips and Tricks | 0 | 05-23-2008 04:18 PM |