Jump to content

Blender


Empfohlene Beiträge

vor 10 Stunden schrieb Dad3353:

Once exported, the Material files have to be made 'power of 2' to comply with MBS import requirements

You have to do this before importing the materials. I have never tried, but this might be the problem why textures are not going along with exporting it.

 And to keep within the texture and material limits, especially when you are going to add transparent textures, animations, or even _CP points, that you use one texture only.

So, gather all in one. 256x1024 or 512x 1024 or 512 x 2028...whatever. 

 

Bearbeitet von hubert.visschedijk
Link zu diesem Kommentar
Auf anderen Seiten teilen

vor 10 Stunden schrieb Dad3353:

s there an easier way of accessing the Material images to change their dimensions, without having to 'unzip' each one, then zip it up again..? Or must I continue to edit the exported images..?

You not leave the textures files zipped before importing the model into MBS. (might be the other reason why textures are not going along.)

So , before importing into MBS, the archive contents are:

The x-file and the textures as they are "power of 2". 

 

 

Bearbeitet von hubert.visschedijk
Link zu diesem Kommentar
Auf anderen Seiten teilen

Hallo / Hello @Dad3353,

wenn Du in Sketchup mit dem DirectX-Exporter eine x-Datei erstellst, spezifizierst Du das Verzeichnis, in welchem die generierte x-Datei abgelegt werden soll. Wenn Du nun die x-Datei öffnest, um sie zu betrachten, findest Du gleich an deren Anfang die Material-Definitionen, in denen jeweils, sofern im Sketchup-Modell verwendet, die entsprechende Textur-Datei ausgewiesen ist.
When you create an x-file in Sketchup with the DirectX exporter, you specify the directory where the generated x-file should be stored. When you open the x-file to view it, you will find the material definitions at the very beginning of the x-file. If used in the Sketchup model, the corresponding texture file is shown in each definition.

Material Fenster {
  0.4980392156862745;0.4980392156862745;0.4980392156862745;1.0;;
  0.0;
  0.000000;0.000000;0.000000;;
  0.000000;0.000000;0.000000;;
  TextureFilename {"Fenster.png";}
}
Material Multitextur {
  0.5607843137254902;0.4823529411764706;0.4549019607843137;1.0;;
  0.0;
  0.000000;0.000000;0.000000;;
  0.000000;0.000000;0.000000;;
  TextureFilename {"_Custom.png";}
}

Im obigen Beispiel sind 2 Material-Definitionen abgebildet, welche die Bezeichnungen "Fenster" und "Multitextur" besitzen, und dene jeweils eine Texturdatei zugewiesen ist ("Fenster.png" und "_Custom.png"). Diese Texturdateien müssen im selben Verzeichnis abgelegt sein, in dem auch die erzeugte x-Datei enthalten ist. Beim Hochladen des Modells (der x-Datei) in das Modellbahn-Studio erkennt dieses anhand der Material-Definitionen, welche Textur-Dateien zu berücksichtigen sind und lädt diese automatisch mit hoch - sofern sie im selben Verzeichnins wie die x-Datei vorgefunden werden.
In the example above, 2 material definitions are shown, which have the names "Fenster" and "Multitextur", and to each of which a texture file is assigned ("Fenster.png" and "_Custom.png"). These texture files must be stored in the same directory as the generated x-file. When uploading the model (the x-file) into the Train Studio, the studio recognizes from the material definitions which texture files are to be considered and uploads them automatically - if they are found in the same directory as the x-file.

Das Modellbahn-Studio verlangt für die einzulesenden Texturdateien Kantenlängen in 2er-Potenzen. Normalerweise erzeugt man die Texturdatei schon vor der Einfärbung des Sketchup-Modells mit diesen Kantenlängen. Wenn Du aber Dein Modell bereits mit einer Textur eingefärbt hast, welche keine 2er-Potenzen als Kantenlängen besitzt, kannst Du die Textur durch "strecken und stauchen"  einfach in ein Format mit erlaubten Kantenlängen umwandeln. Die relativen Positionen der einzelnen Textur-Bestandteile bleiben hierbei erhalten (wie bei einem auseinander gezogenen Gummituch). Da die Texturbereiche in Sketchup alle relativ zur Gesamttextur referenziert werden, braucht nach dem Strecken oder Stauchen der Textur die Zuordnung im Modell nicht korrigiert zu werden. Sie ist weiterhin korrekt.
The Train Studio requires edge lengths in powers of 2 for the texture files to be imported. Normally, the texture file is created with these edge lengths before coloring the sketchup model. But if you have already colored your model with a texture that has no powers of two as edge lengths, you can easily convert the texture into a format with allowed edge lengths by "stretch and compress". The relative positions of the individual texture components are preserved (like a rubber blanket that has been stretched). Since the texture areas in Sketchup are all referenced relative to the overall texture, there is no need to correct the assignment in the model after stretching or compressing the texture. It is still correct.

Also auch wenn die Texturen, die Du dem Sketchup-Modelle zueordnet hast, in den Kantenlängen nicht korrekt sind, genügt es, die Texturdateien in dem Verzeichnis, in dem die x-Datei abgelegt ist, auf die erlaubten Kantenlängen zu strecken. Wenn das Modellbahn-Studio dann diese Texturdateien einliest, werden die Texturen auf dem Modell weiterhin korrekt wiedergegeben.
So even if the textures you have assigned to the Sketchup models are not correct in their edge lengths, it is sufficient to stretch the texture files in the directory where the x-file is stored to the allowed edge lengths. If the Train Studio then reads these texture files, the textures on the model will still be rendered correctly.

Bemerkungen zu den Animationen / Remarks on the animations:

Sketchup selbst unterstützt keine Animationen im Modell. Damit man die zu animierenden Bauteile im Modellbahn-Studio auch wirklich adressieren kann, müssen sie jedoch in Sketchup gruppiert und diese Gruppen mit eindeutigen Namen versehen werden (die Namen dürfen keine Umlaute und keine Leerzeichen enthalten!). Bei einigen Animationen empfiehlt es sich, den "Nullpunkt" des jeweiligen Bauteils explizit festzulegen, wofür der Sketchup-DirectX-Exporter eine spezifische Unterstützung bietet:
Sketchup itself does not support animations in the model. But to be able to address the parts to be animated in the Train Studio, they must be grouped in Sketchup and these groups must be given unique names (the names must not contain any umlauts or spaces!). For some animations it is recommended to explicitly define the "zero point" of the respective component, for which the Sketchup DirectX Exporter offers specific support:

Fügt man in die Baugruppe, die animiert werden soll ein kleines Element (z.B. ein kleines Viereck) ein, das man mit "_AP" bezeichnet. legt der DirectX-Exporter beim Erzeugen der x-Datei für die Baugruppe, in welche dieses _AP-Objekt eingefügt wurde, dessen Mittelüunkt als "Nullpunkt" (Koordinatenkeuz) der Baugruppe fest. So ist es dann im Nachhinein möglich, um diesen Nullpunkt eine Drehung zu realsieren (Rotation) oder die Baugruppe von diesem Nullpunkt ausgehend zu strecken (Scale).
If you insert a small element (e.g. a small square) called "_AP" into the group to be animated, the DirectX Exporter will set its zero point as the "origin" (coordinate cross) of the group when creating the x-file for the group into which this _AP object has been inserted. This makes it possible to rotate the group around this zero point (Rotation) or to stretch the group from this zero point (Scale).

Ist die x-Datei erzeugt, muss man von Hand an ihren Inhalt eine "AnimationSet"-Definition anhängen. In dieser werden dann die von Sketchup selbst nicht untestützten Animationen definiert. Hierzu ein kleines Beispiel:
Once the x-file has been created, an "AnimationSet" definition must be added to its content manually. In this definition the animations not supported by Sketchup itself are defined. Here is a small example:

Simple_House.zip

Im obigen Paket ist die skp-Datei für ein einfaches abstraktes Häuschen, die zugehörige x-Datei, die verwendete Texturdatei, die für die Steuerung der Animation im Modellbahn-Studio (MBS) benötigte anim-Datei und das fertige MBS-Modell (mbp-Datei) für den Import in das Modellbahn-Studio enthalten.
The package above contains the skp-file for a simple abstract little house, the corresponding x-file, the used texture file, the anim-file needed for the control of the animation in the Train Studio (TS) and the finished TS-model (mbp-file) for the import into the Train Studio.

Simple_house.thumb.JPG.85c6f7b40482661567cd15b1fe976551.JPG

Die Tür (Door) und die Fensterflügel (Window1, Window2) sind jeweils als Baugruppe zusammengefasst und enthalten jeweils ein kleines "_AP"-Objekt, mit dem das Koordinatenkreuz der Baugrumme, also insbesondere deren z-Achse als Drehachse festgelegt werden.
The door and the window sashes (Window1, Window2) are each combined as a group and each contain a small "_AP"-object, which defines the coordinate cross of the group, i.e. in particular its z-axis as rotation axis.

1078213407_AnimatetedObjects.thumb.JPG.50493d8ebdde490a962c5384f3e246b1.JPG

Die _AP-Gruppen sind nur im Sketchup-Modell sichtbar und werden beim Export vom DirectX-Exporter interpretiert, aber nicht an das Modellbahn-Studio weitergeleitet, werden also bei der Zählung der Polygone nicht berücksichtigt.
The _AP groups are only visible in the Sketchup model and are interpreted by the DirectX Exporter during export, but are not forwarded to the Train Studio, so they are not considered when counting the polygons.

1012184437_AnimationSetDefinition.thumb.jpg.c7d6c7e073ccbeaad7a6256853ce5e1c.jpg

Nachdem die x-Datei erzeugt wurde, wird in ihr am Ende die AnimationSet-Definition angehängt. Die oben abgebildete AnimationSet-Definition enthält Animationen für die Baugruppen "Door", "Window1" und "Window2", die im Sketchup-Modell als Gruppen definiert wurden und in der x-Datei als Frames vorhanden sind. Auf diese Frames wird in den einzelen Aniamtions-Abschnitten Bezug genommen.
After the x-file has been created, the AnimationSet definition is added to the end of the x-file. The AnimationSet definition shown above contains animations for the groups "Door", "Window1" and "Window2", which were defined as groups in the Sketchup model and exist as frames in the x-file. These frames are referred to in the individual animation sections.

Für das Öffnen der Tür und der Fensterflügel wird jeweils eine Rotation benötigt. Diese erfolgt um die z-Achse am Nullpunkt der jeweiligen Baugruppe. Um das Objekt um den Winkel "w" zu drehen, müssen in die Zustände der einzelen Anmaitions-Positionen die Cosinus- und Sinus-Werte des halben Drehwinkels "w" (also cos(w/2) und sin(w/2)) eingegeben weren. Der Cosinus-Wert steht immer in der Spalte links. Der Sinus-Wert steht in jener Spalte, um dessen Achse die Drehung erfolgen soll.
For opening the door and the window wings a rotation is needed in each case. This is done around the z-axis at the zero point of the respective group. To rotate the object by the angle "w", the cosine and sine values of half the rotation angle "w" (i.e. cos(w/2) and sin(w/2)) must be entered into the state lines of the individual aniamtion positions. The cosine value is always in the column on the left. The sine value is in the column around whose axis the rotation is to take place.

Eine ausführliche Beschreibung der AnimationSet-Defnition befindet sich in diesem Beitrag im Abschnitt "Grundsätzliches zur AnimationSet-Definition" (allerdings nur auf Deutsch).
A detailed description of the AnimationSet-Definition can be found in this article in the section "Grundsätzliches zur AnimationSet-Definition" (Basics of the AnimationSet-Definition) (but only in German).

Damit die Animationen des Modells im Modellbahn-Studio gesteuert werden können, benötigt man noch die anim-Datei, in der festgelegt wird, welche Abschnitte der Gesamtanimation zu welcher (zu bediendenden) (Teil-)Animation gehören.
In order to control the animations of the model in the Train Studio, you need the anim file, in which you define which sections of the whole animation belong to which (part of) the animation.

Anim-File.JPG.b8c58e3f82702de937978e98afce445f.JPG

Bei dem vorliegenden Beispiel sind es 2 Animationen "Door" und "Windows", wobei die zweite gleichzeitig beide Fensterflügel bedient.
In this example there are 2 animations "Door" and "Windows", where the second one serves both window wings simultaneously.

Viele Grüße / Many greetings
BahnLand

Link zu diesem Kommentar
Auf anderen Seiten teilen

6 minutes ago, hubert.visschedijk said:

: D

Nobody can compete with the thoroughness of BahnLand´s explanations

Nobody can keep up with the thoroughness of the explanations from @Bahnlands

Be assured that, despite the excellent explanations and examples, I am dunce enough to come back with more daft questions ..! It's not only the tutor that needs to be great; the student has to be, too ..! : $

Rest assured that despite the excellent explanations and examples, I am stupid enough to come back with dumber questions ..! It's not just the tutor who has to be great. the student must be too ..! : $

Bearbeitet von Dad3353
Link zu diesem Kommentar
Auf anderen Seiten teilen

@BahnLand Another explanation, please..? I finally got the complete Simple House exported from SU 2017 and imported to MBS, by copying the 'Animation' part of your own '.x' file, and pasting it onto mine (we're using different Export versions; where did your v4.0 come from, please..?). I don't understand, however, how the 'Palette.png' file is used. It has nine colours, but I can't pick one to paint with. How would I make a Png file if I wanted bricks and roof tiles..? Does SU use Colours and Materials differently (the Exporter doesn't Export a 'Colour' jpg, only 'Materials'...). If I want to insert glass panes into the windows, do I need another, external, Material file, or can I just 'paint' the windows with 10% opacity..?
OK, that's too many questions at once, but I didn't understand the 'Palette' file. Maybe the answer is there, somewhere..?

Noch eine Erklärung, bitte ..? Ich habe endlich das komplette Simple House aus SU 2017 exportiert und in MBS importiert, indem ich den 'Animation'-Teil Ihrer eigenen' .x'-Datei kopiert und in meine eingefügt habe (wir verwenden verschiedene Exportversionen; wo ist Ihre v4? .0 kommen bitte ..?). Ich verstehe jedoch nicht, wie die Datei 'Palette.png' verwendet wird. Es hat neun Farben, aber ich kann keine auswählen, mit der ich malen möchte. Wie würde ich eine PNG-Datei erstellen, wenn ich Ziegel und Dachziegel wollte? Verwendet SU Farben und Materialien unterschiedlich (der Exporter exportiert kein 'Farbe'-JPG, nur' Materialien '...). Wenn ich Glasscheiben in die Fenster einfügen möchte, benötige ich eine andere externe Materialdatei oder kann ich die Fenster einfach mit 10% Deckkraft "streichen"?
OK, das sind zu viele Fragen gleichzeitig, aber ich habe die 'Palette'-Datei nicht verstanden. Vielleicht ist die Antwort irgendwo da ..?

Link zu diesem Kommentar
Auf anderen Seiten teilen

OK, Hubert; thanks. I'd better stop posting here, anyway, as it's supposed to be a 'Blender' topic ..! :O

OK, Hubert; Many thanks. I better stop posting here as it's supposed to be a "Blender" topic ..! :O

@BahnLand : The answers to my questions are in the information linked to by Hubert, so please ignore my questions above. Other questions will be posted to a separate topic. Many thanks.

Die Antworten auf meine Fragen finden Sie in den von Hubert verlinkten Informationen. Bitte ignorieren Sie meine obigen Fragen. Andere Fragen werden zu einem separaten Thema gestellt. Danke vielmals.

Bearbeitet von Dad3353
Link zu diesem Kommentar
Auf anderen Seiten teilen

Erstelle ein Benutzerkonto oder melde dich an, um zu kommentieren

Du musst ein Benutzerkonto besitzen, um einen Kommentar verfassen zu können

Benutzerkonto erstellen

Neues Benutzerkonto für unsere Community erstellen.

Neues Benutzerkonto erstellen

Anmelden

Du hast bereits ein Benutzerkonto? Melde dich hier an.

Jetzt anmelden
×
×
  • Neu erstellen...