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
|
||||
|
||||
An example of using drawsurrogate to control transparency in Flexsim 5
Some new visual features in Flexsim 5.0 discussed below and shown in the attached example: · Surrogate objects added with the Animation Creator · drawsurrogate attribute · Controlling transparency order · Composite visuals Surrogate objects added with the Animation Creator: On the Properties window of an object, on the General tab, in the Appearance group, there is a group of buttons labeled “Visuals/Animations”. When you push the Edit button, the Animation Creator window opens. When the Animation Creator window is opened on an object, three attributes are added to the object automatically within its visual node. Those attributes are drawsurrogate, resizeinfo, and animationinfo. Pushing the + button in the upper left corner adds surrogate objects (sub-components) to your object. The final version of Flexsim 5.0 will have more documentation on how to use the Animation Creator. This example focuses on the sub-components that can be added, but doesn’t actually use the animation capabilities. drawsurrogate attribute: The drawsurrogate attribute allows a single object to draw multiple objects as if they were part of the original object’s shape. The surrogate objects then inherit local coordinates so that they can move, size, and rotate with the original object. This is beneficial for cases such as a multi-axis robot, where each joint’s motion affects the other parts of the robot in a hierarchical structure. The drawsurrogate attribute allows the other joints to be modeled as separate objects without affecting the main object’s content for modeling and statistical reasons. In this example, I am using surrogate objects to control the draw order for the processor base, its flowitems, and the transparent glass. In the tree, the drawsurrogate attribute works in one of two ways. If it has text data, then you can specify a path to a container that has the surrogate objects. If the drawsurrogate attribute has no data, then it assumes the attribute itself is the container and all the objects within it will be drawn as surrogates. By default, the objects that you add using the Animation Creator are added as contents of the main object’s drawsurrogate attribute. Controlling transparency order: The order in which transparent objects are drawn affects how they look. By default, Flexsim objects are drawn before their contents so that you can see the object through transparent flowitems (such as bottles). If the object has transparency, such as a glass window on a processor, then the default draw order is incorrect and you can’t see the flowitems through the glass. This example model shows how you can have both transparency on the processor and also on the flowitems by drawing the base first, then the contents, then the glass. The contents are drawn by making an object that has no shape, but has a drawsurrogate attribute with a path back to the original object. This allows it to draw the flowitems in the processor before the glass so that you can see them through the processor’s glass. The main object also has no shape and it hides its content (Show Contents is unchecked on the General tab). This is so that the shape is entirely drawn by its surrogate objects. Composite visuals: Because the different parts of the processor are surrogate objects, they can be selected and moved around as a single object in the 3D view. Because all of this was done using the Animation Creator’s surrogate objects and is entirely encapsulated in the main object’s visual node in the tree, you can save the entire “composite visuals” of this object by clicking the Save button on the General tab next to Visuals/Animations. You can then load that saved “composite visual” file into other objects using the Load button for that object. This way you can make a complex visual shape using surrogate objects and easily transfer those visuals (and animations) to other objects as a single file. |
The Following 8 Users Say Thank You to Phil BoBo For This Useful Post: | ||
Tom David (04-01-2010) |
#2
|
|||
|
|||
i open the model, Don't do anything.there are a lot of letters show in the glass
and i import some .skp file, Some place also chang to a lot of letters What is the role of machine.ac , does it change the glass transparent . What is the role of glass.png ,does it change the item transparent . does 5.0 mechanism of making transparent change. do not need *.tmp file |
#3
|
||||
|
||||
machine.ac is the AC3D model file for those who have AC3D. They can see how the shapes were built and designed.
If you use a png for your texture, you don't need a .tmp file for transparency because transparency is built into the png format via (R,G,B,A). The glass uses the semi-transparent png texture. I'm not sure what is going on with the letters. We'll look into it. |
#4
|
||||
|
||||
Kris had the same issue with the "Matrix" look when he loaded a composite visual of a Robot that I had made. I couldn't replicate it on my machine, so it's somehow machine and/or graphics card dependent, but the media is binding to the wrong texture, namely the texture used to draw names under objects. I think it fixes itself if you reload media, but I'm not sure. We'll take a look at this some more.
|
#5
|
|||
|
|||
Hi,
I have also the same problem with glass showing text. If I reload the media, the glass looks right. Also tested to load the machine_glass.3ds into a Visual Tool, the same problem. I did a test and exported the machine_glass to a new 3ds file and loaded that file into a Visual Tool, get the same problem. Did a Reload Media now everything is okay. Load the model GlassMachine.fsm, now the glass is without the text and looks as expected. If you export VRML then it looks like everything works as expected. Lars-Olof Last edited by Lars-Olof Leven; 04-05-2010 at 10:15 AM. Reason: Added information about VRML |
The Following User Says Thank You to Lars-Olof Leven For This Useful Post: | ||
Tom David (04-05-2010) |
#6
|
||||
|
||||
Also, an addendum to Phil's topic on saving the composite visuals. If you save a composite visual .t file, then make sure that the path to any media that that visual references is relative (i.e. in the same directory or a subdirectory) to the path to the .t file. If you do this, then the folder containing the .t composite visual can be zipped up and moved to different locations without messing up the paths to the media.
|
The Following User Says Thank You to Anthony Johnson For This Useful Post: | ||
Phil BoBo (04-06-2010) |
#7
|
|||
|
|||
1
Bobo, How do you make drawsurrogate object resize when resize yellow box? I tried and find that attribute bodies under resizeinfo node matter. 2 If I use a drawsurrogate object in conveyor, it can resize its width, but cannot resize its length. how to solve it? thanks |
#8
|
||||
|
||||
Quote:
The Conveyor's x size is always 1. The animator has no idea how to know how long the conveyor is because that information is stored as the Layout table instead of a simple x size. |
The Following User Says Thank You to Phil BoBo For This Useful Post: | ||
zhang xin (01-20-2011) |
#9
|
|||
|
|||
thank you, bobo.
Could you give a solution on how to let a 3ds shape in a conveyor resize(or maybe duplicate itself) along length? like this / thanks To make my intention clearer, the default shape of conveyor is sometimes not attractive, so I want to replace it. But resize is a problem. |
#10
|
|||
|
|||
haha ,I make the video,please Contact Me ,professor qing
|
#12
|
|||
|
|||
No one can implement / ?
|
#13
|
|||
|
|||
Quote:
I said ,I make it. Last edited by LINWEIXU; 01-24-2011 at 01:47 AM. |
Thread | Thread Starter | Forum | Replies | Last Post |
Version control of Flexsim model | AlanZhang | Q&A | 11 | 12-09-2014 11:12 AM |
Please help to control Flexsim remotely | cedric molthoff | Q&A | 0 | 03-30-2010 02:25 AM |
control Flexsim remotely | Martin Saler | Q&A | 1 | 12-14-2007 04:35 AM |