Jump to content

Carles Olle

Member
  • Posts

    50
  • Joined

  • Last visited

Everything posted by Carles Olle

  1. Hi, I have a project with many lights, rendering in Twinmotion. Now Datasmith DirectLink allows exporting light instruments to the TM scene. I found out that: VW Light "On/Off" --> TM "Light Enabled." VW Light "Field Angle" --> TM "Cone Angle." VW Light "Brightnes %" --> TM "Intensity" I could not find which VW parameters map to TM Attenuation, Cast Shadows, Volumetric Shadows, Color, Color temperature, etc. Is there a document where these details are explained? Also, If I change some of these parameters in TM, every DirectLink update resets them to the defaults os the VW values. Vetorworks 2023 SP3 Twinmotion 2023.1.2
  2. Import Arroway Textures menu option crashes always Using VW 2023 SP3 (Build 684728) (64-Bit) in MacOS M1 processor Any clue of what might be happening? Thanks
  3. Hi @Adam Robinson I'm using VW 2020 (Build 508509) (64bit) and the service pack list is empty. Any advice? Thanks
  4. Did you finally find which was the issue? I'm facing similar problem. thanks
  5. Hi, Joshua(@JBenghiat) I'm also trying the texture mapping and not going anywhere 💀 Did you finally manage to set up the texture mapping? Thanks --Carles
  6. My problem was that, after following the steps described here , my linker was still pointing to the debug version of VWSDK.lib. I think that the wiki has been updated with the additional step.
  7. I've been trying to port an existing plugin to Vectorworks 2019 SDK and I faced the issues described in this post. We are service select customers but Vectorworks support says that the SDK is supported exclusively through this community forum. There has not been any response to my question in the post above (other than confirm the issue). Is there any Nemetschek representative reading these posts that can confirm that the VWSDK2019 is supported through this forum? Thanks in advance --Carles
  8. Hi, I'm in the situation that I need to create around 1000 objects with a mapped texture each. Now I'm doing it manually and, as you can imagine it takes a long time. I've tried to automate the process by creating a python script but it just happens that python doesn't have the functions to load an image file (png, jpg, etc.), create a texture/material and set up the correct aspect ratio for a right object mapping. My question is: Is there a way to archive the functionality described above using the VW SDK? Thanks in advance. Carles
  9. Hi, I have an object with an assigned color texture image ( see "How to assign a texture to a 3d object"). I need to change the the associated texture image aspect ratio to adapt to the dimensions of the object. I don't seem to be able to find the function to archive this. Would it be possible to use some sort of vs.GetTexBitPaintNode() / vs.SetTexBitPaintNode() / vs.CreatePaintFromImgN() combination in order to manipulate and reassign the bitmap bits? Those functions seem to be deprecated. Is there new, equivalent functions to archive this? Thanks
  10. That's exactly right. Thanks (I have another question but I'll open a new topic)
  11. This is a question that probably has a simple answer but that, for some reason I cannot manage to get right. So far I have this code but it does not seem to produce the expected results (the 3D poly-line does not show any texture at all): vs.BeginPoly3D() vs.Add3DPt((-5, 0, -5)) vs.Add3DPt(( 5, 0, -5)) vs.Add3DPt(( 5, 0, 5)) vs.Add3DPt((-5, 0, 5)) vs.Add3DPt((-5, 0, -5)) vs.EndPoly3D() image = vs.LNewObj() textureRef = vs.Name2Index("Test texture") vs.SetObjExpandTexture(image, 0) vs.SetTextureRef(image, textureRef, 1) vs.SetDefaultTexMap(image) vs.SetTexMapBool(image, 3, 3, True) # repeat horizontally vs.SetTexMapBool(image, 3, 4, True) # repeat vertically vs.SetTexMapInt(image, 3, 1, 0) # plane projection vs.SetTexMapReal(image, 3, 1, 0) # offset x vs.SetTexMapReal(image, 3, 2, 0) # offset y vs.SetTexMapReal(image, 3, 3, 10) # scale vs.SetTexMapReal(image, 3, 4, 0) # rotation Why this doesn't work? Any hint will be appreciated. --Carles
  12. Yes, that works. Thanks. Now I need to find ways to implements "search" and "new texture..."
  13. Hi, I need to allow user to select a texture from one of our dialogs. I've been looking around and I don't seem to find the function to create the control to se select textures. Thanks for the help.
  14. I assume that asking for a debug version of VW2019 is out of the question 😏 Anyway, Thanks Nicolas.
  15. Thanks for the reply Nicolas, I'm using VW SDK 2019 which I downloaded from https://www.vectorworks.net/support/custom/sdk/sdkdown I decided to use Visual Studio 2017 as it is indicated in http://developer.vectorworks.net/index.php/SDK:Vectorworks_2019_Development but it seems they forgot to mention not to use the toolset that comes with VS2017 (is this the right source for the VW SDK documentation?) If I open DefaultTools.vcxproj from the VW SDK 2019 samples folder I see they are using the 2017 toolset (v141): <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>DynamicLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> <PlatformToolset>v141</PlatformToolset> </PropertyGroup> It compiles ok using 2017 toolset (v141) but when running the debug version (release version is ok) I get the Exception described above. When I change to 2012 toolset (v110) I get these errors: 1>------ Build started: Project: DefaultTools, Configuration: Debug x64 ------ 1>StdAfx.cpp 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\GSString.X.h(682): error C2143: syntax error : missing ';' before '{' 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\GSString.X.h(682): error C2275: 'std::hash<_Kty>' : illegal use of this type as an expression 1> with 1> [ 1> _Kty=std::u16string 1> ] 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_NORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(267): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_NORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(268): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(269): error C2065: 'FP_ZERO' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MCFloat.h(269): error C2065: 'FP_SUBNORMAL' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(2561): error C2065: 'default' : undeclared identifier 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(2561): error C2253: 'TransferImageEffects' : pure specifier or abstract override specifier only allowed on virtual function 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(4001): error C2614: 'SymbolImgInfo' : illegal member initialization: 'SymbolImgInfo' is not a base or member 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\kernel\MiniCadCallBacks.h(4002): error C2614: 'SymbolImgInfo' : illegal member initialization: 'SymbolImgInfo' is not a base or member 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(29): error C2864: 'VectorWorks::Extension::SSearchProperties::fOnlyCurrentDoc' : only static const integral data members can be initialized within a class 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(30): error C2864: 'VectorWorks::Extension::SSearchProperties::fSearchOnline' : only static const integral data members can be initialized within a class 1>c:\users\...\appdata\roaming\nemetschek\vectorworks\2019\sdk\sdklib\include\interfaces\VectorWorks/Extension/IResourceManagerContent.h(31): error C2864: 'VectorWorks::Extension::SSearchProperties::fSkipCurrentDoc' : only static const integral data members can be initialized within a class 1>Done building project "DefaultTools.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
  16. I'm compiling DeafultsTools SDK sample but when running the debug version of the plug-in in VectorWorks 2017 an exception is thrown. Windows SDK Version: 10.0.17134.0 Platform Toolset: Visual Studio 2017 (v141) No compilation error or warnings. The exception is thrown when inside the VWExtensionTool constructor (VWExtensionTool.cpp): fstrTitle = TXResStr( toolDef.fTitle.fResNameWithoutPathOrExtension, toolDef.fTitle.fStringIdentifier, eAllowEmptyResult ); toolDef.fTitle.fResNameWithoutPathOrExtension = "ExtObjThePoint" toolDef.fTitle.fStringIdentifier = "tool_title" eAllowEmptyResult = 1 This is the stack trace DefaultTools.vlb!std::_Container_base12::_Orphan_all() Line 256 C++ DefaultTools.vlb!std::_String_alloc<std::_String_base_types<wchar_t,TXAlloc<wchar_t> > >::_Orphan_all() Line 1803 C++ DefaultTools.vlb!std::basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >::_Tidy_deallocate() Line 3693 C++ DefaultTools.vlb!std::basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >::~basic_string<wchar_t,std::char_traits<wchar_t>,TXAlloc<wchar_t> >() Line 2231 C++ > DefaultTools.vlb!TXString::~TXString() Line 376 C++ [External Code] DefaultTools.vlb!VWFC::PluginSupport::VWExtensionTool::VWExtensionTool(CallBackBlock * cbp, const VWFC::PluginSupport::SToolDef & toolDef) Line 49 C++ DefaultTools.vlb!DefaultTools::CExtObjThePointDefTool::CExtObjThePointDefTool(CallBackBlock * cbp) Line 112 C++ DefaultTools.vlb!VWFC::PluginSupport::REGISTER_Extension<DefaultTools::CExtObjThePointDefTool>(const VWIID & groupID, int action, void * moduleInfo, const VWIID & inInterfaceID, IVWUnknown * & inOutInterface, CallBackBlock * cbp, int & reply) Line 349 C++ DefaultTools.vlb!plugin_module_main(int action, void * moduleInfo, const VWIID & iid, IVWUnknown * & inOutInterface, CallBackBlock * cbp) Line 41 C++ [External Code] Do you know if I need to change something in the sample code? Thanks.
  17. Thanks Patrick, this works great! Cheers --Carlos
  18. I'm not sure which is the best way to do this so I will ask. I have a relatively complex dialog that requires entering a number of settings. The dialog and its settings are not attached to a specific object but rather allow to create a number of objects. Most of the time parameters are the same but the user has to enter them again every time the dialog opens. Is there a way to attach to the document a set of attributes that ban be used so save and reload the settings for the dialog controls? Thanks --Carlos
  19. Thanks DomC, I do have a menu option "Import Arroway Textures" with I assume is the one you mention above. Let me see if I understand the tip. The first script above will convert a directory with images (in PNG format?) to a format that the Import command will understand. After that script in step 1 is executed, then, manually select the "Import Arroway Textures" command in order to automatically create all the textures. Optionally run the second script in order to rename the created textures during step 2 Is that correct? Cheers --Carlos
  20. Hi, I don't seem to find the way to create a texture color shader that will use a bitmap imported from the file system. Looking at the documentation I found this possible sequence: texture = vs.CreateTexture() vs.SetName(texture, "Test Texture") shader = vs.CreateShaderRecord(texture, 1, 41) bitmap = vs.CreateTextureBitmap() image = vs.ImportImageFile("E:\IMG_8509.JPG", importPt) paint = vs.CreatePaintFromImage(image) vs.SetTexBitPaintNode(bitmap, paint) vs.SetTextureBitmap(shader, bitmap) There seems to be some problems with this sequence: vs.CreateTextureBitmap() is not doing what the documentation says; Instead of creating an empty bitmap object, it opens a dialog to pick an image. It seems to be deprecated also. For some reason vs.CreatePaintFromImage(image) returns always 0 when an a Type 14 (Bitmap Image – BITMAP) coming from vs.ImportImageFile() is used as parameter. Some help will be appreciated Thanks --Carlos
  21. Hi Josh, Yes, the code is part of a menu command. Yes, your understanding is correct. I take some actions when the PIO instance is duplicated; Change a contained Image Prop, change the ID, etc. The PIO entry function is called when I duplicate the PIO manually (not as part of a symbol duplication) but the PIO entry function does not seem to be called when the duplication happens as part of a symbol duplication and the two PIOs end up containing the same Image Prop. This is the snipped I use for the kObjOnInitXProperties event handling: if theEvent == vs.kObjOnInitXProperties: # Enable custom shape pane _ = vs.SetObjPropVS( vs.kObjXPropHasUIOverride, True ) _ = vs.SetObjPropVS( vs.kObjXHasCustomWidgetVisibilities, True ) vs.SetPrefInt(vs.varParametricEnableStateEventing, 1) _ = vs.SetObjPropVS( vs.kObjXPropAcceptStates, True ) _ = vs.SetObjPropVS( vs.kObjXPropAcceptStatesInternal, True ) InitParameters() Cheers --Carlos
  22. Hi, Does anybody know which are the values for object variables: const short ovThumbnailView = 1152; // short write only - The Resource Browser's thumbnail view for a symbol - Public for VS const short ovThumbnailRender = 1153; // short write only - The Resource Browser's thumbnail render for a symbol - Public for VS I did try to set them up with a bunch of values (0, 1, 2, etc.) but it does not seem to work with this code: vs.BeginSym("{} Picture Symbol".format(pictureName)) picture = vs.CreateCustomObject("Picture", 0, 0, 0) vs.SetName(picture, pictureName) vs.EndSym() symbol = vs.GetObject("{} Picture Symbol".format(pictureName)) vs.SetObjectVariableInt(symbol, 1152, 3) #Thumbnail View - Front vs.SetObjectVariableInt(symbol, 1153, 2) #Thumbnail Render - OpenGL Somehow I don't seem to be able to find this information. Any ideas? Thanks --Carlos
  23. Hi, I'm creating PIO that can be created inside a symbol. I'm using a code similar to this: def execute(): objDlg = createObjectDialog() if vs.RunLayoutDialog(objDlg, objectDialogHandler) == kOK: if createSymbol == "True": vs.BeginSym(symbolName) object = vs.CreateCustomObject("MyObject", 0, 0, 0) vs.Record(picture, "MyObject") vs.Field(picture, "MyObject", "objectName", objectName) ... vs.ResetObject(object) vs.SetName(object, objectName) if createSymbol == "True": vs.EndSym() The symbol is created properly. The problem comes when, from the Resource Manager panel you right click the created symbol and select "Duplicate..."; When you duplicate the symbol, the object instance of the original symbol is used for the duplicated symbol. In this way, if you modify the object inside the duplicated symbol, the object inside the original symbol (same instance) is also affected. Is there a way to force to create a new object instance (copy) whenever you duplicate a symbol? Thanks --Carlos
×
×
  • Create New...