http://www.smustard.com/script/fixAspectRatio
Fix aspect ratio - should help if I understand right.
Tomasz
http://www.smustard.com/script/fixAspectRatio
Fix aspect ratio - should help if I understand right.
Tomasz
@cphillips said:
I meant that if you wanted to build a dhtml suite dialog I would give you advice.
Do you have a UI in mind?
I meant if you could show us how you have connected html and Ruby. How you pass results back to Ruby.
Tomasz
Chris,
I am interested. Give us a guidance, please.
Thanks in advance.
Tomasz
Chris,
It is amazing. My head is exploding
Bye Bye Simple input boxes. I just have to wait for the weekend
I hope connecting it to SU is easy.
Thanks a lot!
Tomasz
@daiku said:
gourp.entites will give you the array of entities in the group. Then run through all the items in the array, and look for your face.
I just want to OPEN a group. I am using group.entities.. but it is not the case. uvHelper behaves different INSIDE.
There is method in model called close_active. But I cannot find make_active. How can I achieve it?
In other words - is there way to do outliner double click in Ruby?
Tomasz
Thank you Clark. Unfortunately I am already finding faces as group entities but UVHelper doesn't give correct values or I am doing sth wrong.
Gaieus, I will issue SU2KT 2.3 without support for distorted textures within groups. I don't want to spend months on it. Exploding, exporting UVs and undoing explosion could be a solution!
Tomasz
Is there way to get inside the group and select face as one can do directly in SU? I know how to add an entity to selection but how I can enter the group(component) to use local coordinates?
I hope someone will be able to help me on the matter.
Thanks
Tomasz
@gaieus said:
Would the xml file be considerably bigger if all groups/components were exploded?
No. Only groups\components with photomatched textures need to be exploded prior to exporting. The rest of a model can stay untouched.
I want to export correct UVs from groups because it is a proper solution
I have sorted out issue #2.
For those interested how: I simply assign a texture to newly created group and write it to TW and then load again a face with the same texture to TW. If texture has been added twice it means it is distorted (photomatched).
I still don't know how to get proper UVs for distorted texture within a group.
Tomasz
Does anyone how why when I query the UVs of distorted texture located within a group or component, I am getting wrong coordinates? I thought UVs are independent of face location. What is the 'nature' of UV_helper? Do I need to apply global transformation of the face to UV_helper object to get correct UVs?
Thanks
Tomasz
I have found following method:
mat.materialType
Types are not described anywhere in documentation, but are quite easy to figure out:
0 - only colour
1 - texture used
2 - texture coloured
I think I have found a ruby bug. When the texture colour is reset materialType returns still 2.
It can be brought back to 0 when texture is removed.
When the user will reset colour the method is useless cos it returns wrong value.
Tomasz
Whaat & Rick
I am trying to make SU2KT export distorted textures correctly. It exports coloured textures cos
there is just one texture associated with a material. My script (beta) has problem with recognizing
the first texture getting into texturewritter. When should I use uvHelp? I could use it for all faces, but it would be memory consuming and simply is not necessary.
I have also noticed that UV coordinates obtained using UVHelper are affected when the faces are inside
group or component. When exploded, UVs are correct. It is a surprise for me.
Whaat, your script is an interesting one, but it is half-solution.
Thanks
Tomasz
I don't want to brake open door so here is my question:
How can I precisely identify that a face uses:
coloured texture
distorted texture (without fixed pins)
My solution to the first is to check texture.average_color and compare it with the colour of the material, if != then coloured=true? Am I thinking right?.
.. I have no solution.. comparing UVs using uv_at and using UVHelper? if == then distorted=false ?
Cheers
Tomasz
The file name is case sensitive. Does it matter?
Try dir with the folder and look for the file.upcase.
Tomasz
s=`c;/Program Files/Kerkythea/Kerkythea.exe "c;\\Program Files\\Kerkythea\\start.kst"`
It is script that will run exe with parameter in "" (PC).
For MAC I presume I will have to replace all \ by /.
Still don't know how to keep SU alive when KT is running.
Tomasz
Azuby, I have finally understood what you have written in you first post (I am not very familiar with standard Ruby methods). It works excellent with "dir", but for some reason KT is being opened only when I close SU otherwise SU is hanging and KT awaiting to start (edit - it takes about 40sec KT to start).
system("Kerkythea.exe start.kst")
s=`Kerkythea.exe start.kst`
works fine. Is it possible to run KT as a separate thread,
so SU would be still working?
Tomasz
Thanks Azuby,
Don't worry. I am not familiar with MACs at all. You are simply at the much higher level of programming then me, so most of what you are writing sounds like a Chinese to me I simply would like to start Kerkythea on MAC with start.kst file as a parameter (file to be opened when KT starts).
By the way, next version of KT is expected in few months and it will be available for MAC!
It is what Giannis says.
Thanks Whaat,
I have done some investigation and the line in the batch file should look like:
start "" "C:\Program Files\Kerkythea\Kerkythea.exe" "start.kst"
Now it works (PC only )!
Tomasz
Thanks Lads,
Azuby has killed me, I hope I will recover soon .
I need to run Kerkythea.exe (on Mac kerkythea) with single parameter (KT script file name).
On PC I create separate start.bat file containing :
kerkyhea.exe start.kst
Then I run this batch using UI.openURL(C:\start.bat) which opens command line window, starts batch file and finally opens KT. 'Dos' window is visible in the background so it is not clean solution.
Azuby - how it will look using your backtick?
Tomasz
Hi All,
I wonder if there is way to pass parameters to an executable directly through
UI.openURL("C:\format.exe /Y c:") ? The example unfortunately doesn't work although I have copied format.exe to root directory 8O I use DOS batch file but it is not compatible with MAC.
Related question to MAC users. What extension have executables on MAC and how should look proper UI.openURL(.....) for MAC?
Cheers
Tomasz