Skip to main content
mikewogden1234
Participating Frequently
February 5, 2020
Question

Automation issues with 3D actions using COM library from VB.NET

  • February 5, 2020
  • 1 reply
  • 201 views

I am automating Photoshop using the COM library reference through a VB.NET library. In general things work pretty well, but I am seeing consistent problems with actions on 3D layers being properly applied. For example, I am trying to set the 3dmodel extrusion depth, or change the infinite light intensity, or turn off infinite light shadows. The history shows that the action was executed, but when I look at the content of the Photoshop file, the results of the action are not there. For example, the infinite light default intensity is 90% and my code is supposed to set it to 50%. The history shows there was an action executed to change it to 50%, but the light is still at 90%.

Can anyone offer any tips on how to get this to work reliably?

Is there a way to notify Adobe about it as a bug?

The next idea I will try is to programmatically write a JS script file and then programmatically instruct photoshop to execute that JS script file. It seems like the JS script files work more reliably than the COM automation, but this is a major hassle. 🙂

This topic has been closed for replies.

1 reply

JJMack
Community Expert
Community Expert
February 5, 2020

Have you expanded all the steps in your action and read all the setting recorded for each action step. Is 50% recorded in the action step the that sets the infinite light intensity.  Did the action record your step correctly? If you have a problem with an action you should upload  its set's .atn file a post a link to it so we can test the action.  It hard to give you any help without seeing your action's steps. 

JJMack
mikewogden1234
Participating Frequently
February 6, 2020

Hi JJMack, thank you for the response. Remember, this is not a recorded action, but VB.NET code that is sending the command to Photoshop via the Photoshop COM .dll.

 

Here is the code that I am executing to set the light intensity to 50%. I determined this code by using the Photoshop plugin that writes out javascript and vbscript files when the user executes operations. These files will successfully apply the change if I just run them from within Photoshop. But for my purpose, I need to execute it within a lot of other actions that are all chained together through my VB.NET automation. So I take the javascript and refactor it into VB.NET syntax... they are only syntactical changes, I do not make any other changes.

 

        Dim idsetthreeDLightIntensity As Integer = psApp.StringIDToTypeID("set3DLightIntensity")

        Dim desc19 As New ActionDescriptor()

        Dim idkeythreeDNameList As Integer = psApp.StringIDToTypeID("key3DNameList")

        Dim list6 As New ActionList()

        list6.PutString("""Infinite Light 1""")

        desc19.PutList(idkeythreeDNameList, list6)

        Dim idkeythreeDLightIntensity As Integer = psApp.StringIDToTypeID("key3DLightIntensity")

        desc19.PutDouble(idkeythreeDLightIntensity, 0.5)

        psApp.ExecuteAction(idsetthreeDLightIntensity, desc19, Photoshop.PsDialogModes.psDisplayNoDialogs)

 

 

JJMack
Community Expert
Community Expert
February 6, 2020

I do not use VB I have never look at what Scriptlistenet  records for VB Action manager code. I set the VB log file attribute to read only  so no VB code is recorded on my  machine.    If the code you show works when you run it  as a VB script  from menu File>Scripts>VBScriptName.   I would add an Alert or some kind of message into the code to make sure that code is being run from COM.dll  so that you can see that it is and also see the document conditions and state is proper for the command to be used.  Otherwise the command would not be available for use.  I would not knows how COM.dll would reflect that to the user.  I have never tried to write an extension or or Plug-in and don't know VB.  All of this is above my pay grade.

JJMack