![]() |
【转帖】materials and mappers
materials and mappers
materials and mappers hello, i'm currently trying to write autocad r17 compatible materials to a dwg. defining materials is working almost fine. the problem however lies within the assignment of the materials to my blockinserts. autocad 2007 shows the materials correctly assigned to the inserts of my blocks. but when rendered all surfaces appear pure white. when i assign the material to a volume drawn by hand the material is displayed correctly. my block-structure looks like this: btr: - anonymous block 1 referencing b1...bn (these entities have the materials assigned) . . . - anonymous block n - b1 . . . - bn modelspace: block referencing anonymous blocks any help concerning this is appreciated. there are some more questions regarding the mapping of materials: 1) how do i set the diffuse and specular channel of an material without providing a texture (there is no overload of setdiffuse that only has the color as parameter) 2) how are materials handled when writing to an older file format such as ac1018? cheers psy p.s. i've attached a sample file which suffers from incorrect materials attached files (22.2 kb, 1 views) last edited by psy; 9th october 2007 at 06:55 amfff">. reason: attachment psy # 10th october 2007, 10:23 am moderator join date: mar 2002 posts: 2,994 if you want 3dsolids be rendered with materials assigned to block reference you need set material of 3dsolids inside the block to byblock. materials are round-tripped through r13+ versions as is. by minor autocads they are ignored (interpreted as proxies). if the file is loaded back into ac2007+ they are restored. sergey slezkin sslezkin # 12th october 2007, 01:34 am registered user join date: mar 2007 posts: 12 quote: originally posted by sergey slezkin if you want 3dsolids be rendered with materials assigned to block reference you need set material of 3dsolids inside the block to byblock. thanks so far. okay, but how exactly do i set it to byblock. i've found methods to retrieve if the material *is* set byblock/layer etc. but i didn't find a method to set it. cheers psy last edited by psy; 12th october 2007 at 01:46 amfff">. psy # 15th october 2007, 06:37 pm moderator join date: mar 2002 posts: 2,994 code: p3dsolid->setmaterial(pdatabase->byblockmaterialid()); sergey slezkin sslezkin # 22nd october 2007, 07:02 am registered user join date: mar 2007 posts: 12 thank you very much! this did work only after i created a material called "byblock". cheers psy psy none ? | ? thread tools display modes linear mode search this thread rate this thread excellent good average bad terrible posting rules you may post new threads you may post replies you may post attachments you may edit your posts is on are on code is off html code is off forum jump user control panel private messages subscriptions who's online search forums forums home general topics news questions and remarks business issues industry commentary general software issues documentation issues future directions dwg libraries dwgdirect.net dwgdirect, c++ version dwgdirectx, activex version adtdirect/c3ddirect opendwg toolkit/viewkit dgn libraries dgndirect, c++ version (2.x+) dgndirect libraries (legacy 0.99xx) all times are gmt -7. the time now is 09:31 pmfff">. - - - copyright ?2000 - 2009, jelsoft enterprises ltd. copyright 1998-2008 open design alliance inc. if you want 3dsolids be rendered with materials assigned to block reference you need set material of 3dsolids inside the block to byblock. materials are round-tripped through r13+ versions as is. by minor autocads they are ignored (interpreted as proxies). if the file is loaded back into ac2007+ they are restored. sergey slezkin quote: originally posted by sergey slezkin if you want 3dsolids be rendered with materials assigned to block reference you need set material of 3dsolids inside the block to byblock. thanks so far. okay, but how exactly do i set it to byblock. i've found methods to retrieve if the material *is* set byblock/layer etc. but i didn't find a method to set it. cheers psy last edited by psy; 12th october 2007 at 01:46 amfff">. code: p3dsolid->setmaterial(pdatabase->byblockmaterialid()); sergey slezkin thank you very much! this did work only after i created a material called "byblock". cheers psy |
所有的时间均为北京时间。 现在的时间是 07:48 PM. |