new obj info type scenario

About Truespace Archives

These pages are a copy of the official truespace forums prior to their removal somewhere around 2011.

They are retained here for archive purposes only.

new obj info type scenario // Scriptorium

1  2  |  

Post by Norm // Oct 21, 2006, 9:36am

Norm
Total Posts: 862
pic
I have been wanting to give a go at creating a script that would populate a dropdown list of all objects in current scene. Selecting an object would set in motion some methods to gather info about that object and populate some areas on the interface with the info.


I see where IRiNodeItem Struct Reference has some interesting items to start with.

Post by Asem // Oct 22, 2006, 1:46pm

Asem
Total Posts: 255
I was wondering if it would be possible to treat the drop down menu as a button then we could move it anywhere withen the scene like trueBlues.

I would say one way to do it would make a run script that searched through all the nodes under project/space3D (or whatever the name) and made sure there was a 'mesh' connetor. grab its name and added it to the list (a timer node would have to connect to the 'control in' of the script). As for the adding it to the list thats where I'm not sure.

Decided to try and get some idea that way I or whoever would like to attempt

Post by trueBlue // Oct 22, 2006, 2:47pm

trueBlue
Total Posts: 1761
pic
Hello Norm:
I really appreciate you creating this forum and for all of your help!
It has been a blessing!
I have been trying to add a new attribute to the Combo Control with what is available in the Registered names and types. Sofar nothing is being excepted.
Paul enlightened me with Document Body which is not available in the drop down list, and that works with my trueExplorer example. So if we want Object information that is in the Current Scene, what attribute do we add to the Combo Control that would populate it?

Post by Asem // Oct 22, 2006, 3:08pm

Asem
Total Posts: 255
what is document body, is it a string type? Since if you pre populate it you would enter an item and go to a newline to enter another item of the list.
does the line '\n' (newline) work with the scripts?

Post by trueBlue // Oct 22, 2006, 3:54pm

trueBlue
Total Posts: 1761
pic
Here is a link to the trueExplorer is was an example using the HTML control.
http://forums1.caligari.com/truespace/showpost.php?p=8726&postcount=7 (http://forums1.caligari.com/truespace/showpost.php?p=8726&postcount=7)

Post by Asem // Oct 22, 2006, 4:31pm

Asem
Total Posts: 255
I found that 'Document Body' is of type String and since there's no internal scripting it doesn't give very much info especially since they were pre put into the list.

I was looking at the Dynamic Array thread and that might help or maybe you make it try to take in a string and just make sure when it updates its the next line. I was experimenting with just getting the Listbox to accept a new string value but haven't of yet figured it out though knowing that it seemingly takes in strings gives a place to start (go back because it was my original ideea instead of the array thing).

The idea is to dynamically add to the list

Post by Asem // Oct 22, 2006, 10:32pm

Asem
Total Posts: 255
Norm can I get some feed back of what the paramters for this function is? I'm trying to figure a way to insert new items in the list and I think this function just might be the answer.

UserInterface.OpenPreferencesPanelView(str, str, str, int);

also:
UserInterface.OpenPreferencesPanelViewEx
UserInterface.OpenPreferencesPanelViewWithFlag
etc...

Post by Norm // Oct 23, 2006, 7:04am

Norm
Total Posts: 862
pic
Hello Norm:

I really appreciate you creating this forum and for all of your help!

It has been a blessing!

I have been trying to add a new attribute to the Combo Control with what is available in the Registered names and types. Sofar nothing is being excepted.

Paul enlightened me with Document Body which is not available in the drop down list, and that works with my trueExplorer example. So if we want Object information that is in the Current Scene, what attribute do we add to the Combo Control that would populate it?


If you check out Mine Game from tpportal.caligari.com , it has a dropdown list of player names that is being populated from within script, rather than by populating by hand by editing the panel. Mine game scene/game business/join and also i am looking at mine center/shared data script. I am experiencing difficulty populating array with list of names.


Attached is the sub-objs I was looking at, however full scenario should be harvested from tpportal to get full scoop on what is going on.

Post by Norm // Oct 23, 2006, 7:16am

Norm
Total Posts: 862
pic
I found that 'Document Body' is of type String and since there's no internal scripting it doesn't give very much info especially since they were pre put into the list.


I was looking at the Dynamic Array thread and that might help or maybe you make it try to take in a string and just make sure when it updates its the next line. I was experimenting with just getting the Listbox to accept a new string value but haven't of yet figured it out though knowing that it seemingly takes in strings gives a place to start (go back because it was my original ideea instead of the array thing).


The idea is to dynamically add to the list


I have requested that the html control be expanded upon. I would really like to see the activeX Browser made / incoprorated into ts7. It is on a list of things to do is the answer I recieve. But imagine if it gets put in, we could begin to play with calling "web services" and using that facet of technology.

Post by Norm // Oct 23, 2006, 7:17am

Norm
Total Posts: 862
pic
Norm can I get some feed back of what the paramters for this function is? I'm trying to figure a way to insert new items in the list and I think this function just might be the answer.


UserInterface.OpenPreferencesPanelView(str, str, str, int);


also:

UserInterface.OpenPreferencesPanelViewEx

UserInterface.OpenPreferencesPanelViewWithFlag

etc...


where did initial info come from Asem? We should start using document names so we can look up reference quickly.

Post by trueBlue // Oct 23, 2006, 7:28am

trueBlue
Total Posts: 1761
pic
Okay I see that with the Mines game that ships with 7.11. Names has the Attribute: Common Data Package/String Enum Data. I will look at the tP version. Thanks Norm!

Post by Asem // Oct 23, 2006, 8:57am

Asem
Total Posts: 255
Just like trueBlue thanks Norm, I was also really wondering how to populate a List without manually entering it.



where did initial info come from Asem? We should start using document names so we can look up reference quickly.



You know ,actually this isn't really documented at all (I looked, but maybe not hard enough). I went threw the ts folder to find some of those class type members apparently hidden within the script (you won't find in DevGuide or the IRs* stuff), especially OGLView3D which I saw as kinda weird that was there which I would have tried running it if I new what th two parameters were for (is Caligari planning on OGL support? hmm...). Basically just looking at the dlls that came with ts7 and some of the xml scripts there was kinda a lot of info.

I thought it would be useful as some backdoor to populate the list but I see there is enum string.

though I found another interesting one which is just LE.* for scripting (if you guys don't know about it) .It's members seem a little more obvious. but yeah there were a lot of them but few that didn't seem necessarily complete. I saw that possibly learning to use them without a huge amount of help would be to look at the xml files in the ts/script folder and see how data is entered in for those parameters.

Another thing, is ts grabbing information from those xml files or just giving info on a specific object/script function/... or another way to put it, are xml files only for info? because if not really people might be able to create a D3D shader completely in hlsl and just kinda make the tag names similiar to those in the xml (but probably not as I've read that xml files are mostly for info just not sure).

Post by stan // Oct 24, 2006, 5:15am

stan
Total Posts: 1240
pic
yes thanks alot Norm..:D

here is my best attempt so far..am I on the right track..??:confused:

function Execute(params)
{
nSubObj = Node.SubObjectCount(Space.CurrentScene());
for (i = 0; i < nSubObj; i++)
params.conValue("objectname") = Node.SubObject(Space.CurrentScene(), i)
}

I have been able to get one name on the list in other script..

Post by Asem // Oct 25, 2006, 11:58pm

Asem
Total Posts: 255
I'm not sure where you're at Stan I plan to jump in on this also but there may be a problem. The one thing I have found is that making a variable within the scripting interface part where you can easily create types and creating the type when you create a panel object -> right-click it -> then select what type of data type its supposed to be apparently seem to be two different set of local variables. Technically I don;t thing the drop down list though its has same name as the one in the script are related thus not getting the information.

In many ways that's not cool and whatever data type you create within the script editors attributes area should be easily availiable with the panels version of it and vice-versa.

So to deal with this which is not necessarily so bad (look at my auto load scene example). you will have to do something like:

mList = Node.Value(Object Place, Value/data type);
mList.setStringAt(string, element spot);

in a way you don't really need to specify i as an in_connector as you already did nSubObj (which should be the max count of all objects ).

Now I'm not exactly sure since I haven't really tested it for my self but it seems that it should (I won't be able to really get into it until this friday or Saterday). In many ways this makes scripting in ts7 tricky but also makes learn the little things :D

Post by stan // Nov 3, 2006, 8:24am

stan
Total Posts: 1240
pic
ok Norm..I didn't have it right in the chat..but it works properly now..:D

I put a 'none' if / else option when none is selected or it put the name in the first slot and refreshs the list :)

Post by trueBlue // Nov 3, 2006, 10:47am

trueBlue
Total Posts: 1761
pic
Good job stan! I liked how you were able to scroll in the Combo Control on your other version. Is that still possible?

Post by stan // Nov 3, 2006, 11:07am

stan
Total Posts: 1240
pic
Thanks trueBlue..yes ,scrolling is part of how the combobox works..I just noticed that was the only way we had to navigate the list..there is no scrollbar.. [notice my imagebox widget in background of pics]

Post by Norm // Nov 4, 2006, 5:53am

Norm
Total Posts: 862
pic
Yes this js Manager3 works nicely now Stan.


For those who are wondering, on the Thursday evening live meeting, Stan and I were checing out what I had so far in regards to populating a combo box with list of names in scene. As you can see, it was successful scenario :)

Post by Norm // Nov 4, 2006, 6:07am

Norm
Total Posts: 862
pic
I was looking into the scenario yesterday and tested out:


Long story short, just need:

inNames.SetComboCtrlStyle(2); to change style of combo. I like 2 and can only find three variations, where 1 style is non-dropdown, 2 style has dropdown with fully expanded dropdown list and 3 style is what we seem to default to where dropdown list can be scrolled but with no scrollbars. Left-click-hold-drag to scroll.

Post by stan // Nov 4, 2006, 7:08am

stan
Total Posts: 1240
pic
that works Norm, but rather poorly I might add..I seem to have to do '1' first then go to '2' or it won't show up ...on one try I actually had it sorting but that seems to be overridden most times, checking it stops working..also why won't it work in the properties panel..that is a bug I would think..

Post by trueBlue // Nov 4, 2006, 7:49am

trueBlue
Total Posts: 1761
pic
I am seeing the same thing here as well. Changing the unit 1, 2, 3, has no effect for me. Also panel editing options for the Combo Control does not work. I have also lost the function for None when no object is selected.

Post by trueBlue // Nov 5, 2006, 10:01pm

trueBlue
Total Posts: 1761
pic
''' inNames = System.CreateDO("Common Data Package/String Enum Data") ''' Change to this:
Set inNames = System.CreateDO("Common Data Package/String Enum Data")

''' If ( Node.Exists.Not( Node.Selection() ) ) Then ''' Change to this:
If (Node.Exists(Node.Selection() )) Then

The above item works but still needs additional code to get it to work properly so to add None when nothing is selected in the Combo Control. Have not figured this out yet in VB. But jS looks like this:

if ( !Node.Exists( Node.Selection() ) || Node.Selection() == '')

Post by Norm // Nov 7, 2006, 7:17am

Norm
Total Posts: 862
pic
Here is what I came up with Emma:

Post by trueBlue // Nov 9, 2006, 1:11pm

trueBlue
Total Posts: 1761
pic
I have been trying to do something with the selected object in the Combo Control. Has anybody been able to get access to this?

Post by Norm // Nov 9, 2006, 1:48pm

Norm
Total Posts: 862
pic
variable = inNames.GetSelection()


I never used it but noticed it in the auto-complete when playing with the combo. Have you tried it yet? I wanted to do some filtering as well; populate a dropdown combo with objects that have a matrix connector and such.

Post by stan // Nov 9, 2006, 2:04pm

stan
Total Posts: 1240
pic
well I make a few attempts to get the name in the list you select, to become the selected node..but I had widgets on the brain..I want to get back to that..thought short name might no be useful

I like the filter idea..saw that concept in your object info panel..Norm..wanted to do the same..I have already made a version that just get the current scene.. noticed with your original version a vray node shows up..wheres it hiding.. :D

Post by trueBlue // Nov 9, 2006, 2:15pm

trueBlue
Total Posts: 1761
pic
Yes I have. But I see why from your post that I am not using it correctly. I need to set another attribute for this purpose. I am struggling I guess from the very basics on how to use the SE and the correct syntax. I was going to start out simple and when the Object is selected in the Combo Control have it Selected and Centered in the LE. LE.CenterToSelected() Then I would like to take it further by doing what you say filtering and check to see if it is a Light, Camera, or Object.
I go back and see if I can stumble on how to do it. :confused:

Post by Norm // Nov 9, 2006, 2:15pm

Norm
Total Posts: 862
pic
Sorry Gord, I am not sure what vray node you refer to. Where is is showing up?

Post by Norm // Nov 9, 2006, 2:19pm

Norm
Total Posts: 862
pic
I was going to start out simple and when the Object is selected in the Combo Control have it Selected and Centered in the LE. LE.CenterToSelected()


Neat idea to have the LE center on selected obj/node.

Post by stan // Nov 9, 2006, 2:30pm

stan
Total Posts: 1240
pic
Norm it shows up on the jscript manager list..finds everything..I have vray of course..but have no idea where the vray node is hiding

yes tried to get that LE.CenterToSelected() to work when I did the 'current object' lLE shortcut but it lost track of the LE.CenterToSelected() part when the LE change to its new level..might work better in the manager
Awportals.com is a privately held community resource website dedicated to Active Worlds.
Copyright (c) Mark Randall 2006 - 2024. All Rights Reserved.
Awportals.com   ·   ProLibraries Live   ·   Twitter   ·   LinkedIn