cancel
Showing results for 
Search instead for 
Did you mean: 

Add multiple textures to a collada object

Former Member
0 Kudos

Hi,

I am trying to add textures and materials to a collada object. My problem is, that the collada-type only has one property for textures as a "string".

I need to know whether it is possible to add multiple texture files to a single collada object and - if it is - how to add them.

Thanks and regards,

Marc

Accepted Solutions (1)

Accepted Solutions (1)

former_member182119
Active Participant
0 Kudos

Hello Mark,

Ralf is right, that you can only apply one color or one texture dynamically to a collada object. However, statically, referenced out of the collada DAE file itself, you can have any number of textures and materials. The material descriptions (color) are directly embedded in the collada file and will work out of the box (with some restrictions on the handling of the specular light component). Textures are just referenced from the collada file and they need to be part of the initial archive send the our control with the proper path. At least the VB backend impl will not be able to handle them propertly, which might require some adaptions on appl. side.

Best regards,

Uwe

Former Member
0 Kudos

Hello Uwe,

what do you mean with "with the proper path"? My objects are rendered with relative paths to the textures, which are in the same directory. Or should it be the path in the mime repository?

What do you mean with "the VB backend impl will not be able to handle them propertly, which might require some adaptions on appl. side"? Is it possible for me to do these adaptions in my application or would I have to change something in the VB backend itself?

Thanks and regards,

Marc

former_member182119
Active Participant
0 Kudos

Hello Marc,

in the backend the VBI application object has a method GET_INITIAL_ZIP_ARCHIVE. This method returns a Base64 encoded ZIP archive including an XML file and all required resources, e.g. DAE-Files. This ZIP archive needs also to include the Texture with the right path relative to the DAE-Files.

When calling this method you can specify additional resources to be added to the archive via table IT_ADDITIONAL_RESOURCES. This table holds resource entries with a name and the binary content. I checked it and you can just add the path to the name:

- Texture.jpg will be in the root of the ZIP archive

- Image/Texture.jpg will create a sub folder Image and place the texture there

Best regards,

Uwe

Former Member
0 Kudos

Hi Uwe,

I noticed, that not all of my textures are shown in the Visual Business component. Some of them are still missing.

All of the DAE-Files and all of the textures are in the same folder and have the right path. I checked the archive in debug-mode and they are all loaded correctly with their content.

Is there some kind of maximum capacity like the component can only handle up to x textures or collada objects (or file size) in the same time?

Or are there any restraints for the path of the textures e.g. they have to be in a subfolder?

Thanks and regards,

Marc

EDIT: The textures shown on the objects were used because I falsely added them in the "ADD_COLLADA"-Method of the component. Without it, no texture is displayed.

0 Kudos

Hi Marc,

there is no hard limit on how many textures can the collada object have.

However there maybe some issues in reading and placing the textures on the correct part of the object.

But I cannot say exactly what may be the problem, I could only guess.

From what I understand, some textures are shown, so that means the path is correct.

Is it possible to have the project .zip file sent to my email, or the .dae file with the textures, so I could try to check what may be the issue?

Thanks and regards,

Dimitar

Former Member
0 Kudos

Hi Dimitar,

I am currently not allowed to send the files to others. I will have to check it first and try to fix the problems myself.

As I said in the edited part, the textures shown in the component are not loaded from the dae-file but from the collada-method in the code.

If you say the path is correct, what should it look like exactly?

<init_from>FFM_MAP_RESIDENT_MAP_8.jpg</init_from>

or

<init_from>file://FFM_MAP_RESIDENT_MAP_8.jpg</init_from>

These two are examples, depending on which exporter I used. The original files are in ".MAX". Do you know any problems in trying to convert them to a dae format Visual Business can read?

Regards,

Marc

0 Kudos

Hi Marc,

I have a question.

Do you specify the textures manually or the textures are already specified in the converted .DAE file?

The first texture path is correct, the second path i don't know from where is generated, and it will not work with that.

We have complex converted .dae files from the Blender 3D Editor, and they work perfectly, with many textures, so I am not aware of problems as of now.

Regards,

Dimitar

Former Member
0 Kudos

The textures are specified in the .max file and I can see them on the model in the 3DS Max Editor.

If you say it works fine with the Blender Editor, do you export them with the standard exporter or with a plugin?

Regards,

Marc

Former Member
0 Kudos

Hi,

I got the model to work in Blender.

The upper one is a screenshot of a part of my model in Blender.

The second one is a screenshot of the dae file exported by blender in an external dae-viewer.

The third one is a screenshot of the model in a visual business component. As you can see, the textures are missing, but there are placeholder in the right places.

The last one shows the zip folder in sap debug and some of the paths in the dae. I hope these pictures help to better understand what exactly my problem is.

(As I said previously, I can add one texture to the model via visual business functionality by adding the variable while creating the collada object in the scene. So the visual business component has acces to the texture files.)

Regards,

Marc

0 Kudos

Hi Marc,

I understand what the problem is, but unfortunately from the provided examples, I cannot say exactly what is the cause, until I see the .dae file and try to load it with Visual Business.

In the meantime, I could give some suggestions to try..

You could try with checking the Texture Options in the Default Blender Collada exporter like in the picture below:

If the above doesn't work, could you edit the model and remove all the textures, and then put one texture on it and see it that works?

Also could you tell me which options you select in the exporter, I could try doing the same and see if there is a problem with that?

Thanks and regards,

Dimitar

Former Member
0 Kudos

Hi Dimitar,

I got the permission to send you the files. I need to know which files exactly you need and where to send them.

I could send you a "obj"- file to import the model, a "dae" and the textures.

Thanks and regards,

Marc

0 Kudos

Hi Marc,

Ok so i would like to get the original .obj, the .dae and the textures if possible, so i could check for the issue properly.

Could you just send me an email and then i will reply with the upload link where you can upload these files?

Thanks and regards,

Dimitar


Former Member
0 Kudos

Hi, Dimitar,

sorry, I cannot send you an Email because your address is private.

Thanks and regards,

Marc

0 Kudos

Hi Marc,

I'm sorry for that, it was set by default to private.

Now you should be able to see it.

Regards,

Dimitar

former_member182119
Active Participant
0 Kudos

Hi Marc,

after we received your model we where able to run it from the backend with a little test program. As you can see from the screen shot multiple textures are in use:

Here is a lle ABAP snipped with the relevant coding for loading the model with multiple textures:

*   load application

     data: LV_APPL type ref to LCL_APPLICATION,

           LS_START_POSITION type CL_VBI_APPLICATION=>GTYPE_SCENE_POSITION,

           LS_COLLADA_ENTRY type CL_VBI_APPLICATION=>GTYPE_COLLADA_VO_ENTRY,

           LT_COLLADAS type CL_VBI_APPLICATION=>GTYPE_COLLADA_VO_TAB.

     create object LV_APPL.

     LS_START_POSITION-ZOOM = '1'.

     LS_START_POSITION-SCENE_PITCH = 70.

     LS_START_POSITION-SCENE_ROTATION = 0.

     LS_START_POSITION-CENTER-YPOS = '-3.0'.

     LS_START_POSITION-CENTER-ZPOS = '-9.0'.

     LS_COLLADA_ENTRY-ID = 'MODEL'.

     LS_COLLADA_ENTRY-RESOURCE_NAME = 'VisualBusiness.dae'.

     append LS_COLLADA_ENTRY to LT_COLLADAS.

     LV_APPL->INITIALIZE( IV_APPLICATION_ID       = '3D_DEMO'

                          IS_START_POSITION       = LS_START_POSITION

                          IT_COLLADA_VOS          = LT_COLLADAs ).

     LV_APPL->ATTACH_UI_CONTROL( MY_VISUALBUSINESSCONTROL ).

*   get additional texture images from MIME repositiory

     data: LV_MR_API               type ref to IF_MR_API,

           LS_RESOURCE_ENTRY       type CL_VBI_APPLICATION=>GTYPE_RESOURCE_ENTRY,

           LT_ADDITIONAL_RESOURCES type CL_VBI_APPLICATION=>GTYPE_RESOURCE_TAB.

     LV_MR_API = CL_MIME_REPOSITORY_API=>IF_MR_API~GET_API( ).

     data: LV_URL type STRING.

     LV_URL = '/sap/public/bc/ztest_ur/FFM_MAP_17FLOOR_001_ALP_9_2013_1.png'. "#EC NOTEXT

     LV_MR_API->GET( exporting I_URL             = LV_URL

                               I_CHECK_AUTHORITY = ABAP_FALSE

                     importing E_CONTENT         = LS_RESOURCE_ENTRY-CONTENT

                     exceptions others           = 0 ).

     LS_RESOURCE_ENTRY-NAME = 'FFM_MAP_17FLOOR_001_ALP_9_2013_1.png'. "#EC NOTEXT

     append LS_RESOURCE_ENTRY to LT_ADDITIONAL_RESOURCES.

     LV_URL = '/sap/public/bc/ztest_ur/FFM_MAP_17FLOOR_001_MAP_9_2013_1.jpg'. "#EC NOTEXT

     LV_MR_API->GET( exporting I_URL             = LV_URL

                               I_CHECK_AUTHORITY = ABAP_FALSE

                     importing E_CONTENT         = LS_RESOURCE_ENTRY-CONTENT

                     exceptions others           = 0 ).

     LS_RESOURCE_ENTRY-NAME = 'FFM_MAP_17FLOOR_001_MAP_9_2013_1.jpg'. "#EC NOTEXT

     append LS_RESOURCE_ENTRY to LT_ADDITIONAL_RESOURCES.

...

     LV_URL = '/sap/public/bc/ztest_ur/VisualBusiness.dae'. "#EC NOTEXT

     LV_MR_API->GET( exporting I_URL             = LV_URL

                               I_CHECK_AUTHORITY = ABAP_FALSE

                     importing E_CONTENT         = LS_RESOURCE_ENTRY-CONTENT

                     exceptions others           = 0 ).

     LS_RESOURCE_ENTRY-NAME = 'VisualBusiness.dae'. "#EC NOTEXT

     append LS_RESOURCE_ENTRY to LT_ADDITIONAL_RESOURCES.

*   send application to frontend

     CONTENT = LV_APPL->GET_INITIAL_ZIP_ARCHIVE( IT_ADDITIONAL_RESOURCES = LT_ADDITIONAL_RESOURCES ).

     MY_VISUALBUSINESSCONTROL->LOAD( CONTENT ).


Cheers,

Uwe

Former Member
0 Kudos

Hi Uwe,

my code looks just like yours, but it is still not working. I just tried it in a new application and with this snippet, but that did not work as well.

Are there any changes in the code which adds the model to the component? Or is it possible, that I need some addons or updates?

Regards,

Marc

former_member182119
Active Participant
0 Kudos

Hi Marc,

in order to answer this I would need the exact version your are using. You find this in SAPGUI In menu System->Status... on the popup press button Components in the SAP System Data area. The upcoming popup shows a table with all installed software components and there exact version.
For visual business you have either SC UI_7xx or SAP_UI installed. Please report the release and patch level.

Also the version of the VB frontend is important. In order to find out the version hold down Ctrl+Alt key and right click the control. This will open a properties window with the version info. For multi texture support you need at least VB21 PL2 (with is internal PL5 on the popup)

Beside this is the third screen shot in your reply from May, 26 still what you get?

Cheers,

Uwe

Former Member
0 Kudos

Hi Uwe,

we have SAP_UI 740 SP0012 installed on our server, and on the VB frontend it is 2.1 Final Release PL 3.

It still looks similar, but now it is more like a dark grey.

Regards,

Marc

former_member182119
Active Participant
0 Kudos

Hi Marc, When the control states "2.1 Final Release PL3" than this is the issue. You need at least PL5! You get the latest version from here: https://websmp203.sap-ag.de/~form/handler?_APP=00200682500000001943&_EVENT=DISPHIER&HEADER=Y&FUNCTIO...
Cheers, Uwe

Former Member
0 Kudos

Thanks a lot!

It finally works now!

I should have asked earlier for updates.

Answers (1)

Answers (1)

ralf_rath
Explorer
0 Kudos


Hi Marc,

this is not possible. You can only add a texture and change the color of a collada object.